@webiny/api-page-builder-so-ddb-es 0.0.0-ee-vpcs.549378cf03
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/LICENSE +21 -0
- package/README.md +30 -0
- package/configurations.d.ts +9 -0
- package/configurations.js +49 -0
- package/configurations.js.map +1 -0
- package/definitions/blockCategoryEntity.d.ts +9 -0
- package/definitions/blockCategoryEntity.js +61 -0
- package/definitions/blockCategoryEntity.js.map +1 -0
- package/definitions/categoryEntity.d.ts +9 -0
- package/definitions/categoryEntity.js +61 -0
- package/definitions/categoryEntity.js.map +1 -0
- package/definitions/menuEntity.d.ts +9 -0
- package/definitions/menuEntity.js +61 -0
- package/definitions/menuEntity.js.map +1 -0
- package/definitions/pageBlockEntity.d.ts +9 -0
- package/definitions/pageBlockEntity.js +64 -0
- package/definitions/pageBlockEntity.js.map +1 -0
- package/definitions/pageElasticsearchEntity.d.ts +9 -0
- package/definitions/pageElasticsearchEntity.js +40 -0
- package/definitions/pageElasticsearchEntity.js.map +1 -0
- package/definitions/pageElementEntity.d.ts +9 -0
- package/definitions/pageElementEntity.js +67 -0
- package/definitions/pageElementEntity.js.map +1 -0
- package/definitions/pageEntity.d.ts +9 -0
- package/definitions/pageEntity.js +97 -0
- package/definitions/pageEntity.js.map +1 -0
- package/definitions/settingsEntity.d.ts +9 -0
- package/definitions/settingsEntity.js +77 -0
- package/definitions/settingsEntity.js.map +1 -0
- package/definitions/systemEntity.d.ts +9 -0
- package/definitions/systemEntity.js +40 -0
- package/definitions/systemEntity.js.map +1 -0
- package/definitions/table.d.ts +9 -0
- package/definitions/table.js +24 -0
- package/definitions/table.js.map +1 -0
- package/definitions/tableElasticsearch.d.ts +9 -0
- package/definitions/tableElasticsearch.js +24 -0
- package/definitions/tableElasticsearch.js.map +1 -0
- package/elasticsearch/createElasticsearchIndex.d.ts +9 -0
- package/elasticsearch/createElasticsearchIndex.js +60 -0
- package/elasticsearch/createElasticsearchIndex.js.map +1 -0
- package/elasticsearch/indices/base.d.ts +2 -0
- package/elasticsearch/indices/base.js +15 -0
- package/elasticsearch/indices/base.js.map +1 -0
- package/elasticsearch/indices/index.d.ts +1 -0
- package/elasticsearch/indices/index.js +16 -0
- package/elasticsearch/indices/index.js.map +1 -0
- package/elasticsearch/indices/japanese.d.ts +2 -0
- package/elasticsearch/indices/japanese.js +16 -0
- package/elasticsearch/indices/japanese.js.map +1 -0
- package/index.d.ts +2 -0
- package/index.js +233 -0
- package/index.js.map +1 -0
- package/operations/blockCategory/dataLoader.d.ts +16 -0
- package/operations/blockCategory/dataLoader.js +79 -0
- package/operations/blockCategory/dataLoader.js.map +1 -0
- package/operations/blockCategory/fields.d.ts +2 -0
- package/operations/blockCategory/fields.js +28 -0
- package/operations/blockCategory/fields.js.map +1 -0
- package/operations/blockCategory/index.d.ts +8 -0
- package/operations/blockCategory/index.js +208 -0
- package/operations/blockCategory/index.js.map +1 -0
- package/operations/blockCategory/keys.d.ts +9 -0
- package/operations/blockCategory/keys.js +25 -0
- package/operations/blockCategory/keys.js.map +1 -0
- package/operations/category/dataLoader.d.ts +16 -0
- package/operations/category/dataLoader.js +79 -0
- package/operations/category/dataLoader.js.map +1 -0
- package/operations/category/fields.d.ts +2 -0
- package/operations/category/fields.js +28 -0
- package/operations/category/fields.js.map +1 -0
- package/operations/category/index.d.ts +8 -0
- package/operations/category/index.js +208 -0
- package/operations/category/index.js.map +1 -0
- package/operations/category/keys.d.ts +9 -0
- package/operations/category/keys.js +25 -0
- package/operations/category/keys.js.map +1 -0
- package/operations/menu/fields.d.ts +2 -0
- package/operations/menu/fields.js +27 -0
- package/operations/menu/fields.js.map +1 -0
- package/operations/menu/index.d.ts +8 -0
- package/operations/menu/index.js +217 -0
- package/operations/menu/index.js.map +1 -0
- package/operations/pageBlock/dataLoader.d.ts +16 -0
- package/operations/pageBlock/dataLoader.js +79 -0
- package/operations/pageBlock/dataLoader.js.map +1 -0
- package/operations/pageBlock/fields.d.ts +2 -0
- package/operations/pageBlock/fields.js +25 -0
- package/operations/pageBlock/fields.js.map +1 -0
- package/operations/pageBlock/index.d.ts +8 -0
- package/operations/pageBlock/index.js +208 -0
- package/operations/pageBlock/index.js.map +1 -0
- package/operations/pageBlock/keys.d.ts +9 -0
- package/operations/pageBlock/keys.js +25 -0
- package/operations/pageBlock/keys.js.map +1 -0
- package/operations/pageElement/fields.d.ts +2 -0
- package/operations/pageElement/fields.js +19 -0
- package/operations/pageElement/fields.js.map +1 -0
- package/operations/pageElement/index.d.ts +8 -0
- package/operations/pageElement/index.js +207 -0
- package/operations/pageElement/index.js.map +1 -0
- package/operations/pages/elasticsearchQueryBody.d.ts +12 -0
- package/operations/pages/elasticsearchQueryBody.js +237 -0
- package/operations/pages/elasticsearchQueryBody.js.map +1 -0
- package/operations/pages/fields.d.ts +4 -0
- package/operations/pages/fields.js +54 -0
- package/operations/pages/fields.js.map +1 -0
- package/operations/pages/helpers.d.ts +35 -0
- package/operations/pages/helpers.js +83 -0
- package/operations/pages/helpers.js.map +1 -0
- package/operations/pages/index.d.ts +11 -0
- package/operations/pages/index.js +829 -0
- package/operations/pages/index.js.map +1 -0
- package/operations/pages/keys.d.ts +24 -0
- package/operations/pages/keys.js +79 -0
- package/operations/pages/keys.js.map +1 -0
- package/operations/settings/index.d.ts +6 -0
- package/operations/settings/index.js +178 -0
- package/operations/settings/index.js.map +1 -0
- package/operations/system/index.d.ts +6 -0
- package/operations/system/index.js +104 -0
- package/operations/system/index.js.map +1 -0
- package/package.json +65 -0
- package/plugins/definitions/BlockCategoryDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/BlockCategoryDynamoDbElasticFieldPlugin.js +17 -0
- package/plugins/definitions/BlockCategoryDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/CategoryDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/CategoryDynamoDbElasticFieldPlugin.js +17 -0
- package/plugins/definitions/CategoryDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/IndexPageDataPlugin.d.ts +17 -0
- package/plugins/definitions/IndexPageDataPlugin.js +32 -0
- package/plugins/definitions/IndexPageDataPlugin.js.map +1 -0
- package/plugins/definitions/MenuDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/MenuDynamoDbElasticFieldPlugin.js +17 -0
- package/plugins/definitions/MenuDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageBlockDynamoDbFieldPlugin.d.ts +4 -0
- package/plugins/definitions/PageBlockDynamoDbFieldPlugin.js +17 -0
- package/plugins/definitions/PageBlockDynamoDbFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageDynamoDbElasticsearchFieldPlugin.d.ts +4 -0
- package/plugins/definitions/PageDynamoDbElasticsearchFieldPlugin.js +17 -0
- package/plugins/definitions/PageDynamoDbElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchBodyModifierPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchBodyModifierPlugin.js +17 -0
- package/plugins/definitions/PageElasticsearchBodyModifierPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchFieldPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchFieldPlugin.js +17 -0
- package/plugins/definitions/PageElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchIndexPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchIndexPlugin.js +17 -0
- package/plugins/definitions/PageElasticsearchIndexPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchQueryModifierPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchQueryModifierPlugin.js +17 -0
- package/plugins/definitions/PageElasticsearchQueryModifierPlugin.js.map +1 -0
- package/plugins/definitions/PageElasticsearchSortModifierPlugin.d.ts +4 -0
- package/plugins/definitions/PageElasticsearchSortModifierPlugin.js +17 -0
- package/plugins/definitions/PageElasticsearchSortModifierPlugin.js.map +1 -0
- package/plugins/definitions/PageElementDynamoDbElasticFieldPlugin.d.ts +4 -0
- package/plugins/definitions/PageElementDynamoDbElasticFieldPlugin.js +17 -0
- package/plugins/definitions/PageElementDynamoDbElasticFieldPlugin.js.map +1 -0
- package/plugins/definitions/SearchLatestPagesPlugin.d.ts +4 -0
- package/plugins/definitions/SearchLatestPagesPlugin.js +17 -0
- package/plugins/definitions/SearchLatestPagesPlugin.js.map +1 -0
- package/plugins/definitions/SearchPagesPlugin.d.ts +23 -0
- package/plugins/definitions/SearchPagesPlugin.js +39 -0
- package/plugins/definitions/SearchPagesPlugin.js.map +1 -0
- package/plugins/definitions/SearchPublishedPagesPlugin.d.ts +4 -0
- package/plugins/definitions/SearchPublishedPagesPlugin.js +17 -0
- package/plugins/definitions/SearchPublishedPagesPlugin.js.map +1 -0
- package/types.d.ts +39 -0
- package/types.js +20 -0
- package/types.js.map +1 -0
- package/upgrades/index.d.ts +2 -0
- package/upgrades/index.js +14 -0
- package/upgrades/index.js.map +1 -0
- package/upgrades/v5.15.0/category.d.ts +2 -0
- package/upgrades/v5.15.0/category.js +73 -0
- package/upgrades/v5.15.0/category.js.map +1 -0
- package/upgrades/v5.15.0/index.d.ts +4 -0
- package/upgrades/v5.15.0/index.js +52 -0
- package/upgrades/v5.15.0/index.js.map +1 -0
- package/upgrades/v5.15.0/menu.d.ts +2 -0
- package/upgrades/v5.15.0/menu.js +73 -0
- package/upgrades/v5.15.0/menu.js.map +1 -0
- package/upgrades/v5.15.0/pageElement.d.ts +2 -0
- package/upgrades/v5.15.0/pageElement.js +73 -0
- package/upgrades/v5.15.0/pageElement.js.map +1 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.getESPublishedPageData = exports.getESPageData = exports.getESLatestPageData = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _get = _interopRequireDefault(require("lodash/get"));
|
|
13
|
+
|
|
14
|
+
var _IndexPageDataPlugin = require("../../plugins/definitions/IndexPageDataPlugin");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Map our system fields to the Elasticsearch data.
|
|
18
|
+
* We need to add new fields if we add them into our system.
|
|
19
|
+
*/
|
|
20
|
+
const getESPageData = page => {
|
|
21
|
+
return {
|
|
22
|
+
__type: "page",
|
|
23
|
+
tenant: page.tenant,
|
|
24
|
+
webinyVersion: page.webinyVersion,
|
|
25
|
+
id: page.id,
|
|
26
|
+
pid: page.pid,
|
|
27
|
+
editor: page.editor,
|
|
28
|
+
locale: page.locale,
|
|
29
|
+
createdOn: page.createdOn,
|
|
30
|
+
savedOn: page.savedOn,
|
|
31
|
+
createdBy: page.createdBy,
|
|
32
|
+
ownedBy: page.ownedBy,
|
|
33
|
+
category: page.category,
|
|
34
|
+
version: page.version,
|
|
35
|
+
title: page.title,
|
|
36
|
+
titleLC: page.title.toLowerCase(),
|
|
37
|
+
path: page.path,
|
|
38
|
+
status: page.status,
|
|
39
|
+
locked: page.locked,
|
|
40
|
+
publishedOn: page.publishedOn,
|
|
41
|
+
// Pull tags & snippet from settings.general.
|
|
42
|
+
tags: (0, _get.default)(page, "settings.general.tags") || [],
|
|
43
|
+
snippet: (0, _get.default)(page, "settings.general.snippet") || null,
|
|
44
|
+
// Save some images that could maybe be used on listing pages.
|
|
45
|
+
images: {
|
|
46
|
+
general: (0, _get.default)(page, "settings.general.image")
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.getESPageData = getESPageData;
|
|
52
|
+
|
|
53
|
+
const getESLatestPageData = (plugins, page) => {
|
|
54
|
+
const data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, getESPageData(page)), {}, {
|
|
55
|
+
latest: true
|
|
56
|
+
});
|
|
57
|
+
return modifyData(data, page, plugins);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.getESLatestPageData = getESLatestPageData;
|
|
61
|
+
|
|
62
|
+
const getESPublishedPageData = (plugins, page) => {
|
|
63
|
+
const data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, getESPageData(page)), {}, {
|
|
64
|
+
published: true
|
|
65
|
+
});
|
|
66
|
+
return modifyData(data, page, plugins);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
exports.getESPublishedPageData = getESPublishedPageData;
|
|
70
|
+
|
|
71
|
+
const modifyData = (data, page, plugins) => {
|
|
72
|
+
const pagePlugins = plugins.byType(_IndexPageDataPlugin.IndexPageDataPlugin.type);
|
|
73
|
+
|
|
74
|
+
for (const plugin of pagePlugins) {
|
|
75
|
+
plugin.apply({
|
|
76
|
+
page,
|
|
77
|
+
data,
|
|
78
|
+
plugins
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return data;
|
|
83
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getESPageData","page","__type","tenant","webinyVersion","id","pid","editor","locale","createdOn","savedOn","createdBy","ownedBy","category","version","title","titleLC","toLowerCase","path","status","locked","publishedOn","tags","lodashGet","snippet","images","general","getESLatestPageData","plugins","data","latest","modifyData","getESPublishedPageData","published","pagePlugins","byType","IndexPageDataPlugin","type","plugin","apply"],"sources":["helpers.ts"],"sourcesContent":["import lodashGet from \"lodash/get\";\nimport { IndexPageDataPlugin } from \"~/plugins/definitions/IndexPageDataPlugin\";\nimport { Page } from \"@webiny/api-page-builder/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * Map our system fields to the Elasticsearch data.\n * We need to add new fields if we add them into our system.\n */\nexport const getESPageData = (page: Page) => {\n return {\n __type: \"page\",\n tenant: page.tenant,\n webinyVersion: page.webinyVersion,\n id: page.id,\n pid: page.pid,\n editor: page.editor,\n locale: page.locale,\n createdOn: page.createdOn,\n savedOn: page.savedOn,\n createdBy: page.createdBy,\n ownedBy: page.ownedBy,\n category: page.category,\n version: page.version,\n title: page.title,\n titleLC: page.title.toLowerCase(),\n path: page.path,\n status: page.status,\n locked: page.locked,\n publishedOn: page.publishedOn,\n\n // Pull tags & snippet from settings.general.\n tags: lodashGet(page, \"settings.general.tags\") || [],\n snippet: lodashGet(page, \"settings.general.snippet\") || null,\n\n // Save some images that could maybe be used on listing pages.\n images: {\n general: lodashGet(page, \"settings.general.image\")\n }\n };\n};\n\nexport const getESLatestPageData = (plugins: PluginsContainer, page: Page) => {\n const data = { ...getESPageData(page), latest: true };\n return modifyData(data, page, plugins);\n};\n\nexport const getESPublishedPageData = (plugins: PluginsContainer, page: Page) => {\n const data = { ...getESPageData(page), published: true };\n return modifyData(data, page, plugins);\n};\n\nconst modifyData = (data: Record<string, any>, page: Page, plugins: PluginsContainer) => {\n const pagePlugins = plugins.byType<IndexPageDataPlugin>(IndexPageDataPlugin.type);\n\n for (const plugin of pagePlugins) {\n plugin.apply({ page, data, plugins });\n }\n\n return data;\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAIA;AACA;AACA;AACA;AACO,MAAMA,aAAa,GAAIC,IAAD,IAAgB;EACzC,OAAO;IACHC,MAAM,EAAE,MADL;IAEHC,MAAM,EAAEF,IAAI,CAACE,MAFV;IAGHC,aAAa,EAAEH,IAAI,CAACG,aAHjB;IAIHC,EAAE,EAAEJ,IAAI,CAACI,EAJN;IAKHC,GAAG,EAAEL,IAAI,CAACK,GALP;IAMHC,MAAM,EAAEN,IAAI,CAACM,MANV;IAOHC,MAAM,EAAEP,IAAI,CAACO,MAPV;IAQHC,SAAS,EAAER,IAAI,CAACQ,SARb;IASHC,OAAO,EAAET,IAAI,CAACS,OATX;IAUHC,SAAS,EAAEV,IAAI,CAACU,SAVb;IAWHC,OAAO,EAAEX,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N,OAAO,CAACO,MAAR,CAAoCC,wCAAA,CAAoBC,IAAxD,CAApB;;EAEA,KAAK,MAAMC,MAAX,IAAqBJ,WAArB,EAAkC;IAC9BI,MAAM,CAACC,KAAP,CAAa;MAAEtC,IAAF;MAAQ4B,IAAR;MAAcD;IAAd,CAAb;EACH;;EAED,OAAOC,IAAP;AACH,CARD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageStorageOperations } from "@webiny/api-page-builder/types";
|
|
2
|
+
import { Entity } from "dynamodb-toolbox";
|
|
3
|
+
import { Client } from "@elastic/elasticsearch";
|
|
4
|
+
import { PluginsContainer } from "@webiny/plugins";
|
|
5
|
+
export interface CreatePageStorageOperationsParams {
|
|
6
|
+
entity: Entity<any>;
|
|
7
|
+
esEntity: Entity<any>;
|
|
8
|
+
elasticsearch: Client;
|
|
9
|
+
plugins: PluginsContainer;
|
|
10
|
+
}
|
|
11
|
+
export declare const createPageStorageOperations: (params: CreatePageStorageOperationsParams) => PageStorageOperations;
|