@webiny/api-headless-cms-ddb-es 0.0.0-unstable.40876133bb → 0.0.0-unstable.496cf268ac
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.js +0 -8
- package/configurations.js.map +1 -1
- package/definitions/entry.js +3 -5
- package/definitions/entry.js.map +1 -1
- package/definitions/entryElasticsearch.js +0 -5
- package/definitions/entryElasticsearch.js.map +1 -1
- package/definitions/group.js +0 -5
- package/definitions/group.js.map +1 -1
- package/definitions/model.js +22 -5
- package/definitions/model.js.map +1 -1
- package/definitions/settings.js +0 -5
- package/definitions/settings.js.map +1 -1
- package/definitions/system.js +0 -5
- package/definitions/system.js.map +1 -1
- package/definitions/table.js +0 -3
- package/definitions/table.js.map +1 -1
- package/definitions/tableElasticsearch.js +0 -3
- package/definitions/tableElasticsearch.js.map +1 -1
- package/dynamoDb/index.d.ts +1 -1
- package/dynamoDb/index.js +0 -5
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/date.d.ts +2 -1
- package/dynamoDb/storage/date.js +4 -17
- package/dynamoDb/storage/date.js.map +1 -1
- package/dynamoDb/storage/longText.d.ts +1 -1
- package/dynamoDb/storage/longText.js +10 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.d.ts +1 -1
- package/dynamoDb/storage/richText.js +12 -30
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.js +0 -11
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.js +0 -7
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/elasticsearch/index.js +0 -5
- package/elasticsearch/index.js.map +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.js +4 -21
- package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.js +15 -10
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
- package/elasticsearch/indexing/index.js +0 -9
- package/elasticsearch/indexing/index.js.map +1 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +4 -0
- package/elasticsearch/indexing/longTextIndexing.js +19 -9
- package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
- package/elasticsearch/indexing/numberIndexing.js +0 -9
- package/elasticsearch/indexing/numberIndexing.js.map +1 -1
- package/elasticsearch/indexing/objectIndexing.js +3 -30
- package/elasticsearch/indexing/objectIndexing.js.map +1 -1
- package/elasticsearch/indexing/richTextIndexing.js +0 -5
- package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
- package/elasticsearch/indices/base.js +0 -3
- package/elasticsearch/indices/base.js.map +1 -1
- package/elasticsearch/indices/index.js +0 -4
- package/elasticsearch/indices/index.js.map +1 -1
- package/elasticsearch/indices/japanese.js +0 -3
- package/elasticsearch/indices/japanese.js.map +1 -1
- package/elasticsearch/search/index.js +0 -4
- package/elasticsearch/search/index.js.map +1 -1
- package/elasticsearch/search/refSearch.js +4 -8
- package/elasticsearch/search/refSearch.js.map +1 -1
- package/elasticsearch/search/timeSearch.js +0 -7
- package/elasticsearch/search/timeSearch.js.map +1 -1
- package/helpers/entryIndexHelpers.js +20 -49
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/index.d.ts +0 -1
- package/helpers/index.js +0 -15
- package/helpers/index.js.map +1 -1
- package/index.js +19 -73
- package/index.js.map +1 -1
- package/operations/entry/dataLoaders.js +0 -52
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +32 -0
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
- package/operations/entry/elasticsearch/body.d.ts +13 -0
- package/operations/entry/elasticsearch/body.js +140 -0
- package/operations/entry/elasticsearch/body.js.map +1 -0
- package/operations/entry/elasticsearch/fields.d.ts +9 -0
- package/operations/entry/elasticsearch/fields.js +229 -0
- package/operations/entry/elasticsearch/fields.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +8 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +57 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/exec.d.ts +17 -0
- package/operations/entry/elasticsearch/filtering/exec.js +172 -0
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/index.d.ts +1 -0
- package/operations/entry/elasticsearch/filtering/index.js +16 -0
- package/operations/entry/elasticsearch/filtering/index.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/path.d.ts +15 -0
- package/operations/entry/elasticsearch/filtering/path.js +44 -0
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +28 -0
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/index.js +13 -0
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +65 -0
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +48 -0
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/populated.js +23 -0
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/values.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/values.js +22 -0
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -0
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +12 -0
- package/operations/entry/elasticsearch/fullTextSearch.js +89 -0
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +8 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.js +25 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -0
- package/operations/entry/elasticsearch/initialQuery.d.ts +17 -0
- package/operations/entry/elasticsearch/initialQuery.js +103 -0
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -0
- package/operations/entry/elasticsearch/keyword.d.ts +2 -0
- package/operations/entry/elasticsearch/keyword.js +34 -0
- package/operations/entry/elasticsearch/keyword.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +9 -0
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +16 -0
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/operator.d.ts +8 -0
- package/operations/entry/elasticsearch/plugins/operator.js +37 -0
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +9 -0
- package/operations/entry/elasticsearch/plugins/queryModifier.js +16 -0
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/search.d.ts +7 -0
- package/{helpers/searchPluginsList.js → operations/entry/elasticsearch/plugins/search.js} +7 -9
- package/operations/entry/elasticsearch/plugins/search.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +9 -0
- package/operations/entry/elasticsearch/plugins/sortModifier.js +16 -0
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -0
- package/operations/entry/elasticsearch/sort.d.ts +12 -0
- package/operations/entry/elasticsearch/sort.js +82 -0
- package/operations/entry/elasticsearch/sort.js.map +1 -0
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +16 -0
- package/{helpers → operations/entry/elasticsearch}/transformValueForSearch.js +7 -6
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -0
- package/operations/entry/elasticsearch/types.d.ts +41 -0
- package/operations/entry/elasticsearch/types.js +5 -0
- package/operations/entry/elasticsearch/types.js.map +1 -0
- package/operations/entry/index.d.ts +0 -2
- package/operations/entry/index.js +72 -210
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js +0 -9
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.d.ts +3 -0
- package/operations/entry/recordType.js +18 -0
- package/operations/entry/recordType.js.map +1 -0
- package/operations/group/index.js +2 -32
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.js +1 -34
- package/operations/model/index.js.map +1 -1
- package/operations/settings/index.js +0 -24
- package/operations/settings/index.js.map +1 -1
- package/operations/system/index.js +0 -17
- package/operations/system/index.js.map +1 -1
- package/package.json +16 -16
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +1 -0
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +6 -8
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -6
- package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +23 -0
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +28 -0
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -0
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -5
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +1 -0
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +6 -12
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +1 -0
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +6 -8
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +1 -0
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +6 -8
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +49 -0
- package/plugins/CmsEntryFilterPlugin.js +24 -0
- package/plugins/CmsEntryFilterPlugin.js.map +1 -0
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +11 -12
- package/plugins/index.js.map +1 -1
- package/types.js +0 -5
- package/types.js.map +1 -1
- package/helpers/createElasticsearchQueryBody.d.ts +0 -11
- package/helpers/createElasticsearchQueryBody.js +0 -611
- package/helpers/createElasticsearchQueryBody.js.map +0 -1
- package/helpers/fields.d.ts +0 -19
- package/helpers/fields.js +0 -205
- package/helpers/fields.js.map +0 -1
- package/helpers/searchPluginsList.d.ts +0 -6
- package/helpers/searchPluginsList.js.map +0 -1
- package/helpers/transformValueForSearch.d.ts +0 -12
- package/helpers/transformValueForSearch.js.map +0 -1
- package/operations/entry/elasticsearchFields.d.ts +0 -2
- package/operations/entry/elasticsearchFields.js +0 -38
- package/operations/entry/elasticsearchFields.js.map +0 -1
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createDefaultFilterPlugin = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
var _CmsEntryFilterPlugin = require("../../../../../plugins/CmsEntryFilterPlugin");
|
|
10
|
+
const createDefaultFilterPlugin = () => {
|
|
11
|
+
const plugin = new _CmsEntryFilterPlugin.CmsEntryFilterPlugin({
|
|
12
|
+
fieldType: _CmsEntryFilterPlugin.CmsEntryFilterPlugin.ALL,
|
|
13
|
+
exec: params => {
|
|
14
|
+
const {
|
|
15
|
+
applyFiltering,
|
|
16
|
+
field
|
|
17
|
+
} = params;
|
|
18
|
+
if (!params.field.isSearchable) {
|
|
19
|
+
const identifier = [...field.parents.map(p => p.fieldId), field.field.fieldId].join(".");
|
|
20
|
+
throw new _error.default(`Field "${identifier}" is not searchable.`);
|
|
21
|
+
}
|
|
22
|
+
applyFiltering(params);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
plugin.name = `${plugin.type}.default.all`;
|
|
26
|
+
return plugin;
|
|
27
|
+
};
|
|
28
|
+
exports.createDefaultFilterPlugin = createDefaultFilterPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createDefaultFilterPlugin","plugin","CmsEntryFilterPlugin","fieldType","ALL","exec","params","applyFiltering","field","isSearchable","identifier","parents","map","p","fieldId","join","WebinyError","name","type"],"sources":["defaultFilterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\n\nexport const createDefaultFilterPlugin = () => {\n const plugin = new CmsEntryFilterPlugin({\n fieldType: CmsEntryFilterPlugin.ALL,\n exec: params => {\n const { applyFiltering, field } = params;\n if (!params.field.isSearchable) {\n const identifier = [...field.parents.map(p => p.fieldId), field.field.fieldId].join(\n \".\"\n );\n throw new WebinyError(`Field \"${identifier}\" is not searchable.`);\n }\n applyFiltering(params);\n }\n });\n\n plugin.name = `${plugin.type}.default.all`;\n\n return plugin;\n};\n"],"mappings":";;;;;;;AAAA;AACA;AAEO,MAAMA,yBAAyB,GAAG,MAAM;EAC3C,MAAMC,MAAM,GAAG,IAAIC,0CAAoB,CAAC;IACpCC,SAAS,EAAED,0CAAoB,CAACE,GAAG;IACnCC,IAAI,EAAEC,MAAM,IAAI;MACZ,MAAM;QAAEC,cAAc;QAAEC;MAAM,CAAC,GAAGF,MAAM;MACxC,IAAI,CAACA,MAAM,CAACE,KAAK,CAACC,YAAY,EAAE;QAC5B,MAAMC,UAAU,GAAG,CAAC,GAAGF,KAAK,CAACG,OAAO,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,CAAC,EAAEN,KAAK,CAACA,KAAK,CAACM,OAAO,CAAC,CAACC,IAAI,CAC/E,GAAG,CACN;QACD,MAAM,IAAIC,cAAW,CAAE,UAASN,UAAW,sBAAqB,CAAC;MACrE;MACAH,cAAc,CAACD,MAAM,CAAC;IAC1B;EACJ,CAAC,CAAC;EAEFL,MAAM,CAACgB,IAAI,GAAI,GAAEhB,MAAM,CAACiB,IAAK,cAAa;EAE1C,OAAOjB,MAAM;AACjB,CAAC;AAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createFilterPlugins: () => import("../../../../../plugins/CmsEntryFilterPlugin").CmsEntryFilterPlugin[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createFilterPlugins = void 0;
|
|
7
|
+
var _defaultFilterPlugin = require("./defaultFilterPlugin");
|
|
8
|
+
var _objectFilterPlugin = require("./objectFilterPlugin");
|
|
9
|
+
var _refFilterPlugin = require("./refFilterPlugin");
|
|
10
|
+
const createFilterPlugins = () => {
|
|
11
|
+
return [(0, _defaultFilterPlugin.createDefaultFilterPlugin)(), (0, _objectFilterPlugin.createObjectFilterPlugin)(), (0, _refFilterPlugin.createRefFilterPlugin)()];
|
|
12
|
+
};
|
|
13
|
+
exports.createFilterPlugins = createFilterPlugins;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFilterPlugins","createDefaultFilterPlugin","createObjectFilterPlugin","createRefFilterPlugin"],"sources":["index.ts"],"sourcesContent":["import { createDefaultFilterPlugin } from \"./defaultFilterPlugin\";\nimport { createObjectFilterPlugin } from \"./objectFilterPlugin\";\nimport { createRefFilterPlugin } from \"./refFilterPlugin\";\n\nexport const createFilterPlugins = () => {\n return [createDefaultFilterPlugin(), createObjectFilterPlugin(), createRefFilterPlugin()];\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AAEO,MAAMA,mBAAmB,GAAG,MAAM;EACrC,OAAO,CAAC,IAAAC,8CAAyB,GAAE,EAAE,IAAAC,4CAAwB,GAAE,EAAE,IAAAC,sCAAqB,GAAE,CAAC;AAC7F,CAAC;AAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createObjectFilterPlugin = void 0;
|
|
8
|
+
var _CmsEntryFilterPlugin = require("../../../../../plugins/CmsEntryFilterPlugin");
|
|
9
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
10
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
+
const createObjectFilterPlugin = () => {
|
|
12
|
+
const plugin = new _CmsEntryFilterPlugin.CmsEntryFilterPlugin({
|
|
13
|
+
fieldType: "object",
|
|
14
|
+
exec: params => {
|
|
15
|
+
const {
|
|
16
|
+
applyFiltering,
|
|
17
|
+
value: where,
|
|
18
|
+
fields,
|
|
19
|
+
field: parentField,
|
|
20
|
+
getFilterPlugin,
|
|
21
|
+
query
|
|
22
|
+
} = params;
|
|
23
|
+
/**
|
|
24
|
+
* Because this is an object field, we must construct filters based on the value property.
|
|
25
|
+
* Value property is actually a where condition.
|
|
26
|
+
*/
|
|
27
|
+
for (const key in where) {
|
|
28
|
+
const value = where[key];
|
|
29
|
+
if (value === undefined) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const {
|
|
33
|
+
field: whereFieldId,
|
|
34
|
+
operator
|
|
35
|
+
} = (0, _apiElasticsearch.parseWhereKey)(key);
|
|
36
|
+
const identifier = [...parentField.parents.map(p => p.fieldId), parentField.field.fieldId, whereFieldId].join(".");
|
|
37
|
+
const field = fields[identifier];
|
|
38
|
+
if (!field) {
|
|
39
|
+
throw new _error.default(`There is no field "${identifier}".`);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* We need to find the filter plugin for the child field.
|
|
43
|
+
* This will throw error if no plugin can be found.
|
|
44
|
+
*/
|
|
45
|
+
const plugin = getFilterPlugin(field.type);
|
|
46
|
+
/**
|
|
47
|
+
* Basically this allows us to go into depth as much as we want with the object fields.
|
|
48
|
+
*/
|
|
49
|
+
plugin.exec({
|
|
50
|
+
applyFiltering,
|
|
51
|
+
getFilterPlugin,
|
|
52
|
+
key,
|
|
53
|
+
value,
|
|
54
|
+
operator,
|
|
55
|
+
field,
|
|
56
|
+
fields,
|
|
57
|
+
query
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
plugin.name = `${plugin.type}.default.object`;
|
|
63
|
+
return plugin;
|
|
64
|
+
};
|
|
65
|
+
exports.createObjectFilterPlugin = createObjectFilterPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createObjectFilterPlugin","plugin","CmsEntryFilterPlugin","fieldType","exec","params","applyFiltering","value","where","fields","field","parentField","getFilterPlugin","query","key","undefined","whereFieldId","operator","parseWhereKey","identifier","parents","map","p","fieldId","join","WebinyError","type","name"],"sources":["objectFilterPlugin.ts"],"sourcesContent":["import { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\nimport { parseWhereKey } from \"@webiny/api-elasticsearch\";\nimport WebinyError from \"@webiny/error\";\n\nexport const createObjectFilterPlugin = () => {\n const plugin = new CmsEntryFilterPlugin({\n fieldType: \"object\",\n exec: params => {\n const {\n applyFiltering,\n value: where,\n fields,\n field: parentField,\n getFilterPlugin,\n query\n } = params;\n /**\n * Because this is an object field, we must construct filters based on the value property.\n * Value property is actually a where condition.\n */\n for (const key in where) {\n const value = where[key];\n if (value === undefined) {\n continue;\n }\n const { field: whereFieldId, operator } = parseWhereKey(key);\n\n const identifier = [\n ...parentField.parents.map(p => p.fieldId),\n parentField.field.fieldId,\n whereFieldId\n ].join(\".\");\n const field = fields[identifier];\n if (!field) {\n throw new WebinyError(`There is no field \"${identifier}\".`);\n }\n /**\n * We need to find the filter plugin for the child field.\n * This will throw error if no plugin can be found.\n */\n const plugin = getFilterPlugin(field.type);\n /**\n * Basically this allows us to go into depth as much as we want with the object fields.\n */\n plugin.exec({\n applyFiltering,\n getFilterPlugin,\n key,\n value,\n operator,\n field,\n fields,\n query\n });\n }\n }\n });\n\n plugin.name = `${plugin.type}.default.object`;\n\n return plugin;\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEO,MAAMA,wBAAwB,GAAG,MAAM;EAC1C,MAAMC,MAAM,GAAG,IAAIC,0CAAoB,CAAC;IACpCC,SAAS,EAAE,QAAQ;IACnBC,IAAI,EAAEC,MAAM,IAAI;MACZ,MAAM;QACFC,cAAc;QACdC,KAAK,EAAEC,KAAK;QACZC,MAAM;QACNC,KAAK,EAAEC,WAAW;QAClBC,eAAe;QACfC;MACJ,CAAC,GAAGR,MAAM;MACV;AACZ;AACA;AACA;MACY,KAAK,MAAMS,GAAG,IAAIN,KAAK,EAAE;QACrB,MAAMD,KAAK,GAAGC,KAAK,CAACM,GAAG,CAAC;QACxB,IAAIP,KAAK,KAAKQ,SAAS,EAAE;UACrB;QACJ;QACA,MAAM;UAAEL,KAAK,EAAEM,YAAY;UAAEC;QAAS,CAAC,GAAG,IAAAC,+BAAa,EAACJ,GAAG,CAAC;QAE5D,MAAMK,UAAU,GAAG,CACf,GAAGR,WAAW,CAACS,OAAO,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,OAAO,CAAC,EAC1CZ,WAAW,CAACD,KAAK,CAACa,OAAO,EACzBP,YAAY,CACf,CAACQ,IAAI,CAAC,GAAG,CAAC;QACX,MAAMd,KAAK,GAAGD,MAAM,CAACU,UAAU,CAAC;QAChC,IAAI,CAACT,KAAK,EAAE;UACR,MAAM,IAAIe,cAAW,CAAE,sBAAqBN,UAAW,IAAG,CAAC;QAC/D;QACA;AAChB;AACA;AACA;QACgB,MAAMlB,MAAM,GAAGW,eAAe,CAACF,KAAK,CAACgB,IAAI,CAAC;QAC1C;AAChB;AACA;QACgBzB,MAAM,CAACG,IAAI,CAAC;UACRE,cAAc;UACdM,eAAe;UACfE,GAAG;UACHP,KAAK;UACLU,QAAQ;UACRP,KAAK;UACLD,MAAM;UACNI;QACJ,CAAC,CAAC;MACN;IACJ;EACJ,CAAC,CAAC;EAEFZ,MAAM,CAAC0B,IAAI,GAAI,GAAE1B,MAAM,CAACyB,IAAK,iBAAgB;EAE7C,OAAOzB,MAAM;AACjB,CAAC;AAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createRefFilterPlugin = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
var _CmsEntryFilterPlugin = require("../../../../../plugins/CmsEntryFilterPlugin");
|
|
10
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
11
|
+
const createRefFilterPlugin = () => {
|
|
12
|
+
return new _CmsEntryFilterPlugin.CmsEntryFilterPlugin({
|
|
13
|
+
fieldType: "ref",
|
|
14
|
+
exec: params => {
|
|
15
|
+
const {
|
|
16
|
+
applyFiltering,
|
|
17
|
+
value: values,
|
|
18
|
+
query,
|
|
19
|
+
field
|
|
20
|
+
} = params;
|
|
21
|
+
/**
|
|
22
|
+
* We must have an object when querying in the ref field.
|
|
23
|
+
*/
|
|
24
|
+
if (typeof values !== "object") {
|
|
25
|
+
throw new _error.default(`When querying by ref field, value of the field must be an object.`, "OBJECT_REQUIRED", {
|
|
26
|
+
value: values
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
for (const key in values) {
|
|
30
|
+
const {
|
|
31
|
+
operator
|
|
32
|
+
} = (0, _apiElasticsearch.parseWhereKey)(key);
|
|
33
|
+
const value = values[key];
|
|
34
|
+
if (value === undefined) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
applyFiltering({
|
|
38
|
+
query,
|
|
39
|
+
field,
|
|
40
|
+
operator,
|
|
41
|
+
key,
|
|
42
|
+
value
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
exports.createRefFilterPlugin = createRefFilterPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createRefFilterPlugin","CmsEntryFilterPlugin","fieldType","exec","params","applyFiltering","value","values","query","field","WebinyError","key","operator","parseWhereKey","undefined"],"sources":["refFilterPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\nimport { parseWhereKey } from \"@webiny/api-elasticsearch\";\n\nexport const createRefFilterPlugin = () => {\n return new CmsEntryFilterPlugin({\n fieldType: \"ref\",\n exec: params => {\n const { applyFiltering, value: values, query, field } = params;\n /**\n * We must have an object when querying in the ref field.\n */\n if (typeof values !== \"object\") {\n throw new WebinyError(\n `When querying by ref field, value of the field must be an object.`,\n \"OBJECT_REQUIRED\",\n {\n value: values\n }\n );\n }\n\n for (const key in values) {\n const { operator } = parseWhereKey(key);\n const value = values[key];\n if (value === undefined) {\n continue;\n }\n\n applyFiltering({\n query,\n field,\n operator,\n key,\n value\n });\n }\n }\n });\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAEO,MAAMA,qBAAqB,GAAG,MAAM;EACvC,OAAO,IAAIC,0CAAoB,CAAC;IAC5BC,SAAS,EAAE,KAAK;IAChBC,IAAI,EAAEC,MAAM,IAAI;MACZ,MAAM;QAAEC,cAAc;QAAEC,KAAK,EAAEC,MAAM;QAAEC,KAAK;QAAEC;MAAM,CAAC,GAAGL,MAAM;MAC9D;AACZ;AACA;MACY,IAAI,OAAOG,MAAM,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAIG,cAAW,CAChB,mEAAkE,EACnE,iBAAiB,EACjB;UACIJ,KAAK,EAAEC;QACX,CAAC,CACJ;MACL;MAEA,KAAK,MAAMI,GAAG,IAAIJ,MAAM,EAAE;QACtB,MAAM;UAAEK;QAAS,CAAC,GAAG,IAAAC,+BAAa,EAACF,GAAG,CAAC;QACvC,MAAML,KAAK,GAAGC,MAAM,CAACI,GAAG,CAAC;QACzB,IAAIL,KAAK,KAAKQ,SAAS,EAAE;UACrB;QACJ;QAEAT,cAAc,CAAC;UACXG,KAAK;UACLC,KAAK;UACLG,QAAQ;UACRD,GAAG;UACHL;QACJ,CAAC,CAAC;MACN;IACJ;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getPopulated = void 0;
|
|
7
|
+
const getPopulated = query => {
|
|
8
|
+
const result = {};
|
|
9
|
+
let key;
|
|
10
|
+
for (key in query) {
|
|
11
|
+
const value = query[key];
|
|
12
|
+
if (value === undefined || Array.isArray(value) && value.length === 0) {
|
|
13
|
+
continue;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* TODO figure out better types.
|
|
17
|
+
*/
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
result[key] = value;
|
|
20
|
+
}
|
|
21
|
+
return result;
|
|
22
|
+
};
|
|
23
|
+
exports.getPopulated = getPopulated;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getPopulated","query","result","key","value","undefined","Array","isArray","length"],"sources":["populated.ts"],"sourcesContent":["import { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\n\nexport const getPopulated = (\n query: ElasticsearchBoolQueryConfig\n): Partial<ElasticsearchBoolQueryConfig> => {\n const result: Partial<ElasticsearchBoolQueryConfig> = {};\n let key: keyof ElasticsearchBoolQueryConfig;\n for (key in query) {\n const value = query[key];\n if (value === undefined || (Array.isArray(value) && value.length === 0)) {\n continue;\n }\n /**\n * TODO figure out better types.\n */\n // @ts-ignore\n result[key] = value;\n }\n return result;\n};\n"],"mappings":";;;;;;AAEO,MAAMA,YAAY,GACrBC,KAAmC,IACK;EACxC,MAAMC,MAA6C,GAAG,CAAC,CAAC;EACxD,IAAIC,GAAuC;EAC3C,KAAKA,GAAG,IAAIF,KAAK,EAAE;IACf,MAAMG,KAAK,GAAGH,KAAK,CAACE,GAAG,CAAC;IACxB,IAAIC,KAAK,KAAKC,SAAS,IAAKC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,IAAIA,KAAK,CAACI,MAAM,KAAK,CAAE,EAAE;MACrE;IACJ;IACA;AACR;AACA;IACQ;IACAN,MAAM,CAACC,GAAG,CAAC,GAAGC,KAAK;EACvB;EACA,OAAOF,MAAM;AACjB,CAAC;AAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.getWhereValues = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
const getWhereValues = (value, condition) => {
|
|
10
|
+
const values = value;
|
|
11
|
+
if (!Array.isArray(values)) {
|
|
12
|
+
throw new _error.default(`Trying to run filtering with "${condition}", but the value sent is not an array.`, `MALFORMED_${condition}_CONDITION`, {
|
|
13
|
+
value
|
|
14
|
+
});
|
|
15
|
+
} else if (values.length === 0) {
|
|
16
|
+
throw new _error.default(`Trying to run filtering with "${condition}", but the value sent is empty array.`, `MALFORMED_${condition}_CONDITION`, {
|
|
17
|
+
value
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return values;
|
|
21
|
+
};
|
|
22
|
+
exports.getWhereValues = getWhereValues;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getWhereValues","value","condition","values","Array","isArray","WebinyError","length"],"sources":["values.ts"],"sourcesContent":["import { CmsEntryListWhere } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\n\nexport const getWhereValues = (value: unknown, condition: \"AND\" | \"OR\") => {\n const values = value as CmsEntryListWhere[] | undefined;\n if (!Array.isArray(values)) {\n throw new WebinyError(\n `Trying to run filtering with \"${condition}\", but the value sent is not an array.`,\n `MALFORMED_${condition}_CONDITION`,\n {\n value\n }\n );\n } else if (values.length === 0) {\n throw new WebinyError(\n `Trying to run filtering with \"${condition}\", but the value sent is empty array.`,\n `MALFORMED_${condition}_CONDITION`,\n {\n value\n }\n );\n }\n return values;\n};\n"],"mappings":";;;;;;;AACA;AAEO,MAAMA,cAAc,GAAG,CAACC,KAAc,EAAEC,SAAuB,KAAK;EACvE,MAAMC,MAAM,GAAGF,KAAwC;EACvD,IAAI,CAACG,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,EAAE;IACxB,MAAM,IAAIG,cAAW,CAChB,iCAAgCJ,SAAU,wCAAuC,EACjF,aAAYA,SAAU,YAAW,EAClC;MACID;IACJ,CAAC,CACJ;EACL,CAAC,MAAM,IAAIE,MAAM,CAACI,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAID,cAAW,CAChB,iCAAgCJ,SAAU,uCAAsC,EAChF,aAAYA,SAAU,YAAW,EAClC;MACID;IACJ,CAAC,CACJ;EACL;EACA,OAAOE,MAAM;AACjB,CAAC;AAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
|
|
2
|
+
import { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
|
|
3
|
+
import { PluginsContainer } from "@webiny/plugins";
|
|
4
|
+
interface Params {
|
|
5
|
+
plugins: PluginsContainer;
|
|
6
|
+
model: CmsModel;
|
|
7
|
+
query: ElasticsearchBoolQueryConfig;
|
|
8
|
+
term?: string;
|
|
9
|
+
fields: CmsModelField[];
|
|
10
|
+
}
|
|
11
|
+
export declare const applyFullTextSearch: (params: Params) => void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.applyFullTextSearch = void 0;
|
|
7
|
+
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
8
|
+
var _plugins = require("../../../plugins");
|
|
9
|
+
/**
|
|
10
|
+
* Our default plugin is working with the AND operator for the multiple words query string.
|
|
11
|
+
*/
|
|
12
|
+
const defaultPlugin = (0, _plugins.createCmsEntryElasticsearchFullTextSearchPlugin)({
|
|
13
|
+
apply: params => {
|
|
14
|
+
const {
|
|
15
|
+
query,
|
|
16
|
+
term,
|
|
17
|
+
fields,
|
|
18
|
+
createFieldPath,
|
|
19
|
+
prepareTerm
|
|
20
|
+
} = params;
|
|
21
|
+
query.must.push({
|
|
22
|
+
query_string: {
|
|
23
|
+
allow_leading_wildcard: true,
|
|
24
|
+
fields: fields.map(createFieldPath),
|
|
25
|
+
query: `*${prepareTerm(term)}*`,
|
|
26
|
+
default_operator: "and"
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
defaultPlugin.name = "headless-cms.elasticsearch.entry.fullTextSearch.default";
|
|
32
|
+
const getPlugin = params => {
|
|
33
|
+
const {
|
|
34
|
+
container,
|
|
35
|
+
model
|
|
36
|
+
} = params;
|
|
37
|
+
/**
|
|
38
|
+
* We need to reverse the plugins, so we can take the last one first - possibility to override existing plugins.
|
|
39
|
+
*/
|
|
40
|
+
const plugins = container.byType(_plugins.CmsEntryElasticsearchFullTextSearchPlugin.type).reverse();
|
|
41
|
+
/**
|
|
42
|
+
* We need to find the most specific plugin for the given model.
|
|
43
|
+
* Also, we need to use the first possible plugin if the specific one is not found.
|
|
44
|
+
*/
|
|
45
|
+
let plugin = null;
|
|
46
|
+
for (const pl of plugins) {
|
|
47
|
+
const models = pl.models || [];
|
|
48
|
+
/**
|
|
49
|
+
* We take the first available plugin for the given model.
|
|
50
|
+
*/
|
|
51
|
+
if (models.includes(model.modelId)) {
|
|
52
|
+
return pl;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Then we set the first possible plugin, which has no models defined, as the default one.
|
|
56
|
+
* It is important not to set the plugin which has models defined as they are specifically for the targeted model.
|
|
57
|
+
*/
|
|
58
|
+
//
|
|
59
|
+
else if (!plugin && models.length === 0) {
|
|
60
|
+
plugin = pl;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return plugin || defaultPlugin;
|
|
64
|
+
};
|
|
65
|
+
const applyFullTextSearch = params => {
|
|
66
|
+
const {
|
|
67
|
+
plugins,
|
|
68
|
+
query,
|
|
69
|
+
term,
|
|
70
|
+
fields,
|
|
71
|
+
model
|
|
72
|
+
} = params;
|
|
73
|
+
if (!term || term.length === 0 || fields.length === 0) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const plugin = getPlugin({
|
|
77
|
+
container: plugins,
|
|
78
|
+
model
|
|
79
|
+
});
|
|
80
|
+
plugin.apply({
|
|
81
|
+
model,
|
|
82
|
+
createFieldPath: field => `values.${field.storageId}`,
|
|
83
|
+
fields,
|
|
84
|
+
query,
|
|
85
|
+
term,
|
|
86
|
+
prepareTerm: _apiElasticsearch.normalizeValue
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
exports.applyFullTextSearch = applyFullTextSearch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["defaultPlugin","createCmsEntryElasticsearchFullTextSearchPlugin","apply","params","query","term","fields","createFieldPath","prepareTerm","must","push","query_string","allow_leading_wildcard","map","default_operator","name","getPlugin","container","model","plugins","byType","CmsEntryElasticsearchFullTextSearchPlugin","type","reverse","plugin","pl","models","includes","modelId","length","applyFullTextSearch","field","storageId","normalizeValue"],"sources":["fullTextSearch.ts"],"sourcesContent":["import { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\nimport { normalizeValue } from \"@webiny/api-elasticsearch\";\nimport { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport {\n CmsEntryElasticsearchFullTextSearchPlugin,\n createCmsEntryElasticsearchFullTextSearchPlugin\n} from \"~/plugins\";\n\n/**\n * Our default plugin is working with the AND operator for the multiple words query string.\n */\nconst defaultPlugin = createCmsEntryElasticsearchFullTextSearchPlugin({\n apply: params => {\n const { query, term, fields, createFieldPath, prepareTerm } = params;\n\n query.must.push({\n query_string: {\n allow_leading_wildcard: true,\n fields: fields.map(createFieldPath),\n query: `*${prepareTerm(term)}*`,\n default_operator: \"and\"\n }\n });\n }\n});\ndefaultPlugin.name = \"headless-cms.elasticsearch.entry.fullTextSearch.default\";\n\ninterface GetPluginParams {\n container: PluginsContainer;\n model: CmsModel;\n}\nconst getPlugin = (params: GetPluginParams): CmsEntryElasticsearchFullTextSearchPlugin => {\n const { container, model } = params;\n /**\n * We need to reverse the plugins, so we can take the last one first - possibility to override existing plugins.\n */\n const plugins = container\n .byType<CmsEntryElasticsearchFullTextSearchPlugin>(\n CmsEntryElasticsearchFullTextSearchPlugin.type\n )\n .reverse();\n /**\n * We need to find the most specific plugin for the given model.\n * Also, we need to use the first possible plugin if the specific one is not found.\n */\n let plugin: CmsEntryElasticsearchFullTextSearchPlugin | null = null;\n for (const pl of plugins) {\n const models = pl.models || [];\n /**\n * We take the first available plugin for the given model.\n */\n if (models.includes(model.modelId)) {\n return pl;\n }\n /**\n * Then we set the first possible plugin, which has no models defined, as the default one.\n * It is important not to set the plugin which has models defined as they are specifically for the targeted model.\n */\n //\n else if (!plugin && models.length === 0) {\n plugin = pl;\n }\n }\n\n return plugin || defaultPlugin;\n};\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n query: ElasticsearchBoolQueryConfig;\n term?: string;\n fields: CmsModelField[];\n}\nexport const applyFullTextSearch = (params: Params): void => {\n const { plugins, query, term, fields, model } = params;\n if (!term || term.length === 0 || fields.length === 0) {\n return;\n }\n\n const plugin = getPlugin({\n container: plugins,\n model\n });\n\n plugin.apply({\n model,\n createFieldPath: field => `values.${field.storageId}`,\n fields,\n query,\n term,\n prepareTerm: normalizeValue\n });\n};\n"],"mappings":";;;;;;AACA;AAGA;AAKA;AACA;AACA;AACA,MAAMA,aAAa,GAAG,IAAAC,wDAA+C,EAAC;EAClEC,KAAK,EAAEC,MAAM,IAAI;IACb,MAAM;MAAEC,KAAK;MAAEC,IAAI;MAAEC,MAAM;MAAEC,eAAe;MAAEC;IAAY,CAAC,GAAGL,MAAM;IAEpEC,KAAK,CAACK,IAAI,CAACC,IAAI,CAAC;MACZC,YAAY,EAAE;QACVC,sBAAsB,EAAE,IAAI;QAC5BN,MAAM,EAAEA,MAAM,CAACO,GAAG,CAACN,eAAe,CAAC;QACnCH,KAAK,EAAG,IAAGI,WAAW,CAACH,IAAI,CAAE,GAAE;QAC/BS,gBAAgB,EAAE;MACtB;IACJ,CAAC,CAAC;EACN;AACJ,CAAC,CAAC;AACFd,aAAa,CAACe,IAAI,GAAG,yDAAyD;AAM9E,MAAMC,SAAS,GAAIb,MAAuB,IAAgD;EACtF,MAAM;IAAEc,SAAS;IAAEC;EAAM,CAAC,GAAGf,MAAM;EACnC;AACJ;AACA;EACI,MAAMgB,OAAO,GAAGF,SAAS,CACpBG,MAAM,CACHC,kDAAyC,CAACC,IAAI,CACjD,CACAC,OAAO,EAAE;EACd;AACJ;AACA;AACA;EACI,IAAIC,MAAwD,GAAG,IAAI;EACnE,KAAK,MAAMC,EAAE,IAAIN,OAAO,EAAE;IACtB,MAAMO,MAAM,GAAGD,EAAE,CAACC,MAAM,IAAI,EAAE;IAC9B;AACR;AACA;IACQ,IAAIA,MAAM,CAACC,QAAQ,CAACT,KAAK,CAACU,OAAO,CAAC,EAAE;MAChC,OAAOH,EAAE;IACb;IACA;AACR;AACA;AACA;IACQ;IAAA,KACK,IAAI,CAACD,MAAM,IAAIE,MAAM,CAACG,MAAM,KAAK,CAAC,EAAE;MACrCL,MAAM,GAAGC,EAAE;IACf;EACJ;EAEA,OAAOD,MAAM,IAAIxB,aAAa;AAClC,CAAC;AASM,MAAM8B,mBAAmB,GAAI3B,MAAc,IAAW;EACzD,MAAM;IAAEgB,OAAO;IAAEf,KAAK;IAAEC,IAAI;IAAEC,MAAM;IAAEY;EAAM,CAAC,GAAGf,MAAM;EACtD,IAAI,CAACE,IAAI,IAAIA,IAAI,CAACwB,MAAM,KAAK,CAAC,IAAIvB,MAAM,CAACuB,MAAM,KAAK,CAAC,EAAE;IACnD;EACJ;EAEA,MAAML,MAAM,GAAGR,SAAS,CAAC;IACrBC,SAAS,EAAEE,OAAO;IAClBD;EACJ,CAAC,CAAC;EAEFM,MAAM,CAACtB,KAAK,CAAC;IACTgB,KAAK;IACLX,eAAe,EAAEwB,KAAK,IAAK,UAASA,KAAK,CAACC,SAAU,EAAC;IACrD1B,MAAM;IACNF,KAAK;IACLC,IAAI;IACJG,WAAW,EAAEyB;EACjB,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createFullTextSearchFields = void 0;
|
|
7
|
+
const createFullTextSearchFields = params => {
|
|
8
|
+
const {
|
|
9
|
+
term,
|
|
10
|
+
model,
|
|
11
|
+
fields
|
|
12
|
+
} = params;
|
|
13
|
+
if (!fields || fields.length === 0 || !term || term.trim().length === 0) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
return fields.reduce((collection, fieldId) => {
|
|
17
|
+
const field = model.fields.find(f => f.fieldId === fieldId);
|
|
18
|
+
if (!field) {
|
|
19
|
+
return collection;
|
|
20
|
+
}
|
|
21
|
+
collection.push(field);
|
|
22
|
+
return collection;
|
|
23
|
+
}, []);
|
|
24
|
+
};
|
|
25
|
+
exports.createFullTextSearchFields = createFullTextSearchFields;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFullTextSearchFields","params","term","model","fields","length","trim","reduce","collection","fieldId","field","find","f","push"],"sources":["fullTextSearchFields.ts"],"sourcesContent":["import { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\n\ninterface Params {\n model: CmsModel;\n term?: string;\n fields?: string[];\n}\nexport const createFullTextSearchFields = (params: Params): CmsModelField[] => {\n const { term, model, fields } = params;\n if (!fields || fields.length === 0 || !term || term.trim().length === 0) {\n return [];\n }\n return fields.reduce<CmsModelField[]>((collection, fieldId) => {\n const field = model.fields.find(f => f.fieldId === fieldId);\n if (!field) {\n return collection;\n }\n collection.push(field);\n return collection;\n }, []);\n};\n"],"mappings":";;;;;;AAOO,MAAMA,0BAA0B,GAAIC,MAAc,IAAsB;EAC3E,MAAM;IAAEC,IAAI;IAAEC,KAAK;IAAEC;EAAO,CAAC,GAAGH,MAAM;EACtC,IAAI,CAACG,MAAM,IAAIA,MAAM,CAACC,MAAM,KAAK,CAAC,IAAI,CAACH,IAAI,IAAIA,IAAI,CAACI,IAAI,EAAE,CAACD,MAAM,KAAK,CAAC,EAAE;IACrE,OAAO,EAAE;EACb;EACA,OAAOD,MAAM,CAACG,MAAM,CAAkB,CAACC,UAAU,EAAEC,OAAO,KAAK;IAC3D,MAAMC,KAAK,GAAGP,KAAK,CAACC,MAAM,CAACO,IAAI,CAACC,CAAC,IAAIA,CAAC,CAACH,OAAO,KAAKA,OAAO,CAAC;IAC3D,IAAI,CAACC,KAAK,EAAE;MACR,OAAOF,UAAU;IACrB;IACAA,UAAU,CAACK,IAAI,CAACH,KAAK,CAAC;IACtB,OAAOF,UAAU;EACrB,CAAC,EAAE,EAAE,CAAC;AACV,CAAC;AAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
|
|
2
|
+
import { CmsEntryListWhere, CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
+
export declare const createBaseQuery: () => ElasticsearchBoolQueryConfig;
|
|
4
|
+
interface Params {
|
|
5
|
+
model: CmsModel;
|
|
6
|
+
where: CmsEntryListWhere;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Latest and published are specific in Elasticsearch to that extend that they are tagged in the __type property.
|
|
10
|
+
* We allow either published or either latest.
|
|
11
|
+
* Latest is used in the manage API and published in the read API.
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
* We add the query.filter terms because we do not need scored search here and it is a bit faster.
|
|
15
|
+
*/
|
|
16
|
+
export declare const createInitialQuery: (params: Params) => ElasticsearchBoolQueryConfig;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createInitialQuery = exports.createBaseQuery = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
var _recordType = require("../recordType");
|
|
10
|
+
const createBaseQuery = () => {
|
|
11
|
+
return {
|
|
12
|
+
must: [],
|
|
13
|
+
must_not: [],
|
|
14
|
+
should: [],
|
|
15
|
+
filter: []
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
exports.createBaseQuery = createBaseQuery;
|
|
19
|
+
/**
|
|
20
|
+
* Latest and published are specific in Elasticsearch to that extend that they are tagged in the __type property.
|
|
21
|
+
* We allow either published or either latest.
|
|
22
|
+
* Latest is used in the manage API and published in the read API.
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* We add the query.filter terms because we do not need scored search here and it is a bit faster.
|
|
26
|
+
*/
|
|
27
|
+
const createInitialQuery = params => {
|
|
28
|
+
const {
|
|
29
|
+
model,
|
|
30
|
+
where
|
|
31
|
+
} = params;
|
|
32
|
+
const query = createBaseQuery();
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* When ES index is shared between tenants, we need to filter records by tenant ID
|
|
36
|
+
*
|
|
37
|
+
* TODO determine if we want to search across tenants in shared index?
|
|
38
|
+
*/
|
|
39
|
+
const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === "true";
|
|
40
|
+
if (sharedIndex) {
|
|
41
|
+
/**
|
|
42
|
+
* Tenant for the filtering is taken from the model.
|
|
43
|
+
*
|
|
44
|
+
* TODO determine if we want to send it in the "where" parameter?
|
|
45
|
+
*/
|
|
46
|
+
query.filter.push({
|
|
47
|
+
term: {
|
|
48
|
+
"tenant.keyword": model.tenant
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* Also, we must search only in selected model.
|
|
53
|
+
*/
|
|
54
|
+
query.filter.push({
|
|
55
|
+
term: {
|
|
56
|
+
"modelId.keyword": model.modelId
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
/**
|
|
60
|
+
* TODO determine if we want to search across locales?
|
|
61
|
+
* This search would anyway work for a single model and when sharing index.
|
|
62
|
+
*/
|
|
63
|
+
query.filter.push({
|
|
64
|
+
term: {
|
|
65
|
+
"locale.keyword": model.locale
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* We must transform published and latest where args into something that is understandable by our Elasticsearch
|
|
72
|
+
*/
|
|
73
|
+
if (where.published === true) {
|
|
74
|
+
query.filter.push({
|
|
75
|
+
term: {
|
|
76
|
+
"__type.keyword": (0, _recordType.createPublishedRecordType)()
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
} else if (where.latest === true) {
|
|
80
|
+
query.filter.push({
|
|
81
|
+
term: {
|
|
82
|
+
"__type.keyword": (0, _recordType.createLatestRecordType)()
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
//
|
|
87
|
+
/**
|
|
88
|
+
* We do not allow filtering without the published or latest parameter.
|
|
89
|
+
* Also, we do not want to set the default one, as there is a large possibility for user error when filtering.
|
|
90
|
+
*/else {
|
|
91
|
+
throw new _error.default(`Cannot call Elasticsearch query when not setting "published" or "latest".`, "ELASTICSEARCH_UNSUPPORTED_QUERY", {
|
|
92
|
+
where
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* We need to remove fields that actually do not exist on the record - it will break otherwise.
|
|
97
|
+
* This will modify the original object, which is what we want.
|
|
98
|
+
*/
|
|
99
|
+
delete where.published;
|
|
100
|
+
delete where.latest;
|
|
101
|
+
return query;
|
|
102
|
+
};
|
|
103
|
+
exports.createInitialQuery = createInitialQuery;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createBaseQuery","must","must_not","should","filter","createInitialQuery","params","model","where","query","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","push","term","tenant","modelId","locale","published","createPublishedRecordType","latest","createLatestRecordType","WebinyError"],"sources":["initialQuery.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\nimport { CmsEntryListWhere, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { createLatestRecordType, createPublishedRecordType } from \"../recordType\";\n\nexport const createBaseQuery = (): ElasticsearchBoolQueryConfig => {\n return {\n must: [],\n must_not: [],\n should: [],\n filter: []\n };\n};\n\ninterface Params {\n model: CmsModel;\n where: CmsEntryListWhere;\n}\n/**\n * Latest and published are specific in Elasticsearch to that extend that they are tagged in the __type property.\n * We allow either published or either latest.\n * Latest is used in the manage API and published in the read API.\n *\n *\n * We add the query.filter terms because we do not need scored search here and it is a bit faster.\n */\nexport const createInitialQuery = (params: Params): ElasticsearchBoolQueryConfig => {\n const { model, where } = params;\n\n const query = createBaseQuery();\n\n /**\n * When ES index is shared between tenants, we need to filter records by tenant ID\n *\n * TODO determine if we want to search across tenants in shared index?\n */\n const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === \"true\";\n if (sharedIndex) {\n /**\n * Tenant for the filtering is taken from the model.\n *\n * TODO determine if we want to send it in the \"where\" parameter?\n */\n query.filter.push({\n term: {\n \"tenant.keyword\": model.tenant\n }\n });\n /**\n * Also, we must search only in selected model.\n */\n query.filter.push({\n term: {\n \"modelId.keyword\": model.modelId\n }\n });\n /**\n * TODO determine if we want to search across locales?\n * This search would anyway work for a single model and when sharing index.\n */\n query.filter.push({\n term: {\n \"locale.keyword\": model.locale\n }\n });\n }\n\n /**\n * We must transform published and latest where args into something that is understandable by our Elasticsearch\n */\n if (where.published === true) {\n query.filter.push({\n term: {\n \"__type.keyword\": createPublishedRecordType()\n }\n });\n } else if (where.latest === true) {\n query.filter.push({\n term: {\n \"__type.keyword\": createLatestRecordType()\n }\n });\n }\n //\n /**\n * We do not allow filtering without the published or latest parameter.\n * Also, we do not want to set the default one, as there is a large possibility for user error when filtering.\n */\n else {\n throw new WebinyError(\n `Cannot call Elasticsearch query when not setting \"published\" or \"latest\".`,\n \"ELASTICSEARCH_UNSUPPORTED_QUERY\",\n {\n where\n }\n );\n }\n /**\n * We need to remove fields that actually do not exist on the record - it will break otherwise.\n * This will modify the original object, which is what we want.\n */\n delete where.published;\n delete where.latest;\n\n return query;\n};\n"],"mappings":";;;;;;;AAAA;AAGA;AAEO,MAAMA,eAAe,GAAG,MAAoC;EAC/D,OAAO;IACHC,IAAI,EAAE,EAAE;IACRC,QAAQ,EAAE,EAAE;IACZC,MAAM,EAAE,EAAE;IACVC,MAAM,EAAE;EACZ,CAAC;AACL,CAAC;AAAC;AAMF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,kBAAkB,GAAIC,MAAc,IAAmC;EAChF,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAE/B,MAAMG,KAAK,GAAGT,eAAe,EAAE;;EAE/B;AACJ;AACA;AACA;AACA;EACI,MAAMU,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,4BAA4B,KAAK,MAAM;EACvE,IAAIH,WAAW,EAAE;IACb;AACR;AACA;AACA;AACA;IACQD,KAAK,CAACL,MAAM,CAACU,IAAI,CAAC;MACdC,IAAI,EAAE;QACF,gBAAgB,EAAER,KAAK,CAACS;MAC5B;IACJ,CAAC,CAAC;IACF;AACR;AACA;IACQP,KAAK,CAACL,MAAM,CAACU,IAAI,CAAC;MACdC,IAAI,EAAE;QACF,iBAAiB,EAAER,KAAK,CAACU;MAC7B;IACJ,CAAC,CAAC;IACF;AACR;AACA;AACA;IACQR,KAAK,CAACL,MAAM,CAACU,IAAI,CAAC;MACdC,IAAI,EAAE;QACF,gBAAgB,EAAER,KAAK,CAACW;MAC5B;IACJ,CAAC,CAAC;EACN;;EAEA;AACJ;AACA;EACI,IAAIV,KAAK,CAACW,SAAS,KAAK,IAAI,EAAE;IAC1BV,KAAK,CAACL,MAAM,CAACU,IAAI,CAAC;MACdC,IAAI,EAAE;QACF,gBAAgB,EAAE,IAAAK,qCAAyB;MAC/C;IACJ,CAAC,CAAC;EACN,CAAC,MAAM,IAAIZ,KAAK,CAACa,MAAM,KAAK,IAAI,EAAE;IAC9BZ,KAAK,CAACL,MAAM,CAACU,IAAI,CAAC;MACdC,IAAI,EAAE;QACF,gBAAgB,EAAE,IAAAO,kCAAsB;MAC5C;IACJ,CAAC,CAAC;EACN;EACA;EACA;AACJ;AACA;AACA,KAHI,KAIK;IACD,MAAM,IAAIC,cAAW,CAChB,2EAA0E,EAC3E,iCAAiC,EACjC;MACIf;IACJ,CAAC,CACJ;EACL;EACA;AACJ;AACA;AACA;EACI,OAAOA,KAAK,CAACW,SAAS;EACtB,OAAOX,KAAK,CAACa,MAAM;EAEnB,OAAOZ,KAAK;AAChB,CAAC;AAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hasKeyword = void 0;
|
|
7
|
+
const noKeywordFields = ["date", "datetime", "number", "boolean"];
|
|
8
|
+
const hasKeyword = field => {
|
|
9
|
+
/**
|
|
10
|
+
* We defined some field types that MUST have no keyword added to the field path
|
|
11
|
+
*/
|
|
12
|
+
if (noKeywordFields.includes(field.type)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* If field has unmapped type defined, do not add keyword.
|
|
17
|
+
*/
|
|
18
|
+
//
|
|
19
|
+
else if (field.unmappedType) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* And if specifically defined that field has no keyword, do not add it.
|
|
24
|
+
*/
|
|
25
|
+
//
|
|
26
|
+
else if (field.keyword === false) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* All other fields have keyword added.
|
|
31
|
+
*/
|
|
32
|
+
return true;
|
|
33
|
+
};
|
|
34
|
+
exports.hasKeyword = hasKeyword;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["noKeywordFields","hasKeyword","field","includes","type","unmappedType","keyword"],"sources":["keyword.ts"],"sourcesContent":["import { ModelField } from \"./types\";\n\nconst noKeywordFields: string[] = [\"date\", \"datetime\", \"number\", \"boolean\"];\nexport const hasKeyword = (field: ModelField): boolean => {\n /**\n * We defined some field types that MUST have no keyword added to the field path\n */\n if (noKeywordFields.includes(field.type)) {\n return false;\n }\n /**\n * If field has unmapped type defined, do not add keyword.\n */\n //\n else if (field.unmappedType) {\n return false;\n }\n /**\n * And if specifically defined that field has no keyword, do not add it.\n */\n //\n else if (field.keyword === false) {\n return false;\n }\n /**\n * All other fields have keyword added.\n */\n return true;\n};\n"],"mappings":";;;;;;AAEA,MAAMA,eAAyB,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC;AACpE,MAAMC,UAAU,GAAIC,KAAiB,IAAc;EACtD;AACJ;AACA;EACI,IAAIF,eAAe,CAACG,QAAQ,CAACD,KAAK,CAACE,IAAI,CAAC,EAAE;IACtC,OAAO,KAAK;EAChB;EACA;AACJ;AACA;EACI;EAAA,KACK,IAAIF,KAAK,CAACG,YAAY,EAAE;IACzB,OAAO,KAAK;EAChB;EACA;AACJ;AACA;EACI;EAAA,KACK,IAAIH,KAAK,CAACI,OAAO,KAAK,KAAK,EAAE;IAC9B,OAAO,KAAK;EAChB;EACA;AACJ;AACA;EACI,OAAO,IAAI;AACf,CAAC;AAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CmsEntryElasticsearchBodyModifierPlugin } from "../../../../plugins";
|
|
2
|
+
import { PluginsContainer } from "@webiny/plugins";
|
|
3
|
+
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
4
|
+
interface Params {
|
|
5
|
+
plugins: PluginsContainer;
|
|
6
|
+
model: CmsModel;
|
|
7
|
+
}
|
|
8
|
+
export declare const createBodyModifierPluginList: ({ plugins, model }: Params) => CmsEntryElasticsearchBodyModifierPlugin[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createBodyModifierPluginList = void 0;
|
|
7
|
+
var _plugins = require("../../../../plugins");
|
|
8
|
+
const createBodyModifierPluginList = ({
|
|
9
|
+
plugins,
|
|
10
|
+
model
|
|
11
|
+
}) => {
|
|
12
|
+
return plugins.byType(_plugins.CmsEntryElasticsearchBodyModifierPlugin.type).filter(pl => {
|
|
13
|
+
return !pl.modelId || pl.modelId === model.modelId;
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
exports.createBodyModifierPluginList = createBodyModifierPluginList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createBodyModifierPluginList","plugins","model","byType","CmsEntryElasticsearchBodyModifierPlugin","type","filter","pl","modelId"],"sources":["bodyModifier.ts"],"sourcesContent":["import { CmsEntryElasticsearchBodyModifierPlugin } from \"~/plugins\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n}\nexport const createBodyModifierPluginList = ({ plugins, model }: Params) => {\n return plugins\n .byType<CmsEntryElasticsearchBodyModifierPlugin>(\n CmsEntryElasticsearchBodyModifierPlugin.type\n )\n .filter(pl => {\n return !pl.modelId || pl.modelId === model.modelId;\n });\n};\n"],"mappings":";;;;;;AAAA;AAQO,MAAMA,4BAA4B,GAAG,CAAC;EAAEC,OAAO;EAAEC;AAAc,CAAC,KAAK;EACxE,OAAOD,OAAO,CACTE,MAAM,CACHC,gDAAuC,CAACC,IAAI,CAC/C,CACAC,MAAM,CAACC,EAAE,IAAI;IACV,OAAO,CAACA,EAAE,CAACC,OAAO,IAAID,EAAE,CAACC,OAAO,KAAKN,KAAK,CAACM,OAAO;EACtD,CAAC,CAAC;AACV,CAAC;AAAC"}
|