@webiny/api-headless-cms-ddb-es 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e
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 -6
- package/definitions/entry.js +8 -179
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -7
- package/definitions/group.js +8 -63
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -7
- package/definitions/model.js +8 -107
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/feature.d.ts +9 -0
- package/feature.js +55 -0
- package/feature.js.map +1 -0
- package/index.d.ts +2 -3
- package/index.js +2 -225
- 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 +1 -2
- package/operations/entry/dataLoader/DataLoaderCache.js +21 -35
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +2 -7
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +7 -22
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
- package/operations/entry/dataLoader/getAllEntryRevisions.js +20 -41
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +30 -48
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +30 -48
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
- package/operations/entry/dataLoader/getRevisionById.js +36 -58
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.d.ts +3 -3
- package/operations/entry/dataLoader/index.js +13 -35
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +4 -4
- package/operations/entry/dataLoader/types.js +0 -7
- package/operations/entry/dataLoaders.d.ts +14 -14
- package/operations/entry/dataLoaders.js +92 -110
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +53 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +44 -27
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +4 -18
- 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 +6 -6
- package/operations/entry/transformations/convertEntryKeys.js +21 -34
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +21 -18
- package/operations/entry/transformations/index.js +87 -123
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +30 -35
- package/operations/entry/transformations/modifyEntryValues.js +12 -24
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
- package/operations/entry/transformations/transformEntryKeys.js +14 -24
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
- 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 +40 -36
- package/requestFeature.d.ts +20 -0
- package/requestFeature.js +54 -0
- package/requestFeature.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 +12 -159
- package/types.js +7 -39
- package/types.js.map +1 -1
- package/configurations.d.ts +0 -19
- package/configurations.js +0 -49
- package/configurations.js.map +0 -1
- 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/createElasticsearchIndex.d.ts +0 -9
- package/elasticsearch/createElasticsearchIndex.js +0 -40
- package/elasticsearch/createElasticsearchIndex.js.map +0 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
- package/elasticsearch/deleteElasticsearchIndex.js +0 -38
- package/elasticsearch/deleteElasticsearchIndex.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 +0 -88
- 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 +0 -41
- 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 -13
- 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/searchableJson.d.ts +0 -2
- package/elasticsearch/search/searchableJson.js +0 -60
- package/elasticsearch/search/searchableJson.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/helpers/entryIndexHelpers.d.ts +0 -18
- package/helpers/entryIndexHelpers.js +0 -190
- package/helpers/entryIndexHelpers.js.map +0 -1
- package/helpers/fieldIdentifier.d.ts +0 -6
- package/helpers/fieldIdentifier.js +0 -43
- package/helpers/fieldIdentifier.js.map +0 -1
- package/helpers/index.d.ts +0 -2
- package/helpers/index.js +0 -29
- package/helpers/index.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/entry/dataLoader/types.js.map +0 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -34
- 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 -142
- package/operations/entry/elasticsearch/body.js.map +0 -1
- package/operations/entry/elasticsearch/fields.d.ts +0 -10
- package/operations/entry/elasticsearch/fields.js +0 -315
- 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 -60
- 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 -175
- 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 -18
- package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +0 -16
- package/operations/entry/elasticsearch/filtering/path.js +0 -48
- 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 -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/filtering/populated.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/populated.js +0 -25
- 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 -24
- 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 -91
- 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 -27
- 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 -106
- 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 -36
- package/operations/entry/elasticsearch/keyword.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/operator.d.ts +0 -8
- package/operations/entry/elasticsearch/plugins/operator.js +0 -39
- 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 -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/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -13
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
- package/operations/entry/elasticsearch/sort.d.ts +0 -12
- package/operations/entry/elasticsearch/sort.js +0 -89
- 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 -32
- 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 -7
- package/operations/entry/elasticsearch/types.js.map +0 -1
- package/operations/entry/index.d.ts +0 -11
- package/operations/entry/index.js +0 -1881
- package/operations/entry/index.js.map +0 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
- package/operations/entry/transformations/transformEntryToIndex.js +0 -31
- package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
- package/operations/group/index.d.ts +0 -8
- package/operations/group/index.js +0 -179
- package/operations/group/index.js.map +0 -1
- package/operations/model/index.d.ts +0 -8
- package/operations/model/index.js +0 -183
- package/operations/model/index.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 -32
- 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
- package/tasks/createIndexTaskPlugin.d.ts +0 -2
- package/tasks/createIndexTaskPlugin.js +0 -67
- package/tasks/createIndexTaskPlugin.js.map +0 -1
- package/values/NoValueContainer.d.ts +0 -5
- package/values/NoValueContainer.js +0 -20
- package/values/NoValueContainer.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/model/keys.js","sources":["../../../src/operations/model/keys.ts"],"sourcesContent":["interface PartitionKeysParams {\n tenant: string;\n}\n\nexport const createPartitionKey = (params: PartitionKeysParams): string => {\n const { tenant } = params;\n return `T#${tenant}#CMS#CM`;\n};\n\ninterface SortKeyParams {\n modelId: string;\n}\n\nconst createSortKey = (params: SortKeyParams): string => {\n return params.modelId;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n GSI_TENANT: string;\n}\n\nexport const createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n if (!params.tenant) {\n throw new Error(\"Missing tenant when creating model keys!\");\n }\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params),\n GSI_TENANT: params.tenant\n };\n};\n\nexport const createType = (): string => {\n return \"cms.model\";\n};\n"],"names":["createPartitionKey","params","tenant","createSortKey","createKeys","Error","createType"],"mappings":"AAIO,MAAMA,qBAAqB,CAACC;IAC/B,MAAM,EAAEC,MAAM,EAAE,GAAGD;IACnB,OAAO,CAAC,EAAE,EAAEC,OAAO,OAAO,CAAC;AAC/B;AAMA,MAAMC,gBAAgB,CAACF,SACZA,OAAO,OAAO;AASlB,MAAMG,aAAa,CAACH;IACvB,IAAI,CAACA,OAAO,MAAM,EACd,MAAM,IAAII,MAAM;IAEpB,OAAO;QACH,IAAIL,mBAAmBC;QACvB,IAAIE,cAAcF;QAClB,YAAYA,OAAO,MAAM;IAC7B;AACJ;AAEO,MAAMK,aAAa,IACf"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb-es",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.0-unstable.eb81deee7e",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
5
9
|
"keywords": [
|
|
6
10
|
"@webiny/api-headless-cms",
|
|
7
11
|
"storage-operations",
|
|
@@ -26,46 +30,46 @@
|
|
|
26
30
|
],
|
|
27
31
|
"license": "MIT",
|
|
28
32
|
"dependencies": {
|
|
29
|
-
"@webiny/api": "0.0.0-unstable.
|
|
30
|
-
"@webiny/api-
|
|
31
|
-
"@webiny/api-
|
|
32
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
33
|
-
"@webiny/
|
|
34
|
-
"@webiny/
|
|
35
|
-
"@webiny/
|
|
36
|
-
"@webiny/
|
|
37
|
-
"@webiny/
|
|
38
|
-
"@webiny/
|
|
33
|
+
"@webiny/api": "0.0.0-unstable.eb81deee7e",
|
|
34
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.eb81deee7e",
|
|
35
|
+
"@webiny/api-headless-cms-storage": "0.0.0-unstable.eb81deee7e",
|
|
36
|
+
"@webiny/api-headless-cms-utils-os": "0.0.0-unstable.eb81deee7e",
|
|
37
|
+
"@webiny/api-opensearch": "0.0.0-unstable.eb81deee7e",
|
|
38
|
+
"@webiny/api-opensearch-aws": "0.0.0-unstable.eb81deee7e",
|
|
39
|
+
"@webiny/api-search-index-tasks": "0.0.0-unstable.eb81deee7e",
|
|
40
|
+
"@webiny/db": "0.0.0-unstable.eb81deee7e",
|
|
41
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.eb81deee7e",
|
|
42
|
+
"@webiny/error": "0.0.0-unstable.eb81deee7e",
|
|
43
|
+
"@webiny/feature": "0.0.0-unstable.eb81deee7e",
|
|
44
|
+
"@webiny/plugins": "0.0.0-unstable.eb81deee7e",
|
|
45
|
+
"@webiny/stdlib": "0.0.17",
|
|
46
|
+
"@webiny/utils": "0.0.0-unstable.eb81deee7e",
|
|
39
47
|
"dataloader": "2.2.3",
|
|
40
|
-
"lodash": "4.
|
|
48
|
+
"lodash": "4.18.1"
|
|
41
49
|
},
|
|
42
50
|
"devDependencies": {
|
|
43
|
-
"@elastic/elasticsearch": "7.12.0",
|
|
44
51
|
"@types/jsonpack": "1.1.6",
|
|
45
|
-
"@webiny/api-
|
|
46
|
-
"@webiny/api-
|
|
47
|
-
"@webiny/api-
|
|
48
|
-
"@webiny/api-
|
|
49
|
-
"@webiny/api-
|
|
50
|
-
"@webiny/
|
|
51
|
-
"@webiny/
|
|
52
|
-
"@webiny/
|
|
53
|
-
"@webiny/handler-
|
|
54
|
-
"@webiny/
|
|
55
|
-
"@webiny/
|
|
56
|
-
"jest": "29.7.0",
|
|
52
|
+
"@webiny/api-core": "0.0.0-unstable.eb81deee7e",
|
|
53
|
+
"@webiny/api-core-testing": "0.0.0-unstable.eb81deee7e",
|
|
54
|
+
"@webiny/api-graphql": "0.0.0-unstable.eb81deee7e",
|
|
55
|
+
"@webiny/api-search-index-tasks-ddb-os": "0.0.0-unstable.eb81deee7e",
|
|
56
|
+
"@webiny/api-sync-ddb-to-opensearch": "0.0.0-unstable.eb81deee7e",
|
|
57
|
+
"@webiny/background-tasks": "0.0.0-unstable.eb81deee7e",
|
|
58
|
+
"@webiny/build-tools": "0.0.0-unstable.eb81deee7e",
|
|
59
|
+
"@webiny/di": "1.1.0",
|
|
60
|
+
"@webiny/event-handler-core": "0.0.0-unstable.eb81deee7e",
|
|
61
|
+
"@webiny/handler": "0.0.0-unstable.eb81deee7e",
|
|
62
|
+
"@webiny/wcp": "0.0.0-unstable.eb81deee7e",
|
|
57
63
|
"jest-dynalite": "3.6.1",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
64
|
+
"rimraf": "6.1.3",
|
|
65
|
+
"typescript": "7.0.2",
|
|
66
|
+
"vitest": "4.1.11"
|
|
61
67
|
},
|
|
62
68
|
"publishConfig": {
|
|
63
|
-
"access": "public"
|
|
64
|
-
"directory": "dist"
|
|
65
|
-
},
|
|
66
|
-
"scripts": {
|
|
67
|
-
"build": "node ../cli/bin.js run build",
|
|
68
|
-
"watch": "node ../cli/bin.js run watch"
|
|
69
|
+
"access": "public"
|
|
69
70
|
},
|
|
70
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "b8aec8a1be3f25c3b428b357fe1e352c7cbff9ae",
|
|
72
|
+
"webiny": {
|
|
73
|
+
"publishFrom": "dist"
|
|
74
|
+
}
|
|
71
75
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Container } from "@webiny/feature/api/index.js";
|
|
2
|
+
/**
|
|
3
|
+
* Per-request half of the DynamoDB+OpenSearch CMS storage: the storage operations, the OpenSearch
|
|
4
|
+
* extension points, and everything they keep state in. Register it in the request (child) container,
|
|
5
|
+
* after `HeadlessCmsDdbEsFeature` is in the root.
|
|
6
|
+
*
|
|
7
|
+
* - @webiny/di applies a decorator only if it sits in the same container as the registration it
|
|
8
|
+
* decorates, or in one of that container's parents. Extensions register their decorators in the
|
|
9
|
+
* request container, so with the storage operations and OpenSearch extension points (index, field
|
|
10
|
+
* indexes, filters, modifiers) in the root, an extension decorator on one of them (e.g.
|
|
11
|
+
* `CmsModelOpenSearchIndex`) would be skipped without an error. Registering them here puts the
|
|
12
|
+
* decorator and its target in the same container.
|
|
13
|
+
* - The DataLoader cache must live for one request. A root singleton outlives the request and keeps
|
|
14
|
+
* serving the entries it read first.
|
|
15
|
+
* - The filter registries are mutable; a root instance would collect every request's registrations.
|
|
16
|
+
*/
|
|
17
|
+
export declare const HeadlessCmsDdbEsRequestFeature: {
|
|
18
|
+
name: string;
|
|
19
|
+
register(container: Container): void;
|
|
20
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
+
import { CmsEntryOpenSearchUtilsFeature } from "@webiny/api-headless-cms-utils-os";
|
|
3
|
+
import { FilterRegistriesFeature } from "@webiny/api-headless-cms-storage";
|
|
4
|
+
import { DbRegistry } from "@webiny/db/exports/api/db.js";
|
|
5
|
+
import { CreateElasticsearchIndexTask } from "./tasks/CreateElasticsearchIndexTask.js";
|
|
6
|
+
import { CmsDdbEsEntryEntity } from "./abstractions/CmsDdbEsEntryEntity.js";
|
|
7
|
+
import { CmsDdbEsEntriesEsEntity } from "./abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
8
|
+
import { DdbEsGroupStorageOpsFeature } from "./operations/group/feature.js";
|
|
9
|
+
import { DdbEsModelStorageOpsFeature } from "./operations/model/feature.js";
|
|
10
|
+
import { DdbEsEntryStorageOpsFeature } from "./operations/entry/feature.js";
|
|
11
|
+
import { DataLoadersHandler } from "./operations/entry/dataLoaders.js";
|
|
12
|
+
const resolveDbRegistry = (container)=>{
|
|
13
|
+
try {
|
|
14
|
+
return container.resolve(DbRegistry);
|
|
15
|
+
} catch {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
const HeadlessCmsDdbEsRequestFeature = createFeature({
|
|
20
|
+
name: "cms.storageOperations.openSearch.request",
|
|
21
|
+
register: (container)=>{
|
|
22
|
+
CmsEntryOpenSearchUtilsFeature.register(container);
|
|
23
|
+
FilterRegistriesFeature.register(container);
|
|
24
|
+
container.register(CreateElasticsearchIndexTask);
|
|
25
|
+
const dbRegistry = resolveDbRegistry(container);
|
|
26
|
+
if (dbRegistry) {
|
|
27
|
+
const entryEntity = container.resolve(CmsDdbEsEntryEntity);
|
|
28
|
+
const entriesEsEntity = container.resolve(CmsDdbEsEntriesEsEntity);
|
|
29
|
+
dbRegistry.register({
|
|
30
|
+
item: entryEntity,
|
|
31
|
+
app: "cms",
|
|
32
|
+
tags: [
|
|
33
|
+
"regular",
|
|
34
|
+
entryEntity.name
|
|
35
|
+
]
|
|
36
|
+
});
|
|
37
|
+
dbRegistry.register({
|
|
38
|
+
item: entriesEsEntity,
|
|
39
|
+
app: "cms",
|
|
40
|
+
tags: [
|
|
41
|
+
"es",
|
|
42
|
+
entriesEsEntity.name
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
DdbEsGroupStorageOpsFeature.register(container);
|
|
47
|
+
DdbEsModelStorageOpsFeature.register(container);
|
|
48
|
+
DdbEsEntryStorageOpsFeature.register(container);
|
|
49
|
+
container.register(DataLoadersHandler).inSingletonScope();
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
export { HeadlessCmsDdbEsRequestFeature };
|
|
53
|
+
|
|
54
|
+
//# sourceMappingURL=requestFeature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"requestFeature.js","sources":["../src/requestFeature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport type { Container } from \"@webiny/feature/api/index.js\";\nimport { CmsEntryOpenSearchUtilsFeature } from \"@webiny/api-headless-cms-utils-os\";\nimport { FilterRegistriesFeature } from \"@webiny/api-headless-cms-storage\";\nimport { DbRegistry } from \"@webiny/db/exports/api/db.js\";\nimport { CreateElasticsearchIndexTask } from \"~/tasks/CreateElasticsearchIndexTask.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsDdbEsEntriesEsEntity } from \"~/abstractions/CmsDdbEsEntriesEsEntity.js\";\nimport { DdbEsGroupStorageOpsFeature } from \"~/operations/group/feature.js\";\nimport { DdbEsModelStorageOpsFeature } from \"~/operations/model/feature.js\";\nimport { DdbEsEntryStorageOpsFeature } from \"~/operations/entry/feature.js\";\nimport { DataLoadersHandler } from \"~/operations/entry/dataLoaders.js\";\n\nconst resolveDbRegistry = (container: Container): DbRegistry.Interface | undefined => {\n try {\n return container.resolve(DbRegistry);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Per-request half of the DynamoDB+OpenSearch CMS storage: the storage operations, the OpenSearch\n * extension points, and everything they keep state in. Register it in the request (child) container,\n * after `HeadlessCmsDdbEsFeature` is in the root.\n *\n * - @webiny/di applies a decorator only if it sits in the same container as the registration it\n * decorates, or in one of that container's parents. Extensions register their decorators in the\n * request container, so with the storage operations and OpenSearch extension points (index, field\n * indexes, filters, modifiers) in the root, an extension decorator on one of them (e.g.\n * `CmsModelOpenSearchIndex`) would be skipped without an error. Registering them here puts the\n * decorator and its target in the same container.\n * - The DataLoader cache must live for one request. A root singleton outlives the request and keeps\n * serving the entries it read first.\n * - The filter registries are mutable; a root instance would collect every request's registrations.\n */\nexport const HeadlessCmsDdbEsRequestFeature = createFeature({\n name: \"cms.storageOperations.openSearch.request\",\n register: container => {\n CmsEntryOpenSearchUtilsFeature.register(container);\n FilterRegistriesFeature.register(container);\n\n container.register(CreateElasticsearchIndexTask);\n\n // DbRegistry is per request (DbRegistryFeature), so the root entities are registered into it\n // here. Optional: not every setup registers DbRegistry.\n const dbRegistry = resolveDbRegistry(container);\n if (dbRegistry) {\n const entryEntity = container.resolve(CmsDdbEsEntryEntity);\n const entriesEsEntity = container.resolve(CmsDdbEsEntriesEsEntity);\n dbRegistry.register({\n item: entryEntity,\n app: \"cms\",\n tags: [\"regular\", entryEntity.name]\n });\n dbRegistry.register({\n item: entriesEsEntity,\n app: \"cms\",\n tags: [\"es\", entriesEsEntity.name]\n });\n }\n\n DdbEsGroupStorageOpsFeature.register(container);\n DdbEsModelStorageOpsFeature.register(container);\n DdbEsEntryStorageOpsFeature.register(container);\n\n container.register(DataLoadersHandler).inSingletonScope();\n }\n});\n"],"names":["resolveDbRegistry","container","DbRegistry","HeadlessCmsDdbEsRequestFeature","createFeature","CmsEntryOpenSearchUtilsFeature","FilterRegistriesFeature","CreateElasticsearchIndexTask","dbRegistry","entryEntity","CmsDdbEsEntryEntity","entriesEsEntity","CmsDdbEsEntriesEsEntity","DdbEsGroupStorageOpsFeature","DdbEsModelStorageOpsFeature","DdbEsEntryStorageOpsFeature","DataLoadersHandler"],"mappings":";;;;;;;;;;;AAaA,MAAMA,oBAAoB,CAACC;IACvB,IAAI;QACA,OAAOA,UAAU,OAAO,CAACC;IAC7B,EAAE,OAAM;QACJ;IACJ;AACJ;AAiBO,MAAMC,iCAAiCC,cAAc;IACxD,MAAM;IACN,UAAUH,CAAAA;QACNI,+BAA+B,QAAQ,CAACJ;QACxCK,wBAAwB,QAAQ,CAACL;QAEjCA,UAAU,QAAQ,CAACM;QAInB,MAAMC,aAAaR,kBAAkBC;QACrC,IAAIO,YAAY;YACZ,MAAMC,cAAcR,UAAU,OAAO,CAACS;YACtC,MAAMC,kBAAkBV,UAAU,OAAO,CAACW;YAC1CJ,WAAW,QAAQ,CAAC;gBAChB,MAAMC;gBACN,KAAK;gBACL,MAAM;oBAAC;oBAAWA,YAAY,IAAI;iBAAC;YACvC;YACAD,WAAW,QAAQ,CAAC;gBAChB,MAAMG;gBACN,KAAK;gBACL,MAAM;oBAAC;oBAAMA,gBAAgB,IAAI;iBAAC;YACtC;QACJ;QAEAE,4BAA4B,QAAQ,CAACZ;QACrCa,4BAA4B,QAAQ,CAACb;QACrCc,4BAA4B,QAAQ,CAACd;QAErCA,UAAU,QAAQ,CAACe,oBAAoB,gBAAgB;IAC3D;AACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TenantIndexFactory } from "@webiny/api-search-index-tasks";
|
|
2
|
+
import { ListModelsUseCase } from "@webiny/api-headless-cms/features/contentModel/ListModels/index.js";
|
|
3
|
+
import { CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
4
|
+
declare class CreateElasticsearchIndexTaskImpl implements TenantIndexFactory.Interface {
|
|
5
|
+
private readonly indexProvider;
|
|
6
|
+
private listModels;
|
|
7
|
+
constructor(indexProvider: CmsModelOpenSearchIndexProvider.Interface, listModels: ListModelsUseCase.Interface);
|
|
8
|
+
getIndexList(tenant: TenantIndexFactory.Tenant): Promise<TenantIndexFactory.IndexConfig[]>;
|
|
9
|
+
}
|
|
10
|
+
export declare const CreateElasticsearchIndexTask: typeof CreateElasticsearchIndexTaskImpl & {
|
|
11
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-search-index-tasks/abstractions/TenantIndexFactory").ITenantIndexFactory>;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { TenantIndexFactory } from "@webiny/api-search-index-tasks";
|
|
2
|
+
import { ListModelsUseCase } from "@webiny/api-headless-cms/features/contentModel/ListModels/index.js";
|
|
3
|
+
import { createConfigurations } from "@webiny/api-headless-cms-utils-os/configurations.js";
|
|
4
|
+
import { CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
5
|
+
class CreateElasticsearchIndexTaskImpl {
|
|
6
|
+
constructor(indexProvider, listModels){
|
|
7
|
+
this.indexProvider = indexProvider;
|
|
8
|
+
this.listModels = listModels;
|
|
9
|
+
}
|
|
10
|
+
async getIndexList(tenant) {
|
|
11
|
+
const result = await this.listModels.execute();
|
|
12
|
+
const models = result.value;
|
|
13
|
+
if (0 === models.length) return [];
|
|
14
|
+
const configurations = createConfigurations(this.indexProvider);
|
|
15
|
+
const indices = [];
|
|
16
|
+
for (const model of models){
|
|
17
|
+
const { index, settings } = await configurations.es({
|
|
18
|
+
model: {
|
|
19
|
+
...model,
|
|
20
|
+
tenant: tenant.id
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
indices.push({
|
|
24
|
+
index,
|
|
25
|
+
settings
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return indices;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const CreateElasticsearchIndexTask = TenantIndexFactory.createImplementation({
|
|
32
|
+
implementation: CreateElasticsearchIndexTaskImpl,
|
|
33
|
+
dependencies: [
|
|
34
|
+
CmsModelOpenSearchIndexProvider,
|
|
35
|
+
ListModelsUseCase
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
export { CreateElasticsearchIndexTask };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=CreateElasticsearchIndexTask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tasks/CreateElasticsearchIndexTask.js","sources":["../../src/tasks/CreateElasticsearchIndexTask.ts"],"sourcesContent":["import { TenantIndexFactory } from \"@webiny/api-search-index-tasks\";\nimport { ListModelsUseCase } from \"@webiny/api-headless-cms/features/contentModel/ListModels/index.js\";\nimport { createConfigurations } from \"@webiny/api-headless-cms-utils-os/configurations.js\";\nimport { CmsModelOpenSearchIndexProvider } from \"@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js\";\n\nclass CreateElasticsearchIndexTaskImpl implements TenantIndexFactory.Interface {\n constructor(\n private readonly indexProvider: CmsModelOpenSearchIndexProvider.Interface,\n private listModels: ListModelsUseCase.Interface\n ) {}\n\n async getIndexList(\n tenant: TenantIndexFactory.Tenant\n ): Promise<TenantIndexFactory.IndexConfig[]> {\n const result = await this.listModels.execute();\n const models = result.value;\n\n if (models.length === 0) {\n return [];\n }\n\n const configurations = createConfigurations(this.indexProvider);\n\n const indices: TenantIndexFactory.IndexConfig[] = [];\n for (const model of models) {\n const { index, settings } = await configurations.es({\n model: {\n ...model,\n tenant: tenant.id\n }\n });\n indices.push({ index, settings });\n }\n return indices;\n }\n}\n\nexport const CreateElasticsearchIndexTask = TenantIndexFactory.createImplementation({\n implementation: CreateElasticsearchIndexTaskImpl,\n dependencies: [CmsModelOpenSearchIndexProvider, ListModelsUseCase]\n});\n"],"names":["CreateElasticsearchIndexTaskImpl","indexProvider","listModels","tenant","result","models","configurations","createConfigurations","indices","model","index","settings","CreateElasticsearchIndexTask","TenantIndexFactory","CmsModelOpenSearchIndexProvider","ListModelsUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YACqBC,aAAwD,EACjEC,UAAuC,CACjD;aAFmBD,aAAa,GAAbA;aACTC,UAAU,GAAVA;IACT;IAEH,MAAM,aACFC,MAAiC,EACQ;QACzC,MAAMC,SAAS,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO;QAC5C,MAAMC,SAASD,OAAO,KAAK;QAE3B,IAAIC,AAAkB,MAAlBA,OAAO,MAAM,EACb,OAAO,EAAE;QAGb,MAAMC,iBAAiBC,qBAAqB,IAAI,CAAC,aAAa;QAE9D,MAAMC,UAA4C,EAAE;QACpD,KAAK,MAAMC,SAASJ,OAAQ;YACxB,MAAM,EAAEK,KAAK,EAAEC,QAAQ,EAAE,GAAG,MAAML,eAAe,EAAE,CAAC;gBAChD,OAAO;oBACH,GAAGG,KAAK;oBACR,QAAQN,OAAO,EAAE;gBACrB;YACJ;YACAK,QAAQ,IAAI,CAAC;gBAAEE;gBAAOC;YAAS;QACnC;QACA,OAAOH;IACX;AACJ;AAEO,MAAMI,+BAA+BC,mBAAmB,oBAAoB,CAAC;IAChF,gBAAgBb;IAChB,cAAc;QAACc;QAAiCC;KAAkB;AACtE"}
|
package/types.d.ts
CHANGED
|
@@ -1,169 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
import type { AttributeDefinition, Entity, Table, TableConstructor } from "@webiny/db-dynamodb/toolbox";
|
|
4
|
-
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
5
|
-
import type { Client } from "@elastic/elasticsearch";
|
|
6
|
-
import type { PluginsContainer } from "@webiny/plugins";
|
|
7
|
-
/**
|
|
8
|
-
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
9
|
-
*
|
|
10
|
-
* @category Elasticsearch
|
|
11
|
-
* @category CmsEntry
|
|
12
|
-
*/
|
|
13
|
-
export interface CmsIndexEntry extends CmsEntry {
|
|
14
|
-
/**
|
|
15
|
-
* Values that are not going to be indexed.
|
|
16
|
-
*/
|
|
17
|
-
rawValues: Record<string, any>;
|
|
18
|
-
/**
|
|
19
|
-
* A first part of the ID, without the revision.
|
|
20
|
-
* For example, we can search for all the revisions of the given entry.
|
|
21
|
-
*/
|
|
22
|
-
primaryId: string;
|
|
23
|
-
/**
|
|
24
|
-
* Dev can add what ever keys they want and need. Just need to be careful not to break the entry.
|
|
25
|
-
*/
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.
|
|
30
|
-
*
|
|
31
|
-
* @category Elasticsearch
|
|
32
|
-
* @category CmsEntry
|
|
33
|
-
*/
|
|
34
|
-
export interface CmsModelFieldToElasticsearchToParams {
|
|
35
|
-
plugins: PluginsContainer;
|
|
36
|
-
model: CmsModel;
|
|
37
|
-
field: CmsModelField;
|
|
38
|
-
/**
|
|
39
|
-
* Raw value on the entry - before prepare for storage.
|
|
40
|
-
*/
|
|
41
|
-
rawValue: any;
|
|
42
|
-
/**
|
|
43
|
-
* Value prepared for storage received from base api-headless-cms package.
|
|
44
|
-
*/
|
|
45
|
-
value: any;
|
|
46
|
-
getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;
|
|
47
|
-
getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Arguments for the method that is transforming content entry from Elasticsearch into the original one.
|
|
51
|
-
*
|
|
52
|
-
* @category Elasticsearch
|
|
53
|
-
* @category CmsEntry
|
|
54
|
-
*/
|
|
55
|
-
export interface CmsModelFieldToElasticsearchFromParams {
|
|
56
|
-
plugins: PluginsContainer;
|
|
57
|
-
model: CmsModel;
|
|
58
|
-
field: CmsModelField;
|
|
59
|
-
value: any;
|
|
60
|
-
rawValue: any;
|
|
61
|
-
getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;
|
|
62
|
-
getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;
|
|
63
|
-
}
|
|
64
|
-
interface ToIndexValue {
|
|
65
|
-
/**
|
|
66
|
-
* Use this key to store value for indexing.
|
|
67
|
-
*/
|
|
68
|
-
value?: any;
|
|
69
|
-
/**
|
|
70
|
-
* Use this key to tell ES that this value should not be indexed.
|
|
71
|
-
*/
|
|
72
|
-
rawValue?: any;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* A plugin defining transformation of entry for Elasticsearch.
|
|
76
|
-
*
|
|
77
|
-
* @category Plugin
|
|
78
|
-
* @category ContentModelField
|
|
79
|
-
* @category CmsEntry
|
|
80
|
-
* @category Elasticsearch
|
|
81
|
-
*/
|
|
82
|
-
export interface CmsModelFieldToElasticsearchPlugin extends Plugin {
|
|
83
|
-
/**
|
|
84
|
-
* A plugin type
|
|
85
|
-
*/
|
|
86
|
-
type: "cms-model-field-to-elastic-search";
|
|
87
|
-
/**
|
|
88
|
-
* A unique identifier of the field type (text, number, json, myField, ...).
|
|
89
|
-
*
|
|
90
|
-
* ```ts
|
|
91
|
-
* fieldType: "myField"
|
|
92
|
-
* ```
|
|
93
|
-
*/
|
|
94
|
-
fieldType: CmsModelFieldType;
|
|
95
|
-
/**
|
|
96
|
-
* If you need to define a type when building an Elasticsearch query.
|
|
97
|
-
* Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.
|
|
98
|
-
*
|
|
99
|
-
* ```ts
|
|
100
|
-
* unmappedType: "date"
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
unmappedType?: (field: Pick<CmsModelField, "fieldId" | "type">) => string;
|
|
104
|
-
/**
|
|
105
|
-
* This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.
|
|
106
|
-
* It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.
|
|
107
|
-
*
|
|
108
|
-
* ```ts
|
|
109
|
-
* toIndex({ value }) {
|
|
110
|
-
* return {
|
|
111
|
-
* value: value, // This will be stored and indexed
|
|
112
|
-
* rawValue: JSON.stringify(value) // This will be stored but excluded from indexing
|
|
113
|
-
* };
|
|
114
|
-
* }
|
|
115
|
-
* ```
|
|
116
|
-
*/
|
|
117
|
-
toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;
|
|
118
|
-
/**
|
|
119
|
-
* This is meant to revert a transformation done in the `toIndex` method.
|
|
120
|
-
* You have access to "value" or a "rawValue", depending on what you returned from `toIndex`.
|
|
121
|
-
*
|
|
122
|
-
* ```ts
|
|
123
|
-
* fromIndex({ value, rawValue }) {
|
|
124
|
-
* return JSON.parse(rawValue);
|
|
125
|
-
* }
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
|
-
fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;
|
|
129
|
-
}
|
|
130
|
-
export type Attributes = Record<string, AttributeDefinition>;
|
|
1
|
+
import type { CmsContext, CmsEntryValues, CmsModel, CmsStorageEntry } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
export { CmsContext };
|
|
131
3
|
export declare enum ENTITIES {
|
|
132
|
-
SYSTEM = "CmsSystem",
|
|
133
4
|
GROUPS = "CmsGroups",
|
|
134
5
|
MODELS = "CmsModels",
|
|
135
6
|
ENTRIES = "CmsEntries",
|
|
136
7
|
ENTRIES_ES = "CmsEntriesElasticsearch"
|
|
137
8
|
}
|
|
138
|
-
export interface TableModifier {
|
|
139
|
-
(table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;
|
|
140
|
-
}
|
|
141
|
-
export interface StorageOperationsFactoryParams {
|
|
142
|
-
documentClient: DynamoDBDocument;
|
|
143
|
-
elasticsearch: Client;
|
|
144
|
-
table?: TableModifier;
|
|
145
|
-
esTable?: TableModifier;
|
|
146
|
-
attributes?: Record<ENTITIES, Attributes>;
|
|
147
|
-
plugins?: PluginCollection;
|
|
148
|
-
}
|
|
149
|
-
export interface CmsContext extends BaseCmsContext {
|
|
150
|
-
[key: string]: any;
|
|
151
|
-
}
|
|
152
|
-
export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {
|
|
153
|
-
getTable: () => Table<string, string, string>;
|
|
154
|
-
getEsTable: () => Table<string, string, string>;
|
|
155
|
-
getEntities: () => Record<"system" | "groups" | "models" | "entries" | "entriesEs", Entity<any>>;
|
|
156
|
-
}
|
|
157
|
-
export interface StorageOperationsFactory {
|
|
158
|
-
(params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
|
|
159
|
-
}
|
|
160
|
-
export interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {
|
|
161
|
-
dataLoaders: DataLoadersHandlerInterface;
|
|
162
|
-
}
|
|
163
9
|
export interface DataLoadersHandlerInterfaceClearAllParams {
|
|
164
|
-
|
|
10
|
+
tenant: string;
|
|
11
|
+
}
|
|
12
|
+
export interface DataLoadersHandlerDataLoaderParams {
|
|
13
|
+
model: Pick<CmsModel, "tenant" | "modelId">;
|
|
14
|
+
ids: readonly string[];
|
|
165
15
|
}
|
|
166
|
-
export interface
|
|
16
|
+
export interface IDataLoadersHandler {
|
|
17
|
+
getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
18
|
+
getRevisionById<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
19
|
+
getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
20
|
+
getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoadersHandlerDataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
167
21
|
clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
|
|
168
22
|
}
|
|
169
|
-
export {};
|
package/types.js
CHANGED
|
@@ -1,42 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
9
|
-
*
|
|
10
|
-
* @category Elasticsearch
|
|
11
|
-
* @category CmsEntry
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.
|
|
15
|
-
*
|
|
16
|
-
* @category Elasticsearch
|
|
17
|
-
* @category CmsEntry
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Arguments for the method that is transforming content entry from Elasticsearch into the original one.
|
|
21
|
-
*
|
|
22
|
-
* @category Elasticsearch
|
|
23
|
-
* @category CmsEntry
|
|
24
|
-
*/
|
|
25
|
-
/**
|
|
26
|
-
* A plugin defining transformation of entry for Elasticsearch.
|
|
27
|
-
*
|
|
28
|
-
* @category Plugin
|
|
29
|
-
* @category ContentModelField
|
|
30
|
-
* @category CmsEntry
|
|
31
|
-
* @category Elasticsearch
|
|
32
|
-
*/
|
|
33
|
-
let ENTITIES = exports.ENTITIES = /*#__PURE__*/function (ENTITIES) {
|
|
34
|
-
ENTITIES["SYSTEM"] = "CmsSystem";
|
|
35
|
-
ENTITIES["GROUPS"] = "CmsGroups";
|
|
36
|
-
ENTITIES["MODELS"] = "CmsModels";
|
|
37
|
-
ENTITIES["ENTRIES"] = "CmsEntries";
|
|
38
|
-
ENTITIES["ENTRIES_ES"] = "CmsEntriesElasticsearch";
|
|
39
|
-
return ENTITIES;
|
|
1
|
+
var types_ENTITIES = /*#__PURE__*/ function(ENTITIES) {
|
|
2
|
+
ENTITIES["GROUPS"] = "CmsGroups";
|
|
3
|
+
ENTITIES["MODELS"] = "CmsModels";
|
|
4
|
+
ENTITIES["ENTRIES"] = "CmsEntries";
|
|
5
|
+
ENTITIES["ENTRIES_ES"] = "CmsEntriesElasticsearch";
|
|
6
|
+
return ENTITIES;
|
|
40
7
|
}({});
|
|
8
|
+
export { types_ENTITIES as ENTITIES };
|
|
41
9
|
|
|
42
10
|
//# sourceMappingURL=types.js.map
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n CmsContext,\n CmsEntryValues,\n CmsModel,\n CmsStorageEntry\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport { CmsContext };\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n tenant: string;\n}\n\nexport interface DataLoadersHandlerDataLoaderParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n ids: readonly string[];\n}\n\nexport interface IDataLoadersHandler {\n getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getRevisionById<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"names":["ENTITIES"],"mappings":"AASO,IAAKA,iBAAQA,WAAAA,GAAAA,SAARA,QAAQ;;;;;WAARA"}
|
package/configurations.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import type { CmsContext } from "./types";
|
|
3
|
-
import type { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types";
|
|
4
|
-
interface ConfigurationsElasticsearch {
|
|
5
|
-
index: string;
|
|
6
|
-
}
|
|
7
|
-
export interface CmsElasticsearchParams {
|
|
8
|
-
model: Pick<CmsModel, "tenant" | "locale" | "modelId">;
|
|
9
|
-
}
|
|
10
|
-
export interface ConfigurationsIndexSettingsParams {
|
|
11
|
-
context: CmsContext;
|
|
12
|
-
model: Pick<CmsModel, "locale">;
|
|
13
|
-
}
|
|
14
|
-
export interface Configurations {
|
|
15
|
-
es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;
|
|
16
|
-
indexSettings: (params: ConfigurationsIndexSettingsParams) => Partial<ElasticsearchIndexRequestBody>;
|
|
17
|
-
}
|
|
18
|
-
export declare const configurations: Configurations;
|
|
19
|
-
export {};
|
package/configurations.js
DELETED
|
@@ -1,49 +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.configurations = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
10
|
-
var _plugins = require("./plugins");
|
|
11
|
-
const configurations = exports.configurations = {
|
|
12
|
-
es({
|
|
13
|
-
model
|
|
14
|
-
}) {
|
|
15
|
-
const {
|
|
16
|
-
tenant,
|
|
17
|
-
locale
|
|
18
|
-
} = model;
|
|
19
|
-
if (!tenant) {
|
|
20
|
-
throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
|
|
21
|
-
} else if (!locale) {
|
|
22
|
-
throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
|
|
23
|
-
}
|
|
24
|
-
const sharedIndex = (0, _apiElasticsearch.isSharedElasticsearchIndex)();
|
|
25
|
-
const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
|
|
26
|
-
const prefix = (0, _apiElasticsearch.getElasticsearchIndexPrefix)();
|
|
27
|
-
if (!prefix) {
|
|
28
|
-
return {
|
|
29
|
-
index
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
index: prefix + index
|
|
34
|
-
};
|
|
35
|
-
},
|
|
36
|
-
indexSettings: ({
|
|
37
|
-
context,
|
|
38
|
-
model
|
|
39
|
-
}) => {
|
|
40
|
-
const plugin = (0, _apiElasticsearch.getLastAddedIndexPlugin)({
|
|
41
|
-
container: context.plugins,
|
|
42
|
-
type: _plugins.CmsEntryElasticsearchIndexPlugin.type,
|
|
43
|
-
locale: model.locale
|
|
44
|
-
});
|
|
45
|
-
return plugin ? plugin.body : {};
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=configurations.js.map
|
package/configurations.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_apiElasticsearch","_plugins","configurations","exports","es","model","tenant","locale","WebinyError","sharedIndex","isSharedElasticsearchIndex","index","modelId","join","toLowerCase","prefix","getElasticsearchIndexPrefix","indexSettings","context","plugin","getLastAddedIndexPlugin","container","plugins","type","CmsEntryElasticsearchIndexPlugin","body"],"sources":["configurations.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\nimport type { CmsContext } from \"~/types\";\nimport {\n getElasticsearchIndexPrefix,\n getLastAddedIndexPlugin,\n isSharedElasticsearchIndex\n} from \"@webiny/api-elasticsearch\";\nimport type { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins\";\n\ninterface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\" | \"modelId\">;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n context: CmsContext;\n model: Pick<CmsModel, \"locale\">;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;\n indexSettings: (\n params: ConfigurationsIndexSettingsParams\n ) => Partial<ElasticsearchIndexRequestBody>;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant, locale } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n } else if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n\n const sharedIndex = isSharedElasticsearchIndex();\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getElasticsearchIndexPrefix();\n\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n },\n indexSettings: ({ context, model }) => {\n const plugin = getLastAddedIndexPlugin<CmsEntryElasticsearchIndexPlugin>({\n container: context.plugins,\n type: CmsEntryElasticsearchIndexPlugin.type,\n locale: model.locale\n });\n\n return plugin ? plugin.body : {};\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAsBO,MAAMG,cAA8B,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1CE,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,KAAK;IAEhC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAG,IAAAC,4CAA0B,EAAC,CAAC;IAChD,MAAMC,KAAK,GAAG,CAACF,WAAW,GAAG,MAAM,GAAGH,MAAM,EAAE,cAAc,EAAEC,MAAM,EAAEF,KAAK,CAACO,OAAO,CAAC,CAC/EC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAG,IAAAC,6CAA2B,EAAC,CAAC;IAE5C,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL,CAAC;EACDM,aAAa,EAAEA,CAAC;IAAEC,OAAO;IAAEb;EAAM,CAAC,KAAK;IACnC,MAAMc,MAAM,GAAG,IAAAC,yCAAuB,EAAmC;MACrEC,SAAS,EAAEH,OAAO,CAACI,OAAO;MAC1BC,IAAI,EAAEC,yCAAgC,CAACD,IAAI;MAC3ChB,MAAM,EAAEF,KAAK,CAACE;IAClB,CAAC,CAAC;IAEF,OAAOY,MAAM,GAAGA,MAAM,CAACM,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Table } from "@webiny/db-dynamodb/toolbox";
|
|
2
|
-
import { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
-
import type { Attributes } from "../types";
|
|
4
|
-
export interface CreateEntryElasticsearchEntityParams {
|
|
5
|
-
table: Table<string, string, string>;
|
|
6
|
-
entityName: string;
|
|
7
|
-
attributes: Attributes;
|
|
8
|
-
}
|
|
9
|
-
export declare const createEntryElasticsearchEntity: (params: CreateEntryElasticsearchEntityParams) => Entity<any>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createEntryElasticsearchEntity = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createEntryElasticsearchEntity = params => {
|
|
9
|
-
const {
|
|
10
|
-
table,
|
|
11
|
-
entityName,
|
|
12
|
-
attributes
|
|
13
|
-
} = params;
|
|
14
|
-
return new _toolbox.Entity({
|
|
15
|
-
name: entityName,
|
|
16
|
-
table,
|
|
17
|
-
attributes: {
|
|
18
|
-
PK: {
|
|
19
|
-
type: "string",
|
|
20
|
-
partitionKey: true
|
|
21
|
-
},
|
|
22
|
-
SK: {
|
|
23
|
-
type: "string",
|
|
24
|
-
sortKey: true
|
|
25
|
-
},
|
|
26
|
-
index: {
|
|
27
|
-
type: "string"
|
|
28
|
-
},
|
|
29
|
-
data: {
|
|
30
|
-
type: "map"
|
|
31
|
-
},
|
|
32
|
-
TYPE: {
|
|
33
|
-
type: "string"
|
|
34
|
-
},
|
|
35
|
-
...(attributes || {})
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=entryElasticsearch.js.map
|