@webiny/api-headless-cms-ddb-es 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.e6f0dc8ca7
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 +7 -7
- package/configurations.js +16 -26
- package/configurations.js.map +1 -1
- package/definitions/entry.d.ts +4 -6
- package/definitions/entry.js +5 -174
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -7
- package/definitions/group.js +5 -58
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -7
- package/definitions/model.js +5 -102
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +61 -0
- package/definitions/types.js +3 -0
- package/definitions/types.js.map +1 -0
- package/elasticsearch/createElasticsearchIndex.d.ts +4 -4
- package/elasticsearch/createElasticsearchIndex.js +61 -27
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +2 -2
- package/elasticsearch/deleteElasticsearchIndex.js +3 -10
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/exports/api/cms/opensearch.d.ts +9 -0
- package/exports/api/cms/opensearch.js +11 -0
- package/exports/api/cms/opensearch.js.map +1 -0
- package/feature.d.ts +1 -0
- package/feature.js +188 -0
- package/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +16 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.js +3 -0
- package/features/CmsEntryOpenSearchBodyModifier/index.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +13 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +36 -0
- package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +35 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +11 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.js +3 -0
- package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.js +24 -0
- package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +11 -0
- package/{elasticsearch/indexing/dateTimeIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js} +21 -32
- package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +39 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +22 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +25 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +11 -0
- package/{elasticsearch/indexing/numberIndexing.js → features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js} +11 -15
- package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +10 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +158 -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 +22 -0
- package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.js +5 -0
- package/features/CmsEntryOpenSearchFieldIndex/index.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +11 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +38 -0
- package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +37 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +4 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +4 -0
- package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/constants.d.ts +1 -0
- package/features/CmsEntryOpenSearchFilter/constants.js +3 -0
- package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchFilter/feature.js +16 -0
- package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +23 -0
- package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +61 -0
- package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +9 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +49 -0
- package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -0
- package/features/CmsEntryOpenSearchFilter/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchFilter/index.js +5 -0
- package/features/CmsEntryOpenSearchFilter/index.js.map +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +20 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.js +3 -0
- package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +11 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +16 -0
- package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +14 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchIndex/feature.js +10 -0
- package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchIndex/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchIndex/index.js +5 -0
- package/features/CmsEntryOpenSearchIndex/index.js.map +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +16 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.js +3 -0
- package/features/CmsEntryOpenSearchQueryModifier/index.js.map +1 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +15 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchSortModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchSortModifier/index.js +3 -0
- package/features/CmsEntryOpenSearchSortModifier/index.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +12 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +27 -0
- package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +22 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +4 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +4 -0
- package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +4 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.js +16 -0
- package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +23 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +55 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +10 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +24 -0
- package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -0
- package/features/CmsEntryOpenSearchValueSearch/index.d.ts +3 -0
- package/features/CmsEntryOpenSearchValueSearch/index.js +5 -0
- package/features/CmsEntryOpenSearchValueSearch/index.js.map +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +23 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +4 -0
- package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +1 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.js +3 -0
- package/features/CmsEntryOpenSearchValuesModifier/index.js.map +1 -0
- package/helpers/entryIndexHelpers.d.ts +13 -11
- package/helpers/entryIndexHelpers.js +38 -94
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.d.ts +1 -1
- package/helpers/fieldIdentifier.js +2 -10
- package/helpers/fieldIdentifier.js.map +1 -1
- package/helpers/index.d.ts +2 -2
- package/helpers/index.js +2 -27
- package/helpers/index.js.map +1 -1
- package/index.d.ts +1 -3
- package/index.js +1 -223
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -2
- package/operations/entry/dataLoader/DataLoaderCache.js +3 -13
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +1 -7
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +4 -10
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
- package/operations/entry/dataLoader/getAllEntryRevisions.js +16 -26
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +23 -31
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +23 -31
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
- package/operations/entry/dataLoader/getRevisionById.js +26 -34
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.d.ts +3 -3
- package/operations/entry/dataLoader/index.js +10 -31
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +4 -4
- package/operations/entry/dataLoader/types.js +1 -5
- package/operations/entry/dataLoader/types.js.map +1 -1
- package/operations/entry/dataLoaders.d.ts +13 -13
- package/operations/entry/dataLoaders.js +16 -24
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +1 -8
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
- package/operations/entry/elasticsearch/body.d.ts +20 -4
- package/operations/entry/elasticsearch/body.js +49 -53
- 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 +10 -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 +45 -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 +45 -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 +93 -0
- package/operations/entry/elasticsearch/fields/state.js.map +1 -0
- package/operations/entry/elasticsearch/fields.d.ts +8 -6
- package/operations/entry/elasticsearch/fields.js +38 -122
- 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 +13 -20
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +11 -6
- package/operations/entry/elasticsearch/filtering/exec.js +47 -97
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/index.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/index.js +1 -16
- package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +5 -3
- package/operations/entry/elasticsearch/filtering/path.js +10 -20
- 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 +1 -8
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/values.js +4 -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 +39 -42
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +4 -4
- package/operations/entry/elasticsearch/fullTextSearchFields.js +11 -18
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +4 -4
- package/operations/entry/elasticsearch/initialQuery.js +9 -27
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
- package/operations/entry/elasticsearch/keyword.d.ts +1 -1
- package/operations/entry/elasticsearch/keyword.js +4 -9
- package/operations/entry/elasticsearch/keyword.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -3
- package/operations/entry/elasticsearch/plugins/operator.js +4 -19
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +2 -9
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
- package/operations/entry/elasticsearch/sort.d.ts +6 -6
- package/operations/entry/elasticsearch/sort.js +52 -36
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +3 -10
- package/operations/entry/elasticsearch/transformValueForSearch.js +5 -20
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.d.ts +4 -11
- package/operations/entry/elasticsearch/types.js +1 -5
- package/operations/entry/elasticsearch/types.js.map +1 -1
- package/operations/entry/index.d.ts +26 -5
- package/operations/entry/index.js +421 -541
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +56 -19
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +3 -12
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
- package/operations/entry/transformations/convertEntryKeys.js +2 -10
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +24 -18
- package/operations/entry/transformations/index.js +31 -37
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +30 -35
- package/operations/entry/transformations/modifyEntryValues.js +4 -11
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
- package/operations/entry/transformations/transformEntryKeys.js +4 -11
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -8
- package/operations/entry/transformations/transformEntryToIndex.js +9 -14
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +7 -6
- package/operations/group/index.js +41 -78
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +4 -4
- package/operations/model/index.js +38 -58
- package/operations/model/index.js.map +1 -1
- package/package.json +32 -34
- package/tasks/createIndexTaskPlugin.d.ts +2 -2
- package/tasks/createIndexTaskPlugin.js +41 -60
- package/tasks/createIndexTaskPlugin.js.map +1 -1
- package/types.d.ts +26 -134
- package/types.js +2 -28
- package/types.js.map +1 -1
- package/values/NoValueContainer.d.ts +5 -0
- package/values/NoValueContainer.js +13 -0
- package/values/NoValueContainer.js.map +1 -0
- package/definitions/entryElasticsearch.d.ts +0 -9
- package/definitions/entryElasticsearch.js +0 -41
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/system.d.ts +0 -9
- package/definitions/system.js +0 -42
- package/definitions/system.js.map +0 -1
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -25
- package/definitions/table.js.map +0 -1
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -25
- package/definitions/tableElasticsearch.js.map +0 -1
- package/dynamoDb/index.d.ts +0 -3
- package/dynamoDb/index.js +0 -16
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -96
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -2
- package/dynamoDb/storage/richText.js +0 -59
- package/dynamoDb/storage/richText.js.map +0 -1
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -13
- package/elasticsearch/index.js.map +0 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
- package/elasticsearch/indexing/defaultFieldIndexing.js +0 -54
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
- package/elasticsearch/indexing/index.d.ts +0 -2
- package/elasticsearch/indexing/index.js +0 -18
- package/elasticsearch/indexing/index.js.map +0 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
- package/elasticsearch/indexing/jsonIndexing.js +0 -28
- package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
- package/elasticsearch/indexing/longTextIndexing.js +0 -42
- package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js.map +0 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
- package/elasticsearch/indexing/objectIndexing.js +0 -201
- package/elasticsearch/indexing/objectIndexing.js.map +0 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -31
- package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
- package/elasticsearch/indices/base.d.ts +0 -2
- package/elasticsearch/indices/base.js +0 -13
- package/elasticsearch/indices/base.js.map +0 -1
- package/elasticsearch/indices/index.d.ts +0 -1
- package/elasticsearch/indices/index.js +0 -14
- package/elasticsearch/indices/index.js.map +0 -1
- package/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -14
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -12
- package/elasticsearch/search/index.js.map +0 -1
- package/elasticsearch/search/refSearch.d.ts +0 -2
- package/elasticsearch/search/refSearch.js +0 -31
- package/elasticsearch/search/refSearch.js.map +0 -1
- package/elasticsearch/search/timeSearch.d.ts +0 -2
- package/elasticsearch/search/timeSearch.js +0 -27
- package/elasticsearch/search/timeSearch.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -30
- 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 -15
- 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 -69
- 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 -57
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
- package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -18
- 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 -18
- 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 -26
- 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 -18
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -94
- package/operations/system/index.js.map +0 -1
- package/operations/system/indexes.d.ts +0 -10
- package/operations/system/indexes.js +0 -41
- package/operations/system/indexes.js.map +0 -1
- package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
- package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -52
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -21
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -27
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -13
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -31
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -40
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -21
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -21
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
- package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -50
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
- package/plugins/CmsEntryFilterPlugin.js +0 -22
- package/plugins/CmsEntryFilterPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -8
- package/plugins/index.js +0 -95
- package/plugins/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryOpenSearchFieldIndexRegistry","Abstraction","CmsEntryOpenSearchFieldIndex","getBaseFieldType","FIELD_INDEXING_DEFAULT","CmsEntryOpenSearchFieldIndexRegistryImpl","constructor","fieldIndexing","get","type","fieldType","find","field","getDefault","fieldIndex","Error","getAll","createImplementation","implementation","dependencies","multiple"],"sources":["CmsEntryOpenSearchFieldIndexRegistry.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndexRegistry as Abstraction } from \"./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"./abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\nimport { FIELD_INDEXING_DEFAULT } from \"./constants.js\";\n\nclass CmsEntryOpenSearchFieldIndexRegistryImpl implements Abstraction.Interface {\n public constructor(private readonly fieldIndexing: CmsEntryOpenSearchFieldIndex.Interface[]) {}\n\n public get(type: string): CmsEntryOpenSearchFieldIndex.Interface | undefined {\n const fieldType = getBaseFieldType({\n type\n });\n return this.fieldIndexing.find(field => field.fieldType === fieldType);\n }\n\n public getDefault(): CmsEntryOpenSearchFieldIndex.Interface {\n const fieldIndex = this.fieldIndexing.find(\n field => field.fieldType === FIELD_INDEXING_DEFAULT\n );\n if (fieldIndex) {\n return fieldIndex;\n }\n /**\n * This should never happen, as the default field index plugin exists in our code. This can fail during testing.\n */\n throw new Error(\n `Missing default field index plugin. Please make sure to register a plugin with \"${FIELD_INDEXING_DEFAULT}\" field type.`\n );\n }\n\n public getAll(): CmsEntryOpenSearchFieldIndex.Interface[] {\n return this.fieldIndexing;\n }\n}\n\nexport const CmsEntryOpenSearchFieldIndexRegistry = Abstraction.createImplementation({\n implementation: CmsEntryOpenSearchFieldIndexRegistryImpl,\n dependencies: [[CmsEntryOpenSearchFieldIndex, { multiple: true }]]\n});\n"],"mappings":"AAAA,SAASA,oCAAoC,IAAIC,WAAW;AAC5D,SAASC,4BAA4B;AACrC,SAASC,gBAAgB,QAAQ,oDAAoD;AACrF,SAASC,sBAAsB;AAE/B,MAAMC,wCAAwC,CAAkC;EACrEC,WAAWA,CAAkBC,aAAuD,EAAE;IAAA,KAAzDA,aAAuD,GAAvDA,aAAuD;EAAG;EAEvFC,GAAGA,CAACC,IAAY,EAAsD;IACzE,MAAMC,SAAS,GAAGP,gBAAgB,CAAC;MAC/BM;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACF,aAAa,CAACI,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACF,SAAS,KAAKA,SAAS,CAAC;EAC1E;EAEOG,UAAUA,CAAA,EAA2C;IACxD,MAAMC,UAAU,GAAG,IAAI,CAACP,aAAa,CAACI,IAAI,CACtCC,KAAK,IAAIA,KAAK,CAACF,SAAS,KAAKN,sBACjC,CAAC;IACD,IAAIU,UAAU,EAAE;MACZ,OAAOA,UAAU;IACrB;IACA;AACR;AACA;IACQ,MAAM,IAAIC,KAAK,CACX,mFAAmFX,sBAAsB,eAC7G,CAAC;EACL;EAEOY,MAAMA,CAAA,EAA6C;IACtD,OAAO,IAAI,CAACT,aAAa;EAC7B;AACJ;AAEA,OAAO,MAAMP,oCAAoC,GAAGC,WAAW,CAACgB,oBAAoB,CAAC;EACjFC,cAAc,EAAEb,wCAAwC;EACxDc,YAAY,EAAE,CAAC,CAACjB,4BAA4B,EAAE;IAAEkB,QAAQ,EAAE;EAAK,CAAC,CAAC;AACrE,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import type { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
|
|
3
|
+
export interface ToIndexParams {
|
|
4
|
+
model: CmsModel;
|
|
5
|
+
field: CmsModelField;
|
|
6
|
+
fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
|
|
7
|
+
value: any;
|
|
8
|
+
rawValue: any;
|
|
9
|
+
getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;
|
|
10
|
+
}
|
|
11
|
+
export interface ToIndexValue {
|
|
12
|
+
value?: any;
|
|
13
|
+
rawValue?: any;
|
|
14
|
+
}
|
|
15
|
+
export interface FromIndexParams {
|
|
16
|
+
model: CmsModel;
|
|
17
|
+
field: CmsModelField;
|
|
18
|
+
fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
|
|
19
|
+
value: any;
|
|
20
|
+
rawValue: any;
|
|
21
|
+
getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;
|
|
22
|
+
}
|
|
23
|
+
export interface ICmsEntryOpenSearchFieldIndex {
|
|
24
|
+
readonly fieldType: string;
|
|
25
|
+
unmappedType?(field: Pick<CmsModelField, "fieldId" | "type">): string;
|
|
26
|
+
toIndex(params: ToIndexParams): ToIndexValue;
|
|
27
|
+
fromIndex(params: FromIndexParams): any;
|
|
28
|
+
}
|
|
29
|
+
export declare const CmsEntryOpenSearchFieldIndex: import("@webiny/di").Abstraction<ICmsEntryOpenSearchFieldIndex>;
|
|
30
|
+
export declare namespace CmsEntryOpenSearchFieldIndex {
|
|
31
|
+
type Interface = ICmsEntryOpenSearchFieldIndex;
|
|
32
|
+
type ToIndex = ToIndexParams;
|
|
33
|
+
type ToValue = ToIndexValue;
|
|
34
|
+
type FromIndex = FromIndexParams;
|
|
35
|
+
}
|
package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","CmsEntryOpenSearchFieldIndex"],"sources":["CmsEntryOpenSearchFieldIndex.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\n\nexport interface ToIndexParams {\n model: CmsModel;\n field: CmsModelField;\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n value: any;\n rawValue: any;\n getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;\n}\n\nexport interface ToIndexValue {\n value?: any;\n rawValue?: any;\n}\n\nexport interface FromIndexParams {\n model: CmsModel;\n field: CmsModelField;\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n value: any;\n rawValue: any;\n getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;\n}\n\nexport interface ICmsEntryOpenSearchFieldIndex {\n readonly fieldType: string;\n unmappedType?(field: Pick<CmsModelField, \"fieldId\" | \"type\">): string;\n toIndex(params: ToIndexParams): ToIndexValue;\n fromIndex(params: FromIndexParams): any;\n}\n\nexport const CmsEntryOpenSearchFieldIndex = createAbstraction<ICmsEntryOpenSearchFieldIndex>(\n \"Cms/Entry/OpenSearch/FieldIndex\"\n);\n\nexport namespace CmsEntryOpenSearchFieldIndex {\n export type Interface = ICmsEntryOpenSearchFieldIndex;\n export type ToIndex = ToIndexParams;\n export type ToValue = ToIndexValue;\n export type FromIndex = FromIndexParams;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAkCvD,OAAO,MAAMC,4BAA4B,GAAGD,iBAAiB,CACzD,iCACJ,CAAC","ignoreList":[]}
|
package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CmsEntryOpenSearchFieldIndex } from "./CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
export interface ICmsEntryOpenSearchFieldIndexRegistry {
|
|
3
|
+
get(fieldType: string): CmsEntryOpenSearchFieldIndex.Interface | undefined;
|
|
4
|
+
getDefault(): CmsEntryOpenSearchFieldIndex.Interface;
|
|
5
|
+
getAll(): CmsEntryOpenSearchFieldIndex.Interface[];
|
|
6
|
+
}
|
|
7
|
+
export declare const CmsEntryOpenSearchFieldIndexRegistry: import("@webiny/di").Abstraction<ICmsEntryOpenSearchFieldIndexRegistry>;
|
|
8
|
+
export declare namespace CmsEntryOpenSearchFieldIndexRegistry {
|
|
9
|
+
type Interface = ICmsEntryOpenSearchFieldIndexRegistry;
|
|
10
|
+
type FieldIndex = CmsEntryOpenSearchFieldIndex.Interface;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","CmsEntryOpenSearchFieldIndexRegistry"],"sources":["CmsEntryOpenSearchFieldIndexRegistry.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsEntryOpenSearchFieldIndex } from \"./CmsEntryOpenSearchFieldIndex.js\";\n\nexport interface ICmsEntryOpenSearchFieldIndexRegistry {\n get(fieldType: string): CmsEntryOpenSearchFieldIndex.Interface | undefined;\n getDefault(): CmsEntryOpenSearchFieldIndex.Interface;\n getAll(): CmsEntryOpenSearchFieldIndex.Interface[];\n}\n\nexport const CmsEntryOpenSearchFieldIndexRegistry =\n createAbstraction<ICmsEntryOpenSearchFieldIndexRegistry>(\n \"Cms/Entry/OpenSearch/FieldIndexRegistry\"\n );\n\nexport namespace CmsEntryOpenSearchFieldIndexRegistry {\n export type Interface = ICmsEntryOpenSearchFieldIndexRegistry;\n export type FieldIndex = CmsEntryOpenSearchFieldIndex.Interface;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AASvD,OAAO,MAAMC,oCAAoC,GAC7CD,iBAAiB,CACb,yCACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FIELD_INDEXING_DEFAULT: "*";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FIELD_INDEXING_DEFAULT"],"sources":["constants.ts"],"sourcesContent":["export const FIELD_INDEXING_DEFAULT = \"*\" as const;\n"],"mappings":"AAAA,OAAO,MAAMA,sBAAsB,GAAG,GAAY","ignoreList":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { CmsEntryOpenSearchFieldIndexRegistry } from "./CmsEntryOpenSearchFieldIndexRegistry.js";
|
|
3
|
+
import { RichTextFieldIndex } from "./fields/RichTextFieldIndex.js";
|
|
4
|
+
import { JsonFieldIndex } from "./fields/JsonFieldIndex.js";
|
|
5
|
+
import { LongTextFieldIndex } from "./fields/LongTextFieldIndex.js";
|
|
6
|
+
import { NumberFieldIndex } from "./fields/NumberFieldIndex.js";
|
|
7
|
+
import { DefaultFieldIndex } from "./fields/DefaultFieldIndex.js";
|
|
8
|
+
import { DateTimeFieldIndex } from "./fields/DateTimeFieldIndex.js";
|
|
9
|
+
import { ObjectFieldIndex } from "./fields/ObjectFieldIndex.js";
|
|
10
|
+
export const CmsEntryOpenSearchFieldIndexFeature = createFeature({
|
|
11
|
+
name: "Cms/Entry/OpenSearch/FieldIndexFeature",
|
|
12
|
+
register: container => {
|
|
13
|
+
container.register(RichTextFieldIndex);
|
|
14
|
+
container.register(JsonFieldIndex);
|
|
15
|
+
container.register(LongTextFieldIndex);
|
|
16
|
+
container.register(NumberFieldIndex);
|
|
17
|
+
container.register(DefaultFieldIndex);
|
|
18
|
+
container.register(DateTimeFieldIndex);
|
|
19
|
+
container.register(ObjectFieldIndex);
|
|
20
|
+
container.register(CmsEntryOpenSearchFieldIndexRegistry);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createFeature","CmsEntryOpenSearchFieldIndexRegistry","RichTextFieldIndex","JsonFieldIndex","LongTextFieldIndex","NumberFieldIndex","DefaultFieldIndex","DateTimeFieldIndex","ObjectFieldIndex","CmsEntryOpenSearchFieldIndexFeature","name","register","container"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CmsEntryOpenSearchFieldIndexRegistry } from \"./CmsEntryOpenSearchFieldIndexRegistry.js\";\nimport { RichTextFieldIndex } from \"./fields/RichTextFieldIndex.js\";\nimport { JsonFieldIndex } from \"./fields/JsonFieldIndex.js\";\nimport { LongTextFieldIndex } from \"./fields/LongTextFieldIndex.js\";\nimport { NumberFieldIndex } from \"./fields/NumberFieldIndex.js\";\nimport { DefaultFieldIndex } from \"./fields/DefaultFieldIndex.js\";\nimport { DateTimeFieldIndex } from \"./fields/DateTimeFieldIndex.js\";\nimport { ObjectFieldIndex } from \"./fields/ObjectFieldIndex.js\";\n\nexport const CmsEntryOpenSearchFieldIndexFeature = createFeature({\n name: \"Cms/Entry/OpenSearch/FieldIndexFeature\",\n register: container => {\n container.register(RichTextFieldIndex);\n container.register(JsonFieldIndex);\n container.register(LongTextFieldIndex);\n container.register(NumberFieldIndex);\n container.register(DefaultFieldIndex);\n container.register(DateTimeFieldIndex);\n container.register(ObjectFieldIndex);\n container.register(CmsEntryOpenSearchFieldIndexRegistry);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,oCAAoC;AAC7C,SAASC,kBAAkB;AAC3B,SAASC,cAAc;AACvB,SAASC,kBAAkB;AAC3B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;AAC3B,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,mCAAmC,GAAGT,aAAa,CAAC;EAC7DU,IAAI,EAAE,wCAAwC;EAC9CC,QAAQ,EAAEC,SAAS,IAAI;IACnBA,SAAS,CAACD,QAAQ,CAACT,kBAAkB,CAAC;IACtCU,SAAS,CAACD,QAAQ,CAACR,cAAc,CAAC;IAClCS,SAAS,CAACD,QAAQ,CAACP,kBAAkB,CAAC;IACtCQ,SAAS,CAACD,QAAQ,CAACN,gBAAgB,CAAC;IACpCO,SAAS,CAACD,QAAQ,CAACL,iBAAiB,CAAC;IACrCM,SAAS,CAACD,QAAQ,CAACJ,kBAAkB,CAAC;IACtCK,SAAS,CAACD,QAAQ,CAACH,gBAAgB,CAAC;IACpCI,SAAS,CAACD,QAAQ,CAACV,oCAAoC,CAAC;EAC5D;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
declare class DateTimeFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {
|
|
3
|
+
readonly fieldType = "datetime";
|
|
4
|
+
unmappedType(): string;
|
|
5
|
+
toIndex({ field, value }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue;
|
|
6
|
+
fromIndex({ field, value }: CmsEntryOpenSearchFieldIndex.FromIndex): any;
|
|
7
|
+
}
|
|
8
|
+
export declare const DateTimeFieldIndex: typeof DateTimeFieldIndexImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsEntryOpenSearchFieldIndex.js").ICmsEntryOpenSearchFieldIndex>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
7
2
|
const convertTimeToNumber = time => {
|
|
8
3
|
if (!time) {
|
|
9
4
|
return null;
|
|
@@ -15,17 +10,19 @@ const convertNumberToTime = value => {
|
|
|
15
10
|
if (value === undefined || value === null) {
|
|
16
11
|
return null;
|
|
17
12
|
}
|
|
18
|
-
// TODO remove when v5 goes out
|
|
19
|
-
// this is a fix for pre beta.5
|
|
20
|
-
if (String(value).match(/^([0-9]{2}):([0-9]{2})/) !== null) {
|
|
21
|
-
return String(value);
|
|
22
|
-
}
|
|
23
|
-
//
|
|
24
13
|
const hours = Math.floor(value / 60 / 60);
|
|
25
14
|
const minutes = Math.floor((value - hours * 60 * 60) / 60);
|
|
26
15
|
const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);
|
|
27
16
|
return [hours, minutes, seconds].map(v => String(v).padStart(2, "0")).join(":");
|
|
28
17
|
};
|
|
18
|
+
const convertValueToIndex = (value, field) => {
|
|
19
|
+
if (!value) {
|
|
20
|
+
return null;
|
|
21
|
+
} else if (field.settings?.type === "time") {
|
|
22
|
+
return convertTimeToNumber(value);
|
|
23
|
+
}
|
|
24
|
+
return value;
|
|
25
|
+
};
|
|
29
26
|
const convertValueFromIndex = (value, field) => {
|
|
30
27
|
const type = field.settings?.type;
|
|
31
28
|
if (type === "time") {
|
|
@@ -40,21 +37,11 @@ const convertValueFromIndex = (value, field) => {
|
|
|
40
37
|
}
|
|
41
38
|
return new Date(value).toISOString();
|
|
42
39
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} else if (field.settings?.type === "time") {
|
|
47
|
-
return convertTimeToNumber(value);
|
|
48
|
-
}
|
|
49
|
-
return value;
|
|
50
|
-
};
|
|
51
|
-
var _default = () => ({
|
|
52
|
-
type: "cms-model-field-to-elastic-search",
|
|
53
|
-
name: "cms-model-field-to-elastic-search-datetime",
|
|
54
|
-
fieldType: "datetime",
|
|
55
|
-
unmappedType: () => {
|
|
40
|
+
class DateTimeFieldIndexImpl {
|
|
41
|
+
fieldType = "datetime";
|
|
42
|
+
unmappedType() {
|
|
56
43
|
return "date";
|
|
57
|
-
}
|
|
44
|
+
}
|
|
58
45
|
toIndex({
|
|
59
46
|
field,
|
|
60
47
|
value
|
|
@@ -66,23 +53,25 @@ var _default = () => ({
|
|
|
66
53
|
})
|
|
67
54
|
};
|
|
68
55
|
}
|
|
69
|
-
const dateValue = convertValueToIndex(value, field);
|
|
70
56
|
return {
|
|
71
|
-
value:
|
|
57
|
+
value: convertValueToIndex(value, field)
|
|
72
58
|
};
|
|
73
|
-
}
|
|
59
|
+
}
|
|
74
60
|
fromIndex({
|
|
75
61
|
field,
|
|
76
62
|
value
|
|
77
63
|
}) {
|
|
78
|
-
if (Array.isArray(value)) {
|
|
64
|
+
if (Array.isArray(value) === true) {
|
|
79
65
|
return value.map(v => {
|
|
80
66
|
return convertValueFromIndex(v, field);
|
|
81
67
|
});
|
|
82
68
|
}
|
|
83
69
|
return convertValueFromIndex(value, field);
|
|
84
70
|
}
|
|
71
|
+
}
|
|
72
|
+
export const DateTimeFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({
|
|
73
|
+
implementation: DateTimeFieldIndexImpl,
|
|
74
|
+
dependencies: []
|
|
85
75
|
});
|
|
86
|
-
exports.default = _default;
|
|
87
76
|
|
|
88
|
-
//# sourceMappingURL=
|
|
77
|
+
//# sourceMappingURL=DateTimeFieldIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryOpenSearchFieldIndex","convertTimeToNumber","time","hours","minutes","seconds","split","map","Number","convertNumberToTime","value","undefined","Math","floor","v","String","padStart","join","convertValueToIndex","field","settings","type","convertValueFromIndex","dateValue","Date","toISOString","slice","DateTimeFieldIndexImpl","fieldType","unmappedType","toIndex","Array","isArray","fromIndex","DateTimeFieldIndex","createImplementation","implementation","dependencies"],"sources":["DateTimeFieldIndex.ts"],"sourcesContent":["import type { CmsModelDateTimeField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\n\nconst convertTimeToNumber = (time?: string): number | null => {\n if (!time) {\n return null;\n }\n const [hours, minutes, seconds = 0] = time.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nconst convertNumberToTime = (value?: number): string | null => {\n if (value === undefined || value === null) {\n return null;\n }\n\n const hours = Math.floor(value / 60 / 60);\n const minutes = Math.floor((value - hours * 60 * 60) / 60);\n const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);\n\n return [hours, minutes, seconds].map(v => String(v).padStart(2, \"0\")).join(\":\");\n};\n\nconst convertValueToIndex = (value: string, field: CmsModelDateTimeField) => {\n if (!value) {\n return null;\n } else if (field.settings?.type === \"time\") {\n return convertTimeToNumber(value);\n }\n return value;\n};\n\nconst convertValueFromIndex = (\n value: string | number,\n field: CmsModelDateTimeField\n): string | null => {\n const type = field.settings?.type;\n if (type === \"time\") {\n return convertNumberToTime(value as number);\n } else if (!value) {\n return null;\n } else if (type === \"dateTimeWithTimezone\") {\n return value as string;\n } else if (type === \"date\") {\n const dateValue = new Date(value);\n return dateValue.toISOString().slice(0, 10);\n }\n return new Date(value).toISOString();\n};\n\nclass DateTimeFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = \"datetime\";\n\n public unmappedType(): string {\n return \"date\";\n }\n\n public toIndex({\n field,\n value\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n if (Array.isArray(value) === true) {\n return {\n value: value.map((v: string) => {\n return convertValueToIndex(v, field as CmsModelDateTimeField);\n })\n };\n }\n return {\n value: convertValueToIndex(value, field as CmsModelDateTimeField)\n };\n }\n\n public fromIndex({ field, value }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n if (Array.isArray(value) === true) {\n return value.map((v: string) => {\n return convertValueFromIndex(v, field as CmsModelDateTimeField);\n });\n }\n return convertValueFromIndex(value, field as CmsModelDateTimeField);\n }\n}\n\nexport const DateTimeFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: DateTimeFieldIndexImpl,\n dependencies: []\n});\n"],"mappings":"AACA,SAASA,4BAA4B;AAErC,MAAMC,mBAAmB,GAAIC,IAAa,IAAoB;EAC1D,IAAI,CAACA,IAAI,EAAE;IACP,OAAO,IAAI;EACf;EACA,MAAM,CAACC,KAAK,EAAEC,OAAO,EAAEC,OAAO,GAAG,CAAC,CAAC,GAAGH,IAAI,CAACI,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EACjE,OAAOL,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,GAAGC,OAAO;AACnD,CAAC;AAED,MAAMI,mBAAmB,GAAIC,KAAc,IAAoB;EAC3D,IAAIA,KAAK,KAAKC,SAAS,IAAID,KAAK,KAAK,IAAI,EAAE;IACvC,OAAO,IAAI;EACf;EAEA,MAAMP,KAAK,GAAGS,IAAI,CAACC,KAAK,CAACH,KAAK,GAAG,EAAE,GAAG,EAAE,CAAC;EACzC,MAAMN,OAAO,GAAGQ,IAAI,CAACC,KAAK,CAAC,CAACH,KAAK,GAAGP,KAAK,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;EAC1D,MAAME,OAAO,GAAGO,IAAI,CAACC,KAAK,CAACH,KAAK,GAAGP,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,CAAC;EAElE,OAAO,CAACD,KAAK,EAAEC,OAAO,EAAEC,OAAO,CAAC,CAACE,GAAG,CAACO,CAAC,IAAIC,MAAM,CAACD,CAAC,CAAC,CAACE,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;AACnF,CAAC;AAED,MAAMC,mBAAmB,GAAGA,CAACR,KAAa,EAAES,KAA4B,KAAK;EACzE,IAAI,CAACT,KAAK,EAAE;IACR,OAAO,IAAI;EACf,CAAC,MAAM,IAAIS,KAAK,CAACC,QAAQ,EAAEC,IAAI,KAAK,MAAM,EAAE;IACxC,OAAOpB,mBAAmB,CAACS,KAAK,CAAC;EACrC;EACA,OAAOA,KAAK;AAChB,CAAC;AAED,MAAMY,qBAAqB,GAAGA,CAC1BZ,KAAsB,EACtBS,KAA4B,KACZ;EAChB,MAAME,IAAI,GAAGF,KAAK,CAACC,QAAQ,EAAEC,IAAI;EACjC,IAAIA,IAAI,KAAK,MAAM,EAAE;IACjB,OAAOZ,mBAAmB,CAACC,KAAe,CAAC;EAC/C,CAAC,MAAM,IAAI,CAACA,KAAK,EAAE;IACf,OAAO,IAAI;EACf,CAAC,MAAM,IAAIW,IAAI,KAAK,sBAAsB,EAAE;IACxC,OAAOX,KAAK;EAChB,CAAC,MAAM,IAAIW,IAAI,KAAK,MAAM,EAAE;IACxB,MAAME,SAAS,GAAG,IAAIC,IAAI,CAACd,KAAK,CAAC;IACjC,OAAOa,SAAS,CAACE,WAAW,CAAC,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;EAC/C;EACA,OAAO,IAAIF,IAAI,CAACd,KAAK,CAAC,CAACe,WAAW,CAAC,CAAC;AACxC,CAAC;AAED,MAAME,sBAAsB,CAAmD;EAC3DC,SAAS,GAAG,UAAU;EAE/BC,YAAYA,CAAA,EAAW;IAC1B,OAAO,MAAM;EACjB;EAEOC,OAAOA,CAAC;IACXX,KAAK;IACLT;EACkC,CAAC,EAAwC;IAC3E,IAAIqB,KAAK,CAACC,OAAO,CAACtB,KAAK,CAAC,KAAK,IAAI,EAAE;MAC/B,OAAO;QACHA,KAAK,EAAEA,KAAK,CAACH,GAAG,CAAEO,CAAS,IAAK;UAC5B,OAAOI,mBAAmB,CAACJ,CAAC,EAAEK,KAA8B,CAAC;QACjE,CAAC;MACL,CAAC;IACL;IACA,OAAO;MACHT,KAAK,EAAEQ,mBAAmB,CAACR,KAAK,EAAES,KAA8B;IACpE,CAAC;EACL;EAEOc,SAASA,CAAC;IAAEd,KAAK;IAAET;EAA8C,CAAC,EAAO;IAC5E,IAAIqB,KAAK,CAACC,OAAO,CAACtB,KAAK,CAAC,KAAK,IAAI,EAAE;MAC/B,OAAOA,KAAK,CAACH,GAAG,CAAEO,CAAS,IAAK;QAC5B,OAAOQ,qBAAqB,CAACR,CAAC,EAAEK,KAA8B,CAAC;MACnE,CAAC,CAAC;IACN;IACA,OAAOG,qBAAqB,CAACZ,KAAK,EAAES,KAA8B,CAAC;EACvE;AACJ;AAEA,OAAO,MAAMe,kBAAkB,GAAGlC,4BAA4B,CAACmC,oBAAoB,CAAC;EAChFC,cAAc,EAAET,sBAAsB;EACtCU,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
declare class DefaultFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {
|
|
3
|
+
readonly fieldType: "*";
|
|
4
|
+
toIndex({ field, fieldRegistry, value }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue;
|
|
5
|
+
fromIndex({ field, fieldRegistry, value, rawValue }: CmsEntryOpenSearchFieldIndex.FromIndex): any;
|
|
6
|
+
}
|
|
7
|
+
export declare const DefaultFieldIndex: typeof DefaultFieldIndexImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsEntryOpenSearchFieldIndex.js").ICmsEntryOpenSearchFieldIndex>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
import { FIELD_INDEXING_DEFAULT } from "../constants.js";
|
|
3
|
+
class DefaultFieldIndexImpl {
|
|
4
|
+
fieldType = FIELD_INDEXING_DEFAULT;
|
|
5
|
+
toIndex({
|
|
6
|
+
field,
|
|
7
|
+
fieldRegistry,
|
|
8
|
+
value
|
|
9
|
+
}) {
|
|
10
|
+
const fieldType = fieldRegistry.get(field.type);
|
|
11
|
+
if (fieldType?.isSearchable === true) {
|
|
12
|
+
return {
|
|
13
|
+
value
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
rawValue: value
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
fromIndex({
|
|
21
|
+
field,
|
|
22
|
+
fieldRegistry,
|
|
23
|
+
value,
|
|
24
|
+
rawValue
|
|
25
|
+
}) {
|
|
26
|
+
const fieldType = fieldRegistry.get(field.type);
|
|
27
|
+
const isSearchable = fieldType?.isSearchable ?? false;
|
|
28
|
+
if (isSearchable) {
|
|
29
|
+
return value === undefined ? rawValue : value;
|
|
30
|
+
}
|
|
31
|
+
return rawValue === undefined ? value : rawValue;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export const DefaultFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({
|
|
35
|
+
implementation: DefaultFieldIndexImpl,
|
|
36
|
+
dependencies: []
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=DefaultFieldIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryOpenSearchFieldIndex","FIELD_INDEXING_DEFAULT","DefaultFieldIndexImpl","fieldType","toIndex","field","fieldRegistry","value","get","type","isSearchable","rawValue","fromIndex","undefined","DefaultFieldIndex","createImplementation","implementation","dependencies"],"sources":["DefaultFieldIndex.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport { FIELD_INDEXING_DEFAULT } from \"../constants.js\";\n\nclass DefaultFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = FIELD_INDEXING_DEFAULT;\n\n public toIndex({\n field,\n fieldRegistry,\n value\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n const fieldType = fieldRegistry.get(field.type);\n\n if (fieldType?.isSearchable === true) {\n return { value };\n }\n\n return { rawValue: value };\n }\n\n public fromIndex({\n field,\n fieldRegistry,\n value,\n rawValue\n }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n const fieldType = fieldRegistry.get(field.type);\n const isSearchable = fieldType?.isSearchable ?? false;\n\n if (isSearchable) {\n return value === undefined ? rawValue : value;\n }\n return rawValue === undefined ? value : rawValue;\n }\n}\n\nexport const DefaultFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: DefaultFieldIndexImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,4BAA4B;AACrC,SAASC,sBAAsB;AAE/B,MAAMC,qBAAqB,CAAmD;EAC1DC,SAAS,GAAGF,sBAAsB;EAE3CG,OAAOA,CAAC;IACXC,KAAK;IACLC,aAAa;IACbC;EACkC,CAAC,EAAwC;IAC3E,MAAMJ,SAAS,GAAGG,aAAa,CAACE,GAAG,CAACH,KAAK,CAACI,IAAI,CAAC;IAE/C,IAAIN,SAAS,EAAEO,YAAY,KAAK,IAAI,EAAE;MAClC,OAAO;QAAEH;MAAM,CAAC;IACpB;IAEA,OAAO;MAAEI,QAAQ,EAAEJ;IAAM,CAAC;EAC9B;EAEOK,SAASA,CAAC;IACbP,KAAK;IACLC,aAAa;IACbC,KAAK;IACLI;EACoC,CAAC,EAAO;IAC5C,MAAMR,SAAS,GAAGG,aAAa,CAACE,GAAG,CAACH,KAAK,CAACI,IAAI,CAAC;IAC/C,MAAMC,YAAY,GAAGP,SAAS,EAAEO,YAAY,IAAI,KAAK;IAErD,IAAIA,YAAY,EAAE;MACd,OAAOH,KAAK,KAAKM,SAAS,GAAGF,QAAQ,GAAGJ,KAAK;IACjD;IACA,OAAOI,QAAQ,KAAKE,SAAS,GAAGN,KAAK,GAAGI,QAAQ;EACpD;AACJ;AAEA,OAAO,MAAMG,iBAAiB,GAAGd,4BAA4B,CAACe,oBAAoB,CAAC;EAC/EC,cAAc,EAAEd,qBAAqB;EACrCe,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
declare class JsonFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {
|
|
3
|
+
readonly fieldType = "json";
|
|
4
|
+
toIndex({ value }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue;
|
|
5
|
+
fromIndex({ rawValue }: CmsEntryOpenSearchFieldIndex.FromIndex): any;
|
|
6
|
+
}
|
|
7
|
+
export declare const JsonFieldIndex: typeof JsonFieldIndexImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsEntryOpenSearchFieldIndex.js").ICmsEntryOpenSearchFieldIndex>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
class JsonFieldIndexImpl {
|
|
3
|
+
fieldType = "json";
|
|
4
|
+
toIndex({
|
|
5
|
+
value
|
|
6
|
+
}) {
|
|
7
|
+
return {
|
|
8
|
+
rawValue: value
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
fromIndex({
|
|
12
|
+
rawValue
|
|
13
|
+
}) {
|
|
14
|
+
return rawValue;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export const JsonFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({
|
|
18
|
+
implementation: JsonFieldIndexImpl,
|
|
19
|
+
dependencies: []
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=JsonFieldIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryOpenSearchFieldIndex","JsonFieldIndexImpl","fieldType","toIndex","value","rawValue","fromIndex","JsonFieldIndex","createImplementation","implementation","dependencies"],"sources":["JsonFieldIndex.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\n\nclass JsonFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = \"json\";\n\n public toIndex({\n value\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n return {\n rawValue: value\n };\n }\n\n public fromIndex({ rawValue }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n return rawValue;\n }\n}\n\nexport const JsonFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: JsonFieldIndexImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,4BAA4B;AAErC,MAAMC,kBAAkB,CAAmD;EACvDC,SAAS,GAAG,MAAM;EAE3BC,OAAOA,CAAC;IACXC;EACkC,CAAC,EAAwC;IAC3E,OAAO;MACHC,QAAQ,EAAED;IACd,CAAC;EACL;EAEOE,SAASA,CAAC;IAAED;EAAiD,CAAC,EAAO;IACxE,OAAOA,QAAQ;EACnB;AACJ;AAEA,OAAO,MAAME,cAAc,GAAGP,4BAA4B,CAACQ,oBAAoB,CAAC;EAC5EC,cAAc,EAAER,kBAAkB;EAClCS,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
declare class LongTextFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {
|
|
3
|
+
readonly fieldType = "long-text";
|
|
4
|
+
toIndex({ rawValue }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue;
|
|
5
|
+
fromIndex({ value }: CmsEntryOpenSearchFieldIndex.FromIndex): any;
|
|
6
|
+
}
|
|
7
|
+
export declare const LongTextFieldIndex: typeof LongTextFieldIndexImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsEntryOpenSearchFieldIndex.js").ICmsEntryOpenSearchFieldIndex>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
class LongTextFieldIndexImpl {
|
|
3
|
+
fieldType = "long-text";
|
|
4
|
+
toIndex({
|
|
5
|
+
rawValue
|
|
6
|
+
}) {
|
|
7
|
+
return {
|
|
8
|
+
value: Array.isArray(rawValue) ? rawValue : rawValue || ""
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
fromIndex({
|
|
12
|
+
value
|
|
13
|
+
}) {
|
|
14
|
+
if (Array.isArray(value)) {
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
return value || "";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export const LongTextFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({
|
|
21
|
+
implementation: LongTextFieldIndexImpl,
|
|
22
|
+
dependencies: []
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=LongTextFieldIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryOpenSearchFieldIndex","LongTextFieldIndexImpl","fieldType","toIndex","rawValue","value","Array","isArray","fromIndex","LongTextFieldIndex","createImplementation","implementation","dependencies"],"sources":["LongTextFieldIndex.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\n\nclass LongTextFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = \"long-text\";\n\n public toIndex({\n rawValue\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n return {\n value: Array.isArray(rawValue) ? rawValue : rawValue || \"\"\n };\n }\n\n public fromIndex({ value }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n if (Array.isArray(value)) {\n return value;\n }\n return value || \"\";\n }\n}\n\nexport const LongTextFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: LongTextFieldIndexImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,4BAA4B;AAErC,MAAMC,sBAAsB,CAAmD;EAC3DC,SAAS,GAAG,WAAW;EAEhCC,OAAOA,CAAC;IACXC;EACkC,CAAC,EAAwC;IAC3E,OAAO;MACHC,KAAK,EAAEC,KAAK,CAACC,OAAO,CAACH,QAAQ,CAAC,GAAGA,QAAQ,GAAGA,QAAQ,IAAI;IAC5D,CAAC;EACL;EAEOI,SAASA,CAAC;IAAEH;EAA8C,CAAC,EAAO;IACrE,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK;IAChB;IACA,OAAOA,KAAK,IAAI,EAAE;EACtB;AACJ;AAEA,OAAO,MAAMI,kBAAkB,GAAGT,4BAA4B,CAACU,oBAAoB,CAAC;EAChFC,cAAc,EAAEV,sBAAsB;EACtCW,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
declare class NumberFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {
|
|
3
|
+
readonly fieldType = "number";
|
|
4
|
+
unmappedType(): string;
|
|
5
|
+
toIndex({ value }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue;
|
|
6
|
+
fromIndex({ value }: CmsEntryOpenSearchFieldIndex.FromIndex): any;
|
|
7
|
+
}
|
|
8
|
+
export declare const NumberFieldIndex: typeof NumberFieldIndexImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsEntryOpenSearchFieldIndex.js").ICmsEntryOpenSearchFieldIndex>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
7
2
|
const convertToString = value => {
|
|
8
3
|
if (Array.isArray(value) === false) {
|
|
9
4
|
return value;
|
|
@@ -16,26 +11,27 @@ const convertToFloat = value => {
|
|
|
16
11
|
}
|
|
17
12
|
return value.map(v => parseFloat(v));
|
|
18
13
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
fieldType: "number",
|
|
23
|
-
unmappedType: () => {
|
|
14
|
+
class NumberFieldIndexImpl {
|
|
15
|
+
fieldType = "number";
|
|
16
|
+
unmappedType() {
|
|
24
17
|
return "float";
|
|
25
|
-
}
|
|
18
|
+
}
|
|
26
19
|
toIndex({
|
|
27
20
|
value
|
|
28
21
|
}) {
|
|
29
22
|
return {
|
|
30
23
|
value: convertToString(value)
|
|
31
24
|
};
|
|
32
|
-
}
|
|
25
|
+
}
|
|
33
26
|
fromIndex({
|
|
34
27
|
value
|
|
35
28
|
}) {
|
|
36
29
|
return convertToFloat(value);
|
|
37
30
|
}
|
|
31
|
+
}
|
|
32
|
+
export const NumberFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({
|
|
33
|
+
implementation: NumberFieldIndexImpl,
|
|
34
|
+
dependencies: []
|
|
38
35
|
});
|
|
39
|
-
exports.default = _default;
|
|
40
36
|
|
|
41
|
-
//# sourceMappingURL=
|
|
37
|
+
//# sourceMappingURL=NumberFieldIndex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryOpenSearchFieldIndex","convertToString","value","Array","isArray","map","String","convertToFloat","parseFloat","v","NumberFieldIndexImpl","fieldType","unmappedType","toIndex","fromIndex","NumberFieldIndex","createImplementation","implementation","dependencies"],"sources":["NumberFieldIndex.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.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\nclass NumberFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = \"number\";\n\n public unmappedType(): string {\n return \"float\";\n }\n\n public toIndex({\n value\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n return {\n value: convertToString(value)\n };\n }\n\n public fromIndex({ value }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n return convertToFloat(value);\n }\n}\n\nexport const NumberFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: NumberFieldIndexImpl,\n dependencies: []\n});\n"],"mappings":"AAAA,SAASA,4BAA4B;AAErC,MAAMC,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,MAAMC,oBAAoB,CAAmD;EACzDC,SAAS,GAAG,QAAQ;EAE7BC,YAAYA,CAAA,EAAW;IAC1B,OAAO,OAAO;EAClB;EAEOC,OAAOA,CAAC;IACXX;EACkC,CAAC,EAAwC;IAC3E,OAAO;MACHA,KAAK,EAAED,eAAe,CAACC,KAAK;IAChC,CAAC;EACL;EAEOY,SAASA,CAAC;IAAEZ;EAA8C,CAAC,EAAO;IACrE,OAAOK,cAAc,CAACL,KAAK,CAAC;EAChC;AACJ;AAEA,OAAO,MAAMa,gBAAgB,GAAGf,4BAA4B,CAACgB,oBAAoB,CAAC;EAC9EC,cAAc,EAAEP,oBAAoB;EACpCQ,YAAY,EAAE;AAClB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
2
|
+
declare class ObjectFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {
|
|
3
|
+
readonly fieldType = "object";
|
|
4
|
+
toIndex({ fieldRegistry, model, field, value: initialValue, rawValue: initialRawValue, getFieldIndex }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue;
|
|
5
|
+
fromIndex({ field, value, rawValue, model, getFieldIndex, fieldRegistry }: CmsEntryOpenSearchFieldIndex.FromIndex): any;
|
|
6
|
+
}
|
|
7
|
+
export declare const ObjectFieldIndex: typeof ObjectFieldIndexImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsEntryOpenSearchFieldIndex.js").ICmsEntryOpenSearchFieldIndex>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { getFieldIdentifiers } from "../../../helpers/index.js";
|
|
2
|
+
import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
|
|
3
|
+
const processToIndex = params => {
|
|
4
|
+
const {
|
|
5
|
+
fields,
|
|
6
|
+
value: sourceValue,
|
|
7
|
+
rawValue: sourceRawValue,
|
|
8
|
+
getFieldIndex,
|
|
9
|
+
fieldRegistry,
|
|
10
|
+
model
|
|
11
|
+
} = params;
|
|
12
|
+
return fields.reduce((values, field) => {
|
|
13
|
+
const plugin = getFieldIndex(field.type);
|
|
14
|
+
const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);
|
|
15
|
+
if (!identifiers) {
|
|
16
|
+
return values;
|
|
17
|
+
}
|
|
18
|
+
const {
|
|
19
|
+
value,
|
|
20
|
+
rawValue
|
|
21
|
+
} = plugin.toIndex({
|
|
22
|
+
model,
|
|
23
|
+
field,
|
|
24
|
+
value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],
|
|
25
|
+
rawValue: sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier],
|
|
26
|
+
getFieldIndex,
|
|
27
|
+
fieldRegistry
|
|
28
|
+
});
|
|
29
|
+
if (value !== undefined) {
|
|
30
|
+
values.value[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;
|
|
31
|
+
}
|
|
32
|
+
if (rawValue !== undefined) {
|
|
33
|
+
values.rawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] = rawValue;
|
|
34
|
+
}
|
|
35
|
+
return values;
|
|
36
|
+
}, {
|
|
37
|
+
value: {},
|
|
38
|
+
rawValue: {}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
const processFromIndex = params => {
|
|
42
|
+
const {
|
|
43
|
+
fields,
|
|
44
|
+
value: sourceValue,
|
|
45
|
+
rawValue: sourceRawValue,
|
|
46
|
+
getFieldIndex,
|
|
47
|
+
fieldRegistry,
|
|
48
|
+
model
|
|
49
|
+
} = params;
|
|
50
|
+
return fields.reduce((values, field) => {
|
|
51
|
+
const plugin = getFieldIndex(field.type);
|
|
52
|
+
const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);
|
|
53
|
+
if (!identifiers) {
|
|
54
|
+
return values;
|
|
55
|
+
}
|
|
56
|
+
const value = plugin.fromIndex({
|
|
57
|
+
fieldRegistry,
|
|
58
|
+
model,
|
|
59
|
+
field,
|
|
60
|
+
value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],
|
|
61
|
+
rawValue: sourceRawValue ? sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] : null,
|
|
62
|
+
getFieldIndex
|
|
63
|
+
});
|
|
64
|
+
if (value !== undefined) {
|
|
65
|
+
values[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;
|
|
66
|
+
}
|
|
67
|
+
return values;
|
|
68
|
+
}, {});
|
|
69
|
+
};
|
|
70
|
+
class ObjectFieldIndexImpl {
|
|
71
|
+
fieldType = "object";
|
|
72
|
+
toIndex({
|
|
73
|
+
fieldRegistry,
|
|
74
|
+
model,
|
|
75
|
+
field,
|
|
76
|
+
value: initialValue,
|
|
77
|
+
rawValue: initialRawValue,
|
|
78
|
+
getFieldIndex
|
|
79
|
+
}) {
|
|
80
|
+
if (!initialValue) {
|
|
81
|
+
return {
|
|
82
|
+
value: null
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const fields = field.settings?.fields || [];
|
|
86
|
+
if (field.list) {
|
|
87
|
+
const result = {
|
|
88
|
+
value: [],
|
|
89
|
+
rawValue: []
|
|
90
|
+
};
|
|
91
|
+
for (const key in initialValue) {
|
|
92
|
+
const {
|
|
93
|
+
value,
|
|
94
|
+
rawValue
|
|
95
|
+
} = processToIndex({
|
|
96
|
+
value: initialValue[key],
|
|
97
|
+
rawValue: initialRawValue[key],
|
|
98
|
+
getFieldIndex,
|
|
99
|
+
model,
|
|
100
|
+
fieldRegistry,
|
|
101
|
+
fields
|
|
102
|
+
});
|
|
103
|
+
result.value.push(value);
|
|
104
|
+
result.rawValue.push(rawValue);
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
value: result.value.length > 0 ? result.value : undefined,
|
|
108
|
+
rawValue: result.rawValue.length > 0 ? result.rawValue : undefined
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return processToIndex({
|
|
112
|
+
value: initialValue,
|
|
113
|
+
rawValue: initialRawValue,
|
|
114
|
+
getFieldIndex,
|
|
115
|
+
model,
|
|
116
|
+
fieldRegistry,
|
|
117
|
+
fields
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
fromIndex({
|
|
121
|
+
field,
|
|
122
|
+
value,
|
|
123
|
+
rawValue,
|
|
124
|
+
model,
|
|
125
|
+
getFieldIndex,
|
|
126
|
+
fieldRegistry
|
|
127
|
+
}) {
|
|
128
|
+
if (!value) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
const fields = field.settings?.fields || [];
|
|
132
|
+
if (field.list) {
|
|
133
|
+
const source = value || rawValue || [];
|
|
134
|
+
return source.map((_, index) => processFromIndex({
|
|
135
|
+
value: value ? value[index] || {} : {},
|
|
136
|
+
rawValue: rawValue ? rawValue[index] || {} : {},
|
|
137
|
+
getFieldIndex,
|
|
138
|
+
model,
|
|
139
|
+
fieldRegistry,
|
|
140
|
+
fields
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
return processFromIndex({
|
|
144
|
+
value,
|
|
145
|
+
rawValue,
|
|
146
|
+
getFieldIndex,
|
|
147
|
+
model,
|
|
148
|
+
fieldRegistry,
|
|
149
|
+
fields
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export const ObjectFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({
|
|
154
|
+
implementation: ObjectFieldIndexImpl,
|
|
155
|
+
dependencies: []
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
//# sourceMappingURL=ObjectFieldIndex.js.map
|