@webiny/api-headless-cms-ddb-es 0.0.0-unstable.496cf268ac → 0.0.0-unstable.5387e5f7c8
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/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
- package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
- package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
- package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsModelEntity.js +5 -0
- package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
- package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsOsTable.js +5 -0
- package/abstractions/CmsDdbEsOsTable.js.map +1 -0
- package/abstractions/CmsDdbEsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsTable.js +5 -0
- package/abstractions/CmsDdbEsTable.js.map +1 -0
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +10 -87
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +10 -64
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +10 -108
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/feature.d.ts +10 -0
- package/feature.js +69 -0
- package/feature.js.map +1 -0
- package/index.d.ts +1 -3
- package/index.js +1 -214
- package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
- package/operations/entry/DdbEsCreateEntry.js +134 -0
- package/operations/entry/DdbEsCreateEntry.js.map +1 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
- package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
- package/operations/entry/DdbEsDeleteEntry.js +79 -0
- package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
- package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js +80 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
- package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetEntry.d.ts +14 -0
- package/operations/entry/DdbEsGetEntry.js +27 -0
- package/operations/entry/DdbEsGetEntry.js.map +1 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
- package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
- package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisionById.js +34 -0
- package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
- package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisions.js +33 -0
- package/operations/entry/DdbEsGetRevisions.js.map +1 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js +76 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbEsListEntries.d.ts +25 -0
- package/operations/entry/DdbEsListEntries.js +91 -0
- package/operations/entry/DdbEsListEntries.js.map +1 -0
- package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
- package/operations/entry/DdbEsMoveEntry.js +113 -0
- package/operations/entry/DdbEsMoveEntry.js.map +1 -0
- package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
- package/operations/entry/DdbEsMoveToBin.js +137 -0
- package/operations/entry/DdbEsMoveToBin.js.map +1 -0
- package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsPublishEntry.js +231 -0
- package/operations/entry/DdbEsPublishEntry.js.map +1 -0
- package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
- package/operations/entry/DdbEsRestoreFromBin.js +137 -0
- package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
- package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsUnpublishEntry.js +127 -0
- package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
- package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
- package/operations/entry/DdbEsUpdateEntry.js +175 -0
- package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
- 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 +18 -39
- package/operations/entry/dataLoaders.js +91 -306
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +55 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +46 -27
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +5 -17
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/storageEntryUtils.d.ts +7 -0
- package/operations/entry/storageEntryUtils.js +14 -0
- package/operations/entry/storageEntryUtils.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 +32 -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/group/DdbEsCreateGroup.d.ts +12 -0
- package/operations/group/DdbEsCreateGroup.js +35 -0
- package/operations/group/DdbEsCreateGroup.js.map +1 -0
- package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
- package/operations/group/DdbEsDeleteGroup.js +31 -0
- package/operations/group/DdbEsDeleteGroup.js.map +1 -0
- package/operations/group/DdbEsGetGroup.d.ts +12 -0
- package/operations/group/DdbEsGetGroup.js +31 -0
- package/operations/group/DdbEsGetGroup.js.map +1 -0
- package/operations/group/DdbEsListGroups.d.ts +14 -0
- package/operations/group/DdbEsListGroups.js +52 -0
- package/operations/group/DdbEsListGroups.js.map +1 -0
- package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
- package/operations/group/DdbEsUpdateGroup.js +35 -0
- package/operations/group/DdbEsUpdateGroup.js.map +1 -0
- package/operations/group/feature.d.ts +4 -0
- package/operations/group/feature.js +19 -0
- package/operations/group/feature.js.map +1 -0
- package/operations/group/keys.d.ts +15 -0
- package/operations/group/keys.js +17 -0
- package/operations/group/keys.js.map +1 -0
- package/operations/model/DdbEsCreateModel.d.ts +16 -0
- package/operations/model/DdbEsCreateModel.js +56 -0
- package/operations/model/DdbEsCreateModel.js.map +1 -0
- package/operations/model/DdbEsDeleteModel.d.ts +12 -0
- package/operations/model/DdbEsDeleteModel.js +31 -0
- package/operations/model/DdbEsDeleteModel.js.map +1 -0
- package/operations/model/DdbEsGetModel.d.ts +12 -0
- package/operations/model/DdbEsGetModel.js +30 -0
- package/operations/model/DdbEsGetModel.js.map +1 -0
- package/operations/model/DdbEsListModels.d.ts +12 -0
- package/operations/model/DdbEsListModels.js +36 -0
- package/operations/model/DdbEsListModels.js.map +1 -0
- package/operations/model/DdbEsUpdateModel.d.ts +12 -0
- package/operations/model/DdbEsUpdateModel.js +36 -0
- package/operations/model/DdbEsUpdateModel.js.map +1 -0
- package/operations/model/feature.d.ts +4 -0
- package/operations/model/feature.js +19 -0
- package/operations/model/feature.js.map +1 -0
- package/operations/model/keys.d.ts +15 -0
- package/operations/model/keys.js +17 -0
- package/operations/model/keys.js.map +1 -0
- package/package.json +48 -41
- package/registry/CmsEntitiesDbRegistryDecorator.d.ts +27 -0
- package/registry/CmsEntitiesDbRegistryDecorator.js +46 -0
- package/registry/CmsEntitiesDbRegistryDecorator.js.map +1 -0
- package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
- package/tasks/CreateElasticsearchIndexTask.js +40 -0
- package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
- package/types.d.ts +13 -155
- package/types.js +9 -41
- package/types.js.map +1 -1
- package/configurations.d.ts +0 -12
- package/configurations.js +0 -35
- package/configurations.js.map +0 -1
- package/definitions/entryElasticsearch.d.ts +0 -8
- package/definitions/entryElasticsearch.js +0 -37
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/settings.d.ts +0 -8
- package/definitions/settings.js +0 -53
- package/definitions/settings.js.map +0 -1
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -41
- package/definitions/system.js.map +0 -1
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -21
- package/definitions/table.js.map +0 -1
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -21
- package/definitions/tableElasticsearch.js.map +0 -1
- package/dynamoDb/index.d.ts +0 -2
- package/dynamoDb/index.js +0 -11
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -86
- package/dynamoDb/storage/date.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -93
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -7
- package/dynamoDb/storage/richText.js +0 -110
- package/dynamoDb/storage/richText.js.map +0 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
- package/elasticsearch/createElasticsearchIndex.js +0 -49
- package/elasticsearch/createElasticsearchIndex.js.map +0 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
- package/elasticsearch/deleteElasticsearchIndex.js +0 -36
- package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -11
- package/elasticsearch/index.js.map +0 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js +0 -86
- package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
- package/elasticsearch/indexing/defaultFieldIndexing.js +0 -52
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
- package/elasticsearch/indexing/index.d.ts +0 -2
- package/elasticsearch/indexing/index.js +0 -15
- package/elasticsearch/indexing/index.js.map +0 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
- package/elasticsearch/indexing/longTextIndexing.js +0 -46
- package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js +0 -39
- package/elasticsearch/indexing/numberIndexing.js.map +0 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
- package/elasticsearch/indexing/objectIndexing.js +0 -196
- package/elasticsearch/indexing/objectIndexing.js.map +0 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -29
- package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
- package/elasticsearch/indices/base.d.ts +0 -2
- package/elasticsearch/indices/base.js +0 -12
- package/elasticsearch/indices/base.js.map +0 -1
- package/elasticsearch/indices/index.d.ts +0 -1
- package/elasticsearch/indices/index.js +0 -12
- package/elasticsearch/indices/index.js.map +0 -1
- package/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -13
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -10
- package/elasticsearch/search/index.js.map +0 -1
- package/elasticsearch/search/refSearch.d.ts +0 -2
- package/elasticsearch/search/refSearch.js +0 -29
- package/elasticsearch/search/refSearch.js.map +0 -1
- package/elasticsearch/search/timeSearch.d.ts +0 -2
- package/elasticsearch/search/timeSearch.js +0 -26
- package/elasticsearch/search/timeSearch.js.map +0 -1
- package/helpers/entryIndexHelpers.d.ts +0 -18
- package/helpers/entryIndexHelpers.js +0 -175
- package/helpers/entryIndexHelpers.js.map +0 -1
- package/helpers/index.d.ts +0 -1
- package/helpers/index.js +0 -16
- package/helpers/index.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -32
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
- package/operations/entry/elasticsearch/body.d.ts +0 -13
- package/operations/entry/elasticsearch/body.js +0 -140
- package/operations/entry/elasticsearch/body.js.map +0 -1
- package/operations/entry/elasticsearch/fields.d.ts +0 -9
- package/operations/entry/elasticsearch/fields.js +0 -229
- package/operations/entry/elasticsearch/fields.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -8
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -57
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -17
- package/operations/entry/elasticsearch/filtering/exec.js +0 -172
- package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
- package/operations/entry/elasticsearch/filtering/index.js +0 -16
- package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +0 -15
- package/operations/entry/elasticsearch/filtering/path.js +0 -44
- package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -28
- 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 -13
- 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 -65
- 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 -48
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/populated.js +0 -23
- package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/values.js +0 -22
- package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -12
- package/operations/entry/elasticsearch/fullTextSearch.js +0 -89
- package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
- package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -25
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +0 -17
- package/operations/entry/elasticsearch/initialQuery.js +0 -103
- package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
- package/operations/entry/elasticsearch/keyword.d.ts +0 -2
- package/operations/entry/elasticsearch/keyword.js +0 -34
- package/operations/entry/elasticsearch/keyword.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -16
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -8
- package/operations/entry/elasticsearch/plugins/operator.js +0 -37
- package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -16
- 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 -24
- 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 -16
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
- package/operations/entry/elasticsearch/sort.d.ts +0 -12
- package/operations/entry/elasticsearch/sort.js +0 -82
- package/operations/entry/elasticsearch/sort.js.map +0 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -16
- package/operations/entry/elasticsearch/transformValueForSearch.js +0 -30
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
- package/operations/entry/elasticsearch/types.d.ts +0 -41
- package/operations/entry/elasticsearch/types.js +0 -5
- package/operations/entry/elasticsearch/types.js.map +0 -1
- package/operations/entry/index.d.ts +0 -11
- package/operations/entry/index.js +0 -1128
- package/operations/entry/index.js.map +0 -1
- package/operations/group/index.d.ts +0 -8
- package/operations/group/index.js +0 -165
- package/operations/group/index.js.map +0 -1
- package/operations/model/index.d.ts +0 -8
- package/operations/model/index.js +0 -171
- package/operations/model/index.js.map +0 -1
- package/operations/settings/index.d.ts +0 -6
- package/operations/settings/index.js +0 -111
- package/operations/settings/index.js.map +0 -1
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -82
- package/operations/system/index.js.map +0 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -21
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -22
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -18
- package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -28
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -12
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -31
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -37
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -18
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -22
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -18
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -22
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
- package/plugins/CmsEntryFilterPlugin.js +0 -24
- package/plugins/CmsEntryFilterPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -7
- package/plugins/index.js +0 -82
- package/plugins/index.js.map +0 -1
|
@@ -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,mCAAmC;EACzCC,IAAI,EAAE,6CAA6C;EACnDC,SAAS,EAAE,WAAW;EACtBC,OAAO,CAAC;IAAEC;EAAM,CAAC,EAAE;IACf;;IAEA;AACR;AACA;IACQ,OAAO;MACHC,QAAQ,EAAED;IACd,CAAC;EACL,CAAC;EACDE,SAAS,CAAC;IAAED;EAAS,CAAC,EAAE;IACpB,OAAOA,QAAQ;EACnB;AACJ,CAAC,CAAC;AAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.base = void 0;
|
|
7
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
8
|
-
var _CmsEntryElasticsearchIndexPlugin = require("../../plugins/CmsEntryElasticsearchIndexPlugin");
|
|
9
|
-
const base = new _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin({
|
|
10
|
-
body: (0, _apiElasticsearch.getBaseConfiguration)()
|
|
11
|
-
});
|
|
12
|
-
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,kEAAgC,CAAC;EACrDC,IAAI,EAAE,IAAAC,sCAAoB;AAC9B,CAAC,CAAC;AAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const elasticsearchIndexPlugins: () => import("../..").CmsEntryElasticsearchIndexPlugin[];
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.elasticsearchIndexPlugins = void 0;
|
|
7
|
-
var _base = require("./base");
|
|
8
|
-
var _japanese = require("./japanese");
|
|
9
|
-
const elasticsearchIndexPlugins = () => {
|
|
10
|
-
return [_base.base, _japanese.japanese];
|
|
11
|
-
};
|
|
12
|
-
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,UAAI,EAAEC,kBAAQ,CAAC;AAC3B,CAAC;AAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.japanese = void 0;
|
|
7
|
-
var _CmsEntryElasticsearchIndexPlugin = require("../../plugins/CmsEntryElasticsearchIndexPlugin");
|
|
8
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
9
|
-
const japanese = new _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin({
|
|
10
|
-
body: (0, _apiElasticsearch.getJapaneseConfiguration)(),
|
|
11
|
-
locales: ["ja", "ja-jp"]
|
|
12
|
-
});
|
|
13
|
-
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,kEAAgC,CAAC;EACzDC,IAAI,EAAE,IAAAC,0CAAwB,GAAE;EAChCC,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO;AAC3B,CAAC,CAAC;AAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _timeSearch = require("./timeSearch");
|
|
8
|
-
var _refSearch = require("./refSearch");
|
|
9
|
-
var _default = () => [(0, _timeSearch.createTimeSearchPlugin)(), (0, _refSearch.createRefSearchPlugin)()];
|
|
10
|
-
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;AAAoD,eAGrC,MAA4D,CACvE,IAAAA,kCAAsB,GAAE,EACxB,IAAAC,gCAAqB,GAAE,CAC1B;AAAA"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createRefSearchPlugin = void 0;
|
|
7
|
-
var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
|
|
8
|
-
const createPath = ({
|
|
9
|
-
field,
|
|
10
|
-
key
|
|
11
|
-
}) => {
|
|
12
|
-
if (key && key.match("entryId") === null) {
|
|
13
|
-
return `${field.storageId}.id`;
|
|
14
|
-
}
|
|
15
|
-
return `${field.storageId}.entryId`;
|
|
16
|
-
};
|
|
17
|
-
const transform = ({
|
|
18
|
-
value
|
|
19
|
-
}) => {
|
|
20
|
-
return value;
|
|
21
|
-
};
|
|
22
|
-
const createRefSearchPlugin = () => {
|
|
23
|
-
return new _CmsEntryElasticsearchQueryBuilderValueSearchPlugin.CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
|
|
24
|
-
fieldType: "ref",
|
|
25
|
-
path: createPath,
|
|
26
|
-
transform
|
|
27
|
-
});
|
|
28
|
-
};
|
|
29
|
-
exports.createRefSearchPlugin = createRefSearchPlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createPath","field","key","match","storageId","transform","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 = ({ value }) => {\n return value;\n};\n\nexport const createRefSearchPlugin = (): CmsEntryElasticsearchQueryBuilderValueSearchPlugin => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin({\n fieldType: \"ref\",\n path: createPath,\n transform\n });\n};\n"],"mappings":";;;;;;AAAA;AAMA,MAAMA,UAAsC,GAAG,CAAC;EAAEC,KAAK;EAAEC;AAAI,CAAC,KAAK;EAC/D,IAAIA,GAAG,IAAIA,GAAG,CAACC,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI,EAAE;IACtC,OAAQ,GAAEF,KAAK,CAACG,SAAU,KAAI;EAClC;EACA,OAAQ,GAAEH,KAAK,CAACG,SAAU,UAAS;AACvC,CAAC;AAED,MAAMC,SAA4B,GAAG,CAAC;EAAEC;AAAM,CAAC,KAAK;EAChD,OAAOA,KAAK;AAChB,CAAC;AAEM,MAAMC,qBAAqB,GAAG,MAA0D;EAC3F,OAAO,IAAIC,sGAAkD,CAAC;IAC1DC,SAAS,EAAE,KAAK;IAChBC,IAAI,EAAEV,UAAU;IAChBK;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createTimeSearchPlugin = void 0;
|
|
7
|
-
var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("../../plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
|
|
8
|
-
const transform = params => {
|
|
9
|
-
var _field$settings;
|
|
10
|
-
const {
|
|
11
|
-
field,
|
|
12
|
-
value
|
|
13
|
-
} = params;
|
|
14
|
-
if (!value || ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.type) !== "time") {
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
const [hours, minutes, seconds = 0] = value.split(":").map(Number);
|
|
18
|
-
return hours * 60 * 60 + minutes * 60 + seconds;
|
|
19
|
-
};
|
|
20
|
-
const createTimeSearchPlugin = () => {
|
|
21
|
-
return new _CmsEntryElasticsearchQueryBuilderValueSearchPlugin.CmsEntryElasticsearchQueryBuilderValueSearchPlugin({
|
|
22
|
-
fieldType: "datetime",
|
|
23
|
-
transform
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
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,KAAK;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAC/B,IAAI,CAACE,KAAK,IAAI,oBAAAD,KAAK,CAACE,QAAQ,oDAAd,gBAAgBC,IAAI,MAAK,MAAM,EAAE;IAC3C,OAAOF,KAAK;EAChB;EACA,MAAM,CAACG,KAAK,EAAEC,OAAO,EAAEC,OAAO,GAAG,CAAC,CAAC,GAAGL,KAAK,CAACM,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAACC,MAAM,CAAC;EAClE,OAAOL,KAAK,GAAG,EAAE,GAAG,EAAE,GAAGC,OAAO,GAAG,EAAE,GAAGC,OAAO;AACnD,CAAC;AAEM,MAAMI,sBAAsB,GAAG,MAA0D;EAC5F,OAAO,IAAIC,sGAAkD,CAAC;IAC1DC,SAAS,EAAE,UAAU;IACrBd;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { CmsEntry, CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import { CmsIndexEntry } from "../types";
|
|
3
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
4
|
-
interface SetupEntriesIndexHelpersParams {
|
|
5
|
-
plugins: PluginsContainer;
|
|
6
|
-
}
|
|
7
|
-
interface ExtractEntriesFromIndexParams extends SetupEntriesIndexHelpersParams {
|
|
8
|
-
model: CmsModel;
|
|
9
|
-
entries: CmsIndexEntry[];
|
|
10
|
-
}
|
|
11
|
-
interface PrepareElasticsearchDataParams extends SetupEntriesIndexHelpersParams {
|
|
12
|
-
model: CmsModel;
|
|
13
|
-
entry: CmsEntry;
|
|
14
|
-
storageEntry: CmsEntry;
|
|
15
|
-
}
|
|
16
|
-
export declare const prepareEntryToIndex: (params: PrepareElasticsearchDataParams) => CmsIndexEntry;
|
|
17
|
-
export declare const extractEntriesFromIndex: ({ plugins, entries, model }: ExtractEntriesFromIndexParams) => CmsEntry[];
|
|
18
|
-
export {};
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.prepareEntryToIndex = exports.extractEntriesFromIndex = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
10
|
-
const prepareEntryToIndex = params => {
|
|
11
|
-
const {
|
|
12
|
-
plugins,
|
|
13
|
-
storageEntry,
|
|
14
|
-
entry,
|
|
15
|
-
model
|
|
16
|
-
} = params;
|
|
17
|
-
const {
|
|
18
|
-
fieldIndexPlugins,
|
|
19
|
-
defaultIndexFieldPlugin,
|
|
20
|
-
fieldTypePlugins
|
|
21
|
-
} = setupEntriesIndexHelpers({
|
|
22
|
-
plugins
|
|
23
|
-
});
|
|
24
|
-
function getFieldIndexPlugin(fieldType) {
|
|
25
|
-
return fieldIndexPlugins[fieldType] || defaultIndexFieldPlugin;
|
|
26
|
-
}
|
|
27
|
-
function getFieldTypePlugin(fieldType) {
|
|
28
|
-
const pl = fieldTypePlugins[fieldType];
|
|
29
|
-
if (pl) {
|
|
30
|
-
return pl;
|
|
31
|
-
}
|
|
32
|
-
throw new _error.default(`Missing field type plugin "${fieldType}". Prepare entry for index.`);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// These objects will contain values processed by field index plugins
|
|
36
|
-
const values = {};
|
|
37
|
-
const rawValues = {};
|
|
38
|
-
|
|
39
|
-
// We're only interested in current model fields.
|
|
40
|
-
for (const field of model.fields) {
|
|
41
|
-
if (storageEntry.values.hasOwnProperty(field.storageId) === false) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
const targetFieldPlugin = getFieldIndexPlugin(field.type);
|
|
45
|
-
|
|
46
|
-
// TODO: remove this `if` once we convert this plugin to proper plugin class
|
|
47
|
-
if (!targetFieldPlugin || !targetFieldPlugin.toIndex) {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
const {
|
|
51
|
-
value,
|
|
52
|
-
rawValue
|
|
53
|
-
} = targetFieldPlugin.toIndex({
|
|
54
|
-
plugins,
|
|
55
|
-
model,
|
|
56
|
-
field,
|
|
57
|
-
rawValue: entry.values[field.storageId],
|
|
58
|
-
value: storageEntry.values[field.storageId],
|
|
59
|
-
getFieldIndexPlugin,
|
|
60
|
-
getFieldTypePlugin
|
|
61
|
-
});
|
|
62
|
-
if (typeof value !== "undefined") {
|
|
63
|
-
values[field.storageId] = value;
|
|
64
|
-
}
|
|
65
|
-
if (typeof rawValue !== "undefined") {
|
|
66
|
-
rawValues[field.storageId] = rawValue;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, storageEntry), {}, {
|
|
70
|
-
values,
|
|
71
|
-
rawValues
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
exports.prepareEntryToIndex = prepareEntryToIndex;
|
|
75
|
-
const setupEntriesIndexHelpers = ({
|
|
76
|
-
plugins: pluginsContainer
|
|
77
|
-
}) => {
|
|
78
|
-
const plugins = pluginsContainer.byType("cms-model-field-to-elastic-search");
|
|
79
|
-
const fieldIndexPlugins = {};
|
|
80
|
-
for (const plugin of plugins.reverse()) {
|
|
81
|
-
if (fieldIndexPlugins[plugin.fieldType]) {
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
fieldIndexPlugins[plugin.fieldType] = plugin;
|
|
85
|
-
}
|
|
86
|
-
// we will use this plugin if no targeted plugin found
|
|
87
|
-
const defaultIndexFieldPlugin = plugins.find(plugin => plugin.fieldType === "*");
|
|
88
|
-
|
|
89
|
-
// CmsModelFieldToGraphQLPlugin plugins
|
|
90
|
-
const fieldTypePlugins = pluginsContainer.byType("cms-model-field-to-graphql").reduce((plugins, plugin) => (0, _objectSpread2.default)((0, _objectSpread2.default)({}, plugins), {}, {
|
|
91
|
-
[plugin.fieldType]: plugin
|
|
92
|
-
}), {});
|
|
93
|
-
return {
|
|
94
|
-
fieldIndexPlugins,
|
|
95
|
-
defaultIndexFieldPlugin,
|
|
96
|
-
fieldTypePlugins
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
const extractEntriesFromIndex = ({
|
|
100
|
-
plugins,
|
|
101
|
-
entries,
|
|
102
|
-
model
|
|
103
|
-
}) => {
|
|
104
|
-
const {
|
|
105
|
-
fieldIndexPlugins,
|
|
106
|
-
defaultIndexFieldPlugin,
|
|
107
|
-
fieldTypePlugins
|
|
108
|
-
} = setupEntriesIndexHelpers({
|
|
109
|
-
plugins
|
|
110
|
-
});
|
|
111
|
-
function getFieldIndexPlugin(fieldType) {
|
|
112
|
-
return fieldIndexPlugins[fieldType] || defaultIndexFieldPlugin;
|
|
113
|
-
}
|
|
114
|
-
function getFieldTypePlugin(fieldType) {
|
|
115
|
-
return fieldTypePlugins[fieldType];
|
|
116
|
-
}
|
|
117
|
-
const list = [];
|
|
118
|
-
for (const entry of entries) {
|
|
119
|
-
// This object will contain values processed by field index plugins
|
|
120
|
-
const indexValues = {};
|
|
121
|
-
|
|
122
|
-
// We only consider fields that are present in the model
|
|
123
|
-
for (const field of model.fields) {
|
|
124
|
-
const fieldTypePlugin = fieldTypePlugins[field.type];
|
|
125
|
-
if (!fieldTypePlugin) {
|
|
126
|
-
throw new _error.default(`Missing field type plugin "${field.type}". Extract entries from index.`);
|
|
127
|
-
}
|
|
128
|
-
const targetFieldPlugin = getFieldIndexPlugin(field.type);
|
|
129
|
-
if (!targetFieldPlugin || !targetFieldPlugin.fromIndex) {
|
|
130
|
-
continue;
|
|
131
|
-
}
|
|
132
|
-
try {
|
|
133
|
-
indexValues[field.storageId] = targetFieldPlugin.fromIndex({
|
|
134
|
-
plugins,
|
|
135
|
-
model,
|
|
136
|
-
field,
|
|
137
|
-
getFieldIndexPlugin,
|
|
138
|
-
getFieldTypePlugin,
|
|
139
|
-
value: entry.values[field.storageId],
|
|
140
|
-
/**
|
|
141
|
-
* Possibly no rawValues so we must check for the existence of the field.
|
|
142
|
-
*/
|
|
143
|
-
rawValue: entry.rawValues ? entry.rawValues[field.storageId] : null
|
|
144
|
-
});
|
|
145
|
-
} catch (ex) {
|
|
146
|
-
throw new _error.default(ex.message || "Could not transform entry field from index.", ex.code || "FIELD_FROM_INDEX_ERROR", {
|
|
147
|
-
field,
|
|
148
|
-
entry
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Let's have a new entry so we do not modify the original one.
|
|
154
|
-
*/
|
|
155
|
-
const newEntry = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, entry), {}, {
|
|
156
|
-
values: indexValues
|
|
157
|
-
});
|
|
158
|
-
/**
|
|
159
|
-
* If we want to remove the rawValues, TYPE, latest, published and __type, we must make them optional or ignore them.
|
|
160
|
-
*/
|
|
161
|
-
// @ts-ignore
|
|
162
|
-
delete newEntry["rawValues"];
|
|
163
|
-
// @ts-ignore
|
|
164
|
-
delete newEntry["TYPE"];
|
|
165
|
-
// @ts-ignore
|
|
166
|
-
delete newEntry["__type"];
|
|
167
|
-
// @ts-ignore
|
|
168
|
-
delete newEntry["latest"];
|
|
169
|
-
// @ts-ignore
|
|
170
|
-
delete newEntry["published"];
|
|
171
|
-
list.push((0, _objectSpread2.default)({}, newEntry));
|
|
172
|
-
}
|
|
173
|
-
return list;
|
|
174
|
-
};
|
|
175
|
-
exports.extractEntriesFromIndex = extractEntriesFromIndex;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["prepareEntryToIndex","params","plugins","storageEntry","entry","model","fieldIndexPlugins","defaultIndexFieldPlugin","fieldTypePlugins","setupEntriesIndexHelpers","getFieldIndexPlugin","fieldType","getFieldTypePlugin","pl","WebinyError","values","rawValues","field","fields","hasOwnProperty","storageId","targetFieldPlugin","type","toIndex","value","rawValue","pluginsContainer","byType","plugin","reverse","find","reduce","extractEntriesFromIndex","entries","list","indexValues","fieldTypePlugin","fromIndex","ex","message","code","newEntry","push"],"sources":["entryIndexHelpers.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsEntry, CmsModel, CmsModelFieldToGraphQLPlugin } from \"@webiny/api-headless-cms/types\";\nimport { CmsIndexEntry, CmsModelFieldToElasticsearchPlugin } from \"~/types\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\ninterface SetupEntriesIndexHelpersParams {\n plugins: PluginsContainer;\n}\n\ninterface ExtractEntriesFromIndexParams extends SetupEntriesIndexHelpersParams {\n model: CmsModel;\n entries: CmsIndexEntry[];\n}\n\ninterface PrepareElasticsearchDataParams extends SetupEntriesIndexHelpersParams {\n model: CmsModel;\n entry: CmsEntry;\n storageEntry: CmsEntry;\n}\n\nexport const prepareEntryToIndex = (params: PrepareElasticsearchDataParams): CmsIndexEntry => {\n const { plugins, storageEntry, entry, model } = params;\n const { fieldIndexPlugins, defaultIndexFieldPlugin, fieldTypePlugins } =\n setupEntriesIndexHelpers({ plugins });\n\n function getFieldIndexPlugin(fieldType: string) {\n return fieldIndexPlugins[fieldType] || defaultIndexFieldPlugin;\n }\n\n function getFieldTypePlugin(fieldType: string) {\n const pl = fieldTypePlugins[fieldType];\n if (pl) {\n return pl;\n }\n throw new WebinyError(`Missing field type plugin \"${fieldType}\". Prepare entry for index.`);\n }\n\n // These objects will contain values processed by field index plugins\n const values: Record<string, string> = {};\n const rawValues: Record<string, string> = {};\n\n // We're only interested in current model fields.\n for (const field of model.fields) {\n if (storageEntry.values.hasOwnProperty(field.storageId) === false) {\n continue;\n }\n\n const targetFieldPlugin = getFieldIndexPlugin(field.type);\n\n // TODO: remove this `if` once we convert this plugin to proper plugin class\n if (!targetFieldPlugin || !targetFieldPlugin.toIndex) {\n continue;\n }\n\n const { value, rawValue } = targetFieldPlugin.toIndex({\n plugins,\n model,\n field,\n rawValue: entry.values[field.storageId],\n value: storageEntry.values[field.storageId],\n getFieldIndexPlugin,\n getFieldTypePlugin\n });\n\n if (typeof value !== \"undefined\") {\n values[field.storageId] = value;\n }\n\n if (typeof rawValue !== \"undefined\") {\n rawValues[field.storageId] = rawValue;\n }\n }\n return {\n ...storageEntry,\n values,\n rawValues\n } as CmsIndexEntry;\n};\n\nconst setupEntriesIndexHelpers = ({\n plugins: pluginsContainer\n}: SetupEntriesIndexHelpersParams) => {\n const plugins = pluginsContainer.byType<CmsModelFieldToElasticsearchPlugin>(\n \"cms-model-field-to-elastic-search\"\n );\n\n const fieldIndexPlugins: Record<string, CmsModelFieldToElasticsearchPlugin> = {};\n for (const plugin of plugins.reverse()) {\n if (fieldIndexPlugins[plugin.fieldType]) {\n continue;\n }\n fieldIndexPlugins[plugin.fieldType] = plugin;\n }\n // we will use this plugin if no targeted plugin found\n const defaultIndexFieldPlugin = plugins.find(plugin => plugin.fieldType === \"*\");\n\n // CmsModelFieldToGraphQLPlugin plugins\n const fieldTypePlugins: Record<string, CmsModelFieldToGraphQLPlugin> = pluginsContainer\n .byType<CmsModelFieldToGraphQLPlugin>(\"cms-model-field-to-graphql\")\n .reduce((plugins, plugin) => ({ ...plugins, [plugin.fieldType]: plugin }), {});\n\n return {\n fieldIndexPlugins,\n defaultIndexFieldPlugin,\n fieldTypePlugins\n };\n};\n\nexport const extractEntriesFromIndex = ({\n plugins,\n entries,\n model\n}: ExtractEntriesFromIndexParams): CmsEntry[] => {\n const { fieldIndexPlugins, defaultIndexFieldPlugin, fieldTypePlugins } =\n setupEntriesIndexHelpers({ plugins });\n\n function getFieldIndexPlugin(fieldType: string) {\n return fieldIndexPlugins[fieldType] || defaultIndexFieldPlugin;\n }\n\n function getFieldTypePlugin(fieldType: string) {\n return fieldTypePlugins[fieldType];\n }\n\n const list: CmsEntry[] = [];\n\n for (const entry of entries) {\n // This object will contain values processed by field index plugins\n const indexValues: Record<string, string> = {};\n\n // We only consider fields that are present in the model\n for (const field of model.fields) {\n const fieldTypePlugin = fieldTypePlugins[field.type];\n if (!fieldTypePlugin) {\n throw new WebinyError(\n `Missing field type plugin \"${field.type}\". Extract entries from index.`\n );\n }\n\n const targetFieldPlugin = getFieldIndexPlugin(field.type);\n if (!targetFieldPlugin || !targetFieldPlugin.fromIndex) {\n continue;\n }\n try {\n indexValues[field.storageId] = targetFieldPlugin.fromIndex({\n plugins,\n model,\n field,\n getFieldIndexPlugin,\n getFieldTypePlugin,\n value: entry.values[field.storageId],\n /**\n * Possibly no rawValues so we must check for the existence of the field.\n */\n rawValue: entry.rawValues ? entry.rawValues[field.storageId] : null\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not transform entry field from index.\",\n ex.code || \"FIELD_FROM_INDEX_ERROR\",\n {\n field,\n entry\n }\n );\n }\n }\n /**\n * Let's have a new entry so we do not modify the original one.\n */\n const newEntry: CmsEntry = {\n ...entry,\n values: indexValues\n };\n /**\n * If we want to remove the rawValues, TYPE, latest, published and __type, we must make them optional or ignore them.\n */\n // @ts-ignore\n delete newEntry[\"rawValues\"];\n // @ts-ignore\n delete newEntry[\"TYPE\"];\n // @ts-ignore\n delete newEntry[\"__type\"];\n // @ts-ignore\n delete newEntry[\"latest\"];\n // @ts-ignore\n delete newEntry[\"published\"];\n list.push({ ...newEntry });\n }\n\n return list;\n};\n"],"mappings":";;;;;;;;AAAA;AAoBO,MAAMA,mBAAmB,GAAIC,MAAsC,IAAoB;EAC1F,MAAM;IAAEC,OAAO;IAAEC,YAAY;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGJ,MAAM;EACtD,MAAM;IAAEK,iBAAiB;IAAEC,uBAAuB;IAAEC;EAAiB,CAAC,GAClEC,wBAAwB,CAAC;IAAEP;EAAQ,CAAC,CAAC;EAEzC,SAASQ,mBAAmB,CAACC,SAAiB,EAAE;IAC5C,OAAOL,iBAAiB,CAACK,SAAS,CAAC,IAAIJ,uBAAuB;EAClE;EAEA,SAASK,kBAAkB,CAACD,SAAiB,EAAE;IAC3C,MAAME,EAAE,GAAGL,gBAAgB,CAACG,SAAS,CAAC;IACtC,IAAIE,EAAE,EAAE;MACJ,OAAOA,EAAE;IACb;IACA,MAAM,IAAIC,cAAW,CAAE,8BAA6BH,SAAU,6BAA4B,CAAC;EAC/F;;EAEA;EACA,MAAMI,MAA8B,GAAG,CAAC,CAAC;EACzC,MAAMC,SAAiC,GAAG,CAAC,CAAC;;EAE5C;EACA,KAAK,MAAMC,KAAK,IAAIZ,KAAK,CAACa,MAAM,EAAE;IAC9B,IAAIf,YAAY,CAACY,MAAM,CAACI,cAAc,CAACF,KAAK,CAACG,SAAS,CAAC,KAAK,KAAK,EAAE;MAC/D;IACJ;IAEA,MAAMC,iBAAiB,GAAGX,mBAAmB,CAACO,KAAK,CAACK,IAAI,CAAC;;IAEzD;IACA,IAAI,CAAC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AK;UACLY,KAAK;UACLP,mBAAmB;UACnBE,kBAAkB;UAClBY,KAAK,EAAEpB,KAAK,CAACW,MAAM,CAACE,KAAK,CAACG,SAAS,CAAC;UACpC;AACpB;AACA;UACoBK,QAAQ,EAAErB,KAAK,CAACY,SAAS,GAAGZ,KAAK,CAACY,SAAS,CAACC,KAAK,CAACG,SAAS,CAAC,GAAG;QACnE,CAAC,CAAC;MACN,CAAC,CAAC,OAAOkB,EAAE,EAAE;QACT,MAAM,IAAIxB,cAAW,CACjBwB,EAAE,CAACC,OAAO,IAAI,6CAA6C,EAC3DD,EAAE,CAACE,IAAI,IAAI,wBAAwB,EACnC;UACIvB,KAAK;UACLb;QACJ,CAAC,CACJ;MACL;IACJ;IACA;AACR;AACA;IACQ,MAAMqC,QAAkB,+DACjBrC,KAAK;MACRW,MAAM,EAAEoB;IAAW,EACtB;IACD;AACR;AACA;IACQ;IACA,OAAOM,QAAQ,CAAC,WAAW,CAAC;IAC5B;IACA,OAAOA,QAAQ,CAAC,MAAM,CAAC;IACvB;IACA,OAAOA,QAAQ,CAAC,QAAQ,CAAC;IACzB;IACA,OAAOA,QAAQ,CAAC,QAAQ,CAAC;IACzB;IACA,OAAOA,QAAQ,CAAC,WAAW,CAAC;IAC5BP,IAAI,CAACQ,IAAI,iCAAMD,QAAQ,EAAG;EAC9B;EAEA,OAAOP,IAAI;AACf,CAAC;AAAC"}
|
package/helpers/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./entryIndexHelpers";
|
package/helpers/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _entryIndexHelpers = require("./entryIndexHelpers");
|
|
7
|
-
Object.keys(_entryIndexHelpers).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _entryIndexHelpers[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _entryIndexHelpers[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
package/helpers/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./entryIndexHelpers\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createStorageOperations","params","attributes","table","esTable","documentClient","elasticsearch","plugins","userPlugins","tableInstance","createTable","tableElasticsearchInstance","createElasticsearchTable","entities","settings","createSettingsEntity","entityName","ENTITIES","SETTINGS","system","createSystemEntity","SYSTEM","groups","createGroupEntity","GROUPS","models","createModelEntity","MODELS","entries","createEntryEntity","ENTRIES","entriesEs","createEntryElasticsearchEntity","ENTRIES_ES","PluginsContainer","dynamoDbValueFilters","dynamoDbPlugins","elasticsearchPlugins","elasticsearchIndexPlugins","createFilterPlugins","name","beforeInit","context","register","types","CompressionPlugin","type","ElasticsearchQueryBuilderOperatorPlugin","CmsEntryFilterPlugin","CmsEntryElasticsearchBodyModifierPlugin","CmsEntryElasticsearchFullTextSearchPlugin","CmsEntryElasticsearchIndexPlugin","CmsEntryElasticsearchQueryBuilderValueSearchPlugin","CmsEntryElasticsearchQueryModifierPlugin","CmsEntryElasticsearchSortModifierPlugin","CmsEntryElasticsearchFieldPlugin","mergeByType","init","cms","onModelBeforeCreate","subscribe","model","createElasticsearchIndex","onModelBeforeCreateFrom","onModelAfterDelete","deleteElasticsearchIndex","onModelInitialize","getEntities","getTable","getEsTable","createSystemStorageOperations","entity","createSettingsStorageOperations","createGroupsStorageOperations","createModelsStorageOperations","createEntriesStorageOperations","esEntity"],"sources":["index.ts"],"sourcesContent":["import dynamoDbValueFilters from \"@webiny/db-dynamodb/plugins/filters\";\nimport elasticsearchPlugins from \"./elasticsearch\";\nimport dynamoDbPlugins from \"./dynamoDb\";\nimport { createSettingsStorageOperations } from \"./operations/settings\";\nimport { createSystemStorageOperations } from \"./operations/system\";\nimport { createModelsStorageOperations } from \"./operations/model\";\nimport { createEntriesStorageOperations } from \"./operations/entry\";\nimport { ENTITIES, StorageOperationsFactory } from \"~/types\";\nimport { createTable } from \"~/definitions/table\";\nimport { createElasticsearchTable } from \"~/definitions/tableElasticsearch\";\nimport { createGroupEntity } from \"~/definitions/group\";\nimport { createModelEntity } from \"~/definitions/model\";\nimport { createEntryEntity } from \"~/definitions/entry\";\nimport { createEntryElasticsearchEntity } from \"~/definitions/entryElasticsearch\";\nimport { createSystemEntity } from \"~/definitions/system\";\nimport { createSettingsEntity } from \"~/definitions/settings\";\nimport { createElasticsearchIndex } from \"~/elasticsearch/createElasticsearchIndex\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { createGroupsStorageOperations } from \"~/operations/group\";\nimport {\n CompressionPlugin,\n ElasticsearchQueryBuilderOperatorPlugin\n} from \"@webiny/api-elasticsearch\";\nimport { elasticsearchIndexPlugins } from \"./elasticsearch/indices\";\nimport { deleteElasticsearchIndex } from \"./elasticsearch/deleteElasticsearchIndex\";\nimport {\n CmsEntryElasticsearchBodyModifierPlugin,\n CmsEntryElasticsearchFullTextSearchPlugin,\n CmsEntryElasticsearchIndexPlugin,\n CmsEntryElasticsearchQueryBuilderValueSearchPlugin,\n CmsEntryElasticsearchQueryModifierPlugin,\n CmsEntryElasticsearchSortModifierPlugin,\n CmsEntryElasticsearchFieldPlugin\n} from \"~/plugins\";\nimport { createFilterPlugins } from \"~/operations/entry/elasticsearch/filtering/plugins\";\nimport { CmsEntryFilterPlugin } from \"~/plugins/CmsEntryFilterPlugin\";\n\nexport * from \"./plugins\";\n\nexport const createStorageOperations: StorageOperationsFactory = params => {\n const {\n attributes,\n table,\n esTable,\n documentClient,\n elasticsearch,\n plugins: userPlugins\n } = params;\n\n const tableInstance = createTable({\n table,\n documentClient\n });\n const tableElasticsearchInstance = createElasticsearchTable({\n table: esTable,\n documentClient\n });\n\n const entities = {\n settings: createSettingsEntity({\n entityName: ENTITIES.SETTINGS,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.SETTINGS] : {}\n }),\n system: createSystemEntity({\n entityName: ENTITIES.SYSTEM,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.SYSTEM] : {}\n }),\n groups: createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.GROUPS] : {}\n }),\n models: createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.MODELS] : {}\n }),\n entries: createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance,\n attributes: attributes ? attributes[ENTITIES.ENTRIES] : {}\n }),\n entriesEs: createEntryElasticsearchEntity({\n entityName: ENTITIES.ENTRIES_ES,\n table: tableElasticsearchInstance,\n attributes: attributes ? attributes[ENTITIES.ENTRIES_ES] : {}\n })\n };\n\n const plugins = new PluginsContainer([\n /**\n * DynamoDB filter plugins for the where conditions.\n */\n dynamoDbValueFilters(),\n /**\n * Field plugins for DynamoDB.\n */\n dynamoDbPlugins(),\n /**\n * Field plugins for Elasticsearch.\n */\n elasticsearchPlugins(),\n /**\n * Built-in Elasticsearch index templates.\n */\n elasticsearchIndexPlugins(),\n /**\n * Filter plugins used to apply filtering from where conditions to Elasticsearch query.\n */\n createFilterPlugins(),\n /**\n * User defined custom plugins.\n * They are at the end because we can then override existing plugins.\n */\n ...(userPlugins || [])\n ]);\n\n return {\n name: \"dynamodb:elasticsearch\",\n beforeInit: async context => {\n /**\n * Attach the elasticsearch into context if it is not already attached.\n */\n if (!context.elasticsearch) {\n context.elasticsearch = elasticsearch;\n }\n /**\n * Pass the plugins to the parent context.\n */\n context.plugins.register([dynamoDbPlugins()]);\n /**\n * We need to fetch all the plugin types in the list from the main container.\n * This way we do not need to register plugins in the storage plugins contains.\n */\n const types: string[] = [\n // Elasticsearch\n CompressionPlugin.type,\n ElasticsearchQueryBuilderOperatorPlugin.type,\n // Headless CMS\n \"cms-model-field-to-graphql\",\n CmsEntryFilterPlugin.type,\n CmsEntryElasticsearchBodyModifierPlugin.type,\n CmsEntryElasticsearchFullTextSearchPlugin.type,\n CmsEntryElasticsearchIndexPlugin.type,\n CmsEntryElasticsearchQueryBuilderValueSearchPlugin.type,\n CmsEntryElasticsearchQueryModifierPlugin.type,\n CmsEntryElasticsearchSortModifierPlugin.type,\n CmsEntryElasticsearchFieldPlugin.type\n ];\n for (const type of types) {\n plugins.mergeByType(context.plugins, type);\n }\n },\n init: async context => {\n /**\n * We need to create indexes on before model create and on clone (create from).\n * Other apps create indexes on locale creation.\n */\n context.cms.onModelBeforeCreate.subscribe(async ({ model }) => {\n await createElasticsearchIndex({\n elasticsearch,\n model,\n plugins\n });\n });\n context.cms.onModelBeforeCreateFrom.subscribe(async ({ model }) => {\n await createElasticsearchIndex({\n elasticsearch,\n model,\n plugins\n });\n });\n context.cms.onModelAfterDelete.subscribe(async ({ model }) => {\n await deleteElasticsearchIndex({\n elasticsearch,\n model\n });\n });\n\n context.cms.onModelInitialize.subscribe(async ({ model }) => {\n await createElasticsearchIndex({\n elasticsearch,\n model,\n plugins\n });\n });\n },\n getEntities: () => entities,\n getTable: () => tableInstance,\n getEsTable: () => tableElasticsearchInstance,\n system: createSystemStorageOperations({\n entity: entities.system\n }),\n settings: createSettingsStorageOperations({\n entity: entities.settings\n }),\n groups: createGroupsStorageOperations({\n entity: entities.groups,\n plugins\n }),\n models: createModelsStorageOperations({\n entity: entities.models,\n elasticsearch\n }),\n entries: createEntriesStorageOperations({\n entity: entities.entries,\n esEntity: entities.entriesEs,\n plugins,\n elasticsearch\n })\n };\n};\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AAC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EAAC;UAC3BxD,aAAa;UACbuD,KAAK;UACLtD;QACJ,CAAC,CAAC;MACN,CAAC,CAAC;IACN,CAAC;IACD4D,WAAW,EAAE,MAAMtD,QAAQ;IAC3BuD,QAAQ,EAAE,MAAM3D,aAAa;IAC7B4D,UAAU,EAAE,MAAM1D,0BAA0B;IAC5CQ,MAAM,EAAE,IAAAmD,qCAA6B,EAAC;MAClCC,MAAM,EAAE1D,QAAQ,CAACM;IACrB,CAAC,CAAC;IACFL,QAAQ,EAAE,IAAA0D,yCAA+B,EAAC;MACtCD,MAAM,EAAE1D,QAAQ,CAACC;IACrB,CAAC,CAAC;IACFQ,MAAM,EAAE,IAAAmD,qCAA6B,EAAC;MAClCF,MAAM,EAAE1D,QAAQ,CAACS,MAAM;MACvBf;IACJ,CAAC,CAAC;IACFkB,MAAM,EAAE,IAAAiD,oCAA6B,EAAC;MAClCH,MAAM,EAAE1D,QAAQ,CAACY,MAAM;MACvBnB;IACJ,CAAC,CAAC;IACFsB,OAAO,EAAE,IAAA+C,qCAA8B,EAAC;MACpCJ,MAAM,EAAE1D,QAAQ,CAACe,OAAO;MACxBgD,QAAQ,EAAE/D,QAAQ,CAACkB,SAAS;MAC5BxB,OAAO;MACPD;IACJ,CAAC;EACL,CAAC;AACL,CAAC;AAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BoolQueryConfig } from "@webiny/api-elasticsearch/types";
|
|
2
|
-
/**
|
|
3
|
-
* This function will assign a minimum_should_match for the query if conditions are met:
|
|
4
|
-
* * should is an array
|
|
5
|
-
* * it is not empty
|
|
6
|
-
* * minimum_should_match is not already set
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* By the default we set it to 1 as we want at least one OR condition to produce results.
|
|
10
|
-
*
|
|
11
|
-
* Users can modify minimum_should_match value via the body or query modification plugins.
|
|
12
|
-
*/
|
|
13
|
-
interface Params {
|
|
14
|
-
query: BoolQueryConfig;
|
|
15
|
-
value?: number;
|
|
16
|
-
}
|
|
17
|
-
export declare const assignMinimumShouldMatchToQuery: ({ query, value }: Params) => void;
|
|
18
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.assignMinimumShouldMatchToQuery = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* This function will assign a minimum_should_match for the query if conditions are met:
|
|
9
|
-
* * should is an array
|
|
10
|
-
* * it is not empty
|
|
11
|
-
* * minimum_should_match is not already set
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* By the default we set it to 1 as we want at least one OR condition to produce results.
|
|
15
|
-
*
|
|
16
|
-
* Users can modify minimum_should_match value via the body or query modification plugins.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
const assignMinimumShouldMatchToQuery = ({
|
|
20
|
-
query,
|
|
21
|
-
value = 1
|
|
22
|
-
}) => {
|
|
23
|
-
if (!Array.isArray(query.should)) {
|
|
24
|
-
return;
|
|
25
|
-
} else if (query.should.length === 0) {
|
|
26
|
-
return;
|
|
27
|
-
} else if (query.minimum_should_match) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
query.minimum_should_match = value > 0 ? value : 1;
|
|
31
|
-
};
|
|
32
|
-
exports.assignMinimumShouldMatchToQuery = assignMinimumShouldMatchToQuery;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["assignMinimumShouldMatchToQuery","query","value","Array","isArray","should","length","minimum_should_match"],"sources":["assignMinimumShouldMatchToQuery.ts"],"sourcesContent":["import { BoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\n\n/**\n * This function will assign a minimum_should_match for the query if conditions are met:\n * * should is an array\n * * it is not empty\n * * minimum_should_match is not already set\n *\n *\n * By the default we set it to 1 as we want at least one OR condition to produce results.\n *\n * Users can modify minimum_should_match value via the body or query modification plugins.\n */\ninterface Params {\n query: BoolQueryConfig;\n value?: number;\n}\nexport const assignMinimumShouldMatchToQuery = ({ query, value = 1 }: Params): void => {\n if (!Array.isArray(query.should)) {\n return;\n } else if (query.should.length === 0) {\n return;\n } else if (query.minimum_should_match) {\n return;\n }\n query.minimum_should_match = value > 0 ? value : 1;\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKO,MAAMA,+BAA+B,GAAG,CAAC;EAAEC,KAAK;EAAEC,KAAK,GAAG;AAAU,CAAC,KAAW;EACnF,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,KAAK,CAACI,MAAM,CAAC,EAAE;IAC9B;EACJ,CAAC,MAAM,IAAIJ,KAAK,CAACI,MAAM,CAACC,MAAM,KAAK,CAAC,EAAE;IAClC;EACJ,CAAC,MAAM,IAAIL,KAAK,CAACM,oBAAoB,EAAE;IACnC;EACJ;EACAN,KAAK,CAACM,oBAAoB,GAAGL,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC;AACtD,CAAC;AAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
2
|
-
import { CmsEntryListParams, CmsEntryListWhere, CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
-
import { PrimitiveValue, SearchBody } from "@webiny/api-elasticsearch/types";
|
|
4
|
-
interface Params {
|
|
5
|
-
plugins: PluginsContainer;
|
|
6
|
-
model: CmsModel;
|
|
7
|
-
params: Omit<CmsEntryListParams, "where" | "after"> & {
|
|
8
|
-
where: CmsEntryListWhere;
|
|
9
|
-
after?: PrimitiveValue[];
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export declare const createElasticsearchBody: ({ plugins, model, params }: Params) => SearchBody;
|
|
13
|
-
export {};
|