@webiny/api-headless-cms-ddb-es 0.0.0-mt-3 → 0.0.0-unstable.40876133bb
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/configurations.d.ts +2 -2
- package/configurations.js +18 -7
- package/configurations.js.map +1 -0
- package/definitions/entry.d.ts +2 -2
- package/definitions/entry.js +6 -7
- package/definitions/entry.js.map +1 -0
- package/definitions/entryElasticsearch.d.ts +2 -2
- package/definitions/entryElasticsearch.js +3 -7
- package/definitions/entryElasticsearch.js.map +1 -0
- package/definitions/group.d.ts +2 -2
- package/definitions/group.js +3 -7
- package/definitions/group.js.map +1 -0
- package/definitions/model.d.ts +2 -2
- package/definitions/model.js +3 -7
- package/definitions/model.js.map +1 -0
- package/definitions/settings.d.ts +2 -2
- package/definitions/settings.js +3 -7
- package/definitions/settings.js.map +1 -0
- package/definitions/system.d.ts +2 -2
- package/definitions/system.js +3 -7
- package/definitions/system.js.map +1 -0
- package/definitions/table.d.ts +2 -2
- package/definitions/table.js.map +1 -0
- package/definitions/tableElasticsearch.d.ts +2 -2
- package/definitions/tableElasticsearch.js.map +1 -0
- package/dynamoDb/index.d.ts +1 -1
- package/dynamoDb/index.js +4 -6
- package/dynamoDb/index.js.map +1 -0
- package/dynamoDb/storage/date.d.ts +2 -3
- package/dynamoDb/storage/date.js +80 -46
- package/dynamoDb/storage/date.js.map +1 -0
- package/dynamoDb/storage/longText.d.ts +7 -4
- package/dynamoDb/storage/longText.js +72 -54
- package/dynamoDb/storage/longText.js.map +1 -0
- package/dynamoDb/storage/richText.d.ts +2 -3
- package/dynamoDb/storage/richText.js +85 -67
- package/dynamoDb/storage/richText.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/deleteElasticsearchIndex.d.ts +8 -0
- package/elasticsearch/deleteElasticsearchIndex.js +43 -0
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -0
- package/elasticsearch/index.d.ts +1 -1
- package/elasticsearch/index.js +1 -1
- package/elasticsearch/index.js.map +1 -0
- package/elasticsearch/indexing/dateTimeIndexing.js +15 -1
- package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -0
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -0
- package/elasticsearch/indexing/index.js +1 -1
- package/elasticsearch/indexing/index.js.map +1 -0
- package/elasticsearch/indexing/longTextIndexing.js.map +1 -0
- package/elasticsearch/indexing/numberIndexing.js.map +1 -0
- package/elasticsearch/indexing/objectIndexing.d.ts +9 -0
- package/elasticsearch/indexing/objectIndexing.js +32 -9
- package/elasticsearch/indexing/objectIndexing.js.map +1 -0
- package/elasticsearch/indexing/richTextIndexing.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/elasticsearch/search/index.d.ts +2 -2
- package/elasticsearch/search/index.js +3 -5
- package/elasticsearch/search/index.js.map +1 -0
- package/elasticsearch/search/refSearch.d.ts +2 -3
- package/elasticsearch/search/refSearch.js +25 -16
- package/elasticsearch/search/refSearch.js.map +1 -0
- package/elasticsearch/search/timeSearch.d.ts +2 -3
- package/elasticsearch/search/timeSearch.js +22 -14
- package/elasticsearch/search/timeSearch.js.map +1 -0
- package/helpers/createElasticsearchQueryBody.js +320 -84
- package/helpers/createElasticsearchQueryBody.js.map +1 -0
- package/helpers/entryIndexHelpers.js +33 -18
- package/helpers/entryIndexHelpers.js.map +1 -0
- package/helpers/fields.d.ts +4 -62
- package/helpers/fields.js +39 -8
- package/helpers/fields.js.map +1 -0
- package/helpers/index.js.map +1 -0
- package/helpers/searchPluginsList.d.ts +2 -2
- package/helpers/searchPluginsList.js +1 -1
- package/helpers/searchPluginsList.js.map +1 -0
- package/helpers/transformValueForSearch.d.ts +5 -2
- package/helpers/transformValueForSearch.js +3 -0
- package/helpers/transformValueForSearch.js.map +1 -0
- package/index.d.ts +1 -0
- package/index.js +126 -29
- package/index.js.map +1 -0
- package/operations/entry/dataLoaders.d.ts +6 -2
- package/operations/entry/dataLoaders.js +31 -13
- package/operations/entry/dataLoaders.js.map +1 -0
- package/operations/entry/elasticsearchFields.js +6 -0
- package/operations/entry/elasticsearchFields.js.map +1 -0
- package/operations/entry/index.d.ts +2 -2
- package/operations/entry/index.js +445 -331
- package/operations/entry/index.js.map +1 -0
- package/operations/entry/keys.js.map +1 -0
- package/operations/group/index.d.ts +2 -2
- package/operations/group/index.js +8 -15
- package/operations/group/index.js.map +1 -0
- package/operations/model/index.d.ts +2 -2
- package/operations/model/index.js +38 -39
- package/operations/model/index.js.map +1 -0
- package/operations/settings/index.d.ts +2 -2
- package/operations/settings/index.js +7 -13
- package/operations/settings/index.js.map +1 -0
- package/operations/system/index.d.ts +2 -2
- package/operations/system/index.js +5 -11
- package/operations/system/index.js.map +1 -0
- package/package.json +24 -29
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +6 -3
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +3 -3
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -0
- package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +3 -3
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +3 -3
- package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +1 -0
- package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +4 -0
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +17 -0
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -0
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +30 -0
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +43 -0
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -0
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +3 -3
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +3 -3
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -0
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +3 -3
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +3 -3
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -0
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +83 -0
- package/plugins/index.js.map +1 -0
- package/types.d.ts +7 -34
- package/types.js +0 -13
- package/types.js.map +1 -0
- package/helpers/operatorPluginsList.d.ts +0 -7
- package/helpers/operatorPluginsList.js +0 -30
- package/operations/entry/fields.d.ts +0 -3
- package/operations/entry/fields.js +0 -60
- package/operations/system/createElasticsearchTemplate.d.ts +0 -5
- package/operations/system/createElasticsearchTemplate.js +0 -62
- package/upgrades/index.d.ts +0 -2
- package/upgrades/index.js +0 -16
- package/upgrades/utils.d.ts +0 -1
- package/upgrades/utils.js +0 -16
- package/upgrades/v5.0.0/cleanDatabaseRecord.d.ts +0 -6
- package/upgrades/v5.0.0/cleanDatabaseRecord.js +0 -16
- package/upgrades/v5.0.0/createOldVersionIndiceName.d.ts +0 -2
- package/upgrades/v5.0.0/createOldVersionIndiceName.js +0 -12
- package/upgrades/v5.0.0/entryValueFixer.d.ts +0 -4
- package/upgrades/v5.0.0/entryValueFixer.js +0 -124
- package/upgrades/v5.0.0/fieldFinder.d.ts +0 -6
- package/upgrades/v5.0.0/fieldFinder.js +0 -42
- package/upgrades/v5.0.0/helpers.d.ts +0 -4
- package/upgrades/v5.0.0/helpers.js +0 -57
- package/upgrades/v5.0.0/index.d.ts +0 -4
- package/upgrades/v5.0.0/index.js +0 -232
- package/upgrades/v5.8.0/index.d.ts +0 -4
- package/upgrades/v5.8.0/index.js +0 -426
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.createSystemStorageOperations = void 0;
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
11
|
|
|
12
12
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
13
|
|
|
@@ -15,10 +15,6 @@ var _get = require("@webiny/db-dynamodb/utils/get");
|
|
|
15
15
|
|
|
16
16
|
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
17
17
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
-
|
|
22
18
|
const createPartitionKey = ({
|
|
23
19
|
tenant
|
|
24
20
|
}) => {
|
|
@@ -47,7 +43,7 @@ const createSystemStorageOperations = params => {
|
|
|
47
43
|
const keys = createKeys(system);
|
|
48
44
|
|
|
49
45
|
try {
|
|
50
|
-
await entity.put(
|
|
46
|
+
await entity.put((0, _objectSpread2.default)((0, _objectSpread2.default)({}, system), keys));
|
|
51
47
|
return system;
|
|
52
48
|
} catch (ex) {
|
|
53
49
|
throw new _error.default(ex.message || "Could not create system.", ex.code || "CREATE_SYSTEM_ERROR", {
|
|
@@ -60,19 +56,17 @@ const createSystemStorageOperations = params => {
|
|
|
60
56
|
|
|
61
57
|
const update = async params => {
|
|
62
58
|
const {
|
|
63
|
-
system
|
|
64
|
-
original
|
|
59
|
+
system
|
|
65
60
|
} = params;
|
|
66
61
|
const keys = createKeys(system);
|
|
67
62
|
|
|
68
63
|
try {
|
|
69
|
-
await entity.put(
|
|
64
|
+
await entity.put((0, _objectSpread2.default)((0, _objectSpread2.default)({}, system), keys));
|
|
70
65
|
return system;
|
|
71
66
|
} catch (ex) {
|
|
72
67
|
throw new _error.default(ex.message || "Could not update system.", ex.code || "UPDATE_SYSTEM_ERROR", {
|
|
73
68
|
error: ex,
|
|
74
69
|
system,
|
|
75
|
-
original,
|
|
76
70
|
keys
|
|
77
71
|
});
|
|
78
72
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createPartitionKey","tenant","toLowerCase","createSortKey","createKeys","params","PK","SK","createSystemStorageOperations","entity","create","system","keys","put","ex","WebinyError","message","code","error","update","get","getRecord","cleanupItem"],"sources":["index.ts"],"sourcesContent":["import {\n CmsSystem,\n CmsSystemStorageOperations,\n CmsSystemStorageOperationsCreateParams,\n CmsSystemStorageOperationsGetParams,\n CmsSystemStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport { get as getRecord } from \"@webiny/db-dynamodb/utils/get\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\n\nexport interface CreateSystemStorageOperationsParams {\n entity: Entity<any>;\n}\n\ninterface PartitionKeyParams {\n tenant: string;\n}\nconst createPartitionKey = ({ tenant }: PartitionKeyParams): string => {\n return `T#${tenant.toLowerCase()}#SYSTEM`;\n};\nconst createSortKey = (): string => {\n return \"CMS\";\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey()\n };\n};\n\nexport const createSystemStorageOperations = (\n params: CreateSystemStorageOperationsParams\n): CmsSystemStorageOperations => {\n const { entity } = params;\n\n const create = async ({ system }: CmsSystemStorageOperationsCreateParams) => {\n const keys = createKeys(system);\n try {\n await entity.put({\n ...system,\n ...keys\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create system.\",\n ex.code || \"CREATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const update = async (params: CmsSystemStorageOperationsUpdateParams) => {\n const { system } = params;\n\n const keys = createKeys(system);\n\n try {\n await entity.put({\n ...system,\n ...keys\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update system.\",\n ex.code || \"UPDATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsSystemStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const system = await getRecord<CmsSystem>({\n entity,\n keys\n });\n return cleanupItem(entity, system);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get system.\",\n ex.code || \"GET_SYSTEM_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n return {\n create,\n update,\n get\n };\n};\n"],"mappings":";;;;;;;;;;;AAQA;;AACA;;AACA;;AASA,MAAMA,kBAAkB,GAAG,CAAC;EAAEC;AAAF,CAAD,KAA4C;EACnE,OAAQ,KAAIA,MAAM,CAACC,WAAP,EAAqB,SAAjC;AACH,CAFD;;AAGA,MAAMC,aAAa,GAAG,MAAc;EAChC,OAAO,KAAP;AACH,CAFD;;AAQA,MAAMC,UAAU,GAAIC,MAAD,IAAsC;EACrD,OAAO;IACHC,EAAE,EAAEN,kBAAkB,CAACK,MAAD,CADnB;IAEHE,EAAE,EAAEJ,aAAa;EAFd,CAAP;AAIH,CALD;;AAOO,MAAMK,6BAA6B,GACtCH,MADyC,IAEZ;EAC7B,MAAM;IAAEI;EAAF,IAAaJ,MAAnB;;EAEA,MAAMK,MAAM,GAAG,OAAO;IAAEC;EAAF,CAAP,KAA8D;IACzE,MAAMC,IAAI,GAAGR,UAAU,CAACO,MAAD,CAAvB;;IACA,IAAI;MACA,MAAMF,MAAM,CAACI,GAAP,6DACCF,MADD,GAECC,IAFD,EAAN;MAIA,OAAOD,MAAP;IACH,CAND,CAME,OAAOG,EAAP,EAAW;MACT,MAAM,IAAIC,cAAJ,CACFD,EAAE,CAACE,OAAH,IAAc,0BADZ,EAEFF,EAAE,CAACG,IAAH,IAAW,qBAFT,EAGF;QACIC,KAAK,EAAEJ,EADX;QAEIH,MAFJ;QAGIC;MAHJ,CAHE,CAAN;IASH;EACJ,CAnBD;;EAqBA,MAAMO,MAAM,GAAG,MAAOd,MAAP,IAA0D;IACrE,MAAM;MAAEM;IAAF,IAAaN,MAAnB;IAEA,MAAMO,IAAI,GAAGR,UAAU,CAACO,MAAD,CAAvB;;IAEA,IAAI;MACA,MAAMF,MAAM,CAACI,GAAP,6DACCF,MADD,GAECC,IAFD,EAAN;MAIA,OAAOD,MAAP;IACH,CAND,CAME,OAAOG,EAAP,EAAW;MACT,MAAM,IAAIC,cAAJ,CACFD,EAAE,CAACE,OAAH,IAAc,0BADZ,EAEFF,EAAE,CAACG,IAAH,IAAW,qBAFT,EAGF;QACIC,KAAK,EAAEJ,EADX;QAEIH,MAFJ;QAGIC;MAHJ,CAHE,CAAN;IASH;EACJ,CAtBD;;EAwBA,MAAMQ,GAAG,GAAG,MAAOf,MAAP,IAAuD;IAC/D,MAAMO,IAAI,GAAGR,UAAU,CAACC,MAAD,CAAvB;;IAEA,IAAI;MACA,MAAMM,MAAM,GAAG,MAAM,IAAAU,QAAA,EAAqB;QACtCZ,MADsC;QAEtCG;MAFsC,CAArB,CAArB;MAIA,OAAO,IAAAU,oBAAA,EAAYb,MAAZ,EAAoBE,MAApB,CAAP;IACH,CAND,CAME,OAAOG,EAAP,EAAW;MACT,MAAM,IAAIC,cAAJ,CACFD,EAAE,CAACE,OAAH,IAAc,uBADZ,EAEFF,EAAE,CAACG,IAAH,IAAW,kBAFT,EAGF;QACIC,KAAK,EAAEJ,EADX;QAEIF;MAFJ,CAHE,CAAN;IAQH;EACJ,CAnBD;;EAqBA,OAAO;IACHF,MADG;IAEHS,MAFG;IAGHC;EAHG,CAAP;AAKH,CA5EM"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb-es",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-unstable.40876133bb",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-headless-cms",
|
|
@@ -22,44 +22,39 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@babel/runtime": "7.
|
|
26
|
-
"@webiny/api
|
|
27
|
-
"@webiny/api-
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"@webiny/
|
|
31
|
-
"@webiny/handler-
|
|
32
|
-
"@webiny/
|
|
33
|
-
"@webiny/
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"dynamodb-toolbox": "0.3.4",
|
|
25
|
+
"@babel/runtime": "7.19.0",
|
|
26
|
+
"@webiny/api": "0.0.0-unstable.40876133bb",
|
|
27
|
+
"@webiny/api-elasticsearch": "0.0.0-unstable.40876133bb",
|
|
28
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.40876133bb",
|
|
29
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.40876133bb",
|
|
30
|
+
"@webiny/error": "0.0.0-unstable.40876133bb",
|
|
31
|
+
"@webiny/handler-db": "0.0.0-unstable.40876133bb",
|
|
32
|
+
"@webiny/plugins": "0.0.0-unstable.40876133bb",
|
|
33
|
+
"@webiny/utils": "0.0.0-unstable.40876133bb",
|
|
34
|
+
"dataloader": "2.1.0",
|
|
35
|
+
"dynamodb-toolbox": "0.3.5",
|
|
37
36
|
"jsonpack": "1.1.5",
|
|
38
|
-
"lodash
|
|
39
|
-
"lodash.clonedeep": "4.5.0",
|
|
40
|
-
"lodash.omit": "4.5.0"
|
|
37
|
+
"lodash": "4.17.21"
|
|
41
38
|
},
|
|
42
39
|
"devDependencies": {
|
|
43
|
-
"@babel/cli": "^7.
|
|
44
|
-
"@babel/core": "^7.
|
|
45
|
-
"@babel/preset-env": "^7.
|
|
46
|
-
"@babel/preset-flow": "^7.0.0",
|
|
40
|
+
"@babel/cli": "^7.19.3",
|
|
41
|
+
"@babel/core": "^7.19.3",
|
|
42
|
+
"@babel/preset-env": "^7.19.4",
|
|
47
43
|
"@elastic/elasticsearch": "7.12.0",
|
|
48
|
-
"@shelf/jest-elasticsearch": "^1.0.0",
|
|
49
44
|
"@types/jsonpack": "^1.1.0",
|
|
50
|
-
"@webiny/api-dynamodb-to-elasticsearch": "^0.0.0-
|
|
51
|
-
"@webiny/
|
|
52
|
-
"@webiny/
|
|
53
|
-
"@webiny/project-utils": "^0.0.0-
|
|
54
|
-
"jest": "^
|
|
45
|
+
"@webiny/api-dynamodb-to-elasticsearch": "^0.0.0-unstable.40876133bb",
|
|
46
|
+
"@webiny/cli": "^0.0.0-unstable.40876133bb",
|
|
47
|
+
"@webiny/handler-aws": "^0.0.0-unstable.40876133bb",
|
|
48
|
+
"@webiny/project-utils": "^0.0.0-unstable.40876133bb",
|
|
49
|
+
"jest": "^28.1.0",
|
|
55
50
|
"jest-dynalite": "^3.2.0",
|
|
56
|
-
"jest-environment-node": "^
|
|
51
|
+
"jest-environment-node": "^27.2.4",
|
|
57
52
|
"mdbid": "^1.0.0",
|
|
58
53
|
"prettier": "^2.3.2",
|
|
59
54
|
"rimraf": "^3.0.2",
|
|
60
55
|
"sinon": "^9.0.2",
|
|
61
56
|
"ttypescript": "^1.5.12",
|
|
62
|
-
"typescript": "
|
|
57
|
+
"typescript": "4.7.4"
|
|
63
58
|
},
|
|
64
59
|
"publishConfig": {
|
|
65
60
|
"access": "public",
|
|
@@ -69,5 +64,5 @@
|
|
|
69
64
|
"build": "yarn webiny run build",
|
|
70
65
|
"watch": "yarn webiny run watch"
|
|
71
66
|
},
|
|
72
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "f33811072795d25c5787ae39808e75e3312fb247"
|
|
73
68
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { ElasticsearchBodyModifierPlugin, ModifyBodyCallable, ModifyBodyParams as BaseModifyBodyParams } from "@webiny/api-elasticsearch
|
|
1
|
+
import { ElasticsearchBodyModifierPlugin, ModifyBodyCallable, ModifyBodyParams as BaseModifyBodyParams } from "@webiny/api-elasticsearch";
|
|
2
2
|
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
3
|
export interface ModifyBodyParams extends BaseModifyBodyParams {
|
|
4
4
|
model: CmsModel;
|
|
5
|
+
where: {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
};
|
|
5
8
|
}
|
|
6
|
-
export interface
|
|
9
|
+
export interface CmsEntryElasticsearchBodyModifierPluginConfig {
|
|
7
10
|
modifyBody: ModifyBodyCallable<ModifyBodyParams>;
|
|
8
11
|
/**
|
|
9
12
|
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
@@ -13,5 +16,5 @@ export interface Config {
|
|
|
13
16
|
export declare class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {
|
|
14
17
|
static readonly type: string;
|
|
15
18
|
readonly modelId?: string;
|
|
16
|
-
constructor(config:
|
|
19
|
+
constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig);
|
|
17
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,9 +9,9 @@ exports.CmsEntryElasticsearchBodyModifierPlugin = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
13
|
|
|
14
|
-
class CmsEntryElasticsearchBodyModifierPlugin extends
|
|
14
|
+
class CmsEntryElasticsearchBodyModifierPlugin extends _apiElasticsearch.ElasticsearchBodyModifierPlugin {
|
|
15
15
|
constructor(config) {
|
|
16
16
|
super(config.modifyBody);
|
|
17
17
|
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchBodyModifierPlugin","ElasticsearchBodyModifierPlugin","constructor","config","modifyBody","modelId"],"sources":["CmsEntryElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchBodyModifierPlugin,\n ModifyBodyCallable,\n ModifyBodyParams as BaseModifyBodyParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyBodyParams extends BaseModifyBodyParams {\n model: CmsModel;\n where: {\n [key: string]: any;\n };\n}\n\nexport interface CmsEntryElasticsearchBodyModifierPluginConfig {\n modifyBody: ModifyBodyCallable<ModifyBodyParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.body.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig) {\n super(config.modifyBody);\n\n this.modelId = config.modelId;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAsBO,MAAMA,uCAAN,SAAsDC,iDAAtD,CAAwG;EAKpGC,WAAW,CAACC,MAAD,EAAwD;IACtE,MAAMA,MAAM,CAACC,UAAb;IADsE;IAGtE,KAAKC,OAAL,GAAeF,MAAM,CAACE,OAAtB;EACH;;AAT0G;;;8BAAlGL,uC,UACsC,uC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ElasticsearchFieldPlugin,
|
|
2
|
-
export interface
|
|
1
|
+
import { ElasticsearchFieldPlugin, ElasticsearchFieldPluginParams as ElasticsearchFieldPluginParamsBaseParams } from "@webiny/api-elasticsearch";
|
|
2
|
+
export interface CmsEntryElasticsearchFieldPluginParams extends ElasticsearchFieldPluginParamsBaseParams {
|
|
3
3
|
/**
|
|
4
4
|
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
5
5
|
*/
|
|
@@ -8,5 +8,5 @@ export interface Params extends BaseParams {
|
|
|
8
8
|
export declare class CmsEntryElasticsearchFieldPlugin extends ElasticsearchFieldPlugin {
|
|
9
9
|
static readonly type: string;
|
|
10
10
|
readonly modelId?: string;
|
|
11
|
-
constructor(params:
|
|
11
|
+
constructor(params: CmsEntryElasticsearchFieldPluginParams);
|
|
12
12
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,9 +9,9 @@ exports.CmsEntryElasticsearchFieldPlugin = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
13
|
|
|
14
|
-
class CmsEntryElasticsearchFieldPlugin extends
|
|
14
|
+
class CmsEntryElasticsearchFieldPlugin extends _apiElasticsearch.ElasticsearchFieldPlugin {
|
|
15
15
|
constructor(params) {
|
|
16
16
|
super(params);
|
|
17
17
|
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchFieldPlugin","ElasticsearchFieldPlugin","constructor","params","modelId"],"sources":["CmsEntryElasticsearchFieldPlugin.ts"],"sourcesContent":["import {\n ElasticsearchFieldPlugin,\n ElasticsearchFieldPluginParams as ElasticsearchFieldPluginParamsBaseParams\n} from \"@webiny/api-elasticsearch\";\n\nexport interface CmsEntryElasticsearchFieldPluginParams\n extends ElasticsearchFieldPluginParamsBaseParams {\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\nexport class CmsEntryElasticsearchFieldPlugin extends ElasticsearchFieldPlugin {\n public static override readonly type: string = \"elasticsearch.fieldDefinition.cms.entry\";\n\n public readonly modelId?: string;\n\n public constructor(params: CmsEntryElasticsearchFieldPluginParams) {\n super(params);\n\n this.modelId = params.modelId;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAYO,MAAMA,gCAAN,SAA+CC,0CAA/C,CAAwE;EAKpEC,WAAW,CAACC,MAAD,EAAiD;IAC/D,MAAMA,MAAN;IAD+D;IAG/D,KAAKC,OAAL,GAAeD,MAAM,CAACC,OAAtB;EACH;;AAT0E;;;8BAAlEJ,gC,UACsC,yC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
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.CmsEntryElasticsearchIndexPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
|
+
|
|
14
|
+
class CmsEntryElasticsearchIndexPlugin extends _apiElasticsearch.ElasticsearchIndexPlugin {}
|
|
15
|
+
|
|
16
|
+
exports.CmsEntryElasticsearchIndexPlugin = CmsEntryElasticsearchIndexPlugin;
|
|
17
|
+
(0, _defineProperty2.default)(CmsEntryElasticsearchIndexPlugin, "type", "cms.entry.elasticsearch.index");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchIndexPlugin","ElasticsearchIndexPlugin"],"sources":["CmsEntryElasticsearchIndexPlugin.ts"],"sourcesContent":["import { ElasticsearchIndexPlugin } from \"@webiny/api-elasticsearch\";\n\nexport class CmsEntryElasticsearchIndexPlugin extends ElasticsearchIndexPlugin {\n public static override readonly type: string = \"cms.entry.elasticsearch.index\";\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAEO,MAAMA,gCAAN,SAA+CC,0CAA/C,CAAwE;;;8BAAlED,gC,UACsC,+B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins/Plugin";
|
|
2
|
+
import { CmsModelField } from "@webiny/api-headless-cms/types";
|
|
3
|
+
export interface CreatePathCallableParams<T = any> {
|
|
4
|
+
field: CmsModelField;
|
|
5
|
+
key: string;
|
|
6
|
+
value: T;
|
|
7
|
+
}
|
|
8
|
+
export interface CreatePathCallable<T = any> {
|
|
9
|
+
(params: CreatePathCallableParams<T>): string;
|
|
10
|
+
}
|
|
11
|
+
export interface TransformCallableParams<T = any> {
|
|
12
|
+
field: CmsModelField;
|
|
13
|
+
value: T;
|
|
14
|
+
}
|
|
15
|
+
export interface TransformCallable<T = any> {
|
|
16
|
+
(params: TransformCallableParams<T>): string;
|
|
17
|
+
}
|
|
18
|
+
export interface CmsEntryElasticsearchQueryBuilderValueSearchPluginParams {
|
|
19
|
+
fieldType: string;
|
|
20
|
+
path?: string | CreatePathCallable;
|
|
21
|
+
transform: TransformCallable;
|
|
22
|
+
}
|
|
23
|
+
export declare class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends Plugin {
|
|
24
|
+
static readonly type: string;
|
|
25
|
+
private readonly config;
|
|
26
|
+
get fieldType(): string;
|
|
27
|
+
constructor(params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams);
|
|
28
|
+
transform(params: TransformCallableParams): any;
|
|
29
|
+
createPath(params: CreatePathCallableParams): string | null;
|
|
30
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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.CmsEntryElasticsearchQueryBuilderValueSearchPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _Plugin = require("@webiny/plugins/Plugin");
|
|
13
|
+
|
|
14
|
+
class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends _Plugin.Plugin {
|
|
15
|
+
get fieldType() {
|
|
16
|
+
return this.config.fieldType;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
constructor(params) {
|
|
20
|
+
super();
|
|
21
|
+
(0, _defineProperty2.default)(this, "config", void 0);
|
|
22
|
+
this.config = params;
|
|
23
|
+
this.name = `${this.constructor.type}-${this.config.fieldType}`;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
transform(params) {
|
|
27
|
+
return this.config.transform(params);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
createPath(params) {
|
|
31
|
+
if (typeof this.config.path === "function") {
|
|
32
|
+
return this.config.path(params);
|
|
33
|
+
} else if (typeof this.config.path === "string") {
|
|
34
|
+
return this.config.path;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
exports.CmsEntryElasticsearchQueryBuilderValueSearchPlugin = CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
|
|
43
|
+
(0, _defineProperty2.default)(CmsEntryElasticsearchQueryBuilderValueSearchPlugin, "type", "cms-elastic-search-query-builder-value-search");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","Plugin","fieldType","config","constructor","params","name","type","transform","createPath","path"],"sources":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams<T = any> {\n field: CmsModelField;\n key: string;\n value: T;\n}\n\nexport interface CreatePathCallable<T = any> {\n (params: CreatePathCallableParams<T>): string;\n}\n\nexport interface TransformCallableParams<T = any> {\n field: CmsModelField;\n value: T;\n}\nexport interface TransformCallable<T = any> {\n (params: TransformCallableParams<T>): string;\n}\n\nexport interface CmsEntryElasticsearchQueryBuilderValueSearchPluginParams {\n fieldType: string;\n path?: string | CreatePathCallable;\n transform: TransformCallable;\n}\nexport class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends Plugin {\n public static override readonly type: string = \"cms-elastic-search-query-builder-value-search\";\n\n private readonly config: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams) {\n super();\n\n this.config = params;\n this.name = `${(this.constructor as any).type}-${this.config.fieldType}`;\n }\n\n public transform(params: TransformCallableParams): any {\n return this.config.transform(params);\n }\n\n public createPath(params: CreatePathCallableParams): string | null {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n return null;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AA0BO,MAAMA,kDAAN,SAAiEC,cAAjE,CAAwE;EAKvD,IAATC,SAAS,GAAW;IAC3B,OAAO,KAAKC,MAAL,CAAYD,SAAnB;EACH;;EAEME,WAAW,CAACC,MAAD,EAAmE;IACjF;IADiF;IAGjF,KAAKF,MAAL,GAAcE,MAAd;IACA,KAAKC,IAAL,GAAa,GAAG,KAAKF,WAAN,CAA0BG,IAAK,IAAG,KAAKJ,MAAL,CAAYD,SAAU,EAAvE;EACH;;EAEMM,SAAS,CAACH,MAAD,EAAuC;IACnD,OAAO,KAAKF,MAAL,CAAYK,SAAZ,CAAsBH,MAAtB,CAAP;EACH;;EAEMI,UAAU,CAACJ,MAAD,EAAkD;IAC/D,IAAI,OAAO,KAAKF,MAAL,CAAYO,IAAnB,KAA4B,UAAhC,EAA4C;MACxC,OAAO,KAAKP,MAAL,CAAYO,IAAZ,CAAiBL,MAAjB,CAAP;IACH,CAFD,MAEO,IAAI,OAAO,KAAKF,MAAL,CAAYO,IAAnB,KAA4B,QAAhC,EAA0C;MAC7C,OAAO,KAAKP,MAAL,CAAYO,IAAnB;IACH;;IACD,OAAO,IAAP;EACH;;AA3B0E;;;8BAAlEV,kD,UACsC,+C"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ElasticsearchQueryModifierPlugin, ModifyQueryCallable, ModifyQueryParams as BaseModifyQueryParams } from "@webiny/api-elasticsearch
|
|
1
|
+
import { ElasticsearchQueryModifierPlugin, ModifyQueryCallable, ModifyQueryParams as BaseModifyQueryParams } from "@webiny/api-elasticsearch";
|
|
2
2
|
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
3
|
export interface ModifyQueryParams extends BaseModifyQueryParams {
|
|
4
4
|
model: CmsModel;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface CmsEntryElasticsearchQueryModifierPluginConfig {
|
|
7
7
|
modifyQuery: ModifyQueryCallable<ModifyQueryParams>;
|
|
8
8
|
/**
|
|
9
9
|
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
@@ -13,5 +13,5 @@ export interface Config {
|
|
|
13
13
|
export declare class CmsEntryElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin<ModifyQueryParams> {
|
|
14
14
|
static readonly type: string;
|
|
15
15
|
readonly modelId?: string;
|
|
16
|
-
constructor(config:
|
|
16
|
+
constructor(config: CmsEntryElasticsearchQueryModifierPluginConfig);
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,9 +9,9 @@ exports.CmsEntryElasticsearchQueryModifierPlugin = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
13
|
|
|
14
|
-
class CmsEntryElasticsearchQueryModifierPlugin extends
|
|
14
|
+
class CmsEntryElasticsearchQueryModifierPlugin extends _apiElasticsearch.ElasticsearchQueryModifierPlugin {
|
|
15
15
|
constructor(config) {
|
|
16
16
|
super(config.modifyQuery);
|
|
17
17
|
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchQueryModifierPlugin","ElasticsearchQueryModifierPlugin","constructor","config","modifyQuery","modelId"],"sources":["CmsEntryElasticsearchQueryModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchQueryModifierPlugin,\n ModifyQueryCallable,\n ModifyQueryParams as BaseModifyQueryParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyQueryParams extends BaseModifyQueryParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchQueryModifierPluginConfig {\n modifyQuery: ModifyQueryCallable<ModifyQueryParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin<ModifyQueryParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.query.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchQueryModifierPluginConfig) {\n super(config.modifyQuery);\n\n this.modelId = config.modelId;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAmBO,MAAMA,wCAAN,SAAuDC,kDAAvD,CAA2G;EAKvGC,WAAW,CAACC,MAAD,EAAyD;IACvE,MAAMA,MAAM,CAACC,WAAb;IADuE;IAGvE,KAAKC,OAAL,GAAeF,MAAM,CAACE,OAAtB;EACH;;AAT6G;;;8BAArGL,wC,UACsC,wC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ElasticsearchSortModifierPlugin, ModifySortCallable, ModifySortParams as BaseModifySortParams } from "@webiny/api-elasticsearch
|
|
1
|
+
import { ElasticsearchSortModifierPlugin, ModifySortCallable, ModifySortParams as BaseModifySortParams } from "@webiny/api-elasticsearch";
|
|
2
2
|
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
3
|
export interface ModifySortParams extends BaseModifySortParams {
|
|
4
4
|
model: CmsModel;
|
|
5
5
|
}
|
|
6
|
-
export interface
|
|
6
|
+
export interface CmsEntryElasticsearchSortModifierPluginConfig {
|
|
7
7
|
modifySort: ModifySortCallable<ModifySortParams>;
|
|
8
8
|
/**
|
|
9
9
|
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
@@ -13,5 +13,5 @@ export interface Config {
|
|
|
13
13
|
export declare class CmsEntryElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin<ModifySortParams> {
|
|
14
14
|
static readonly type: string;
|
|
15
15
|
readonly modelId?: string;
|
|
16
|
-
constructor(config:
|
|
16
|
+
constructor(config: CmsEntryElasticsearchSortModifierPluginConfig);
|
|
17
17
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,9 +9,9 @@ exports.CmsEntryElasticsearchSortModifierPlugin = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
13
|
|
|
14
|
-
class CmsEntryElasticsearchSortModifierPlugin extends
|
|
14
|
+
class CmsEntryElasticsearchSortModifierPlugin extends _apiElasticsearch.ElasticsearchSortModifierPlugin {
|
|
15
15
|
constructor(config) {
|
|
16
16
|
super(config.modifySort);
|
|
17
17
|
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchSortModifierPlugin","ElasticsearchSortModifierPlugin","constructor","config","modifySort","modelId"],"sources":["CmsEntryElasticsearchSortModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchSortModifierPlugin,\n ModifySortCallable,\n ModifySortParams as BaseModifySortParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifySortParams extends BaseModifySortParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchSortModifierPluginConfig {\n modifySort: ModifySortCallable<ModifySortParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin<ModifySortParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.sort.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchSortModifierPluginConfig) {\n super(config.modifySort);\n this.modelId = config.modelId;\n }\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAmBO,MAAMA,uCAAN,SAAsDC,iDAAtD,CAAwG;EAKpGC,WAAW,CAACC,MAAD,EAAwD;IACtE,MAAMA,MAAM,CAACC,UAAb;IADsE;IAEtE,KAAKC,OAAL,GAAeF,MAAM,CAACE,OAAtB;EACH;;AAR0G;;;8BAAlGL,uC,UACsC,uC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./CmsEntryElasticsearchBodyModifierPlugin";
|
|
2
|
+
export * from "./CmsEntryElasticsearchFieldPlugin";
|
|
3
|
+
export * from "./CmsEntryElasticsearchIndexPlugin";
|
|
4
|
+
export * from "./CmsEntryElasticsearchQueryBuilderValueSearchPlugin";
|
|
5
|
+
export * from "./CmsEntryElasticsearchQueryModifierPlugin";
|
|
6
|
+
export * from "./CmsEntryElasticsearchSortModifierPlugin";
|
package/plugins/index.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _CmsEntryElasticsearchBodyModifierPlugin = require("./CmsEntryElasticsearchBodyModifierPlugin");
|
|
8
|
+
|
|
9
|
+
Object.keys(_CmsEntryElasticsearchBodyModifierPlugin).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _CmsEntryElasticsearchBodyModifierPlugin[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _CmsEntryElasticsearchBodyModifierPlugin[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _CmsEntryElasticsearchFieldPlugin = require("./CmsEntryElasticsearchFieldPlugin");
|
|
21
|
+
|
|
22
|
+
Object.keys(_CmsEntryElasticsearchFieldPlugin).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _CmsEntryElasticsearchFieldPlugin[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _CmsEntryElasticsearchFieldPlugin[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _CmsEntryElasticsearchIndexPlugin = require("./CmsEntryElasticsearchIndexPlugin");
|
|
34
|
+
|
|
35
|
+
Object.keys(_CmsEntryElasticsearchIndexPlugin).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _CmsEntryElasticsearchIndexPlugin[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _CmsEntryElasticsearchIndexPlugin[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("./CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
|
|
47
|
+
|
|
48
|
+
Object.keys(_CmsEntryElasticsearchQueryBuilderValueSearchPlugin).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (key in exports && exports[key] === _CmsEntryElasticsearchQueryBuilderValueSearchPlugin[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _CmsEntryElasticsearchQueryBuilderValueSearchPlugin[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
var _CmsEntryElasticsearchQueryModifierPlugin = require("./CmsEntryElasticsearchQueryModifierPlugin");
|
|
60
|
+
|
|
61
|
+
Object.keys(_CmsEntryElasticsearchQueryModifierPlugin).forEach(function (key) {
|
|
62
|
+
if (key === "default" || key === "__esModule") return;
|
|
63
|
+
if (key in exports && exports[key] === _CmsEntryElasticsearchQueryModifierPlugin[key]) return;
|
|
64
|
+
Object.defineProperty(exports, key, {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
get: function () {
|
|
67
|
+
return _CmsEntryElasticsearchQueryModifierPlugin[key];
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
var _CmsEntryElasticsearchSortModifierPlugin = require("./CmsEntryElasticsearchSortModifierPlugin");
|
|
73
|
+
|
|
74
|
+
Object.keys(_CmsEntryElasticsearchSortModifierPlugin).forEach(function (key) {
|
|
75
|
+
if (key === "default" || key === "__esModule") return;
|
|
76
|
+
if (key in exports && exports[key] === _CmsEntryElasticsearchSortModifierPlugin[key]) return;
|
|
77
|
+
Object.defineProperty(exports, key, {
|
|
78
|
+
enumerable: true,
|
|
79
|
+
get: function () {
|
|
80
|
+
return _CmsEntryElasticsearchSortModifierPlugin[key];
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryElasticsearchBodyModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchFieldPlugin\";\nexport * from \"./CmsEntryElasticsearchIndexPlugin\";\nexport * from \"./CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\nexport * from \"./CmsEntryElasticsearchQueryModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchSortModifierPlugin\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/types.d.ts
CHANGED
|
@@ -1,40 +1,11 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins/types";
|
|
2
|
-
import { CmsEntry, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
1
|
+
import { Plugin, PluginCollection } from "@webiny/plugins/types";
|
|
2
|
+
import { CmsContext as BaseCmsContext, CmsEntry, CmsModel, CmsModelField, CmsModelFieldToGraphQLPlugin, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
3
3
|
import { DynamoDBTypes, TableConstructor } from "dynamodb-toolbox/dist/classes/Table";
|
|
4
4
|
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
5
5
|
import { EntityAttributeConfig, EntityCompositeAttributes } from "dynamodb-toolbox/dist/classes/Entity";
|
|
6
6
|
import { Client } from "@elastic/elasticsearch";
|
|
7
7
|
import { Entity, Table } from "dynamodb-toolbox";
|
|
8
8
|
import { PluginsContainer } from "@webiny/plugins";
|
|
9
|
-
/**
|
|
10
|
-
* Arguments for ElasticsearchQueryBuilderValueSearchPlugin.
|
|
11
|
-
*
|
|
12
|
-
* @see ElasticsearchQueryBuilderValueSearchPlugin.transform
|
|
13
|
-
*/
|
|
14
|
-
interface ElasticsearchQueryBuilderValueSearchPluginArgs {
|
|
15
|
-
field: CmsModelField;
|
|
16
|
-
value: any;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* A plugin definition for transforming the search value for Elasticsearch.
|
|
20
|
-
*
|
|
21
|
-
* @category Plugin
|
|
22
|
-
* @category Elasticsearch
|
|
23
|
-
*/
|
|
24
|
-
export interface ElasticsearchQueryBuilderValueSearchPlugin extends Plugin {
|
|
25
|
-
/**
|
|
26
|
-
* A plugin type.
|
|
27
|
-
*/
|
|
28
|
-
type: "cms-elastic-search-query-builder-value-search";
|
|
29
|
-
/**
|
|
30
|
-
* A field type for plugin to target.
|
|
31
|
-
*/
|
|
32
|
-
fieldType: string;
|
|
33
|
-
/**
|
|
34
|
-
* Transform value that is going to be searched for in the Elasticsearch.
|
|
35
|
-
*/
|
|
36
|
-
transform: (args: ElasticsearchQueryBuilderValueSearchPluginArgs) => any;
|
|
37
|
-
}
|
|
38
9
|
/**
|
|
39
10
|
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
40
11
|
*
|
|
@@ -176,11 +147,10 @@ export interface StorageOperationsFactoryParams {
|
|
|
176
147
|
elasticsearch: Client;
|
|
177
148
|
table?: TableModifier;
|
|
178
149
|
esTable?: TableModifier;
|
|
179
|
-
modelFieldToGraphQLPlugins: CmsModelFieldToGraphQLPlugin[];
|
|
180
150
|
attributes?: Record<ENTITIES, Attributes>;
|
|
181
|
-
plugins?:
|
|
151
|
+
plugins?: PluginCollection;
|
|
182
152
|
}
|
|
183
|
-
export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {
|
|
153
|
+
export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {
|
|
184
154
|
getTable: () => Table;
|
|
185
155
|
getEsTable: () => Table;
|
|
186
156
|
getEntities: () => Record<"system" | "settings" | "groups" | "models" | "entries" | "entriesEs", Entity<any>>;
|
|
@@ -188,4 +158,7 @@ export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOper
|
|
|
188
158
|
export interface StorageOperationsFactory {
|
|
189
159
|
(params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
|
|
190
160
|
}
|
|
161
|
+
export interface CmsContext extends BaseCmsContext {
|
|
162
|
+
[key: string]: any;
|
|
163
|
+
}
|
|
191
164
|
export {};
|
package/types.js
CHANGED
|
@@ -5,19 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ENTITIES = void 0;
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* Arguments for ElasticsearchQueryBuilderValueSearchPlugin.
|
|
10
|
-
*
|
|
11
|
-
* @see ElasticsearchQueryBuilderValueSearchPlugin.transform
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* A plugin definition for transforming the search value for Elasticsearch.
|
|
16
|
-
*
|
|
17
|
-
* @category Plugin
|
|
18
|
-
* @category Elasticsearch
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
8
|
/**
|
|
22
9
|
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
23
10
|
*
|