@webiny/api-headless-cms-ddb-es 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9
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 +5 -4
- package/configurations.js +27 -33
- package/configurations.js.map +1 -1
- package/definitions/entry.js +7 -9
- package/definitions/entry.js.map +1 -1
- package/definitions/group.js +7 -9
- package/definitions/group.js.map +1 -1
- package/definitions/model.js +7 -9
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +9 -3
- package/definitions/types.js +0 -3
- package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
- package/elasticsearch/createElasticsearchIndex.js +52 -27
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
- package/elasticsearch/deleteElasticsearchIndex.js +18 -26
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/exports/api/cms/opensearch.d.ts +9 -0
- package/exports/api/cms/opensearch.js +9 -0
- package/feature.d.ts +1 -0
- package/feature.js +179 -0
- package/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.js +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +14 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +42 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +32 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +5 -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 +5 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.js +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.js +29 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +60 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +13 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +33 -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 +21 -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 +22 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +32 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +12 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +107 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +21 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.d.ts +15 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +40 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.d.ts +15 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +40 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.js +3 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +36 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +5 -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 +5 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
- package/features/CmsEntryOpenSearchFilter/constants.js +4 -0
- package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchFilter/feature.js +17 -0
- package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +26 -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 +43 -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 +36 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchFilter/index.js +3 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.js +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 +5 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchIndex/feature.js +11 -0
- package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchIndex/index.js +3 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.js +1 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchSortModifier/index.js +1 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +31 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +5 -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 +5 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.js +17 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +21 -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 +44 -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 +22 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchValueSearch/index.js +3 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +5 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.js +1 -0
- package/helpers/entryIndexHelpers.d.ts +6 -4
- package/helpers/entryIndexHelpers.js +70 -186
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.js +18 -30
- package/helpers/fieldIdentifier.js.map +1 -1
- package/helpers/index.js +0 -2
- package/index.d.ts +1 -3
- package/index.js +1 -190
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +22 -29
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +2 -1
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -26
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +28 -34
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +28 -34
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.js +33 -43
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.js +8 -9
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +1 -0
- package/operations/entry/dataLoader/types.js +0 -3
- package/operations/entry/dataLoaders.js +81 -97
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +6 -24
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
- package/operations/entry/elasticsearch/body.d.ts +19 -3
- package/operations/entry/elasticsearch/body.js +74 -122
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields/createSystemField.d.ts +4 -0
- package/operations/entry/elasticsearch/fields/createSystemField.js +9 -0
- package/operations/entry/elasticsearch/fields/createSystemField.js.map +1 -0
- package/operations/entry/elasticsearch/fields/live.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/live.js +50 -0
- package/operations/entry/elasticsearch/fields/live.js.map +1 -0
- package/operations/entry/elasticsearch/fields/location.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/location.js +50 -0
- package/operations/entry/elasticsearch/fields/location.js.map +1 -0
- package/operations/entry/elasticsearch/fields/state.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/state.js +104 -0
- package/operations/entry/elasticsearch/fields/state.js.map +1 -0
- package/operations/entry/elasticsearch/fields.d.ts +6 -4
- package/operations/entry/elasticsearch/fields.js +194 -388
- package/operations/entry/elasticsearch/fields.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +6 -5
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +32 -45
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +6 -2
- package/operations/entry/elasticsearch/filtering/exec.js +84 -166
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/index.js +0 -2
- package/operations/entry/elasticsearch/filtering/path.d.ts +4 -3
- package/operations/entry/elasticsearch/filtering/path.js +24 -35
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -2
- package/operations/entry/elasticsearch/filtering/populated.js +8 -14
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/values.js +11 -12
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +7 -6
- package/operations/entry/elasticsearch/fullTextSearch.js +45 -79
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +4 -4
- package/operations/entry/elasticsearch/fullTextSearchFields.js +7 -17
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +3 -3
- package/operations/entry/elasticsearch/initialQuery.js +37 -80
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
- package/operations/entry/elasticsearch/keyword.js +13 -27
- package/operations/entry/elasticsearch/keyword.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -2
- package/operations/entry/elasticsearch/plugins/operator.js +10 -21
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -4
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
- package/operations/entry/elasticsearch/sort.d.ts +4 -4
- package/operations/entry/elasticsearch/sort.js +69 -96
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js +9 -24
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.d.ts +3 -10
- package/operations/entry/elasticsearch/types.js +0 -3
- package/operations/entry/index.d.ts +22 -2
- package/operations/entry/index.js +1316 -1650
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js +43 -63
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +4 -9
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/transformations/convertEntryKeys.js +21 -26
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +6 -2
- package/operations/entry/transformations/index.js +84 -112
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +6 -4
- package/operations/entry/transformations/modifyEntryValues.js +12 -17
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.js +13 -16
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +2 -2
- package/operations/entry/transformations/transformEntryToIndex.js +16 -20
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +2 -2
- package/operations/group/index.js +115 -139
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +1 -1
- package/operations/model/index.js +128 -157
- package/operations/model/index.js.map +1 -1
- package/package.json +35 -30
- package/tasks/createIndexTaskPlugin.js +36 -32
- package/tasks/createIndexTaskPlugin.js.map +1 -1
- package/types.d.ts +7 -112
- package/types.js +7 -36
- package/types.js.map +1 -1
- package/values/NoValueContainer.js +8 -10
- package/values/NoValueContainer.js.map +1 -1
- package/definitions/types.js.map +0 -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 +0 -81
- 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 +0 -34
- package/elasticsearch/indexing/numberIndexing.js.map +0 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
- package/elasticsearch/indexing/objectIndexing.js +0 -194
- 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/helpers/index.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/entry/dataLoader/types.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/index.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/operations/entry/elasticsearch/types.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 -23
- 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,10 +0,0 @@
|
|
|
1
|
-
import richTextIndexing from "./richTextIndexing.js";
|
|
2
|
-
import longTextIndexing from "./longTextIndexing.js";
|
|
3
|
-
import defaultFieldIndexing from "./defaultFieldIndexing.js";
|
|
4
|
-
import dateTimeIndexing from "./dateTimeIndexing.js";
|
|
5
|
-
import numberIndexing from "./numberIndexing.js";
|
|
6
|
-
import objectIndexing from "./objectIndexing.js";
|
|
7
|
-
import { createJsonIndexing } from "./jsonIndexing.js";
|
|
8
|
-
export default () => [dateTimeIndexing(), richTextIndexing(), longTextIndexing(), defaultFieldIndexing(), numberIndexing(), objectIndexing(), createJsonIndexing()];
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["richTextIndexing","longTextIndexing","defaultFieldIndexing","dateTimeIndexing","numberIndexing","objectIndexing","createJsonIndexing"],"sources":["index.ts"],"sourcesContent":["import richTextIndexing from \"./richTextIndexing.js\";\nimport longTextIndexing from \"./longTextIndexing.js\";\nimport defaultFieldIndexing from \"./defaultFieldIndexing.js\";\nimport dateTimeIndexing from \"./dateTimeIndexing.js\";\nimport numberIndexing from \"./numberIndexing.js\";\nimport objectIndexing from \"./objectIndexing.js\";\nimport { createJsonIndexing } from \"./jsonIndexing.js\";\n\nexport default () => [\n dateTimeIndexing(),\n richTextIndexing(),\n longTextIndexing(),\n defaultFieldIndexing(),\n numberIndexing(),\n objectIndexing(),\n createJsonIndexing()\n];\n"],"mappings":"AAAA,OAAOA,gBAAgB;AACvB,OAAOC,gBAAgB;AACvB,OAAOC,oBAAoB;AAC3B,OAAOC,gBAAgB;AACvB,OAAOC,cAAc;AACrB,OAAOC,cAAc;AACrB,SAASC,kBAAkB;AAE3B,eAAe,MAAM,CACjBH,gBAAgB,CAAC,CAAC,EAClBH,gBAAgB,CAAC,CAAC,EAClBC,gBAAgB,CAAC,CAAC,EAClBC,oBAAoB,CAAC,CAAC,EACtBE,cAAc,CAAC,CAAC,EAChBC,cAAc,CAAC,CAAC,EAChBC,kBAAkB,CAAC,CAAC,CACvB","ignoreList":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export const createJsonIndexing = () => {
|
|
2
|
-
return {
|
|
3
|
-
type: "cms-model-field-to-elastic-search",
|
|
4
|
-
name: "cms-model-field-to-elastic-search-json",
|
|
5
|
-
fieldType: "json",
|
|
6
|
-
toIndex({
|
|
7
|
-
value
|
|
8
|
-
}) {
|
|
9
|
-
return {
|
|
10
|
-
rawValue: value
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
fromIndex({
|
|
14
|
-
rawValue
|
|
15
|
-
}) {
|
|
16
|
-
return rawValue;
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=jsonIndexing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createJsonIndexing","type","name","fieldType","toIndex","value","rawValue","fromIndex"],"sources":["jsonIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nexport const createJsonIndexing = (): CmsModelFieldToElasticsearchPlugin => {\n return {\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-json\",\n fieldType: \"json\",\n toIndex({ value }) {\n return {\n rawValue: value\n };\n },\n fromIndex({ rawValue }) {\n return rawValue;\n }\n };\n};\n"],"mappings":"AAEA,OAAO,MAAMA,kBAAkB,GAAGA,CAAA,KAA0C;EACxE,OAAO;IACHC,IAAI,EAAE,mCAAmC;IACzCC,IAAI,EAAE,wCAAwC;IAC9CC,SAAS,EAAE,MAAM;IACjBC,OAAOA,CAAC;MAAEC;IAAM,CAAC,EAAE;MACf,OAAO;QACHC,QAAQ,EAAED;MACd,CAAC;IACL,CAAC;IACDE,SAASA,CAAC;MAAED;IAAS,CAAC,EAAE;MACpB,OAAOA,QAAQ;IACnB;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
|
|
2
|
-
/**
|
|
3
|
-
* The long-text indexing plugin must take in consideration that users might have list of long-text fields.
|
|
4
|
-
* Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.
|
|
5
|
-
*/
|
|
6
|
-
declare const _default: () => CmsModelFieldToElasticsearchPlugin;
|
|
7
|
-
export default _default;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The long-text indexing plugin must take in consideration that users might have list of long-text fields.
|
|
3
|
-
* Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.
|
|
4
|
-
*/
|
|
5
|
-
export default () => ({
|
|
6
|
-
type: "cms-model-field-to-elastic-search",
|
|
7
|
-
name: "cms-model-field-to-elastic-search-long-text",
|
|
8
|
-
fieldType: "long-text",
|
|
9
|
-
toIndex({
|
|
10
|
-
rawValue
|
|
11
|
-
}) {
|
|
12
|
-
/**
|
|
13
|
-
* We take the raw value, before it was prepared via `transformToStorage` for storage (there might be some transform due to DynamoDB) and store it in the Elasticsearch to be indexed.
|
|
14
|
-
*/
|
|
15
|
-
return {
|
|
16
|
-
value: Array.isArray(rawValue) ? rawValue : rawValue || ""
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
/**
|
|
20
|
-
* When taking value from the index, we can return the original value.
|
|
21
|
-
* At that point the `transformFromStorage` does not need to do anything.
|
|
22
|
-
*
|
|
23
|
-
* We need to decode to support older systems.
|
|
24
|
-
*/
|
|
25
|
-
fromIndex({
|
|
26
|
-
value
|
|
27
|
-
}) {
|
|
28
|
-
if (Array.isArray(value)) {
|
|
29
|
-
return value;
|
|
30
|
-
}
|
|
31
|
-
return value || "";
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=longTextIndexing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["type","name","fieldType","toIndex","rawValue","value","Array","isArray","fromIndex"],"sources":["longTextIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\n/**\n * The long-text indexing plugin must take in consideration that users might have list of long-text fields.\n * Also, we used to encode values, and we do not do that anymore - but we need to have backward compatibility.\n */\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-long-text\",\n fieldType: \"long-text\",\n toIndex({ rawValue }) {\n /**\n * We take the raw value, before it was prepared via `transformToStorage` for storage (there might be some transform due to DynamoDB) and store it in the Elasticsearch to be indexed.\n */\n return {\n value: Array.isArray(rawValue) ? rawValue : rawValue || \"\"\n };\n },\n /**\n * When taking value from the index, we can return the original value.\n * At that point the `transformFromStorage` does not need to do anything.\n *\n * We need to decode to support older systems.\n */\n fromIndex({ value }) {\n if (Array.isArray(value)) {\n return value;\n }\n return value || \"\";\n }\n});\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA,eAAe,OAA2C;EACtDA,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAOA,CAAC;IAAEC;EAAS,CAAC,EAAE;IAClB;AACR;AACA;IACQ,OAAO;MACHC,KAAK,EAAEC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,GAAGA,QAAQ,GAAGA,QAAQ,IAAI;IAC5D,CAAC;EACL,CAAC;EACD;AACJ;AACA;AACA;AACA;AACA;EACII,SAASA,CAAC;IAAEH;EAAM,CAAC,EAAE;IACjB,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK;IAChB;IACA,OAAOA,KAAK,IAAI,EAAE;EACtB;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const convertToString = value => {
|
|
2
|
-
if (Array.isArray(value) === false) {
|
|
3
|
-
return value;
|
|
4
|
-
}
|
|
5
|
-
return value.map(String);
|
|
6
|
-
};
|
|
7
|
-
const convertToFloat = value => {
|
|
8
|
-
if (Array.isArray(value) === false) {
|
|
9
|
-
return typeof value === "string" ? parseFloat(value) : value;
|
|
10
|
-
}
|
|
11
|
-
return value.map(v => parseFloat(v));
|
|
12
|
-
};
|
|
13
|
-
export default () => ({
|
|
14
|
-
type: "cms-model-field-to-elastic-search",
|
|
15
|
-
name: "cms-model-field-to-elastic-search-number",
|
|
16
|
-
fieldType: "number",
|
|
17
|
-
unmappedType: () => {
|
|
18
|
-
return "float";
|
|
19
|
-
},
|
|
20
|
-
toIndex({
|
|
21
|
-
value
|
|
22
|
-
}) {
|
|
23
|
-
return {
|
|
24
|
-
value: convertToString(value)
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
fromIndex({
|
|
28
|
-
value
|
|
29
|
-
}) {
|
|
30
|
-
return convertToFloat(value);
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
//# sourceMappingURL=numberIndexing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["convertToString","value","Array","isArray","map","String","convertToFloat","parseFloat","v","type","name","fieldType","unmappedType","toIndex","fromIndex"],"sources":["numberIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nconst convertToString = (value: number[] | number) => {\n if (Array.isArray(value) === false) {\n return value;\n }\n return (value as number[]).map(String);\n};\n\nconst convertToFloat = (value: string[] | number) => {\n if (Array.isArray(value) === false) {\n return typeof value === \"string\" ? parseFloat(value) : value;\n }\n return (value as string[]).map(v => parseFloat(v));\n};\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-number\",\n fieldType: \"number\",\n unmappedType: () => {\n return \"float\";\n },\n toIndex({ value }) {\n return {\n value: convertToString(value)\n };\n },\n fromIndex({ value }) {\n return convertToFloat(value);\n }\n});\n"],"mappings":"AAEA,MAAMA,eAAe,GAAIC,KAAwB,IAAK;EAClD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,KAAK,KAAK,EAAE;IAChC,OAAOA,KAAK;EAChB;EACA,OAAQA,KAAK,CAAcG,GAAG,CAACC,MAAM,CAAC;AAC1C,CAAC;AAED,MAAMC,cAAc,GAAIL,KAAwB,IAAK;EACjD,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,KAAK,KAAK,EAAE;IAChC,OAAO,OAAOA,KAAK,KAAK,QAAQ,GAAGM,UAAU,CAACN,KAAK,CAAC,GAAGA,KAAK;EAChE;EACA,OAAQA,KAAK,CAAcG,GAAG,CAACI,CAAC,IAAID,UAAU,CAACC,CAAC,CAAC,CAAC;AACtD,CAAC;AAED,eAAe,OAA2C;EACtDC,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,0CAA0C;EAChDC,SAAS,EAAE,QAAQ;EACnBC,YAAY,EAAEA,CAAA,KAAM;IAChB,OAAO,OAAO;EAClB,CAAC;EACDC,OAAOA,CAAC;IAAEZ;EAAM,CAAC,EAAE;IACf,OAAO;MACHA,KAAK,EAAED,eAAe,CAACC,KAAK;IAChC,CAAC;EACL,CAAC;EACDa,SAASA,CAAC;IAAEb;EAAM,CAAC,EAAE;IACjB,OAAOK,cAAc,CAACL,KAAK,CAAC;EAChC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TODO remove rawValue when field aliases and field types targeting will be active.
|
|
3
|
-
*
|
|
4
|
-
* Currently we use rawValue for the values that we do not want to be indexed.
|
|
5
|
-
* When field aliases and types in the value path will be active, we can target the keys directly.
|
|
6
|
-
*
|
|
7
|
-
* This change will be incompatible with the current systems so we will need to release a major version.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
import type { CmsModelFieldToElasticsearchPlugin } from "../../types.js";
|
|
11
|
-
declare const _default: () => CmsModelFieldToElasticsearchPlugin;
|
|
12
|
-
export default _default;
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TODO remove rawValue when field aliases and field types targeting will be active.
|
|
3
|
-
*
|
|
4
|
-
* Currently we use rawValue for the values that we do not want to be indexed.
|
|
5
|
-
* When field aliases and types in the value path will be active, we can target the keys directly.
|
|
6
|
-
*
|
|
7
|
-
* This change will be incompatible with the current systems so we will need to release a major version.
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { getFieldIdentifiers } from "../../helpers/index.js";
|
|
12
|
-
const processToIndex = ({
|
|
13
|
-
fields,
|
|
14
|
-
value: sourceValue,
|
|
15
|
-
rawValue: sourceRawValue,
|
|
16
|
-
getFieldIndexPlugin,
|
|
17
|
-
getFieldTypePlugin,
|
|
18
|
-
plugins,
|
|
19
|
-
model
|
|
20
|
-
}) => {
|
|
21
|
-
const reducer = (values, field) => {
|
|
22
|
-
const plugin = getFieldIndexPlugin(field.type);
|
|
23
|
-
if (!plugin || !plugin.toIndex) {
|
|
24
|
-
return values;
|
|
25
|
-
}
|
|
26
|
-
const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);
|
|
27
|
-
if (!identifiers) {
|
|
28
|
-
return values;
|
|
29
|
-
}
|
|
30
|
-
const {
|
|
31
|
-
value,
|
|
32
|
-
rawValue
|
|
33
|
-
} = plugin.toIndex({
|
|
34
|
-
model,
|
|
35
|
-
field,
|
|
36
|
-
value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],
|
|
37
|
-
rawValue: sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier],
|
|
38
|
-
getFieldIndexPlugin,
|
|
39
|
-
getFieldTypePlugin,
|
|
40
|
-
plugins
|
|
41
|
-
});
|
|
42
|
-
if (value !== undefined) {
|
|
43
|
-
values.value[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;
|
|
44
|
-
}
|
|
45
|
-
if (rawValue !== undefined) {
|
|
46
|
-
values.rawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] = rawValue;
|
|
47
|
-
}
|
|
48
|
-
return values;
|
|
49
|
-
};
|
|
50
|
-
return fields.reduce(reducer, {
|
|
51
|
-
value: {},
|
|
52
|
-
rawValue: {}
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
const processFromIndex = ({
|
|
56
|
-
fields,
|
|
57
|
-
value: sourceValue,
|
|
58
|
-
rawValue: sourceRawValue,
|
|
59
|
-
getFieldIndexPlugin,
|
|
60
|
-
getFieldTypePlugin,
|
|
61
|
-
plugins,
|
|
62
|
-
model
|
|
63
|
-
}) => {
|
|
64
|
-
const reducer = (values, field) => {
|
|
65
|
-
const plugin = getFieldIndexPlugin(field.type);
|
|
66
|
-
if (!plugin || !plugin.fromIndex) {
|
|
67
|
-
return values;
|
|
68
|
-
}
|
|
69
|
-
const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);
|
|
70
|
-
if (!identifiers) {
|
|
71
|
-
return values;
|
|
72
|
-
}
|
|
73
|
-
const value = plugin.fromIndex({
|
|
74
|
-
plugins,
|
|
75
|
-
model,
|
|
76
|
-
field,
|
|
77
|
-
value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],
|
|
78
|
-
rawValue: sourceRawValue ? sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] : null,
|
|
79
|
-
getFieldIndexPlugin,
|
|
80
|
-
getFieldTypePlugin
|
|
81
|
-
});
|
|
82
|
-
if (value !== undefined) {
|
|
83
|
-
values[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;
|
|
84
|
-
}
|
|
85
|
-
return values;
|
|
86
|
-
};
|
|
87
|
-
return fields.reduce(reducer, {});
|
|
88
|
-
};
|
|
89
|
-
export default () => ({
|
|
90
|
-
type: "cms-model-field-to-elastic-search",
|
|
91
|
-
name: "cms-model-field-to-elastic-search-object",
|
|
92
|
-
fieldType: "object",
|
|
93
|
-
toIndex({
|
|
94
|
-
plugins,
|
|
95
|
-
model,
|
|
96
|
-
field,
|
|
97
|
-
value: initialValue,
|
|
98
|
-
rawValue: initialRawValue,
|
|
99
|
-
getFieldIndexPlugin,
|
|
100
|
-
getFieldTypePlugin
|
|
101
|
-
}) {
|
|
102
|
-
if (!initialValue) {
|
|
103
|
-
return {
|
|
104
|
-
value: null
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
const fields = field.settings?.fields || [];
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* In "object" field, value is either an object or an array of objects.
|
|
111
|
-
*/
|
|
112
|
-
if (field.multipleValues) {
|
|
113
|
-
const result = {
|
|
114
|
-
value: [],
|
|
115
|
-
rawValue: []
|
|
116
|
-
};
|
|
117
|
-
for (const key in initialValue) {
|
|
118
|
-
const {
|
|
119
|
-
value,
|
|
120
|
-
rawValue
|
|
121
|
-
} = processToIndex({
|
|
122
|
-
value: initialValue[key],
|
|
123
|
-
rawValue: initialRawValue[key],
|
|
124
|
-
getFieldIndexPlugin,
|
|
125
|
-
getFieldTypePlugin,
|
|
126
|
-
model,
|
|
127
|
-
plugins,
|
|
128
|
-
fields
|
|
129
|
-
});
|
|
130
|
-
result.value.push(value);
|
|
131
|
-
result.rawValue.push(rawValue);
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
value: result.value.length > 0 ? result.value : undefined,
|
|
135
|
-
rawValue: result.rawValue.length > 0 ? result.rawValue : undefined
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
return processToIndex({
|
|
139
|
-
value: initialValue,
|
|
140
|
-
rawValue: initialRawValue,
|
|
141
|
-
getFieldIndexPlugin,
|
|
142
|
-
getFieldTypePlugin,
|
|
143
|
-
model,
|
|
144
|
-
plugins,
|
|
145
|
-
fields
|
|
146
|
-
});
|
|
147
|
-
},
|
|
148
|
-
fromIndex({
|
|
149
|
-
field,
|
|
150
|
-
value,
|
|
151
|
-
rawValue,
|
|
152
|
-
model,
|
|
153
|
-
plugins,
|
|
154
|
-
getFieldIndexPlugin,
|
|
155
|
-
getFieldTypePlugin
|
|
156
|
-
}) {
|
|
157
|
-
if (!value) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
const fields = field.settings?.fields || [];
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* In "object" field, value is either an object or an array of objects.
|
|
164
|
-
*/
|
|
165
|
-
if (field.multipleValues) {
|
|
166
|
-
/**
|
|
167
|
-
* Why this `value || rawValue || []`?
|
|
168
|
-
* It's possible that an object contains all non-indexable fields, or vice-versa, and so
|
|
169
|
-
* we can never be sure which array we can reliably use as a source of values.
|
|
170
|
-
*/
|
|
171
|
-
const source = value || rawValue || [];
|
|
172
|
-
return source.map((_, index) => processFromIndex({
|
|
173
|
-
value: value ? value[index] || {} : {},
|
|
174
|
-
rawValue: rawValue ? rawValue[index] || {} : {},
|
|
175
|
-
getFieldIndexPlugin,
|
|
176
|
-
getFieldTypePlugin,
|
|
177
|
-
model,
|
|
178
|
-
plugins,
|
|
179
|
-
fields
|
|
180
|
-
}));
|
|
181
|
-
}
|
|
182
|
-
return processFromIndex({
|
|
183
|
-
value,
|
|
184
|
-
rawValue,
|
|
185
|
-
getFieldIndexPlugin,
|
|
186
|
-
getFieldTypePlugin,
|
|
187
|
-
model,
|
|
188
|
-
plugins,
|
|
189
|
-
fields
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
//# sourceMappingURL=objectIndexing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getFieldIdentifiers","processToIndex","fields","value","sourceValue","rawValue","sourceRawValue","getFieldIndexPlugin","getFieldTypePlugin","plugins","model","reducer","values","field","plugin","type","toIndex","identifiers","valueIdentifier","rawValueIdentifier","undefined","reduce","processFromIndex","fromIndex","name","fieldType","initialValue","initialRawValue","settings","multipleValues","result","key","push","length","source","map","_","index"],"sources":["objectIndexing.ts"],"sourcesContent":["/**\n * TODO remove rawValue when field aliases and field types targeting will be active.\n *\n * Currently we use rawValue for the values that we do not want to be indexed.\n * When field aliases and types in the value path will be active, we can target the keys directly.\n *\n * This change will be incompatible with the current systems so we will need to release a major version.\n *\n */\n\nimport type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\nimport type {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { getFieldIdentifiers } from \"~/helpers/index.js\";\n\ninterface ProcessToIndex {\n (params: {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue: Record<string, any>;\n getFieldIndexPlugin: (fieldType: string) => CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin: (fieldType: string) => CmsModelFieldToGraphQLPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n }): Record<\"value\" | \"rawValue\", Record<string, any>>;\n}\n\ninterface ProcessFromIndex {\n (params: {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue?: Record<string, any> | null;\n getFieldIndexPlugin: (fieldType: string) => CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin: (fieldType: string) => CmsModelFieldToGraphQLPlugin;\n plugins: PluginsContainer;\n model: CmsModel;\n }): Record<string, any>;\n}\n\ninterface ReducerValue {\n value: {\n [key: string]: string;\n };\n rawValue: {\n [key: string]: string;\n };\n}\n\nconst processToIndex: ProcessToIndex = ({\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins,\n model\n}) => {\n const reducer = (values: ReducerValue, field: CmsModelField) => {\n const plugin = getFieldIndexPlugin(field.type);\n if (!plugin || !plugin.toIndex) {\n return values;\n }\n\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const { value, rawValue } = plugin.toIndex({\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins\n });\n\n if (value !== undefined) {\n values.value[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n if (rawValue !== undefined) {\n values.rawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] =\n rawValue;\n }\n\n return values;\n };\n\n return fields.reduce(reducer, { value: {}, rawValue: {} });\n};\nconst processFromIndex: ProcessFromIndex = ({\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins,\n model\n}) => {\n const reducer = (values: Record<string, string>, field: CmsModelField) => {\n const plugin = getFieldIndexPlugin(field.type);\n if (!plugin || !plugin.fromIndex) {\n return values;\n }\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const value = plugin.fromIndex({\n plugins,\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue\n ? sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier]\n : null,\n getFieldIndexPlugin,\n getFieldTypePlugin\n });\n\n if (value !== undefined) {\n values[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n\n return values;\n };\n\n return fields.reduce(reducer, {});\n};\n\ninterface ToIndexMultipleFieldValue {\n value: Record<string, string>[];\n rawValue: Record<string, string>[];\n}\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-object\",\n fieldType: \"object\",\n toIndex({\n plugins,\n model,\n field,\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin\n }) {\n if (!initialValue) {\n return {\n value: null\n };\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n /**\n * In \"object\" field, value is either an object or an array of objects.\n */\n if (field.multipleValues) {\n const result: ToIndexMultipleFieldValue = {\n value: [],\n rawValue: []\n };\n for (const key in initialValue) {\n const { value, rawValue } = processToIndex({\n value: initialValue[key],\n rawValue: initialRawValue[key],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n\n result.value.push(value);\n result.rawValue.push(rawValue);\n }\n\n return {\n value: result.value.length > 0 ? result.value : undefined,\n rawValue: result.rawValue.length > 0 ? result.rawValue : undefined\n };\n }\n\n return processToIndex({\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n },\n fromIndex({ field, value, rawValue, model, plugins, getFieldIndexPlugin, getFieldTypePlugin }) {\n if (!value) {\n return null;\n }\n\n const fields = field.settings?.fields || [];\n\n /**\n * In \"object\" field, value is either an object or an array of objects.\n */\n if (field.multipleValues) {\n /**\n * Why this `value || rawValue || []`?\n * It's possible that an object contains all non-indexable fields, or vice-versa, and so\n * we can never be sure which array we can reliably use as a source of values.\n */\n const source = value || rawValue || [];\n\n return source.map((_: any, index: number) =>\n processFromIndex({\n value: value ? value[index] || {} : {},\n rawValue: rawValue ? rawValue[index] || {} : {},\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n })\n );\n }\n\n return processFromIndex({\n value,\n rawValue,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n model,\n plugins,\n fields\n });\n }\n});\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export default () => ({
|
|
2
|
-
type: "cms-model-field-to-elastic-search",
|
|
3
|
-
name: "cms-model-field-to-elastic-search-rich-text",
|
|
4
|
-
fieldType: "rich-text",
|
|
5
|
-
toIndex({
|
|
6
|
-
value
|
|
7
|
-
}) {
|
|
8
|
-
// TODO: convert rich-text object to a searchable string to offer full-text search at some point
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* We want to store rich-text value as a "rawValue", meaning it wont' be indexed by ES.
|
|
12
|
-
*/
|
|
13
|
-
return {
|
|
14
|
-
rawValue: value
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
fromIndex({
|
|
18
|
-
rawValue
|
|
19
|
-
}) {
|
|
20
|
-
return rawValue;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=richTextIndexing.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["type","name","fieldType","toIndex","value","rawValue","fromIndex"],"sources":["richTextIndexing.ts"],"sourcesContent":["import type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-rich-text\",\n fieldType: \"rich-text\",\n toIndex({ value }) {\n // TODO: convert rich-text object to a searchable string to offer full-text search at some point\n\n /**\n * We want to store rich-text value as a \"rawValue\", meaning it wont' be indexed by ES.\n */\n return {\n rawValue: value\n };\n },\n fromIndex({ rawValue }) {\n return rawValue;\n }\n});\n"],"mappings":"AAEA,eAAe,OAA2C;EACtDA,IAAI,EAAE,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAOA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACf;;IAEA;AACR;AACA;IACQ,OAAO;MACHC,QAAQ,EAAED;IACd,CAAC;EACL,CAAC;EACDE,SAASA,CAAC;IAAED;EAAS,CAAC,EAAE;IACpB,OAAOA,QAAQ;EACnB;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { getBaseConfiguration } from "@webiny/api-elasticsearch";
|
|
2
|
-
import { CmsEntryElasticsearchIndexPlugin } from "../../plugins/CmsEntryElasticsearchIndexPlugin.js";
|
|
3
|
-
export const base = new CmsEntryElasticsearchIndexPlugin({
|
|
4
|
-
body: getBaseConfiguration()
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
//# sourceMappingURL=base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getBaseConfiguration","CmsEntryElasticsearchIndexPlugin","base","body"],"sources":["base.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-elasticsearch\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin.js\";\n\nexport const base = new CmsEntryElasticsearchIndexPlugin({\n body: getBaseConfiguration()\n});\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ,2BAA2B;AAChE,SAASC,gCAAgC;AAEzC,OAAO,MAAMC,IAAI,GAAG,IAAID,gCAAgC,CAAC;EACrDE,IAAI,EAAEH,oBAAoB,CAAC;AAC/B,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const elasticsearchIndexPlugins: () => import("../../index.js").CmsEntryElasticsearchIndexPlugin[];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["base","elasticsearchIndexPlugins"],"sources":["index.ts"],"sourcesContent":["import { base } from \"./base.js\";\n\nexport const elasticsearchIndexPlugins = () => {\n return [base];\n};\n"],"mappings":"AAAA,SAASA,IAAI;AAEb,OAAO,MAAMC,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,OAAO,CAACD,IAAI,CAAC;AACjB,CAAC","ignoreList":[]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { createTimeSearchPlugin } from "./timeSearch.js";
|
|
2
|
-
import { createRefSearchPlugin } from "./refSearch.js";
|
|
3
|
-
import { createSearchableJsonSearchPlugin } from "./searchableJson.js";
|
|
4
|
-
export default () => [createTimeSearchPlugin(), createRefSearchPlugin(), createSearchableJsonSearchPlugin()];
|
|
5
|
-
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createTimeSearchPlugin","createRefSearchPlugin","createSearchableJsonSearchPlugin"],"sources":["index.ts"],"sourcesContent":["import { createTimeSearchPlugin } from \"./timeSearch.js\";\nimport { createRefSearchPlugin } from \"./refSearch.js\";\nimport { createSearchableJsonSearchPlugin } from \"./searchableJson.js\";\nimport type { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\n\nexport default (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin[] => [\n createTimeSearchPlugin(),\n createRefSearchPlugin(),\n createSearchableJsonSearchPlugin()\n];\n"],"mappings":"AAAA,SAASA,sBAAsB;AAC/B,SAASC,qBAAqB;AAC9B,SAASC,gCAAgC;AAGzC,eAAe,MAA4D,CACvEF,sBAAsB,CAAC,CAAC,EACxBC,qBAAqB,CAAC,CAAC,EACvBC,gCAAgC,CAAC,CAAC,CACrC","ignoreList":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
|
|
2
|
-
const createPath = ({
|
|
3
|
-
field,
|
|
4
|
-
key
|
|
5
|
-
}) => {
|
|
6
|
-
if (key && key.match("entryId") === null) {
|
|
7
|
-
return `${field.storageId}.id`;
|
|
8
|
-
}
|
|
9
|
-
return `${field.storageId}.entryId`;
|
|
10
|
-
};
|
|
11
|
-
const transform = ({
|
|
12
|
-
value
|
|
13
|
-
}) => {
|
|
14
|
-
return value;
|
|
15
|
-
};
|
|
16
|
-
export const createRefSearchPlugin = () => {
|
|
17
|
-
return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
|
|
18
|
-
fieldType: "ref",
|
|
19
|
-
path: createPath,
|
|
20
|
-
transform
|
|
21
|
-
});
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=refSearch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","createPath","field","key","match","storageId","transform","value","createRefSearchPlugin","fieldType","path"],"sources":["refSearch.ts"],"sourcesContent":["import type {\n CreatePathCallable,\n TransformCallable\n} from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\nimport { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\n\nconst createPath: CreatePathCallable<string> = ({ field, key }) => {\n if (key && key.match(\"entryId\") === null) {\n return `${field.storageId}.id`;\n }\n return `${field.storageId}.entryId`;\n};\n\nconst transform: TransformCallable = ({ value }) => {\n return value;\n};\n\nexport const createRefSearchPlugin = (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"ref\",\n path: createPath,\n transform\n });\n};\n"],"mappings":"AAIA,SAASA,kDAAkD;AAE3D,MAAMC,UAAsC,GAAGA,CAAC;EAAEC,KAAK;EAAEC;AAAI,CAAC,KAAK;EAC/D,IAAIA,GAAG,IAAIA,GAAG,CAACC,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACtC,OAAO,GAAGF,KAAK,CAACG,SAAS,KAAK;EAClC;EACA,OAAO,GAAGH,KAAK,CAACG,SAAS,UAAU;AACvC,CAAC;AAED,MAAMC,SAA4B,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EAChD,OAAOA,KAAK;AAChB,CAAC;AAED,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAA0D;EAC3F,OAAO,IAAIR,kDAAkD,CAAC;IAC1DS,SAAS,EAAE,KAAK;IAChBC,IAAI,EAAET,UAAU;IAChBK;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
|
|
2
|
-
import { WebinyError } from "@webiny/error";
|
|
3
|
-
import { NoValueContainer } from "../../values/NoValueContainer.js";
|
|
4
|
-
const getKey = params => {
|
|
5
|
-
const {
|
|
6
|
-
field,
|
|
7
|
-
value
|
|
8
|
-
} = params;
|
|
9
|
-
const keys = Object.keys(value);
|
|
10
|
-
if (keys.length === 0) {
|
|
11
|
-
throw new WebinyError(`Searchable JSON field "${field.fieldId}" cannot be empty.`, "EMPTY_SEARCHABLE_JSON_FIELD", {
|
|
12
|
-
field,
|
|
13
|
-
value
|
|
14
|
-
});
|
|
15
|
-
} else if (keys.length > 1) {
|
|
16
|
-
throw new WebinyError(`Searchable JSON field "${field.fieldId}" can only have one key.`, "MULTIPLE_KEYS_IN_SEARCHABLE_JSON_FIELD", {
|
|
17
|
-
field,
|
|
18
|
-
value,
|
|
19
|
-
keys
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return keys[0];
|
|
23
|
-
};
|
|
24
|
-
export const createSearchableJsonSearchPlugin = () => {
|
|
25
|
-
return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
|
|
26
|
-
fieldType: "searchable-json",
|
|
27
|
-
transform: params => {
|
|
28
|
-
const {
|
|
29
|
-
value
|
|
30
|
-
} = params;
|
|
31
|
-
if (NoValueContainer.is(value)) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
const key = getKey(params);
|
|
35
|
-
return value[key] || null;
|
|
36
|
-
},
|
|
37
|
-
path: params => {
|
|
38
|
-
const {
|
|
39
|
-
field
|
|
40
|
-
} = params;
|
|
41
|
-
if (NoValueContainer.is(params.originalValue)) {
|
|
42
|
-
return `${field.storageId}.unknown`;
|
|
43
|
-
}
|
|
44
|
-
const key = getKey({
|
|
45
|
-
field,
|
|
46
|
-
value: params.originalValue
|
|
47
|
-
});
|
|
48
|
-
return `${field.storageId}.${key}`;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
//# sourceMappingURL=searchableJson.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","WebinyError","NoValueContainer","getKey","params","field","value","keys","Object","length","fieldId","createSearchableJsonSearchPlugin","fieldType","transform","is","key","path","originalValue","storageId"],"sources":["searchableJson.ts"],"sourcesContent":["import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\nimport { WebinyError } from \"@webiny/error\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { NoValueContainer } from \"~/values/NoValueContainer.js\";\n\ninterface IGetKeyParams {\n field: CmsModelField;\n value: {\n [key: string]: any;\n };\n}\n\nconst getKey = (params: IGetKeyParams): string => {\n const { field, value } = params;\n const keys = Object.keys(value);\n if (keys.length === 0) {\n throw new WebinyError(\n `Searchable JSON field \"${field.fieldId}\" cannot be empty.`,\n \"EMPTY_SEARCHABLE_JSON_FIELD\",\n {\n field,\n value\n }\n );\n } else if (keys.length > 1) {\n throw new WebinyError(\n `Searchable JSON field \"${field.fieldId}\" can only have one key.`,\n \"MULTIPLE_KEYS_IN_SEARCHABLE_JSON_FIELD\",\n {\n field,\n value,\n keys\n }\n );\n }\n return keys[0];\n};\n\nexport const createSearchableJsonSearchPlugin =\n (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"searchable-json\",\n transform: params => {\n const { value } = params;\n\n if (NoValueContainer.is(value)) {\n return null;\n }\n\n const key = getKey(params);\n return value[key] || null;\n },\n path: params => {\n const { field } = params;\n\n if (NoValueContainer.is(params.originalValue)) {\n return `${field.storageId}.unknown`;\n }\n\n const key = getKey({\n field,\n value: params.originalValue\n });\n\n return `${field.storageId}.${key}`;\n }\n });\n };\n"],"mappings":"AAAA,SAASA,kDAAkD;AAC3D,SAASC,WAAW,QAAQ,eAAe;AAE3C,SAASC,gBAAgB;AASzB,MAAMC,MAAM,GAAIC,MAAqB,IAAa;EAC9C,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAC/B,MAAMG,IAAI,GAAGC,MAAM,CAACD,IAAI,CAACD,KAAK,CAAC;EAC/B,IAAIC,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE;IACnB,MAAM,IAAIR,WAAW,CACjB,0BAA0BI,KAAK,CAACK,OAAO,oBAAoB,EAC3D,6BAA6B,EAC7B;MACIL,KAAK;MACLC;IACJ,CACJ,CAAC;EACL,CAAC,MAAM,IAAIC,IAAI,CAACE,MAAM,GAAG,CAAC,EAAE;IACxB,MAAM,IAAIR,WAAW,CACjB,0BAA0BI,KAAK,CAACK,OAAO,0BAA0B,EACjE,wCAAwC,EACxC;MACIL,KAAK;MACLC,KAAK;MACLC;IACJ,CACJ,CAAC;EACL;EACA,OAAOA,IAAI,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,OAAO,MAAMI,gCAAgC,GACzCA,CAAA,KAA0D;EACtD,OAAO,IAAIX,kDAAkD,CAAC;IAC1DY,SAAS,EAAE,iBAAiB;IAC5BC,SAAS,EAAET,MAAM,IAAI;MACjB,MAAM;QAAEE;MAAM,CAAC,GAAGF,MAAM;MAExB,IAAIF,gBAAgB,CAACY,EAAE,CAACR,KAAK,CAAC,EAAE;QAC5B,OAAO,IAAI;MACf;MAEA,MAAMS,GAAG,GAAGZ,MAAM,CAACC,MAAM,CAAC;MAC1B,OAAOE,KAAK,CAACS,GAAG,CAAC,IAAI,IAAI;IAC7B,CAAC;IACDC,IAAI,EAAEZ,MAAM,IAAI;MACZ,MAAM;QAAEC;MAAM,CAAC,GAAGD,MAAM;MAExB,IAAIF,gBAAgB,CAACY,EAAE,CAACV,MAAM,CAACa,aAAa,CAAC,EAAE;QAC3C,OAAO,GAAGZ,KAAK,CAACa,SAAS,UAAU;MACvC;MAEA,MAAMH,GAAG,GAAGZ,MAAM,CAAC;QACfE,KAAK;QACLC,KAAK,EAAEF,MAAM,CAACa;MAClB,CAAC,CAAC;MAEF,OAAO,GAAGZ,KAAK,CAACa,SAAS,IAAIH,GAAG,EAAE;IACtC;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from "../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js";
|
|
2
|
-
const transform = params => {
|
|
3
|
-
const {
|
|
4
|
-
field,
|
|
5
|
-
value
|
|
6
|
-
} = params;
|
|
7
|
-
if (!value || field.settings?.type !== "time") {
|
|
8
|
-
return value;
|
|
9
|
-
}
|
|
10
|
-
const [hours, minutes, seconds = 0] = value.split(":").map(Number);
|
|
11
|
-
return hours * 60 * 60 + minutes * 60 + seconds;
|
|
12
|
-
};
|
|
13
|
-
export const createTimeSearchPlugin = () => {
|
|
14
|
-
return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
|
|
15
|
-
fieldType: "datetime",
|
|
16
|
-
transform
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=timeSearch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","transform","params","field","value","settings","type","hours","minutes","seconds","split","map","Number","createTimeSearchPlugin","fieldType"],"sources":["timeSearch.ts"],"sourcesContent":["import type { TransformCallable } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\nimport { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js\";\n\nconst transform: TransformCallable = params => {\n const { field, value } = params;\n if (!value || field.settings?.type !== \"time\") {\n return value;\n }\n const [hours, minutes, seconds = 0] = value.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nexport const createTimeSearchPlugin = (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"datetime\",\n transform\n });\n};\n"],"mappings":"AACA,SAASA,kDAAkD;AAE3D,MAAMC,SAA4B,GAAGC,MAAM,IAAI;EAC3C,MAAM;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAC/B,IAAI,CAACE,KAAK,IAAID,KAAK,CAACE,QAAQ,EAAEC,IAAI,KAAK,MAAM,EAAE;IAC3C,OAAOF,KAAK;EAChB;EACA,MAAM,CAACG,KAAK,EAAEC,OAAO,EAAEC,OAAO,GAAG,CAAC,CAAC,GAAGL,KAAK,CAACM,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAClE,OAAOL,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,GAAGC,OAAO;AACnD,CAAC;AAED,OAAO,MAAMI,sBAAsB,GAAGA,CAAA,KAA0D;EAC5F,OAAO,IAAIb,kDAAkD,CAAC;IAC1Dc,SAAS,EAAE,UAAU;IACrBb;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/helpers/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./entryIndexHelpers.js\";\nexport * from \"./fieldIdentifier.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|