@webiny/api-headless-cms-ddb-es 0.0.0-unstable.78f581c1d2 → 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/README.md +6 -30
- package/configurations.d.ts +13 -6
- package/configurations.js +28 -40
- package/configurations.js.map +1 -1
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +9 -88
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +9 -68
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +9 -90
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/elasticsearch/createElasticsearchIndex.d.ts +5 -5
- package/elasticsearch/createElasticsearchIndex.js +53 -56
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +3 -3
- package/elasticsearch/deleteElasticsearchIndex.js +20 -40
- 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 +13 -11
- package/helpers/entryIndexHelpers.js +72 -196
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.d.ts +6 -0
- package/helpers/fieldIdentifier.js +23 -0
- package/helpers/fieldIdentifier.js.map +1 -0
- package/helpers/index.d.ts +2 -2
- package/helpers/index.js +2 -31
- package/index.d.ts +1 -3
- package/index.js +1 -268
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +27 -0
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
- package/operations/entry/dataLoader/constants.d.ts +1 -0
- package/operations/entry/dataLoader/constants.js +5 -0
- package/operations/entry/dataLoader/constants.js.map +1 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js +10 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js +24 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +34 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +34 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
- package/operations/entry/dataLoader/getRevisionById.js +40 -0
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
- package/operations/entry/dataLoader/index.d.ts +8 -0
- package/operations/entry/dataLoader/index.js +18 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +6 -0
- package/operations/entry/dataLoader/types.js +0 -0
- package/operations/entry/dataLoaders.d.ts +17 -38
- package/operations/entry/dataLoaders.js +82 -357
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +9 -0
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
- package/operations/entry/elasticsearch/body.d.ts +29 -0
- package/operations/entry/elasticsearch/body.js +87 -0
- package/operations/entry/elasticsearch/body.js.map +1 -0
- 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 +12 -0
- package/operations/entry/elasticsearch/fields.js +207 -0
- package/operations/entry/elasticsearch/fields.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +9 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +39 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/exec.d.ts +22 -0
- package/operations/entry/elasticsearch/filtering/exec.js +96 -0
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/index.d.ts +1 -0
- package/operations/entry/elasticsearch/filtering/index.js +1 -0
- package/operations/entry/elasticsearch/filtering/path.d.ts +17 -0
- package/operations/entry/elasticsearch/filtering/path.js +27 -0
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/populated.js +12 -0
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/values.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/values.js +15 -0
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -0
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +13 -0
- package/operations/entry/elasticsearch/fullTextSearch.js +51 -0
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +8 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.js +10 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -0
- package/operations/entry/elasticsearch/initialQuery.d.ts +17 -0
- package/operations/entry/elasticsearch/initialQuery.js +45 -0
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -0
- package/operations/entry/elasticsearch/keyword.d.ts +2 -0
- package/operations/entry/elasticsearch/keyword.js +17 -0
- package/operations/entry/elasticsearch/keyword.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/operator.d.ts +7 -0
- package/operations/entry/elasticsearch/plugins/operator.js +13 -0
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +8 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
- package/operations/entry/elasticsearch/sort.d.ts +12 -0
- package/operations/entry/elasticsearch/sort.js +80 -0
- package/operations/entry/elasticsearch/sort.js.map +1 -0
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +9 -0
- package/operations/entry/elasticsearch/transformValueForSearch.js +12 -0
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -0
- package/operations/entry/elasticsearch/types.d.ts +34 -0
- package/operations/entry/elasticsearch/types.js +0 -0
- package/operations/entry/index.d.ts +27 -8
- package/operations/entry/index.js +1344 -1245
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +45 -35
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.d.ts +3 -0
- package/operations/entry/recordType.js +6 -0
- package/operations/entry/recordType.js.map +1 -0
- package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
- package/operations/entry/transformations/convertEntryKeys.js +25 -0
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
- package/operations/entry/transformations/index.d.ts +33 -0
- package/operations/entry/transformations/index.js +91 -0
- package/operations/entry/transformations/index.js.map +1 -0
- package/operations/entry/transformations/modifyEntryValues.d.ts +53 -0
- package/operations/entry/transformations/modifyEntryValues.js +16 -0
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
- package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
- package/operations/entry/transformations/transformEntryKeys.js +17 -0
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
- package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -0
- package/operations/entry/transformations/transformEntryToIndex.js +20 -0
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -0
- package/operations/group/index.d.ts +7 -6
- package/operations/group/index.js +116 -190
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +4 -4
- package/operations/model/index.js +130 -199
- package/operations/model/index.js.map +1 -1
- package/package.json +44 -41
- package/tasks/createIndexTaskPlugin.d.ts +2 -0
- package/tasks/createIndexTaskPlugin.js +45 -0
- package/tasks/createIndexTaskPlugin.js.map +1 -0
- package/types.d.ts +34 -137
- package/types.js +10 -47
- package/types.js.map +1 -1
- package/values/NoValueContainer.d.ts +5 -0
- package/values/NoValueContainer.js +11 -0
- package/values/NoValueContainer.js.map +1 -0
- package/definitions/entryElasticsearch.d.ts +0 -8
- package/definitions/entryElasticsearch.js +0 -42
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/settings.d.ts +0 -8
- package/definitions/settings.js +0 -58
- package/definitions/settings.js.map +0 -1
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -46
- package/definitions/system.js.map +0 -1
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -24
- package/definitions/table.js.map +0 -1
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -24
- package/definitions/tableElasticsearch.js.map +0 -1
- package/dynamoDb/index.d.ts +0 -2
- package/dynamoDb/index.js +0 -16
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -2
- package/dynamoDb/storage/date.js +0 -99
- package/dynamoDb/storage/date.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -101
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -7
- package/dynamoDb/storage/richText.js +0 -128
- package/dynamoDb/storage/richText.js.map +0 -1
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -16
- package/elasticsearch/index.js.map +0 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js +0 -103
- 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 -24
- package/elasticsearch/indexing/index.js.map +0 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/longTextIndexing.js +0 -36
- package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js +0 -48
- package/elasticsearch/indexing/numberIndexing.js.map +0 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
- package/elasticsearch/indexing/objectIndexing.js +0 -223
- package/elasticsearch/indexing/objectIndexing.js.map +0 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -34
- package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
- package/elasticsearch/indices/base.d.ts +0 -2
- package/elasticsearch/indices/base.js +0 -15
- package/elasticsearch/indices/base.js.map +0 -1
- package/elasticsearch/indices/index.d.ts +0 -1
- package/elasticsearch/indices/index.js +0 -16
- package/elasticsearch/indices/index.js.map +0 -1
- package/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -16
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -14
- package/elasticsearch/search/index.js.map +0 -1
- package/elasticsearch/search/refSearch.d.ts +0 -2
- package/elasticsearch/search/refSearch.js +0 -33
- package/elasticsearch/search/refSearch.js.map +0 -1
- package/elasticsearch/search/timeSearch.d.ts +0 -2
- package/elasticsearch/search/timeSearch.js +0 -33
- package/elasticsearch/search/timeSearch.js.map +0 -1
- package/helpers/createElasticsearchQueryBody.d.ts +0 -11
- package/helpers/createElasticsearchQueryBody.js +0 -611
- package/helpers/createElasticsearchQueryBody.js.map +0 -1
- package/helpers/fields.d.ts +0 -19
- package/helpers/fields.js +0 -205
- package/helpers/fields.js.map +0 -1
- package/helpers/index.js.map +0 -1
- package/helpers/searchPluginsList.d.ts +0 -6
- package/helpers/searchPluginsList.js +0 -26
- package/helpers/searchPluginsList.js.map +0 -1
- package/helpers/transformValueForSearch.d.ts +0 -12
- package/helpers/transformValueForSearch.js +0 -29
- package/helpers/transformValueForSearch.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/entry/elasticsearchFields.d.ts +0 -2
- package/operations/entry/elasticsearchFields.js +0 -38
- package/operations/entry/elasticsearchFields.js.map +0 -1
- package/operations/settings/index.d.ts +0 -6
- package/operations/settings/index.js +0 -135
- package/operations/settings/index.js.map +0 -1
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -99
- package/operations/system/index.js.map +0 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -20
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -17
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -30
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -43
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -17
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -17
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -6
- package/plugins/index.js +0 -83
- package/plugins/index.js.map +0 -1
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _default = () => ({
|
|
9
|
-
type: "cms-model-field-to-elastic-search",
|
|
10
|
-
name: "cms-model-field-to-elastic-search-long-text",
|
|
11
|
-
fieldType: "long-text",
|
|
12
|
-
|
|
13
|
-
toIndex({
|
|
14
|
-
rawValue
|
|
15
|
-
}) {
|
|
16
|
-
/**
|
|
17
|
-
* We want to store the value (rawValue) from entry before it was prepared for storage as value to be searched on.
|
|
18
|
-
* And we want to store prepared value into rawValue so it is not indexed.
|
|
19
|
-
*/
|
|
20
|
-
return {
|
|
21
|
-
value: rawValue ? encodeURIComponent(rawValue) : ""
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* When extracting from index, we can return the value that was stored to be searched - and then no decompression will be required.
|
|
27
|
-
*/
|
|
28
|
-
fromIndex({
|
|
29
|
-
value
|
|
30
|
-
}) {
|
|
31
|
-
return value ? decodeURIComponent(value) : "";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["type","name","fieldType","toIndex","rawValue","value","encodeURIComponent","fromIndex","decodeURIComponent"],"sources":["longTextIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\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 want to store the value (rawValue) from entry before it was prepared for storage as value to be searched on.\n * And we want to store prepared value into rawValue so it is not indexed.\n */\n return {\n value: rawValue ? encodeURIComponent(rawValue) : \"\"\n };\n },\n /**\n * When extracting from index, we can return the value that was stored to be searched - and then no decompression will be required.\n */\n fromIndex({ value }) {\n return value ? decodeURIComponent(value) : \"\";\n }\n});\n"],"mappings":";;;;;;;eAEe,OAA2C;EACtDA,IAAI,EAAE,mCADgD;EAEtDC,IAAI,EAAE,6CAFgD;EAGtDC,SAAS,EAAE,WAH2C;;EAItDC,OAAO,CAAC;IAAEC;EAAF,CAAD,EAAe;IAClB;AACR;AACA;AACA;IACQ,OAAO;MACHC,KAAK,EAAED,QAAQ,GAAGE,kBAAkB,CAACF,QAAD,CAArB,GAAkC;IAD9C,CAAP;EAGH,CAZqD;;EAatD;AACJ;AACA;EACIG,SAAS,CAAC;IAAEF;EAAF,CAAD,EAAY;IACjB,OAAOA,KAAK,GAAGG,kBAAkB,CAACH,KAAD,CAArB,GAA+B,EAA3C;EACH;;AAlBqD,CAA3C,C"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
const convertToString = value => {
|
|
9
|
-
if (Array.isArray(value) === false) {
|
|
10
|
-
return value;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return value.map(String);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const convertToFloat = value => {
|
|
17
|
-
if (Array.isArray(value) === false) {
|
|
18
|
-
return typeof value === "string" ? parseFloat(value) : value;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return value.map(v => parseFloat(v));
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
var _default = () => ({
|
|
25
|
-
type: "cms-model-field-to-elastic-search",
|
|
26
|
-
name: "cms-model-field-to-elastic-search-number",
|
|
27
|
-
fieldType: "number",
|
|
28
|
-
unmappedType: () => {
|
|
29
|
-
return "float";
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
toIndex({
|
|
33
|
-
value
|
|
34
|
-
}) {
|
|
35
|
-
return {
|
|
36
|
-
value: convertToString(value)
|
|
37
|
-
};
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
fromIndex({
|
|
41
|
-
value
|
|
42
|
-
}) {
|
|
43
|
-
return convertToFloat(value);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
exports.default = _default;
|
|
@@ -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 { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\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,KAAD,IAA8B;EAClD,IAAIC,KAAK,CAACC,OAAN,CAAcF,KAAd,MAAyB,KAA7B,EAAoC;IAChC,OAAOA,KAAP;EACH;;EACD,OAAQA,KAAD,CAAoBG,GAApB,CAAwBC,MAAxB,CAAP;AACH,CALD;;AAOA,MAAMC,cAAc,GAAIL,KAAD,IAA8B;EACjD,IAAIC,KAAK,CAACC,OAAN,CAAcF,KAAd,MAAyB,KAA7B,EAAoC;IAChC,OAAO,OAAOA,KAAP,KAAiB,QAAjB,GAA4BM,UAAU,CAACN,KAAD,CAAtC,GAAgDA,KAAvD;EACH;;EACD,OAAQA,KAAD,CAAoBG,GAApB,CAAwBI,CAAC,IAAID,UAAU,CAACC,CAAD,CAAvC,CAAP;AACH,CALD;;eAOe,OAA2C;EACtDC,IAAI,EAAE,mCADgD;EAEtDC,IAAI,EAAE,0CAFgD;EAGtDC,SAAS,EAAE,QAH2C;EAItDC,YAAY,EAAE,MAAM;IAChB,OAAO,OAAP;EACH,CANqD;;EAOtDC,OAAO,CAAC;IAAEZ;EAAF,CAAD,EAAY;IACf,OAAO;MACHA,KAAK,EAAED,eAAe,CAACC,KAAD;IADnB,CAAP;EAGH,CAXqD;;EAYtDa,SAAS,CAAC;IAAEb;EAAF,CAAD,EAAY;IACjB,OAAOK,cAAc,CAACL,KAAD,CAArB;EACH;;AAdqD,CAA3C,C"}
|
|
@@ -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 { CmsModelFieldToElasticsearchPlugin } from "../../types";
|
|
11
|
-
declare const _default: () => CmsModelFieldToElasticsearchPlugin;
|
|
12
|
-
export default _default;
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* TODO remove rawValue when field aliases and field types targeting will be active.
|
|
10
|
-
*
|
|
11
|
-
* Currently we use rawValue for the values that we do not want to be indexed.
|
|
12
|
-
* When field aliases and types in the value path will be active, we can target the keys directly.
|
|
13
|
-
*
|
|
14
|
-
* This change will be incompatible with the current systems so we will need to release a major version.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
const processToIndex = ({
|
|
18
|
-
fields,
|
|
19
|
-
value: sourceValue,
|
|
20
|
-
rawValue: sourceRawValue,
|
|
21
|
-
getFieldIndexPlugin,
|
|
22
|
-
getFieldTypePlugin,
|
|
23
|
-
plugins,
|
|
24
|
-
model
|
|
25
|
-
}) => {
|
|
26
|
-
const reducer = (values, field) => {
|
|
27
|
-
const plugin = getFieldIndexPlugin(field.type);
|
|
28
|
-
|
|
29
|
-
if (!plugin || !plugin.toIndex) {
|
|
30
|
-
return values;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const {
|
|
34
|
-
value,
|
|
35
|
-
rawValue
|
|
36
|
-
} = plugin.toIndex({
|
|
37
|
-
model,
|
|
38
|
-
field,
|
|
39
|
-
value: sourceValue[field.storageId],
|
|
40
|
-
rawValue: sourceRawValue[field.storageId],
|
|
41
|
-
getFieldIndexPlugin,
|
|
42
|
-
getFieldTypePlugin,
|
|
43
|
-
plugins
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
if (value !== undefined) {
|
|
47
|
-
values.value[field.storageId] = value;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (rawValue !== undefined) {
|
|
51
|
-
values.rawValue[field.storageId] = rawValue;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
return values;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
return fields.reduce(reducer, {
|
|
58
|
-
value: {},
|
|
59
|
-
rawValue: {}
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const processFromIndex = ({
|
|
64
|
-
fields,
|
|
65
|
-
value: sourceValue,
|
|
66
|
-
rawValue: sourceRawValue,
|
|
67
|
-
getFieldIndexPlugin,
|
|
68
|
-
getFieldTypePlugin,
|
|
69
|
-
plugins,
|
|
70
|
-
model
|
|
71
|
-
}) => {
|
|
72
|
-
const reducer = (values, field) => {
|
|
73
|
-
const plugin = getFieldIndexPlugin(field.type);
|
|
74
|
-
|
|
75
|
-
if (!plugin || !plugin.fromIndex) {
|
|
76
|
-
return values;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const value = plugin.fromIndex({
|
|
80
|
-
plugins,
|
|
81
|
-
model,
|
|
82
|
-
field,
|
|
83
|
-
value: sourceValue[field.storageId],
|
|
84
|
-
rawValue: sourceRawValue[field.storageId],
|
|
85
|
-
getFieldIndexPlugin,
|
|
86
|
-
getFieldTypePlugin
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
if (value !== undefined) {
|
|
90
|
-
values[field.storageId] = value;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
return values;
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
return fields.reduce(reducer, {});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
var _default = () => ({
|
|
100
|
-
type: "cms-model-field-to-elastic-search",
|
|
101
|
-
name: "cms-model-field-to-elastic-search-object",
|
|
102
|
-
fieldType: "object",
|
|
103
|
-
|
|
104
|
-
toIndex({
|
|
105
|
-
plugins,
|
|
106
|
-
model,
|
|
107
|
-
field,
|
|
108
|
-
value: initialValue,
|
|
109
|
-
rawValue: initialRawValue,
|
|
110
|
-
getFieldIndexPlugin,
|
|
111
|
-
getFieldTypePlugin
|
|
112
|
-
}) {
|
|
113
|
-
var _field$settings;
|
|
114
|
-
|
|
115
|
-
if (!initialValue) {
|
|
116
|
-
return {
|
|
117
|
-
value: null
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const fields = ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.fields) || [];
|
|
122
|
-
/**
|
|
123
|
-
* In "object" field, value is either an object or an array of objects.
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
if (field.multipleValues) {
|
|
127
|
-
const result = {
|
|
128
|
-
value: [],
|
|
129
|
-
rawValue: []
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
for (const key in initialValue) {
|
|
133
|
-
const {
|
|
134
|
-
value,
|
|
135
|
-
rawValue
|
|
136
|
-
} = processToIndex({
|
|
137
|
-
value: initialValue[key],
|
|
138
|
-
rawValue: initialRawValue[key],
|
|
139
|
-
getFieldIndexPlugin,
|
|
140
|
-
getFieldTypePlugin,
|
|
141
|
-
model,
|
|
142
|
-
plugins,
|
|
143
|
-
fields
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
if (Object.keys(value).length > 0) {
|
|
147
|
-
result.value.push(value);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if (Object.keys(rawValue).length > 0) {
|
|
151
|
-
result.rawValue.push(rawValue);
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return {
|
|
156
|
-
value: result.value.length > 0 ? result.value : undefined,
|
|
157
|
-
rawValue: result.rawValue.length > 0 ? result.rawValue : undefined
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return processToIndex({
|
|
162
|
-
value: initialValue,
|
|
163
|
-
rawValue: initialRawValue,
|
|
164
|
-
getFieldIndexPlugin,
|
|
165
|
-
getFieldTypePlugin,
|
|
166
|
-
model,
|
|
167
|
-
plugins,
|
|
168
|
-
fields
|
|
169
|
-
});
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
fromIndex({
|
|
173
|
-
field,
|
|
174
|
-
value,
|
|
175
|
-
rawValue,
|
|
176
|
-
model,
|
|
177
|
-
plugins,
|
|
178
|
-
getFieldIndexPlugin,
|
|
179
|
-
getFieldTypePlugin
|
|
180
|
-
}) {
|
|
181
|
-
var _field$settings2;
|
|
182
|
-
|
|
183
|
-
if (!value) {
|
|
184
|
-
return null;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
const fields = ((_field$settings2 = field.settings) === null || _field$settings2 === void 0 ? void 0 : _field$settings2.fields) || [];
|
|
188
|
-
/**
|
|
189
|
-
* In "object" field, value is either an object or an array of objects.
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
if (field.multipleValues) {
|
|
193
|
-
/**
|
|
194
|
-
* Why this `value || rawValue || []`?
|
|
195
|
-
* It's possible that an object contains all non-indexable fields, or vice-versa, and so
|
|
196
|
-
* we can never be sure which array we can reliably use as a source of values.
|
|
197
|
-
*/
|
|
198
|
-
const source = value || rawValue || [];
|
|
199
|
-
return source.map((_, index) => processFromIndex({
|
|
200
|
-
value: value ? value[index] || {} : {},
|
|
201
|
-
rawValue: rawValue ? rawValue[index] || {} : {},
|
|
202
|
-
getFieldIndexPlugin,
|
|
203
|
-
getFieldTypePlugin,
|
|
204
|
-
model,
|
|
205
|
-
plugins,
|
|
206
|
-
fields
|
|
207
|
-
}));
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return processFromIndex({
|
|
211
|
-
value,
|
|
212
|
-
rawValue,
|
|
213
|
-
getFieldIndexPlugin,
|
|
214
|
-
getFieldTypePlugin,
|
|
215
|
-
model,
|
|
216
|
-
plugins,
|
|
217
|
-
fields
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["processToIndex","fields","value","sourceValue","rawValue","sourceRawValue","getFieldIndexPlugin","getFieldTypePlugin","plugins","model","reducer","values","field","plugin","type","toIndex","storageId","undefined","reduce","processFromIndex","fromIndex","name","fieldType","initialValue","initialRawValue","settings","multipleValues","result","key","Object","keys","length","push","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 { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\nimport {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\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>;\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 const { value, rawValue } = plugin.toIndex({\n model,\n field,\n value: sourceValue[field.storageId],\n rawValue: sourceRawValue[field.storageId],\n getFieldIndexPlugin,\n getFieldTypePlugin,\n plugins\n });\n\n if (value !== undefined) {\n values.value[field.storageId] = value;\n }\n if (rawValue !== undefined) {\n values.rawValue[field.storageId] = 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 value = plugin.fromIndex({\n plugins,\n model,\n field,\n value: sourceValue[field.storageId],\n rawValue: sourceRawValue[field.storageId],\n getFieldIndexPlugin,\n getFieldTypePlugin\n });\n\n if (value !== undefined) {\n values[field.storageId] = 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 { value: null };\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 if (Object.keys(value).length > 0) {\n result.value.push(value);\n }\n\n if (Object.keys(rawValue).length > 0) {\n result.rawValue.push(rawValue);\n }\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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"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _default = () => ({
|
|
9
|
-
type: "cms-model-field-to-elastic-search",
|
|
10
|
-
name: "cms-model-field-to-elastic-search-rich-text",
|
|
11
|
-
fieldType: "rich-text",
|
|
12
|
-
|
|
13
|
-
toIndex({
|
|
14
|
-
value
|
|
15
|
-
}) {
|
|
16
|
-
// TODO: convert rich-text object to a searchable string to offer full-text search at some point
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* We want to store rich-text value as a "rawValue", meaning it wont' be indexed by ES.
|
|
20
|
-
*/
|
|
21
|
-
return {
|
|
22
|
-
rawValue: value
|
|
23
|
-
};
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
fromIndex({
|
|
27
|
-
rawValue
|
|
28
|
-
}) {
|
|
29
|
-
return rawValue;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["type","name","fieldType","toIndex","value","rawValue","fromIndex"],"sources":["richTextIndexing.ts"],"sourcesContent":["import { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\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":";;;;;;;eAEe,OAA2C;EACtDA,IAAI,EAAE,mCADgD;EAEtDC,IAAI,EAAE,6CAFgD;EAGtDC,SAAS,EAAE,WAH2C;;EAItDC,OAAO,CAAC;IAAEC;EAAF,CAAD,EAAY;IACf;;IAEA;AACR;AACA;IACQ,OAAO;MACHC,QAAQ,EAAED;IADP,CAAP;EAGH,CAbqD;;EActDE,SAAS,CAAC;IAAED;EAAF,CAAD,EAAe;IACpB,OAAOA,QAAP;EACH;;AAhBqD,CAA3C,C"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.base = void 0;
|
|
7
|
-
|
|
8
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
9
|
-
|
|
10
|
-
var _CmsEntryElasticsearchIndexPlugin = require("../../plugins/CmsEntryElasticsearchIndexPlugin");
|
|
11
|
-
|
|
12
|
-
const base = new _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin({
|
|
13
|
-
body: (0, _apiElasticsearch.getBaseConfiguration)()
|
|
14
|
-
});
|
|
15
|
-
exports.base = base;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["base","CmsEntryElasticsearchIndexPlugin","body","getBaseConfiguration"],"sources":["base.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-elasticsearch\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin\";\n\nexport const base = new CmsEntryElasticsearchIndexPlugin({\n body: getBaseConfiguration()\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,IAAI,GAAG,IAAIC,kEAAJ,CAAqC;EACrDC,IAAI,EAAE,IAAAC,sCAAA;AAD+C,CAArC,CAAb"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const elasticsearchIndexPlugins: () => import("../..").CmsEntryElasticsearchIndexPlugin[];
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.elasticsearchIndexPlugins = void 0;
|
|
7
|
-
|
|
8
|
-
var _base = require("./base");
|
|
9
|
-
|
|
10
|
-
var _japanese = require("./japanese");
|
|
11
|
-
|
|
12
|
-
const elasticsearchIndexPlugins = () => {
|
|
13
|
-
return [_base.base, _japanese.japanese];
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.elasticsearchIndexPlugins = elasticsearchIndexPlugins;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["elasticsearchIndexPlugins","base","japanese"],"sources":["index.ts"],"sourcesContent":["import { base } from \"./base\";\nimport { japanese } from \"./japanese\";\n\nexport const elasticsearchIndexPlugins = () => {\n return [base, japanese];\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,yBAAyB,GAAG,MAAM;EAC3C,OAAO,CAACC,UAAD,EAAOC,kBAAP,CAAP;AACH,CAFM"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.japanese = void 0;
|
|
7
|
-
|
|
8
|
-
var _CmsEntryElasticsearchIndexPlugin = require("../../plugins/CmsEntryElasticsearchIndexPlugin");
|
|
9
|
-
|
|
10
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
11
|
-
|
|
12
|
-
const japanese = new _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin({
|
|
13
|
-
body: (0, _apiElasticsearch.getJapaneseConfiguration)(),
|
|
14
|
-
locales: ["ja", "ja-jp"]
|
|
15
|
-
});
|
|
16
|
-
exports.japanese = japanese;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["japanese","CmsEntryElasticsearchIndexPlugin","body","getJapaneseConfiguration","locales"],"sources":["japanese.ts"],"sourcesContent":["import { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin\";\nimport { getJapaneseConfiguration } from \"@webiny/api-elasticsearch\";\n\nexport const japanese = new CmsEntryElasticsearchIndexPlugin({\n body: getJapaneseConfiguration(),\n locales: [\"ja\", \"ja-jp\"]\n});\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEO,MAAMA,QAAQ,GAAG,IAAIC,kEAAJ,CAAqC;EACzDC,IAAI,EAAE,IAAAC,0CAAA,GADmD;EAEzDC,OAAO,EAAE,CAAC,IAAD,EAAO,OAAP;AAFgD,CAArC,CAAjB"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _timeSearch = require("./timeSearch");
|
|
9
|
-
|
|
10
|
-
var _refSearch = require("./refSearch");
|
|
11
|
-
|
|
12
|
-
var _default = () => [(0, _timeSearch.createTimeSearchPlugin)(), (0, _refSearch.createRefSearchPlugin)()];
|
|
13
|
-
|
|
14
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createTimeSearchPlugin","createRefSearchPlugin"],"sources":["index.ts"],"sourcesContent":["import { createTimeSearchPlugin } from \"./timeSearch\";\nimport { createRefSearchPlugin } from \"./refSearch\";\nimport { CmsEntryElasticsearchQueryBuilderValueSearchPlugin } from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\n\nexport default (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin[] => [\n createTimeSearchPlugin(),\n createRefSearchPlugin()\n];\n"],"mappings":";;;;;;;AAAA;;AACA;;eAGe,MAA4D,CACvE,IAAAA,kCAAA,GADuE,EAEvE,IAAAC,gCAAA,GAFuE,C"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createRefSearchPlugin = void 0;
|
|
7
|
-
|
|
8
|
-
var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
|
|
9
|
-
|
|
10
|
-
const createPath = ({
|
|
11
|
-
field,
|
|
12
|
-
key
|
|
13
|
-
}) => {
|
|
14
|
-
if (key && key.match("entryId") === null) {
|
|
15
|
-
return `${field.storageId}.id`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return `${field.storageId}.entryId`;
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const transform = params => {
|
|
22
|
-
return params.value;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const createRefSearchPlugin = () => {
|
|
26
|
-
return new _CmsEntryElasticsearchQueryBuilderValueSearchPlugin.CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
|
|
27
|
-
fieldType: "ref",
|
|
28
|
-
path: createPath,
|
|
29
|
-
transform
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
exports.createRefSearchPlugin = createRefSearchPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createPath","field","key","match","storageId","transform","params","value","createRefSearchPlugin","CmsEntryElasticsearchQueryBuilderValueSearchPlugin","fieldType","path"],"sources":["refSearch.ts"],"sourcesContent":["import {\n CmsEntryElasticsearchQueryBuilderValueSearchPlugin,\n CreatePathCallable,\n TransformCallable\n} from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\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<string> = params => {\n return params.value;\n};\n\nexport const createRefSearchPlugin = (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"ref\",\n path: createPath,\n transform\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAMA,MAAMA,UAAsC,GAAG,CAAC;EAAEC,KAAF;EAASC;AAAT,CAAD,KAAoB;EAC/D,IAAIA,GAAG,IAAIA,GAAG,CAACC,KAAJ,CAAU,SAAV,MAAyB,IAApC,EAA0C;IACtC,OAAQ,GAAEF,KAAK,CAACG,SAAU,KAA1B;EACH;;EACD,OAAQ,GAAEH,KAAK,CAACG,SAAU,UAA1B;AACH,CALD;;AAOA,MAAMC,SAAoC,GAAGC,MAAM,IAAI;EACnD,OAAOA,MAAM,CAACC,KAAd;AACH,CAFD;;AAIO,MAAMC,qBAAqB,GAAG,MAA0D;EAC3F,OAAO,IAAIC,sGAAJ,CAAuD;IAC1DC,SAAS,EAAE,KAD+C;IAE1DC,IAAI,EAAEX,UAFoD;IAG1DK;EAH0D,CAAvD,CAAP;AAKH,CANM"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createTimeSearchPlugin = void 0;
|
|
7
|
-
|
|
8
|
-
var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
|
|
9
|
-
|
|
10
|
-
const transform = params => {
|
|
11
|
-
var _field$settings;
|
|
12
|
-
|
|
13
|
-
const {
|
|
14
|
-
field,
|
|
15
|
-
value
|
|
16
|
-
} = params;
|
|
17
|
-
|
|
18
|
-
if (!value || ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.type) !== "time") {
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const [hours, minutes, seconds = 0] = value.split(":").map(Number);
|
|
23
|
-
return hours * 60 * 60 + minutes * 60 + seconds;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
const createTimeSearchPlugin = () => {
|
|
27
|
-
return new _CmsEntryElasticsearchQueryBuilderValueSearchPlugin.CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
|
|
28
|
-
fieldType: "datetime",
|
|
29
|
-
transform
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
exports.createTimeSearchPlugin = createTimeSearchPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["transform","params","field","value","settings","type","hours","minutes","seconds","split","map","Number","createTimeSearchPlugin","CmsEntryElasticsearchQueryBuilderValueSearchPlugin","fieldType"],"sources":["timeSearch.ts"],"sourcesContent":["import {\n CmsEntryElasticsearchQueryBuilderValueSearchPlugin,\n TransformCallable\n} from \"~/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\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":";;;;;;;AAAA;;AAKA,MAAMA,SAA4B,GAAGC,MAAM,IAAI;EAAA;;EAC3C,MAAM;IAAEC,KAAF;IAASC;EAAT,IAAmBF,MAAzB;;EACA,IAAI,CAACE,KAAD,IAAU,oBAAAD,KAAK,CAACE,QAAN,oEAAgBC,IAAhB,MAAyB,MAAvC,EAA+C;IAC3C,OAAOF,KAAP;EACH;;EACD,MAAM,CAACG,KAAD,EAAQC,OAAR,EAAiBC,OAAO,GAAG,CAA3B,IAAgCL,KAAK,CAACM,KAAN,CAAY,GAAZ,EAAiBC,GAAjB,CAAqBC,MAArB,CAAtC;EACA,OAAOL,KAAK,GAAG,EAAR,GAAa,EAAb,GAAkBC,OAAO,GAAG,EAA5B,GAAiCC,OAAxC;AACH,CAPD;;AASO,MAAMI,sBAAsB,GAAG,MAA0D;EAC5F,OAAO,IAAIC,sGAAJ,CAAuD;IAC1DC,SAAS,EAAE,UAD+C;IAE1Dd;EAF0D,CAAvD,CAAP;AAIH,CALM"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CmsEntryListParams, CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import { SearchBody as esSearchBody } from "@webiny/api-elasticsearch/types";
|
|
3
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
4
|
-
interface CreateElasticsearchParams {
|
|
5
|
-
plugins: PluginsContainer;
|
|
6
|
-
model: CmsModel;
|
|
7
|
-
args: CmsEntryListParams;
|
|
8
|
-
parentPath?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const createElasticsearchQueryBody: (params: CreateElasticsearchParams) => esSearchBody;
|
|
11
|
-
export {};
|