@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.
Files changed (204) hide show
  1. package/configurations.js +0 -8
  2. package/configurations.js.map +1 -1
  3. package/definitions/entry.js +3 -5
  4. package/definitions/entry.js.map +1 -1
  5. package/definitions/entryElasticsearch.js +0 -5
  6. package/definitions/entryElasticsearch.js.map +1 -1
  7. package/definitions/group.js +0 -5
  8. package/definitions/group.js.map +1 -1
  9. package/definitions/model.js +22 -5
  10. package/definitions/model.js.map +1 -1
  11. package/definitions/settings.js +0 -5
  12. package/definitions/settings.js.map +1 -1
  13. package/definitions/system.js +0 -5
  14. package/definitions/system.js.map +1 -1
  15. package/definitions/table.js +0 -3
  16. package/definitions/table.js.map +1 -1
  17. package/definitions/tableElasticsearch.js +0 -3
  18. package/definitions/tableElasticsearch.js.map +1 -1
  19. package/dynamoDb/index.d.ts +1 -1
  20. package/dynamoDb/index.js +0 -5
  21. package/dynamoDb/index.js.map +1 -1
  22. package/dynamoDb/storage/date.d.ts +2 -1
  23. package/dynamoDb/storage/date.js +4 -17
  24. package/dynamoDb/storage/date.js.map +1 -1
  25. package/dynamoDb/storage/longText.d.ts +1 -1
  26. package/dynamoDb/storage/longText.js +10 -18
  27. package/dynamoDb/storage/longText.js.map +1 -1
  28. package/dynamoDb/storage/richText.d.ts +1 -1
  29. package/dynamoDb/storage/richText.js +12 -30
  30. package/dynamoDb/storage/richText.js.map +1 -1
  31. package/elasticsearch/createElasticsearchIndex.js +0 -11
  32. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  33. package/elasticsearch/deleteElasticsearchIndex.js +0 -7
  34. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  35. package/elasticsearch/index.js +0 -5
  36. package/elasticsearch/index.js.map +1 -1
  37. package/elasticsearch/indexing/dateTimeIndexing.js +4 -21
  38. package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
  39. package/elasticsearch/indexing/defaultFieldIndexing.js +15 -10
  40. package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
  41. package/elasticsearch/indexing/index.js +0 -9
  42. package/elasticsearch/indexing/index.js.map +1 -1
  43. package/elasticsearch/indexing/longTextIndexing.d.ts +4 -0
  44. package/elasticsearch/indexing/longTextIndexing.js +19 -9
  45. package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
  46. package/elasticsearch/indexing/numberIndexing.js +0 -9
  47. package/elasticsearch/indexing/numberIndexing.js.map +1 -1
  48. package/elasticsearch/indexing/objectIndexing.js +3 -30
  49. package/elasticsearch/indexing/objectIndexing.js.map +1 -1
  50. package/elasticsearch/indexing/richTextIndexing.js +0 -5
  51. package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
  52. package/elasticsearch/indices/base.js +0 -3
  53. package/elasticsearch/indices/base.js.map +1 -1
  54. package/elasticsearch/indices/index.js +0 -4
  55. package/elasticsearch/indices/index.js.map +1 -1
  56. package/elasticsearch/indices/japanese.js +0 -3
  57. package/elasticsearch/indices/japanese.js.map +1 -1
  58. package/elasticsearch/search/index.js +0 -4
  59. package/elasticsearch/search/index.js.map +1 -1
  60. package/elasticsearch/search/refSearch.js +4 -8
  61. package/elasticsearch/search/refSearch.js.map +1 -1
  62. package/elasticsearch/search/timeSearch.js +0 -7
  63. package/elasticsearch/search/timeSearch.js.map +1 -1
  64. package/helpers/entryIndexHelpers.js +20 -49
  65. package/helpers/entryIndexHelpers.js.map +1 -1
  66. package/helpers/index.d.ts +0 -1
  67. package/helpers/index.js +0 -15
  68. package/helpers/index.js.map +1 -1
  69. package/index.js +19 -73
  70. package/index.js.map +1 -1
  71. package/operations/entry/dataLoaders.js +0 -52
  72. package/operations/entry/dataLoaders.js.map +1 -1
  73. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
  74. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +32 -0
  75. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
  76. package/operations/entry/elasticsearch/body.d.ts +13 -0
  77. package/operations/entry/elasticsearch/body.js +140 -0
  78. package/operations/entry/elasticsearch/body.js.map +1 -0
  79. package/operations/entry/elasticsearch/fields.d.ts +9 -0
  80. package/operations/entry/elasticsearch/fields.js +229 -0
  81. package/operations/entry/elasticsearch/fields.js.map +1 -0
  82. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +8 -0
  83. package/operations/entry/elasticsearch/filtering/applyFiltering.js +57 -0
  84. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -0
  85. package/operations/entry/elasticsearch/filtering/exec.d.ts +17 -0
  86. package/operations/entry/elasticsearch/filtering/exec.js +172 -0
  87. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -0
  88. package/operations/entry/elasticsearch/filtering/index.d.ts +1 -0
  89. package/operations/entry/elasticsearch/filtering/index.js +16 -0
  90. package/operations/entry/elasticsearch/filtering/index.js.map +1 -0
  91. package/operations/entry/elasticsearch/filtering/path.d.ts +15 -0
  92. package/operations/entry/elasticsearch/filtering/path.js +44 -0
  93. package/operations/entry/elasticsearch/filtering/path.js.map +1 -0
  94. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +2 -0
  95. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +28 -0
  96. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -0
  97. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -0
  98. package/operations/entry/elasticsearch/filtering/plugins/index.js +13 -0
  99. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -0
  100. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +2 -0
  101. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +65 -0
  102. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -0
  103. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +2 -0
  104. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +48 -0
  105. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -0
  106. package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -0
  107. package/operations/entry/elasticsearch/filtering/populated.js +23 -0
  108. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -0
  109. package/operations/entry/elasticsearch/filtering/values.d.ts +2 -0
  110. package/operations/entry/elasticsearch/filtering/values.js +22 -0
  111. package/operations/entry/elasticsearch/filtering/values.js.map +1 -0
  112. package/operations/entry/elasticsearch/fullTextSearch.d.ts +12 -0
  113. package/operations/entry/elasticsearch/fullTextSearch.js +89 -0
  114. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -0
  115. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +8 -0
  116. package/operations/entry/elasticsearch/fullTextSearchFields.js +25 -0
  117. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -0
  118. package/operations/entry/elasticsearch/initialQuery.d.ts +17 -0
  119. package/operations/entry/elasticsearch/initialQuery.js +103 -0
  120. package/operations/entry/elasticsearch/initialQuery.js.map +1 -0
  121. package/operations/entry/elasticsearch/keyword.d.ts +2 -0
  122. package/operations/entry/elasticsearch/keyword.js +34 -0
  123. package/operations/entry/elasticsearch/keyword.js.map +1 -0
  124. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +9 -0
  125. package/operations/entry/elasticsearch/plugins/bodyModifier.js +16 -0
  126. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -0
  127. package/operations/entry/elasticsearch/plugins/operator.d.ts +8 -0
  128. package/operations/entry/elasticsearch/plugins/operator.js +37 -0
  129. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -0
  130. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +9 -0
  131. package/operations/entry/elasticsearch/plugins/queryModifier.js +16 -0
  132. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -0
  133. package/operations/entry/elasticsearch/plugins/search.d.ts +7 -0
  134. package/{helpers/searchPluginsList.js → operations/entry/elasticsearch/plugins/search.js} +7 -9
  135. package/operations/entry/elasticsearch/plugins/search.js.map +1 -0
  136. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +9 -0
  137. package/operations/entry/elasticsearch/plugins/sortModifier.js +16 -0
  138. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -0
  139. package/operations/entry/elasticsearch/sort.d.ts +12 -0
  140. package/operations/entry/elasticsearch/sort.js +82 -0
  141. package/operations/entry/elasticsearch/sort.js.map +1 -0
  142. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +16 -0
  143. package/{helpers → operations/entry/elasticsearch}/transformValueForSearch.js +7 -6
  144. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -0
  145. package/operations/entry/elasticsearch/types.d.ts +41 -0
  146. package/operations/entry/elasticsearch/types.js +5 -0
  147. package/operations/entry/elasticsearch/types.js.map +1 -0
  148. package/operations/entry/index.d.ts +0 -2
  149. package/operations/entry/index.js +72 -210
  150. package/operations/entry/index.js.map +1 -1
  151. package/operations/entry/keys.js +0 -9
  152. package/operations/entry/keys.js.map +1 -1
  153. package/operations/entry/recordType.d.ts +3 -0
  154. package/operations/entry/recordType.js +18 -0
  155. package/operations/entry/recordType.js.map +1 -0
  156. package/operations/group/index.js +2 -32
  157. package/operations/group/index.js.map +1 -1
  158. package/operations/model/index.js +1 -34
  159. package/operations/model/index.js.map +1 -1
  160. package/operations/settings/index.js +0 -24
  161. package/operations/settings/index.js.map +1 -1
  162. package/operations/system/index.js +0 -17
  163. package/operations/system/index.js.map +1 -1
  164. package/package.json +16 -16
  165. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +1 -0
  166. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +6 -8
  167. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
  168. package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -6
  169. package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +1 -1
  170. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +23 -0
  171. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +28 -0
  172. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -0
  173. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -5
  174. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
  175. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +1 -0
  176. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +6 -12
  177. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
  178. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +1 -0
  179. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +6 -8
  180. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
  181. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +1 -0
  182. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +6 -8
  183. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
  184. package/plugins/CmsEntryFilterPlugin.d.ts +49 -0
  185. package/plugins/CmsEntryFilterPlugin.js +24 -0
  186. package/plugins/CmsEntryFilterPlugin.js.map +1 -0
  187. package/plugins/index.d.ts +1 -0
  188. package/plugins/index.js +11 -12
  189. package/plugins/index.js.map +1 -1
  190. package/types.js +0 -5
  191. package/types.js.map +1 -1
  192. package/helpers/createElasticsearchQueryBody.d.ts +0 -11
  193. package/helpers/createElasticsearchQueryBody.js +0 -611
  194. package/helpers/createElasticsearchQueryBody.js.map +0 -1
  195. package/helpers/fields.d.ts +0 -19
  196. package/helpers/fields.js +0 -205
  197. package/helpers/fields.js.map +0 -1
  198. package/helpers/searchPluginsList.d.ts +0 -6
  199. package/helpers/searchPluginsList.js.map +0 -1
  200. package/helpers/transformValueForSearch.d.ts +0 -12
  201. package/helpers/transformValueForSearch.js.map +0 -1
  202. package/operations/entry/elasticsearchFields.d.ts +0 -2
  203. package/operations/entry/elasticsearchFields.js +0 -38
  204. package/operations/entry/elasticsearchFields.js.map +0 -1
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createModelFields = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _error = _interopRequireDefault(require("@webiny/error"));
10
+ const createSystemField = field => {
11
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, field), {}, {
12
+ id: field.fieldId,
13
+ label: field.fieldId
14
+ });
15
+ };
16
+ const createSystemFields = () => {
17
+ return {
18
+ id: {
19
+ type: "text",
20
+ isSystemField: true,
21
+ isSearchable: true,
22
+ isSortable: true,
23
+ field: createSystemField({
24
+ storageId: "id",
25
+ fieldId: "id",
26
+ type: "text"
27
+ }),
28
+ parents: []
29
+ },
30
+ entryId: {
31
+ type: "text",
32
+ isSystemField: true,
33
+ isSearchable: true,
34
+ isSortable: true,
35
+ field: createSystemField({
36
+ storageId: "entryId",
37
+ fieldId: "entryId",
38
+ type: "text"
39
+ }),
40
+ parents: []
41
+ },
42
+ savedOn: {
43
+ type: "date",
44
+ unmappedType: "date",
45
+ keyword: false,
46
+ isSystemField: true,
47
+ isSearchable: true,
48
+ isSortable: true,
49
+ field: createSystemField({
50
+ storageId: "savedOn",
51
+ fieldId: "savedOn",
52
+ type: "datetime",
53
+ settings: {
54
+ type: "dateTimeWithoutTimezone"
55
+ }
56
+ }),
57
+ parents: []
58
+ },
59
+ createdOn: {
60
+ type: "date",
61
+ unmappedType: "date",
62
+ keyword: false,
63
+ isSystemField: true,
64
+ isSearchable: true,
65
+ isSortable: true,
66
+ field: createSystemField({
67
+ storageId: "createdOn",
68
+ fieldId: "createdOn",
69
+ type: "text",
70
+ settings: {
71
+ type: "dateTimeWithoutTimezone"
72
+ }
73
+ }),
74
+ parents: []
75
+ },
76
+ createdBy: {
77
+ type: "text",
78
+ unmappedType: undefined,
79
+ isSystemField: true,
80
+ isSearchable: true,
81
+ isSortable: false,
82
+ path: "createdBy.id",
83
+ field: createSystemField({
84
+ storageId: "createdBy",
85
+ fieldId: "createdBy",
86
+ type: "text"
87
+ }),
88
+ parents: []
89
+ },
90
+ ownedBy: {
91
+ type: "text",
92
+ unmappedType: undefined,
93
+ isSystemField: true,
94
+ isSearchable: true,
95
+ isSortable: false,
96
+ path: "ownedBy.id",
97
+ field: createSystemField({
98
+ storageId: "ownedBy",
99
+ fieldId: "ownedBy",
100
+ type: "text"
101
+ }),
102
+ parents: []
103
+ },
104
+ version: {
105
+ type: "number",
106
+ unmappedType: undefined,
107
+ keyword: false,
108
+ isSystemField: true,
109
+ isSearchable: true,
110
+ isSortable: true,
111
+ field: createSystemField({
112
+ storageId: "version",
113
+ fieldId: "version",
114
+ type: "number"
115
+ }),
116
+ parents: []
117
+ },
118
+ status: {
119
+ type: "string",
120
+ unmappedType: undefined,
121
+ keyword: false,
122
+ isSystemField: true,
123
+ isSearchable: true,
124
+ isSortable: false,
125
+ field: createSystemField({
126
+ storageId: "status",
127
+ fieldId: "status",
128
+ type: "string"
129
+ }),
130
+ parents: []
131
+ }
132
+ };
133
+ };
134
+ const buildFieldsList = params => {
135
+ const {
136
+ plugins,
137
+ fields,
138
+ parents
139
+ } = params;
140
+ return fields.reduce((result, field) => {
141
+ var _field$settings;
142
+ const plugin = plugins[field.type];
143
+ if (!plugin) {
144
+ throw new _error.default(`There is no plugin for field type "${field.type}".`);
145
+ }
146
+ const {
147
+ isSearchable,
148
+ isSortable,
149
+ unmappedType,
150
+ fullTextSearch
151
+ } = plugin;
152
+ /**
153
+ * If a field has child fields, go through them and add them to a result.
154
+ */
155
+ const childFields = ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.fields) || [];
156
+ if (childFields.length > 0) {
157
+ /**
158
+ * Let's build all the child fields
159
+ */
160
+ const childResult = buildFieldsList({
161
+ fields: childFields,
162
+ plugins,
163
+ parents: [...parents, {
164
+ fieldId: field.fieldId,
165
+ storageId: field.storageId,
166
+ type: field.type
167
+ }]
168
+ });
169
+ /**
170
+ *
171
+ */
172
+ Object.assign(result, childResult);
173
+ }
174
+ const identifier = [...parents.map(p => p.fieldId), field.fieldId].join(".");
175
+ result[identifier] = {
176
+ type: field.type,
177
+ parents,
178
+ isSearchable,
179
+ isSortable,
180
+ fullTextSearch,
181
+ unmappedType: typeof unmappedType === "function" ? unmappedType(field) : undefined,
182
+ isSystemField: false,
183
+ field
184
+ };
185
+ return result;
186
+ }, {});
187
+ };
188
+ const createModelFields = ({
189
+ plugins,
190
+ fields
191
+ }) => {
192
+ if (!fields || fields.length === 0) {
193
+ return createSystemFields();
194
+ }
195
+ /**
196
+ * Collect all unmappedType from elastic plugins.
197
+ */
198
+ const unmappedTypes = plugins.byType("cms-model-field-to-elastic-search").reduce((acc, plugin) => {
199
+ if (!plugin.unmappedType) {
200
+ return acc;
201
+ }
202
+ acc[plugin.fieldType] = plugin.unmappedType;
203
+ return acc;
204
+ }, {});
205
+ /**
206
+ * Collect all field types from the plugins.
207
+ */
208
+ const fieldTypePlugins = plugins.byType("cms-model-field-to-graphql").reduce((types, plugin) => {
209
+ const {
210
+ fieldType,
211
+ isSearchable,
212
+ isSortable,
213
+ fullTextSearch
214
+ } = plugin;
215
+ types[fieldType] = {
216
+ unmappedType: unmappedTypes[fieldType],
217
+ isSearchable,
218
+ isSortable,
219
+ fullTextSearch
220
+ };
221
+ return types;
222
+ }, {});
223
+ return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, createSystemFields()), buildFieldsList({
224
+ fields,
225
+ plugins: fieldTypePlugins,
226
+ parents: []
227
+ }));
228
+ };
229
+ exports.createModelFields = createModelFields;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createSystemField","field","id","fieldId","label","createSystemFields","type","isSystemField","isSearchable","isSortable","storageId","parents","entryId","savedOn","unmappedType","keyword","settings","createdOn","createdBy","undefined","path","ownedBy","version","status","buildFieldsList","params","plugins","fields","reduce","result","plugin","WebinyError","fullTextSearch","childFields","length","childResult","Object","assign","identifier","map","p","join","createModelFields","unmappedTypes","byType","acc","fieldType","fieldTypePlugins","types"],"sources":["fields.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { CmsModelField, CmsModelFieldToGraphQLPlugin } from \"@webiny/api-headless-cms/types\";\nimport { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\nimport { ModelFieldParent, ModelFields } from \"./types\";\n\ntype PartialCmsModelField = Partial<CmsModelField> &\n Pick<CmsModelField, \"storageId\" | \"fieldId\" | \"type\">;\nconst createSystemField = (field: PartialCmsModelField): CmsModelField => {\n return {\n ...field,\n id: field.fieldId,\n label: field.fieldId\n };\n};\n\nconst createSystemFields = (): ModelFields => {\n return {\n id: {\n type: \"text\",\n isSystemField: true,\n isSearchable: true,\n isSortable: true,\n field: createSystemField({\n storageId: \"id\",\n fieldId: \"id\",\n type: \"text\"\n }),\n parents: []\n },\n entryId: {\n type: \"text\",\n isSystemField: true,\n isSearchable: true,\n isSortable: true,\n field: createSystemField({\n storageId: \"entryId\",\n fieldId: \"entryId\",\n type: \"text\"\n }),\n parents: []\n },\n savedOn: {\n type: \"date\",\n unmappedType: \"date\",\n keyword: false,\n isSystemField: true,\n isSearchable: true,\n isSortable: true,\n field: createSystemField({\n storageId: \"savedOn\",\n fieldId: \"savedOn\",\n type: \"datetime\",\n settings: {\n type: \"dateTimeWithoutTimezone\"\n }\n }),\n parents: []\n },\n createdOn: {\n type: \"date\",\n unmappedType: \"date\",\n keyword: false,\n isSystemField: true,\n isSearchable: true,\n isSortable: true,\n field: createSystemField({\n storageId: \"createdOn\",\n fieldId: \"createdOn\",\n type: \"text\",\n settings: {\n type: \"dateTimeWithoutTimezone\"\n }\n }),\n parents: []\n },\n createdBy: {\n type: \"text\",\n unmappedType: undefined,\n isSystemField: true,\n isSearchable: true,\n isSortable: false,\n path: \"createdBy.id\",\n field: createSystemField({\n storageId: \"createdBy\",\n fieldId: \"createdBy\",\n type: \"text\"\n }),\n parents: []\n },\n ownedBy: {\n type: \"text\",\n unmappedType: undefined,\n isSystemField: true,\n isSearchable: true,\n isSortable: false,\n path: \"ownedBy.id\",\n field: createSystemField({\n storageId: \"ownedBy\",\n fieldId: \"ownedBy\",\n type: \"text\"\n }),\n parents: []\n },\n version: {\n type: \"number\",\n unmappedType: undefined,\n keyword: false,\n isSystemField: true,\n isSearchable: true,\n isSortable: true,\n field: createSystemField({\n storageId: \"version\",\n fieldId: \"version\",\n type: \"number\"\n }),\n parents: []\n },\n status: {\n type: \"string\",\n unmappedType: undefined,\n keyword: false,\n isSystemField: true,\n isSearchable: true,\n isSortable: false,\n field: createSystemField({\n storageId: \"status\",\n fieldId: \"status\",\n type: \"string\"\n }),\n parents: []\n }\n };\n};\n\ninterface UnmappedFieldTypes {\n [type: string]: (field: CmsModelField) => string | undefined;\n}\n\ninterface FieldTypePlugin {\n unmappedType?: (field: CmsModelField) => string | undefined;\n isSearchable: boolean;\n isSortable: boolean;\n fullTextSearch?: boolean;\n}\ninterface FieldTypePlugins {\n [key: string]: FieldTypePlugin;\n}\n\ninterface BuildParams {\n plugins: FieldTypePlugins;\n fields: CmsModelField[];\n parents: ModelFieldParent[];\n}\nconst buildFieldsList = (params: BuildParams): ModelFields => {\n const { plugins, fields, parents } = params;\n\n return fields.reduce<ModelFields>((result, field) => {\n const plugin = plugins[field.type];\n if (!plugin) {\n throw new WebinyError(`There is no plugin for field type \"${field.type}\".`);\n }\n\n const { isSearchable, isSortable, unmappedType, fullTextSearch } = plugin;\n /**\n * If a field has child fields, go through them and add them to a result.\n */\n const childFields = field.settings?.fields || [];\n if (childFields.length > 0) {\n /**\n * Let's build all the child fields\n */\n const childResult = buildFieldsList({\n fields: childFields,\n plugins,\n parents: [\n ...parents,\n {\n fieldId: field.fieldId,\n storageId: field.storageId,\n type: field.type\n }\n ]\n });\n /**\n *\n */\n Object.assign(result, childResult);\n }\n\n const identifier = [...parents.map(p => p.fieldId), field.fieldId].join(\".\");\n\n result[identifier] = {\n type: field.type,\n parents,\n isSearchable,\n isSortable,\n fullTextSearch,\n unmappedType: typeof unmappedType === \"function\" ? unmappedType(field) : undefined,\n isSystemField: false,\n field\n };\n\n return result;\n }, {});\n};\n\ninterface Params {\n plugins: PluginsContainer;\n fields?: CmsModelField[];\n}\nexport const createModelFields = ({ plugins, fields }: Params) => {\n if (!fields || fields.length === 0) {\n return createSystemFields();\n }\n /**\n * Collect all unmappedType from elastic plugins.\n */\n const unmappedTypes = plugins\n .byType<CmsModelFieldToElasticsearchPlugin>(\"cms-model-field-to-elastic-search\")\n .reduce<UnmappedFieldTypes>((acc, plugin) => {\n if (!plugin.unmappedType) {\n return acc;\n }\n acc[plugin.fieldType] = plugin.unmappedType;\n return acc;\n }, {});\n /**\n * Collect all field types from the plugins.\n */\n const fieldTypePlugins = plugins\n .byType<CmsModelFieldToGraphQLPlugin>(\"cms-model-field-to-graphql\")\n .reduce<FieldTypePlugins>((types, plugin) => {\n const { fieldType, isSearchable, isSortable, fullTextSearch } = plugin;\n types[fieldType] = {\n unmappedType: unmappedTypes[fieldType],\n isSearchable,\n isSortable,\n fullTextSearch\n };\n return types;\n }, {});\n\n return {\n ...createSystemFields(),\n ...buildFieldsList({\n fields,\n plugins: fieldTypePlugins,\n parents: []\n })\n };\n};\n"],"mappings":";;;;;;;;AAAA;AAQA,MAAMA,iBAAiB,GAAIC,KAA2B,IAAoB;EACtE,mEACOA,KAAK;IACRC,EAAE,EAAED,KAAK,CAACE,OAAO;IACjBC,KAAK,EAAEH,KAAK,CAACE;EAAO;AAE5B,CAAC;AAED,MAAME,kBAAkB,GAAG,MAAmB;EAC1C,OAAO;IAC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,EAAE,CAAC,CAAC,CAAC;EAEV,mEACO3C,kBAAkB,EAAE,GACpBmB,eAAe,CAAC;IACfG,MAAM;IACND,OAAO,EAAEqB,gBAAgB;IACzBpC,OAAO,EAAE;EACb,CAAC,CAAC;AAEV,CAAC;AAAC"}
@@ -0,0 +1,8 @@
1
+ import { ElasticsearchQueryBuilderOperatorPlugins, ElasticsearchQuerySearchValuePlugins } from "../types";
2
+ import { ApplyFilteringCb } from "../../../../plugins/CmsEntryFilterPlugin";
3
+ interface CreateParams {
4
+ operatorPlugins: ElasticsearchQueryBuilderOperatorPlugins;
5
+ searchPlugins: ElasticsearchQuerySearchValuePlugins;
6
+ }
7
+ export declare const createApplyFiltering: ({ operatorPlugins, searchPlugins }: CreateParams) => ApplyFilteringCb;
8
+ export {};
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createApplyFiltering = void 0;
8
+ var _error = _interopRequireDefault(require("@webiny/error"));
9
+ var _transformValueForSearch = require("../transformValueForSearch");
10
+ var _keyword = require("../keyword");
11
+ var _path = require("./path");
12
+ const createApplyFiltering = ({
13
+ operatorPlugins,
14
+ searchPlugins
15
+ }) => {
16
+ const createFieldPath = (0, _path.createFieldPathFactory)({
17
+ plugins: searchPlugins
18
+ });
19
+ return params => {
20
+ const {
21
+ key,
22
+ value: initialValue,
23
+ query,
24
+ operator,
25
+ field
26
+ } = params;
27
+ const plugin = operatorPlugins[operator];
28
+ if (!plugin) {
29
+ throw new _error.default(`Elasticsearch operator "${operator}" plugin missing.`, "PLUGIN_MISSING", {
30
+ operator
31
+ });
32
+ }
33
+ const value = (0, _transformValueForSearch.transformValueForSearch)({
34
+ plugins: searchPlugins,
35
+ field: field.field,
36
+ value: initialValue
37
+ });
38
+ const keyword = (0, _keyword.hasKeyword)(field);
39
+ const {
40
+ basePath,
41
+ path
42
+ } = createFieldPath({
43
+ field,
44
+ value,
45
+ key,
46
+ keyword
47
+ });
48
+ plugin.apply(query, {
49
+ name: field.field.fieldId,
50
+ basePath,
51
+ path,
52
+ value,
53
+ keyword
54
+ });
55
+ };
56
+ };
57
+ exports.createApplyFiltering = createApplyFiltering;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createApplyFiltering","operatorPlugins","searchPlugins","createFieldPath","createFieldPathFactory","plugins","params","key","value","initialValue","query","operator","field","plugin","WebinyError","transformValueForSearch","keyword","hasKeyword","basePath","path","apply","name","fieldId"],"sources":["applyFiltering.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { transformValueForSearch } from \"~/operations/entry/elasticsearch/transformValueForSearch\";\nimport { hasKeyword } from \"~/operations/entry/elasticsearch/keyword\";\nimport {\n ElasticsearchQueryBuilderOperatorPlugins,\n ElasticsearchQuerySearchValuePlugins\n} from \"~/operations/entry/elasticsearch/types\";\nimport { createFieldPathFactory } from \"~/operations/entry/elasticsearch/filtering/path\";\nimport { ApplyFilteringCb } from \"~/plugins/CmsEntryFilterPlugin\";\n\ninterface CreateParams {\n operatorPlugins: ElasticsearchQueryBuilderOperatorPlugins;\n searchPlugins: ElasticsearchQuerySearchValuePlugins;\n}\n\nexport const createApplyFiltering = ({\n operatorPlugins,\n searchPlugins\n}: CreateParams): ApplyFilteringCb => {\n const createFieldPath = createFieldPathFactory({\n plugins: searchPlugins\n });\n\n return params => {\n const { key, value: initialValue, query, operator, field } = params;\n\n const plugin = operatorPlugins[operator];\n if (!plugin) {\n throw new WebinyError(\n `Elasticsearch operator \"${operator}\" plugin missing.`,\n \"PLUGIN_MISSING\",\n {\n operator\n }\n );\n }\n\n const value = transformValueForSearch({\n plugins: searchPlugins,\n field: field.field,\n value: initialValue\n });\n\n const keyword = hasKeyword(field);\n\n const { basePath, path } = createFieldPath({\n field,\n value,\n key,\n keyword\n });\n\n plugin.apply(query, {\n name: field.field.fieldId,\n basePath,\n path,\n value,\n keyword\n });\n };\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAKA;AAQO,MAAMA,oBAAoB,GAAG,CAAC;EACjCC,eAAe;EACfC;AACU,CAAC,KAAuB;EAClC,MAAMC,eAAe,GAAG,IAAAC,4BAAsB,EAAC;IAC3CC,OAAO,EAAEH;EACb,CAAC,CAAC;EAEF,OAAOI,MAAM,IAAI;IACb,MAAM;MAAEC,GAAG;MAAEC,KAAK,EAAEC,YAAY;MAAEC,KAAK;MAAEC,QAAQ;MAAEC;IAAM,CAAC,GAAGN,MAAM;IAEnE,MAAMO,MAAM,GAAGZ,eAAe,CAACU,QAAQ,CAAC;IACxC,IAAI,CAACE,MAAM,EAAE;MACT,MAAM,IAAIC,cAAW,CAChB,2BAA0BH,QAAS,mBAAkB,EACtD,gBAAgB,EAChB;QACIA;MACJ,CAAC,CACJ;IACL;IAEA,MAAMH,KAAK,GAAG,IAAAO,gDAAuB,EAAC;MAClCV,OAAO,EAAEH,aAAa;MACtBU,KAAK,EAAEA,KAAK,CAACA,KAAK;MAClBJ,KAAK,EAAEC;IACX,CAAC,CAAC;IAEF,MAAMO,OAAO,GAAG,IAAAC,mBAAU,EAACL,KAAK,CAAC;IAEjC,MAAM;MAAEM,QAAQ;MAAEC;IAAK,CAAC,GAAGhB,eAAe,CAAC;MACvCS,KAAK;MACLJ,KAAK;MACLD,GAAG;MACHS;IACJ,CAAC,CAAC;IAEFH,MAAM,CAACO,KAAK,CAACV,KAAK,EAAE;MAChBW,IAAI,EAAET,KAAK,CAACA,KAAK,CAACU,OAAO;MACzBJ,QAAQ;MACRC,IAAI;MACJX,KAAK;MACLQ;IACJ,CAAC,CAAC;EACN,CAAC;AACL,CAAC;AAAC"}
@@ -0,0 +1,17 @@
1
+ import { CmsEntryListWhere, CmsModel } from "@webiny/api-headless-cms/types";
2
+ import { ModelFields } from "../types";
3
+ import { PluginsContainer } from "@webiny/plugins";
4
+ import { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
5
+ export interface CreateExecParams {
6
+ model: CmsModel;
7
+ fields: ModelFields;
8
+ plugins: PluginsContainer;
9
+ }
10
+ export interface ExecParams {
11
+ where: CmsEntryListWhere;
12
+ query: ElasticsearchBoolQueryConfig;
13
+ }
14
+ export interface CreateExecFilteringResponse {
15
+ (params: ExecParams): void;
16
+ }
17
+ export declare const createExecFiltering: (params: CreateExecParams) => CreateExecFilteringResponse;
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.createExecFiltering = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
+ var _error = _interopRequireDefault(require("@webiny/error"));
10
+ var _search = require("../plugins/search");
11
+ var _operator = require("../plugins/operator");
12
+ var _initialQuery = require("../initialQuery");
13
+ var _apiElasticsearch = require("@webiny/api-elasticsearch");
14
+ var _values = require("./values");
15
+ var _populated = require("./populated");
16
+ var _applyFiltering = require("./applyFiltering");
17
+ var _CmsEntryFilterPlugin = require("../../../../plugins/CmsEntryFilterPlugin");
18
+ var _assignMinimumShouldMatchToQuery = require("../assignMinimumShouldMatchToQuery");
19
+ const createExecFiltering = params => {
20
+ const {
21
+ fields,
22
+ plugins,
23
+ model
24
+ } = params;
25
+
26
+ /**
27
+ * We need the search plugins as key -> plugin value, so it is easy to find plugin we need, without iterating through array.
28
+ */
29
+ const searchPlugins = (0, _search.createSearchPluginList)({
30
+ plugins
31
+ });
32
+ /**
33
+ * We need the operator plugins, which we execute on our where conditions.
34
+ */
35
+ const operatorPlugins = (0, _operator.createOperatorPluginList)({
36
+ plugins,
37
+ locale: model.locale
38
+ });
39
+ const applyFiltering = (0, _applyFiltering.createApplyFiltering)({
40
+ operatorPlugins,
41
+ searchPlugins
42
+ });
43
+ const filteringPlugins = plugins.byType(_CmsEntryFilterPlugin.CmsEntryFilterPlugin.type).reduce((collection, plugin) => {
44
+ collection[plugin.fieldType] = plugin;
45
+ return collection;
46
+ }, {});
47
+ const getFilterPlugin = type => {
48
+ const plugin = filteringPlugins[type] || filteringPlugins["*"];
49
+ if (plugin) {
50
+ return plugin;
51
+ }
52
+ throw new _error.default(`There is no filtering plugin for the given field type "${type}".`, "FILTERING_PLUGIN_ERROR", {
53
+ type
54
+ });
55
+ };
56
+ const execFiltering = params => {
57
+ const {
58
+ where: initialWhere,
59
+ query
60
+ } = params;
61
+ /**
62
+ * No point in continuing if no "where" conditions exist.
63
+ */
64
+ const keys = Object.keys(initialWhere);
65
+ if (keys.length === 0) {
66
+ return;
67
+ }
68
+ const where = (0, _objectSpread2.default)({}, initialWhere);
69
+ for (const key in where) {
70
+ const value = where[key];
71
+ /**
72
+ * We always skip if no value is defined.
73
+ * Only skip undefined value, null is valid.
74
+ */
75
+ if (value === undefined) {
76
+ continue;
77
+ }
78
+ //
79
+ /**
80
+ * When we are running with AND, the "value" MUST be an array.
81
+ */else if (key === "AND") {
82
+ const childWhereList = (0, _values.getWhereValues)(value, "AND");
83
+ const childQuery = (0, _initialQuery.createBaseQuery)();
84
+ for (const childWhere of childWhereList) {
85
+ execFiltering({
86
+ query: childQuery,
87
+ where: childWhere
88
+ });
89
+ }
90
+ const childQueryBool = (0, _populated.getPopulated)(childQuery);
91
+ if (Object.keys(childQueryBool).length === 0) {
92
+ continue;
93
+ }
94
+ query.filter.push({
95
+ bool: childQueryBool
96
+ });
97
+ continue;
98
+ }
99
+ //
100
+ /**
101
+ * When we are running with OR, the "value" must be an array.
102
+ */else if (key === "OR") {
103
+ const childWhereList = (0, _values.getWhereValues)(value, "OR");
104
+ /**
105
+ * Each of the conditions MUST produce it's own should section.
106
+ */
107
+ const should = [];
108
+ for (const childWhere of childWhereList) {
109
+ const childQuery = (0, _initialQuery.createBaseQuery)();
110
+ execFiltering({
111
+ query: childQuery,
112
+ where: childWhere
113
+ });
114
+ const childQueryBool = (0, _populated.getPopulated)(childQuery);
115
+ if (Object.keys(childQueryBool).length === 0) {
116
+ continue;
117
+ }
118
+ should.push({
119
+ bool: childQueryBool
120
+ });
121
+ }
122
+ if (should.length === 0) {
123
+ continue;
124
+ }
125
+ query.should.push(...should);
126
+ /**
127
+ * If there are any should, minimum to have is 1.
128
+ * Of course, do not override if it's already set.
129
+ */
130
+ (0, _assignMinimumShouldMatchToQuery.assignMinimumShouldMatchToQuery)({
131
+ query
132
+ });
133
+ continue;
134
+ }
135
+ const {
136
+ field: whereFieldId,
137
+ operator
138
+ } = (0, _apiElasticsearch.parseWhereKey)(key);
139
+ let fieldId = whereFieldId;
140
+
141
+ /**
142
+ * TODO This will be required until the storage operations receive the fieldId instead of field storageId.
143
+ * TODO For this to work without field searching, we need to refactor how the query looks like.
144
+ *
145
+ * Storage operations should NEVER receive an field storageId, only alias - fieldId.
146
+ */
147
+ const cmsModelField = model.fields.find(f => f.fieldId === fieldId);
148
+ if (!cmsModelField && !fields[fieldId]) {
149
+ throw new _error.default(`There is no CMS Model Field field "${fieldId}".`);
150
+ } else if (cmsModelField) {
151
+ fieldId = cmsModelField.fieldId;
152
+ }
153
+ const field = fields[fieldId];
154
+ if (!field) {
155
+ throw new _error.default(`There is no field "${fieldId}".`);
156
+ }
157
+ const filterPlugin = getFilterPlugin(field.type);
158
+ filterPlugin.exec({
159
+ applyFiltering,
160
+ getFilterPlugin,
161
+ key,
162
+ value,
163
+ operator,
164
+ field,
165
+ fields,
166
+ query
167
+ });
168
+ }
169
+ };
170
+ return execFiltering;
171
+ };
172
+ exports.createExecFiltering = createExecFiltering;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createExecFiltering","params","fields","plugins","model","searchPlugins","createSearchPluginList","operatorPlugins","createOperatorPluginList","locale","applyFiltering","createApplyFiltering","filteringPlugins","byType","CmsEntryFilterPlugin","type","reduce","collection","plugin","fieldType","getFilterPlugin","WebinyError","execFiltering","where","initialWhere","query","keys","Object","length","key","value","undefined","childWhereList","getWhereValues","childQuery","createBaseQuery","childWhere","childQueryBool","getPopulated","filter","push","bool","should","assignMinimumShouldMatchToQuery","field","whereFieldId","operator","parseWhereKey","fieldId","cmsModelField","find","f","filterPlugin","exec"],"sources":["exec.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntryListWhere, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { ModelFields } from \"~/operations/entry/elasticsearch/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { ElasticsearchBoolQueryConfig, Query } from \"@webiny/api-elasticsearch/types\";\nimport { createSearchPluginList } from \"~/operations/entry/elasticsearch/plugins/search\";\nimport { createOperatorPluginList } from \"~/operations/entry/elasticsearch/plugins/operator\";\nimport { createBaseQuery } from \"~/operations/entry/elasticsearch/initialQuery\";\nimport { parseWhereKey } from \"@webiny/api-elasticsearch\";\nimport { getWhereValues } from \"./values\";\nimport { getPopulated } from \"./populated\";\nimport { createApplyFiltering } from \"./applyFiltering\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\nimport { assignMinimumShouldMatchToQuery } from \"~/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery\";\n\nexport interface CreateExecParams {\n model: CmsModel;\n fields: ModelFields;\n plugins: PluginsContainer;\n}\nexport interface ExecParams {\n where: CmsEntryListWhere;\n query: ElasticsearchBoolQueryConfig;\n}\nexport interface CreateExecFilteringResponse {\n (params: ExecParams): void;\n}\nexport const createExecFiltering = (params: CreateExecParams): CreateExecFilteringResponse => {\n const { fields, plugins, model } = params;\n\n /**\n * We need the search plugins as key -> plugin value, so it is easy to find plugin we need, without iterating through array.\n */\n const searchPlugins = createSearchPluginList({\n plugins\n });\n /**\n * We need the operator plugins, which we execute on our where conditions.\n */\n const operatorPlugins = createOperatorPluginList({\n plugins,\n locale: model.locale\n });\n\n const applyFiltering = createApplyFiltering({\n operatorPlugins,\n searchPlugins\n });\n\n const filteringPlugins = plugins\n .byType<CmsEntryFilterPlugin>(CmsEntryFilterPlugin.type)\n .reduce<Record<string, CmsEntryFilterPlugin>>((collection, plugin) => {\n collection[plugin.fieldType] = plugin;\n\n return collection;\n }, {});\n\n const getFilterPlugin = (type: string) => {\n const plugin = filteringPlugins[type] || filteringPlugins[\"*\"];\n if (plugin) {\n return plugin;\n }\n throw new WebinyError(\n `There is no filtering plugin for the given field type \"${type}\".`,\n \"FILTERING_PLUGIN_ERROR\",\n {\n type\n }\n );\n };\n\n const execFiltering = (params: ExecParams) => {\n const { where: initialWhere, query } = params;\n /**\n * No point in continuing if no \"where\" conditions exist.\n */\n const keys = Object.keys(initialWhere);\n if (keys.length === 0) {\n return;\n }\n const where: CmsEntryListWhere = {\n ...initialWhere\n };\n\n for (const key in where) {\n const value = where[key] as unknown as any;\n /**\n * We always skip if no value is defined.\n * Only skip undefined value, null is valid.\n */\n if (value === undefined) {\n continue;\n }\n //\n /**\n * When we are running with AND, the \"value\" MUST be an array.\n */\n else if (key === \"AND\") {\n const childWhereList = getWhereValues(value, \"AND\");\n\n const childQuery = createBaseQuery();\n\n for (const childWhere of childWhereList) {\n execFiltering({\n query: childQuery,\n where: childWhere\n });\n }\n const childQueryBool = getPopulated(childQuery);\n if (Object.keys(childQueryBool).length === 0) {\n continue;\n }\n query.filter.push({\n bool: childQueryBool\n });\n\n continue;\n }\n //\n /**\n * When we are running with OR, the \"value\" must be an array.\n */\n else if (key === \"OR\") {\n const childWhereList = getWhereValues(value, \"OR\");\n /**\n * Each of the conditions MUST produce it's own should section.\n */\n const should: Query[] = [];\n for (const childWhere of childWhereList) {\n const childQuery = createBaseQuery();\n execFiltering({\n query: childQuery,\n where: childWhere\n });\n const childQueryBool = getPopulated(childQuery);\n if (Object.keys(childQueryBool).length === 0) {\n continue;\n }\n should.push({\n bool: childQueryBool\n });\n }\n if (should.length === 0) {\n continue;\n }\n query.should.push(...should);\n /**\n * If there are any should, minimum to have is 1.\n * Of course, do not override if it's already set.\n */\n assignMinimumShouldMatchToQuery({\n query\n });\n continue;\n }\n const { field: whereFieldId, operator } = parseWhereKey(key);\n\n let fieldId: string = whereFieldId;\n\n /**\n * TODO This will be required until the storage operations receive the fieldId instead of field storageId.\n * TODO For this to work without field searching, we need to refactor how the query looks like.\n *\n * Storage operations should NEVER receive an field storageId, only alias - fieldId.\n */\n const cmsModelField = model.fields.find(f => f.fieldId === fieldId);\n if (!cmsModelField && !fields[fieldId]) {\n throw new WebinyError(`There is no CMS Model Field field \"${fieldId}\".`);\n } else if (cmsModelField) {\n fieldId = cmsModelField.fieldId;\n }\n\n const field = fields[fieldId];\n if (!field) {\n throw new WebinyError(`There is no field \"${fieldId}\".`);\n }\n const filterPlugin = getFilterPlugin(field.type);\n\n filterPlugin.exec({\n applyFiltering,\n getFilterPlugin,\n key,\n value,\n operator,\n field,\n fields,\n query\n });\n }\n };\n\n return execFiltering;\n};\n"],"mappings":";;;;;;;;AAAA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAcO,MAAMA,mBAAmB,GAAIC,MAAwB,IAAkC;EAC1F,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGH,MAAM;;EAEzC;AACJ;AACA;EACI,MAAMI,aAAa,GAAG,IAAAC,8BAAsB,EAAC;IACzCH;EACJ,CAAC,CAAC;EACF;AACJ;AACA;EACI,MAAMI,eAAe,GAAG,IAAAC,kCAAwB,EAAC;IAC7CL,OAAO;IACPM,MAAM,EAAEL,KAAK,CAACK;EAClB,CAAC,CAAC;EAEF,MAAMC,cAAc,GAAG,IAAAC,oCAAoB,EAAC;IACxCJ,eAAe;IACfF;EACJ,CAAC,CAAC;EAEF,MAAMO,gBAAgB,GAAGT,OAAO,CAC3BU,MAAM,CAAuBC,0CAAoB,CAACC,IAAI,CAAC,CACvDC,MAAM,CAAuC,CAACC,UAAU,EAAEC,MAAM,KAAK;IAClED,UAAU,CAACC,MAAM,CAACC,SAAS,CAAC,GAAGD,MAAM;IAErC,OAAOD,UAAU;EACrB,CAAC,EAAE,CAAC,CAAC,CAAC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W,CAAE,sCAAqC2B,OAAQ,IAAG,CAAC;MAC5E,CAAC,MAAM,IAAIC,aAAa,EAAE;QACtBD,OAAO,GAAGC,aAAa,CAACD,OAAO;MACnC;MAEA,MAAMJ,KAAK,GAAG1C,MAAM,CAAC8C,OAAO,CAAC;MAC7B,IAAI,CAACJ,KAAK,EAAE;QACR,MAAM,IAAIvB,cAAW,CAAE,sBAAqB2B,OAAQ,IAAG,CAAC;MAC5D;MACA,MAAMI,YAAY,GAAGhC,eAAe,CAACwB,KAAK,CAAC7B,IAAI,CAAC;MAEhDqC,YAAY,CAACC,IAAI,CAAC;QACd3C,cAAc;QACdU,eAAe;QACfS,GAAG;QACHC,KAAK;QACLgB,QAAQ;QACRF,KAAK;QACL1C,MAAM;QACNuB;MACJ,CAAC,CAAC;IACN;EACJ,CAAC;EAED,OAAOH,aAAa;AACxB,CAAC;AAAC"}
@@ -0,0 +1 @@
1
+ export * from "./exec";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exec = require("./exec");
7
+ Object.keys(_exec).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _exec[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _exec[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./exec\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -0,0 +1,15 @@
1
+ import { ElasticsearchQuerySearchValuePlugins, ModelField } from "../types";
2
+ interface FieldPathFactoryParams {
3
+ plugins: ElasticsearchQuerySearchValuePlugins;
4
+ }
5
+ interface FieldPathParams {
6
+ field: ModelField;
7
+ key: string;
8
+ value: any;
9
+ keyword: boolean;
10
+ }
11
+ export declare const createFieldPathFactory: ({ plugins }: FieldPathFactoryParams) => (params: FieldPathParams) => {
12
+ basePath: string;
13
+ path: string;
14
+ };
15
+ export {};
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createFieldPathFactory = void 0;
7
+ const createFieldPathFactory = ({
8
+ plugins
9
+ }) => {
10
+ return params => {
11
+ const {
12
+ field,
13
+ key,
14
+ value,
15
+ keyword
16
+ } = params;
17
+ const plugin = plugins[field.type];
18
+ let fieldPath = null;
19
+ if (plugin) {
20
+ fieldPath = plugin.createPath({
21
+ field: field.field,
22
+ value,
23
+ key
24
+ });
25
+ }
26
+ if (!fieldPath) {
27
+ fieldPath = field.field.storageId;
28
+ if (field.path) {
29
+ fieldPath = typeof field.path === "function" ? field.path(value) : field.path;
30
+ }
31
+ }
32
+ const result = [];
33
+ if (!field.isSystemField) {
34
+ result.push("values");
35
+ }
36
+ result.push(...field.parents.map(p => p.storageId));
37
+ result.push(fieldPath);
38
+ return {
39
+ basePath: result.join("."),
40
+ path: result.concat(keyword ? ["keyword"] : []).join(".")
41
+ };
42
+ };
43
+ };
44
+ exports.createFieldPathFactory = createFieldPathFactory;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createFieldPathFactory","plugins","params","field","key","value","keyword","plugin","type","fieldPath","createPath","storageId","path","result","isSystemField","push","parents","map","p","basePath","join","concat"],"sources":["path.ts"],"sourcesContent":["import {\n ElasticsearchQuerySearchValuePlugins,\n ModelField\n} from \"~/operations/entry/elasticsearch/types\";\n\ninterface FieldPathFactoryParams {\n plugins: ElasticsearchQuerySearchValuePlugins;\n}\ninterface FieldPathParams {\n field: ModelField;\n key: string;\n value: any;\n keyword: boolean;\n}\n\nexport const createFieldPathFactory = ({ plugins }: FieldPathFactoryParams) => {\n return (params: FieldPathParams) => {\n const { field, key, value, keyword } = params;\n const plugin = plugins[field.type];\n\n let fieldPath: string | null = null;\n if (plugin) {\n fieldPath = plugin.createPath({ field: field.field, value, key });\n }\n if (!fieldPath) {\n fieldPath = field.field.storageId;\n if (field.path) {\n fieldPath = typeof field.path === \"function\" ? field.path(value) : field.path;\n }\n }\n\n const result: string[] = [];\n if (!field.isSystemField) {\n result.push(\"values\");\n }\n result.push(...field.parents.map(p => p.storageId));\n result.push(fieldPath);\n\n return {\n basePath: result.join(\".\"),\n path: result.concat(keyword ? [\"keyword\"] : []).join(\".\")\n };\n };\n};\n"],"mappings":";;;;;;AAeO,MAAMA,sBAAsB,GAAG,CAAC;EAAEC;AAAgC,CAAC,KAAK;EAC3E,OAAQC,MAAuB,IAAK;IAChC,MAAM;MAAEC,KAAK;MAAEC,GAAG;MAAEC,KAAK;MAAEC;IAAQ,CAAC,GAAGJ,MAAM;IAC7C,MAAMK,MAAM,GAAGN,OAAO,CAACE,KAAK,CAACK,IAAI,CAAC;IAElC,IAAIC,SAAwB,GAAG,IAAI;IACnC,IAAIF,MAAM,EAAE;MACRE,SAAS,GAAGF,MAAM,CAACG,UAAU,CAAC;QAAEP,KAAK,EAAEA,KAAK,CAACA,KAAK;QAAEE,KAAK;QAAED;MAAI,CAAC,CAAC;IACrE;IACA,IAAI,CAACK,SAAS,EAAE;MACZA,SAAS,GAAGN,KAAK,CAACA,KAAK,CAACQ,SAAS;MACjC,IAAIR,KAAK,CAACS,IAAI,EAAE;QACZH,SAAS,GAAG,OAAON,KAAK,CAACS,IAAI,KAAK,UAAU,GAAGT,KAAK,CAACS,IAAI,CAACP,KAAK,CAAC,GAAGF,KAAK,CAACS,IAAI;MACjF;IACJ;IAEA,MAAMC,MAAgB,GAAG,EAAE;IAC3B,IAAI,CAACV,KAAK,CAACW,aAAa,EAAE;MACtBD,MAAM,CAACE,IAAI,CAAC,QAAQ,CAAC;IACzB;IACAF,MAAM,CAACE,IAAI,CAAC,GAAGZ,KAAK,CAACa,OAAO,CAACC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACP,SAAS,CAAC,CAAC;IACnDE,MAAM,CAACE,IAAI,CAACN,SAAS,CAAC;IAEtB,OAAO;MACHU,QAAQ,EAAEN,MAAM,CAACO,IAAI,CAAC,GAAG,CAAC;MAC1BR,IAAI,EAAEC,MAAM,CAACQ,MAAM,CAACf,OAAO,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,CAACc,IAAI,CAAC,GAAG;IAC5D,CAAC;EACL,CAAC;AACL,CAAC;AAAC"}
@@ -0,0 +1,2 @@
1
+ import { CmsEntryFilterPlugin } from "../../../../../plugins/CmsEntryFilterPlugin";
2
+ export declare const createDefaultFilterPlugin: () => CmsEntryFilterPlugin;