@webiny/api-headless-cms-ddb-es 6.1.0-beta.3 → 6.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configurations.d.ts +3 -2
- package/configurations.js +10 -8
- package/configurations.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +2 -2
- package/elasticsearch/createElasticsearchIndex.js +58 -16
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/exports/api/cms/opensearch.d.ts +9 -0
- package/exports/api/cms/opensearch.js +11 -0
- package/exports/api/cms/opensearch.js.map +1 -0
- package/feature.d.ts +1 -0
- package/feature.js +188 -0
- package/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.js +3 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +13 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +36 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +35 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.js +3 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.js +24 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
- package/{elasticsearch/indexing/dateTimeIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js} +21 -19
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +39 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +22 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +25 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
- package/{elasticsearch/indexing/numberIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js} +11 -8
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +10 -0
- package/{elasticsearch/indexing/objectIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js} +50 -86
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +22 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.js +5 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +38 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +4 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +4 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
- package/features/CmsEntryOpenSearchFilter/constants.js +3 -0
- package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/feature.d.ts +1 -0
- package/features/CmsEntryOpenSearchFilter/feature.js +16 -0
- package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +23 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +61 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +49 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchFilter/index.js +5 -0
- package/features/CmsEntryOpenSearchFilter/index.js.map +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.js +3 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +17 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/feature.d.ts +1 -0
- package/features/CmsEntryOpenSearchIndex/feature.js +10 -0
- package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchIndex/index.js +5 -0
- package/features/CmsEntryOpenSearchIndex/index.js.map +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.js +3 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.js.map +1 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchSortModifier/index.js +3 -0
- package/features/CmsEntryOpenSearchSortModifier/index.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +27 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +4 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +4 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +1 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.js +16 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +23 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +55 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +24 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchValueSearch/index.js +5 -0
- package/features/CmsEntryOpenSearchValueSearch/index.js.map +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.js +3 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.js.map +1 -0
- package/helpers/entryIndexHelpers.d.ts +5 -3
- package/helpers/entryIndexHelpers.js +28 -90
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/index.d.ts +1 -3
- package/index.js +1 -188
- package/index.js.map +1 -1
- package/operations/entry/elasticsearch/body.d.ts +18 -2
- package/operations/entry/elasticsearch/body.js +32 -29
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields.d.ts +6 -4
- package/operations/entry/elasticsearch/fields.js +14 -57
- package/operations/entry/elasticsearch/fields.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +5 -4
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +3 -3
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +4 -0
- package/operations/entry/elasticsearch/filtering/exec.js +11 -64
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +4 -3
- package/operations/entry/elasticsearch/filtering/path.js +4 -6
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +2 -2
- package/operations/entry/elasticsearch/fullTextSearch.js +25 -29
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
- package/operations/entry/elasticsearch/sort.d.ts +2 -2
- package/operations/entry/elasticsearch/sort.js +2 -6
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js +4 -14
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.d.ts +0 -7
- package/operations/entry/elasticsearch/types.js.map +1 -1
- package/operations/entry/index.d.ts +21 -1
- package/operations/entry/index.js +96 -39
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +8 -2
- package/operations/entry/transformations/index.js +14 -12
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +2 -2
- package/operations/entry/transformations/modifyEntryValues.js +3 -3
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +4 -2
- package/operations/entry/transformations/transformEntryToIndex.js +6 -4
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +2 -2
- package/operations/group/index.js +6 -9
- package/operations/group/index.js.map +1 -1
- package/package.json +25 -23
- package/tasks/createIndexTaskPlugin.js +8 -1
- package/tasks/createIndexTaskPlugin.js.map +1 -1
- package/types.d.ts +7 -112
- package/types.js +0 -23
- package/types.js.map +1 -1
- package/dynamoDb/index.d.ts +0 -3
- package/dynamoDb/index.js +0 -8
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -88
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -2
- package/dynamoDb/storage/richText.js +0 -51
- package/dynamoDb/storage/richText.js.map +0 -1
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -5
- package/elasticsearch/index.js.map +0 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
- package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
- package/elasticsearch/indexing/index.d.ts +0 -2
- package/elasticsearch/indexing/index.js +0 -10
- package/elasticsearch/indexing/index.js.map +0 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
- package/elasticsearch/indexing/jsonIndexing.js +0 -21
- package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
- package/elasticsearch/indexing/longTextIndexing.js +0 -35
- package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js.map +0 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
- package/elasticsearch/indexing/objectIndexing.js.map +0 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -24
- package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
- package/elasticsearch/indices/base.d.ts +0 -2
- package/elasticsearch/indices/base.js +0 -7
- package/elasticsearch/indices/base.js.map +0 -1
- package/elasticsearch/indices/index.d.ts +0 -1
- package/elasticsearch/indices/index.js +0 -6
- package/elasticsearch/indices/index.js.map +0 -1
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -6
- package/elasticsearch/search/index.js.map +0 -1
- package/elasticsearch/search/refSearch.d.ts +0 -2
- package/elasticsearch/search/refSearch.js +0 -24
- package/elasticsearch/search/refSearch.js.map +0 -1
- package/elasticsearch/search/searchableJson.d.ts +0 -2
- package/elasticsearch/search/searchableJson.js +0 -53
- package/elasticsearch/search/searchableJson.js.map +0 -1
- package/elasticsearch/search/timeSearch.d.ts +0 -2
- package/elasticsearch/search/timeSearch.js +0 -20
- package/elasticsearch/search/timeSearch.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -22
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -8
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -61
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -49
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -11
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -11
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
- package/operations/entry/elasticsearch/plugins/search.js +0 -18
- package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -11
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
- package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
- package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -46
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -13
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -24
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -19
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -6
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -32
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -13
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -13
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
- package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -42
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
- package/plugins/CmsEntryFilterPlugin.js +0 -15
- package/plugins/CmsEntryFilterPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -8
- package/plugins/index.js +0 -10
- package/plugins/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSort","OpenSearchFieldPlugin","hasKeyword","
|
|
1
|
+
{"version":3,"names":["createSort","OpenSearchFieldPlugin","hasKeyword","createFieldPathFactory","NoValueContainer","matchField","input","valuesMatch","match","fieldId","order","isValues","nonValues","createElasticsearchSort","params","sort","modelFields","valueSearchRegistry","length","createFieldPath","fieldIdToStorageIdIdMap","sortPlugins","Object","values","reduce","plugins","field","parents","fieldIdPath","path","key","storageId","value","create","keyword","originalValue","unmappedType","sortable","searchable","ALL","transformedSort","map","matched","filter","Boolean","fieldPlugins"],"sources":["sort.ts"],"sourcesContent":["import type { Sort as OpenSearchSort } from \"@webiny/api-opensearch/types.js\";\nimport { createSort, OpenSearchFieldPlugin } from \"@webiny/api-opensearch\";\nimport type { CmsEntryListSort, CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { ModelFields } from \"./types.js\";\nimport { hasKeyword } from \"~/operations/entry/elasticsearch/keyword.js\";\nimport { createFieldPathFactory } from \"~/operations/entry/elasticsearch/filtering/path.js\";\nimport { NoValueContainer } from \"~/values/NoValueContainer.js\";\nimport type { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\n\ninterface IMatchFieldResponse {\n fieldId: string;\n isValues: boolean;\n order: \"ASC\" | \"DESC\";\n}\n\nconst matchField = (input: string): IMatchFieldResponse | null => {\n const valuesMatch = input.match(/^values_([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (valuesMatch) {\n const [, fieldId, order] = valuesMatch;\n return {\n fieldId,\n isValues: true,\n order: order as \"ASC\" | \"DESC\"\n };\n }\n const nonValues = input.match(/^([a-zA-Z-0-9_]+)_(ASC|DESC)$/);\n if (!nonValues) {\n return null;\n }\n const [, fieldId, order] = nonValues;\n return {\n fieldId,\n isValues: false,\n order: order as \"ASC\" | \"DESC\"\n };\n};\n\ninterface Params {\n sort?: CmsEntryListSort;\n modelFields: ModelFields;\n model: CmsModel;\n valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;\n}\n\nexport const createElasticsearchSort = (params: Params): OpenSearchSort => {\n const { sort, modelFields, valueSearchRegistry } = params;\n\n if (!sort || sort.length === 0) {\n return [\n {\n [\"id.keyword\"]: {\n order: \"asc\"\n }\n }\n ];\n }\n\n const createFieldPath = createFieldPathFactory({\n valueSearchRegistry\n });\n\n const fieldIdToStorageIdIdMap: Record<string, string> = {};\n\n const sortPlugins = Object.values(modelFields).reduce<Record<string, OpenSearchFieldPlugin>>(\n (plugins, field) => {\n /**\n * We do not support sorting by nested fields.\n */\n const isValues = field.parents.length === 1 && field.parents[0].fieldId === \"values\";\n if (field.parents.length > 0 && !isValues) {\n return plugins;\n }\n\n const fieldId = field.field.fieldId;\n const fieldIdPath = isValues ? `values.${fieldId}` : fieldId;\n\n fieldIdToStorageIdIdMap[fieldIdPath] = fieldIdPath;\n\n const { path } = createFieldPath({\n key: field.field.storageId,\n field,\n value: NoValueContainer.create(),\n keyword: false,\n originalValue: NoValueContainer.create()\n });\n /**\n * Plugins must be stored with fieldId as key because it is later used to find the sorting plugin.\n */\n plugins[fieldIdPath] = new OpenSearchFieldPlugin({\n unmappedType: field.unmappedType,\n keyword: hasKeyword(field),\n sortable: field.sortable,\n searchable: field.searchable,\n field: fieldId,\n path\n });\n return plugins;\n },\n {\n [\"*\"]: new OpenSearchFieldPlugin({\n field: OpenSearchFieldPlugin.ALL,\n keyword: false\n })\n }\n );\n\n const transformedSort = sort\n .map(value => {\n const matched = matchField(value);\n if (!matched) {\n return null;\n }\n const { fieldId, order, isValues } = matched;\n const key = isValues ? `values.${fieldId}` : fieldId;\n if (fieldIdToStorageIdIdMap[key]) {\n return `${fieldIdToStorageIdIdMap[key]}_${order}`;\n }\n\n return value;\n })\n .filter(Boolean) as string[];\n return createSort({\n fieldPlugins: sortPlugins,\n sort: transformedSort\n });\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We use any for input and output because they really can be anything.
|
|
3
|
-
* Plugin, if exists, makes sure that response value is correct.
|
|
4
|
-
*/
|
|
5
1
|
import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
|
|
6
|
-
import type {
|
|
2
|
+
import type { CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
|
|
7
3
|
interface Params {
|
|
8
|
-
|
|
4
|
+
valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
|
|
9
5
|
field: CmsModelField;
|
|
10
6
|
value: any;
|
|
11
7
|
}
|
|
12
|
-
/**
|
|
13
|
-
* Transformed value can be anything.
|
|
14
|
-
*/
|
|
15
8
|
export declare const transformValueForSearch: (params: Params) => any;
|
|
16
9
|
export {};
|
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* We use any for input and output because they really can be anything.
|
|
3
|
-
* Plugin, if exists, makes sure that response value is correct.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
|
|
7
|
-
/**
|
|
8
|
-
* Transformed value can be anything.
|
|
9
|
-
*/
|
|
10
1
|
export const transformValueForSearch = params => {
|
|
11
2
|
const {
|
|
12
3
|
field,
|
|
13
|
-
|
|
4
|
+
valueSearchRegistry,
|
|
14
5
|
value
|
|
15
6
|
} = params;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
if (!plugin) {
|
|
7
|
+
const search = valueSearchRegistry.get(field.type);
|
|
8
|
+
if (!search) {
|
|
19
9
|
return value;
|
|
20
10
|
}
|
|
21
|
-
return
|
|
11
|
+
return search.transform({
|
|
22
12
|
field,
|
|
23
13
|
value
|
|
24
14
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["transformValueForSearch","params","field","valueSearchRegistry","value","search","get","type","transform"],"sources":["transformValueForSearch.ts"],"sourcesContent":["import type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\n\ninterface Params {\n valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;\n field: CmsModelField;\n value: any;\n}\n\nexport const transformValueForSearch = (params: Params): any => {\n const { field, valueSearchRegistry, value } = params;\n const search = valueSearchRegistry.get(field.type);\n if (!search) {\n return value;\n }\n return search.transform({ field, value });\n};\n"],"mappings":"AASA,OAAO,MAAMA,uBAAuB,GAAIC,MAAc,IAAU;EAC5D,MAAM;IAAEC,KAAK;IAAEC,mBAAmB;IAAEC;EAAM,CAAC,GAAGH,MAAM;EACpD,MAAMI,MAAM,GAAGF,mBAAmB,CAACG,GAAG,CAACJ,KAAK,CAACK,IAAI,CAAC;EAClD,IAAI,CAACF,MAAM,EAAE;IACT,OAAOD,KAAK;EAChB;EACA,OAAOC,MAAM,CAACG,SAAS,CAAC;IAAEN,KAAK;IAAEE;EAAM,CAAC,CAAC;AAC7C,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../../plugins/index.js";
|
|
2
1
|
import type { OpenSearchQueryBuilderOperatorPlugin } from "@webiny/api-opensearch";
|
|
3
2
|
import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
|
|
4
3
|
/**
|
|
@@ -32,10 +31,4 @@ export interface ModelFields {
|
|
|
32
31
|
export interface OpenSearchQueryBuilderOperatorPlugins {
|
|
33
32
|
[key: string]: OpenSearchQueryBuilderOperatorPlugin;
|
|
34
33
|
}
|
|
35
|
-
/**
|
|
36
|
-
* ./plugins/search
|
|
37
|
-
*/
|
|
38
|
-
export interface OpenSearchQuerySearchValuePlugins {
|
|
39
|
-
[fieldType: string]: CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
|
|
40
|
-
}
|
|
41
34
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { OpenSearchQueryBuilderOperatorPlugin } from \"@webiny/api-opensearch\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\n\n/**\n * ./fields\n */\ntype ModelFieldPath = string | ((value: string) => string);\n\nexport type FieldType = \"text\" | \"date\" | \"datetime\" | \"time\" | \"number\" | \"boolean\" | string;\n\nexport interface ModelFieldParent {\n fieldId: string;\n storageId: string;\n type: FieldType;\n}\nexport interface ModelField {\n unmappedType?: string;\n keyword?: boolean;\n searchable: boolean;\n sortable: boolean;\n type: FieldType;\n systemField?: boolean;\n field: CmsModelField;\n path?: ModelFieldPath;\n fullTextSearch?: boolean;\n parents: ModelFieldParent[];\n}\n\nexport interface ModelFields {\n [fieldId: string]: ModelField;\n}\n\n/**\n * ./plugins/operator\n */\nexport interface OpenSearchQueryBuilderOperatorPlugins {\n [key: string]: OpenSearchQueryBuilderOperatorPlugin;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
import type { Client } from "@webiny/api-opensearch";
|
|
2
|
-
import type { PluginsContainer } from "@webiny/plugins";
|
|
3
2
|
import { type IOpenSearchEntity as IElasticsearchEntity } from "@webiny/api-opensearch";
|
|
3
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
|
4
4
|
import type { CmsEntryStorageOperations } from "../../types.js";
|
|
5
5
|
import type { IEntryEntity } from "../../definitions/types.js";
|
|
6
|
+
import type { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
|
|
7
|
+
import { CompressionHandler } from "@webiny/utils/features/compression/abstractions/CompressionHandler.js";
|
|
8
|
+
import type { CmsEntryOpenSearchBodyModifier } from "../../features/CmsEntryOpenSearchBodyModifier/index.js";
|
|
9
|
+
import type { CmsEntryOpenSearchSortModifier } from "../../features/CmsEntryOpenSearchSortModifier/index.js";
|
|
10
|
+
import type { CmsEntryOpenSearchValuesModifier } from "../../features/CmsEntryOpenSearchValuesModifier/index.js";
|
|
11
|
+
import type { CmsEntryOpenSearchQueryModifier } from "../../features/CmsEntryOpenSearchQueryModifier/index.js";
|
|
12
|
+
import type { CmsEntryOpenSearchValueSearchRegistry } from "../../features/CmsEntryOpenSearchValueSearch/index.js";
|
|
13
|
+
import type { CmsEntryOpenSearchFullTextSearch } from "../../features/CmsEntryOpenSearchFullTextSearch/index.js";
|
|
14
|
+
import type { CmsEntryOpenSearchFieldIndexRegistry } from "../../features/CmsEntryOpenSearchFieldIndex/index.js";
|
|
15
|
+
import type { CmsEntryOpenSearchFilterRegistry } from "../../features/CmsEntryOpenSearchFilter/index.js";
|
|
6
16
|
export interface CreateEntriesStorageOperationsParams {
|
|
7
17
|
entity: IEntryEntity;
|
|
8
18
|
esEntity: IElasticsearchEntity;
|
|
9
19
|
elasticsearch: Client;
|
|
10
20
|
plugins: PluginsContainer;
|
|
21
|
+
fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
|
|
22
|
+
fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface;
|
|
23
|
+
compressionHandler: CompressionHandler.Interface;
|
|
24
|
+
bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[];
|
|
25
|
+
sortModifiers: CmsEntryOpenSearchSortModifier.Interface[];
|
|
26
|
+
queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[];
|
|
27
|
+
valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface;
|
|
28
|
+
fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[];
|
|
29
|
+
valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[];
|
|
30
|
+
filterRegistry: CmsEntryOpenSearchFilterRegistry.Interface;
|
|
11
31
|
}
|
|
12
32
|
export declare const createEntriesStorageOperations: (params: CreateEntriesStorageOperationsParams) => CmsEntryStorageOperations;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import WebinyError from "@webiny/error";
|
|
1
|
+
import { WebinyError } from "@webiny/error";
|
|
2
2
|
import { CONTENT_ENTRY_STATUS } from "@webiny/api-headless-cms/types/index.js";
|
|
3
3
|
import { extractEntriesFromIndex } from "../../helpers/index.js";
|
|
4
4
|
import { configurations } from "../../configurations.js";
|
|
5
|
+
import { createLimit, decodeCursor, encodeCursor } from "@webiny/api-opensearch";
|
|
5
6
|
import { DataLoadersHandler } from "./dataLoaders.js";
|
|
6
7
|
import { createEntryLatestKeys, createEntryPublishedKeys, createEntryRevisionKeys, createLatestSortKey, createPartitionKey, createPublishedSortKey, createRevisionSortKey } from "./keys.js";
|
|
7
|
-
import {
|
|
8
|
+
import { getTotalCount } from "@webiny/api-opensearch/types.js";
|
|
8
9
|
import { createElasticsearchBody } from "./elasticsearch/body.js";
|
|
9
10
|
import { shouldIgnoreEsResponseError } from "./elasticsearch/shouldIgnoreEsResponseError.js";
|
|
10
11
|
import { StorageOperationsCmsModelPlugin } from "@webiny/api-headless-cms";
|
|
@@ -30,7 +31,17 @@ export const createEntriesStorageOperations = params => {
|
|
|
30
31
|
entity,
|
|
31
32
|
esEntity,
|
|
32
33
|
elasticsearch,
|
|
33
|
-
plugins
|
|
34
|
+
plugins,
|
|
35
|
+
fieldRegistry,
|
|
36
|
+
fieldIndexRegistry,
|
|
37
|
+
compressionHandler,
|
|
38
|
+
bodyModifiers,
|
|
39
|
+
sortModifiers,
|
|
40
|
+
queryModifiers,
|
|
41
|
+
valueSearchRegistry,
|
|
42
|
+
fullTextSearches,
|
|
43
|
+
valuesModifiers,
|
|
44
|
+
filterRegistry
|
|
34
45
|
} = params;
|
|
35
46
|
let storageOperationsCmsModelPlugin;
|
|
36
47
|
const getStorageOperationsCmsModelPlugin = () => {
|
|
@@ -58,10 +69,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
58
69
|
initialEntry.locked = locked;
|
|
59
70
|
initialStorageEntry.locked = locked;
|
|
60
71
|
const transformer = createTransformer({
|
|
61
|
-
|
|
72
|
+
fieldRegistry,
|
|
73
|
+
fieldIndexRegistry,
|
|
62
74
|
model,
|
|
63
75
|
entry: initialEntry,
|
|
64
|
-
storageEntry: initialStorageEntry
|
|
76
|
+
storageEntry: initialStorageEntry,
|
|
77
|
+
compressionHandler,
|
|
78
|
+
valuesModifiers
|
|
65
79
|
});
|
|
66
80
|
const {
|
|
67
81
|
entry,
|
|
@@ -146,10 +160,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
146
160
|
} = params;
|
|
147
161
|
const model = getStorageOperationsModel(initialModel);
|
|
148
162
|
const transformer = createTransformer({
|
|
149
|
-
plugins,
|
|
150
163
|
model,
|
|
151
164
|
entry: initialEntry,
|
|
152
|
-
storageEntry: initialStorageEntry
|
|
165
|
+
storageEntry: initialStorageEntry,
|
|
166
|
+
fieldRegistry,
|
|
167
|
+
fieldIndexRegistry,
|
|
168
|
+
compressionHandler,
|
|
169
|
+
valuesModifiers
|
|
153
170
|
});
|
|
154
171
|
const {
|
|
155
172
|
entry,
|
|
@@ -245,10 +262,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
245
262
|
} = params;
|
|
246
263
|
const model = getStorageOperationsModel(initialModel);
|
|
247
264
|
const transformer = createTransformer({
|
|
248
|
-
|
|
265
|
+
valuesModifiers,
|
|
249
266
|
model,
|
|
250
267
|
entry: initialEntry,
|
|
251
|
-
storageEntry: initialStorageEntry
|
|
268
|
+
storageEntry: initialStorageEntry,
|
|
269
|
+
fieldRegistry,
|
|
270
|
+
fieldIndexRegistry,
|
|
271
|
+
compressionHandler
|
|
252
272
|
});
|
|
253
273
|
const {
|
|
254
274
|
entry,
|
|
@@ -355,8 +375,8 @@ export const createEntriesStorageOperations = params => {
|
|
|
355
375
|
*/
|
|
356
376
|
const latestEsEntry = await esEntity.getClean(latestKeys);
|
|
357
377
|
if (latestEsEntry) {
|
|
358
|
-
const latestEsEntryDataDecompressed = await decompress(
|
|
359
|
-
const updatedLatestEntry = await compress(
|
|
378
|
+
const latestEsEntryDataDecompressed = await compressionHandler.decompress(latestEsEntry.data);
|
|
379
|
+
const updatedLatestEntry = await compressionHandler.compress({
|
|
360
380
|
...latestEsEntryDataDecompressed,
|
|
361
381
|
...updatedEntryLevelMetaFields
|
|
362
382
|
});
|
|
@@ -477,7 +497,7 @@ export const createEntriesStorageOperations = params => {
|
|
|
477
497
|
}
|
|
478
498
|
return {
|
|
479
499
|
...record,
|
|
480
|
-
data: await decompress(
|
|
500
|
+
data: await compressionHandler.decompress(record.data)
|
|
481
501
|
};
|
|
482
502
|
}))).filter(item => !!item);
|
|
483
503
|
if (esItems.length === 0) {
|
|
@@ -488,7 +508,7 @@ export const createEntriesStorageOperations = params => {
|
|
|
488
508
|
put: await Promise.all(esItems.map(async item => {
|
|
489
509
|
return {
|
|
490
510
|
...item,
|
|
491
|
-
data: await compress(
|
|
511
|
+
data: await compressionHandler.compress({
|
|
492
512
|
...item.data,
|
|
493
513
|
location: {
|
|
494
514
|
...item.data?.location,
|
|
@@ -513,10 +533,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
513
533
|
} = params;
|
|
514
534
|
const model = getStorageOperationsModel(initialModel);
|
|
515
535
|
const transformer = createTransformer({
|
|
516
|
-
|
|
536
|
+
valuesModifiers,
|
|
517
537
|
model,
|
|
518
538
|
entry: initialEntry,
|
|
519
|
-
storageEntry: initialStorageEntry
|
|
539
|
+
storageEntry: initialStorageEntry,
|
|
540
|
+
fieldRegistry,
|
|
541
|
+
fieldIndexRegistry,
|
|
542
|
+
compressionHandler
|
|
520
543
|
});
|
|
521
544
|
const {
|
|
522
545
|
entry,
|
|
@@ -615,7 +638,7 @@ export const createEntriesStorageOperations = params => {
|
|
|
615
638
|
}
|
|
616
639
|
return {
|
|
617
640
|
...record,
|
|
618
|
-
data: await decompress(
|
|
641
|
+
data: await compressionHandler.decompress(record.data)
|
|
619
642
|
};
|
|
620
643
|
}))).filter(item => !!item);
|
|
621
644
|
if (esItems.length === 0) {
|
|
@@ -629,7 +652,7 @@ export const createEntriesStorageOperations = params => {
|
|
|
629
652
|
for (const item of esItems) {
|
|
630
653
|
elasticsearchEntityBatch.put({
|
|
631
654
|
...item,
|
|
632
|
-
data: await compress(
|
|
655
|
+
data: await compressionHandler.compress({
|
|
633
656
|
...item.data,
|
|
634
657
|
...updatedEntryMetaFields,
|
|
635
658
|
wbyDeleted: entry.wbyDeleted,
|
|
@@ -659,10 +682,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
659
682
|
} = params;
|
|
660
683
|
const model = getStorageOperationsModel(initialModel);
|
|
661
684
|
const transformer = createTransformer({
|
|
662
|
-
|
|
685
|
+
valuesModifiers,
|
|
663
686
|
model,
|
|
664
687
|
entry: initialEntry,
|
|
665
|
-
storageEntry: initialStorageEntry
|
|
688
|
+
storageEntry: initialStorageEntry,
|
|
689
|
+
fieldRegistry,
|
|
690
|
+
fieldIndexRegistry,
|
|
691
|
+
compressionHandler
|
|
666
692
|
});
|
|
667
693
|
const {
|
|
668
694
|
entry,
|
|
@@ -758,7 +784,7 @@ export const createEntriesStorageOperations = params => {
|
|
|
758
784
|
}
|
|
759
785
|
return {
|
|
760
786
|
...record,
|
|
761
|
-
data: await decompress(
|
|
787
|
+
data: await compressionHandler.decompress(record.data)
|
|
762
788
|
};
|
|
763
789
|
}))).filter(item => !!item);
|
|
764
790
|
if (esItems.length === 0) {
|
|
@@ -772,7 +798,7 @@ export const createEntriesStorageOperations = params => {
|
|
|
772
798
|
for (const item of esItems) {
|
|
773
799
|
elasticsearchEntityBatch.put({
|
|
774
800
|
...item,
|
|
775
|
-
data: await compress(
|
|
801
|
+
data: await compressionHandler.compress({
|
|
776
802
|
...item.data,
|
|
777
803
|
...updatedEntryMetaFields,
|
|
778
804
|
wbyDeleted: entry.wbyDeleted,
|
|
@@ -926,10 +952,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
926
952
|
data: latestStorageEntry
|
|
927
953
|
});
|
|
928
954
|
const latestTransformer = createTransformer({
|
|
929
|
-
|
|
955
|
+
valuesModifiers,
|
|
930
956
|
model,
|
|
931
957
|
entry: latestEntry,
|
|
932
|
-
storageEntry: initialLatestStorageEntry
|
|
958
|
+
storageEntry: initialLatestStorageEntry,
|
|
959
|
+
fieldRegistry,
|
|
960
|
+
fieldIndexRegistry,
|
|
961
|
+
compressionHandler
|
|
933
962
|
});
|
|
934
963
|
const esLatestData = await latestTransformer.getElasticsearchLatestEntryData();
|
|
935
964
|
const esLatestKeys = createEntryLatestKeys(latestEntry);
|
|
@@ -1045,6 +1074,14 @@ export const createEntriesStorageOperations = params => {
|
|
|
1045
1074
|
});
|
|
1046
1075
|
const body = createElasticsearchBody({
|
|
1047
1076
|
model,
|
|
1077
|
+
fieldRegistry,
|
|
1078
|
+
fieldIndexRegistry,
|
|
1079
|
+
bodyModifiers,
|
|
1080
|
+
sortModifiers,
|
|
1081
|
+
queryModifiers,
|
|
1082
|
+
valueSearchRegistry,
|
|
1083
|
+
fullTextSearches,
|
|
1084
|
+
filterRegistry,
|
|
1048
1085
|
params: {
|
|
1049
1086
|
...params,
|
|
1050
1087
|
limit,
|
|
@@ -1081,9 +1118,10 @@ export const createEntriesStorageOperations = params => {
|
|
|
1081
1118
|
const {
|
|
1082
1119
|
hits,
|
|
1083
1120
|
total
|
|
1084
|
-
} = response
|
|
1121
|
+
} = response.body.hits;
|
|
1085
1122
|
const items = extractEntriesFromIndex({
|
|
1086
|
-
|
|
1123
|
+
fieldRegistry,
|
|
1124
|
+
fieldIndexRegistry,
|
|
1087
1125
|
model,
|
|
1088
1126
|
entries: hits.map(item => {
|
|
1089
1127
|
return item._source;
|
|
@@ -1108,7 +1146,7 @@ export const createEntriesStorageOperations = params => {
|
|
|
1108
1146
|
const cursor = items.length > 0 ? encodeCursor(hits[items.length - 1].sort) || null : null;
|
|
1109
1147
|
return {
|
|
1110
1148
|
hasMoreItems,
|
|
1111
|
-
totalCount: total
|
|
1149
|
+
totalCount: getTotalCount(total),
|
|
1112
1150
|
cursor,
|
|
1113
1151
|
items
|
|
1114
1152
|
};
|
|
@@ -1130,10 +1168,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
1130
1168
|
} = params;
|
|
1131
1169
|
const model = getStorageOperationsModel(initialModel);
|
|
1132
1170
|
const transformer = createTransformer({
|
|
1133
|
-
|
|
1171
|
+
valuesModifiers,
|
|
1134
1172
|
model,
|
|
1135
1173
|
entry: initialEntry,
|
|
1136
|
-
storageEntry: initialStorageEntry
|
|
1174
|
+
storageEntry: initialStorageEntry,
|
|
1175
|
+
fieldRegistry,
|
|
1176
|
+
fieldIndexRegistry,
|
|
1177
|
+
compressionHandler
|
|
1137
1178
|
});
|
|
1138
1179
|
const {
|
|
1139
1180
|
entry,
|
|
@@ -1295,18 +1336,21 @@ export const createEntriesStorageOperations = params => {
|
|
|
1295
1336
|
* No need to transform it for the storage because it was fetched
|
|
1296
1337
|
* directly from the Elasticsearch table, where it sits transformed.
|
|
1297
1338
|
*/
|
|
1298
|
-
const latestEsEntryDataDecompressed = await decompress(
|
|
1339
|
+
const latestEsEntryDataDecompressed = await compressionHandler.decompress(latestEsEntry.data);
|
|
1299
1340
|
if (publishingLatestRevision) {
|
|
1300
1341
|
const updatedMetaFields = pickEntryMetaFields(entry);
|
|
1301
1342
|
const latestTransformer = createTransformer({
|
|
1302
|
-
|
|
1343
|
+
valuesModifiers,
|
|
1303
1344
|
model,
|
|
1304
1345
|
transformedToIndex: {
|
|
1305
1346
|
...latestEsEntryDataDecompressed,
|
|
1306
1347
|
status: CONTENT_ENTRY_STATUS.PUBLISHED,
|
|
1307
1348
|
locked: true,
|
|
1308
1349
|
...updatedMetaFields
|
|
1309
|
-
}
|
|
1350
|
+
},
|
|
1351
|
+
fieldRegistry,
|
|
1352
|
+
fieldIndexRegistry,
|
|
1353
|
+
compressionHandler
|
|
1310
1354
|
});
|
|
1311
1355
|
const esEntryLatestKeys = createEntryLatestKeys(latestEsEntryDataDecompressed);
|
|
1312
1356
|
elasticsearchEntityWriter.put({
|
|
@@ -1322,12 +1366,12 @@ export const createEntriesStorageOperations = params => {
|
|
|
1322
1366
|
*/
|
|
1323
1367
|
const latestEsEntry = await esEntity.getClean(latestKeys);
|
|
1324
1368
|
if (latestEsEntry) {
|
|
1325
|
-
const latestEsEntryDataDecompressed = await decompress(
|
|
1369
|
+
const latestEsEntryDataDecompressed = await compressionHandler.decompress(latestEsEntry.data);
|
|
1326
1370
|
let latestRevisionStatus = latestEsEntryDataDecompressed.status;
|
|
1327
1371
|
if (latestRevisionStatus === CONTENT_ENTRY_STATUS.PUBLISHED) {
|
|
1328
1372
|
latestRevisionStatus = CONTENT_ENTRY_STATUS.UNPUBLISHED;
|
|
1329
1373
|
}
|
|
1330
|
-
const updatedLatestEntry = await compress(
|
|
1374
|
+
const updatedLatestEntry = await compressionHandler.compress({
|
|
1331
1375
|
...latestEsEntryDataDecompressed,
|
|
1332
1376
|
...updatedEntryLevelMetaFields,
|
|
1333
1377
|
status: latestRevisionStatus
|
|
@@ -1378,10 +1422,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
1378
1422
|
} = params;
|
|
1379
1423
|
const model = getStorageOperationsModel(initialModel);
|
|
1380
1424
|
const transformer = createTransformer({
|
|
1381
|
-
|
|
1425
|
+
valuesModifiers,
|
|
1382
1426
|
model,
|
|
1383
1427
|
entry: initialEntry,
|
|
1384
|
-
storageEntry: initialStorageEntry
|
|
1428
|
+
storageEntry: initialStorageEntry,
|
|
1429
|
+
fieldRegistry,
|
|
1430
|
+
fieldIndexRegistry,
|
|
1431
|
+
compressionHandler
|
|
1385
1432
|
});
|
|
1386
1433
|
const {
|
|
1387
1434
|
entry,
|
|
@@ -1617,6 +1664,14 @@ export const createEntriesStorageOperations = params => {
|
|
|
1617
1664
|
});
|
|
1618
1665
|
const initialBody = createElasticsearchBody({
|
|
1619
1666
|
model,
|
|
1667
|
+
fieldRegistry,
|
|
1668
|
+
fieldIndexRegistry,
|
|
1669
|
+
bodyModifiers,
|
|
1670
|
+
sortModifiers,
|
|
1671
|
+
queryModifiers,
|
|
1672
|
+
valueSearchRegistry,
|
|
1673
|
+
fullTextSearches,
|
|
1674
|
+
filterRegistry,
|
|
1620
1675
|
params: {
|
|
1621
1676
|
limit: 1,
|
|
1622
1677
|
where
|
|
@@ -1661,11 +1716,13 @@ export const createEntriesStorageOperations = params => {
|
|
|
1661
1716
|
body
|
|
1662
1717
|
});
|
|
1663
1718
|
}
|
|
1664
|
-
const
|
|
1665
|
-
|
|
1719
|
+
const aggregations = response.body.aggregations || {};
|
|
1720
|
+
const agg = aggregations["getUniqueFieldValues"];
|
|
1721
|
+
const buckets = agg && "buckets" in agg && Array.isArray(agg.buckets) ? agg.buckets : [];
|
|
1722
|
+
return buckets.map(bucket => {
|
|
1666
1723
|
return {
|
|
1667
|
-
value:
|
|
1668
|
-
count:
|
|
1724
|
+
value: bucket.key,
|
|
1725
|
+
count: bucket.doc_count
|
|
1669
1726
|
};
|
|
1670
1727
|
});
|
|
1671
1728
|
};
|