@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
package/definitions/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"definitions/model.js","sources":["../../src/definitions/model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<StorageCmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"names":["createModelEntity","params","table","entityName","createStandardEntity"],"mappings":";AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAsC;QACzC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
|
|
2
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
+
import type { CmsEntryStatus, CmsGroup, CmsIdentity, ICmsEntryLive, ICmsEntryLocation, ICmsEntrySystem, StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
4
|
+
export interface IEntryEntityAttributesData {
|
|
5
|
+
tenant: string;
|
|
6
|
+
entryId: string;
|
|
7
|
+
id: string;
|
|
8
|
+
modelId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Revision-level meta fields. 👇
|
|
11
|
+
*/
|
|
12
|
+
revisionCreatedOn: string;
|
|
13
|
+
revisionModifiedOn: string | null;
|
|
14
|
+
revisionSavedOn: string;
|
|
15
|
+
revisionDeletedOn: string | null;
|
|
16
|
+
revisionRestoredOn: string | null;
|
|
17
|
+
revisionFirstPublishedOn: string | null;
|
|
18
|
+
revisionLastPublishedOn: string | null;
|
|
19
|
+
revisionCreatedBy: CmsIdentity;
|
|
20
|
+
revisionModifiedBy: CmsIdentity | null;
|
|
21
|
+
revisionSavedBy: CmsIdentity;
|
|
22
|
+
revisionDeletedBy: CmsIdentity | null;
|
|
23
|
+
revisionRestoredBy: CmsIdentity | null;
|
|
24
|
+
revisionFirstPublishedBy: CmsIdentity | null;
|
|
25
|
+
revisionLastPublishedBy: CmsIdentity | null;
|
|
26
|
+
/**
|
|
27
|
+
* Entry-level meta fields. 👇
|
|
28
|
+
*/
|
|
29
|
+
createdOn: string;
|
|
30
|
+
modifiedOn: string | null;
|
|
31
|
+
savedOn: string;
|
|
32
|
+
deletedOn: string | null;
|
|
33
|
+
restoredOn: string | null;
|
|
34
|
+
firstPublishedOn: string | null;
|
|
35
|
+
lastPublishedOn: string | null;
|
|
36
|
+
createdBy: CmsIdentity;
|
|
37
|
+
modifiedBy: CmsIdentity | null;
|
|
38
|
+
savedBy: CmsIdentity;
|
|
39
|
+
deletedBy: CmsIdentity | null;
|
|
40
|
+
restoredBy: CmsIdentity | null;
|
|
41
|
+
firstPublishedBy: CmsIdentity | null;
|
|
42
|
+
lastPublishedBy: CmsIdentity | null;
|
|
43
|
+
/**
|
|
44
|
+
* The rest. 👇
|
|
45
|
+
*/
|
|
46
|
+
version: number;
|
|
47
|
+
locked: boolean;
|
|
48
|
+
status: CmsEntryStatus;
|
|
49
|
+
location?: ICmsEntryLocation;
|
|
50
|
+
wbyDeleted?: boolean | null;
|
|
51
|
+
binOriginalFolderId?: string;
|
|
52
|
+
values: GenericRecord;
|
|
53
|
+
meta?: GenericRecord;
|
|
54
|
+
system?: ICmsEntrySystem;
|
|
55
|
+
live: ICmsEntryLive | null;
|
|
56
|
+
revisionDescription: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* A timestamp of when the entry should be automatically deleted from the database.
|
|
59
|
+
*/
|
|
60
|
+
expiresAt: number | null;
|
|
61
|
+
}
|
|
62
|
+
export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
|
|
63
|
+
export type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;
|
|
64
|
+
export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
|
|
65
|
+
export type IEntryEntity = IEntity<IEntryEntityAttributes>;
|
|
File without changes
|
package/feature.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Root half of the DynamoDB+OpenSearch CMS storage: the table and entity definitions, built once per
|
|
3
|
+
* process. The storage operations and OpenSearch extension points are per request, in
|
|
4
|
+
* `HeadlessCmsDdbEsRequestFeature`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HeadlessCmsDdbEsFeature: {
|
|
7
|
+
name: string;
|
|
8
|
+
register(container: import("@webiny/di").Container): void;
|
|
9
|
+
};
|
package/feature.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { DynamoDBClient, createTable } from "@webiny/db-dynamodb";
|
|
2
|
+
import { ENTITIES } from "./types.js";
|
|
3
|
+
import { createFeature } from "@webiny/feature/api/index.js";
|
|
4
|
+
import { createGroupEntity } from "./definitions/group.js";
|
|
5
|
+
import { createModelEntity } from "./definitions/model.js";
|
|
6
|
+
import { createEntryEntity } from "./definitions/entry.js";
|
|
7
|
+
import { createOpenSearchEntity, createOpenSearchTable } from "@webiny/api-opensearch-aws";
|
|
8
|
+
import { FilterUtilFeature } from "@webiny/db-dynamodb/feature/FilterUtil/feature.js";
|
|
9
|
+
import { CmsDdbEsTable } from "./abstractions/CmsDdbEsTable.js";
|
|
10
|
+
import { CmsDdbEsOsTable } from "./abstractions/CmsDdbEsOsTable.js";
|
|
11
|
+
import { CmsDdbEsGroupEntity } from "./abstractions/CmsDdbEsGroupEntity.js";
|
|
12
|
+
import { CmsDdbEsModelEntity } from "./abstractions/CmsDdbEsModelEntity.js";
|
|
13
|
+
import { CmsDdbEsEntryEntity } from "./abstractions/CmsDdbEsEntryEntity.js";
|
|
14
|
+
import { CmsDdbEsEntriesEsEntity } from "./abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
15
|
+
const HeadlessCmsDdbEsFeature = createFeature({
|
|
16
|
+
name: "cms.storageOperations.openSearch",
|
|
17
|
+
register: (container)=>{
|
|
18
|
+
FilterUtilFeature.register(container);
|
|
19
|
+
const db = container.resolve(DynamoDBClient);
|
|
20
|
+
const documentClient = db.client;
|
|
21
|
+
const tableInstance = createTable({
|
|
22
|
+
name: process.env.DB_TABLE,
|
|
23
|
+
documentClient
|
|
24
|
+
});
|
|
25
|
+
const tableElasticsearchInstance = createOpenSearchTable({
|
|
26
|
+
name: process.env.DB_TABLE_OPENSEARCH,
|
|
27
|
+
documentClient
|
|
28
|
+
});
|
|
29
|
+
const groupEntity = createGroupEntity({
|
|
30
|
+
entityName: ENTITIES.GROUPS,
|
|
31
|
+
table: tableInstance
|
|
32
|
+
});
|
|
33
|
+
const modelEntity = createModelEntity({
|
|
34
|
+
entityName: ENTITIES.MODELS,
|
|
35
|
+
table: tableInstance
|
|
36
|
+
});
|
|
37
|
+
const entryEntity = createEntryEntity({
|
|
38
|
+
entityName: ENTITIES.ENTRIES,
|
|
39
|
+
table: tableInstance
|
|
40
|
+
});
|
|
41
|
+
const entriesEsEntity = createOpenSearchEntity({
|
|
42
|
+
entityName: ENTITIES.ENTRIES_ES,
|
|
43
|
+
table: tableElasticsearchInstance
|
|
44
|
+
});
|
|
45
|
+
container.registerInstance(CmsDdbEsTable, tableInstance);
|
|
46
|
+
container.registerInstance(CmsDdbEsOsTable, tableElasticsearchInstance);
|
|
47
|
+
container.registerInstance(CmsDdbEsGroupEntity, groupEntity);
|
|
48
|
+
container.registerInstance(CmsDdbEsModelEntity, modelEntity);
|
|
49
|
+
container.registerInstance(CmsDdbEsEntryEntity, entryEntity);
|
|
50
|
+
container.registerInstance(CmsDdbEsEntriesEsEntity, entriesEsEntity);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
export { HeadlessCmsDdbEsFeature };
|
|
54
|
+
|
|
55
|
+
//# sourceMappingURL=feature.js.map
|
package/feature.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sources":["../src/feature.ts"],"sourcesContent":["import { createTable, DynamoDBClient } from \"@webiny/db-dynamodb\";\nimport { ENTITIES } from \"~/types.js\";\nimport { createFeature } from \"@webiny/feature/api/index.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { createOpenSearchEntity, createOpenSearchTable } from \"@webiny/api-opensearch-aws\";\nimport { FilterUtilFeature } from \"@webiny/db-dynamodb/feature/FilterUtil/feature.js\";\nimport { CmsDdbEsTable } from \"~/abstractions/CmsDdbEsTable.js\";\nimport { CmsDdbEsOsTable } from \"~/abstractions/CmsDdbEsOsTable.js\";\nimport { CmsDdbEsGroupEntity } from \"~/abstractions/CmsDdbEsGroupEntity.js\";\nimport { CmsDdbEsModelEntity } from \"~/abstractions/CmsDdbEsModelEntity.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsDdbEsEntriesEsEntity } from \"~/abstractions/CmsDdbEsEntriesEsEntity.js\";\n\n/**\n * Root half of the DynamoDB+OpenSearch CMS storage: the table and entity definitions, built once per\n * process. The storage operations and OpenSearch extension points are per request, in\n * `HeadlessCmsDdbEsRequestFeature`.\n */\nexport const HeadlessCmsDdbEsFeature = createFeature({\n name: \"cms.storageOperations.openSearch\",\n register: container => {\n FilterUtilFeature.register(container);\n\n const db = container.resolve(DynamoDBClient);\n const documentClient = db.client;\n\n const tableInstance = createTable({\n name: process.env.DB_TABLE as string,\n documentClient\n });\n const tableElasticsearchInstance = createOpenSearchTable({\n name: process.env.DB_TABLE_OPENSEARCH as string,\n documentClient\n });\n\n const groupEntity = createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n });\n const modelEntity = createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n });\n const entryEntity = createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n });\n const entriesEsEntity = createOpenSearchEntity({\n entityName: ENTITIES.ENTRIES_ES,\n table: tableElasticsearchInstance\n });\n\n // Register infrastructure instances (app-scoped)\n container.registerInstance(CmsDdbEsTable, tableInstance);\n container.registerInstance(CmsDdbEsOsTable, tableElasticsearchInstance);\n container.registerInstance(CmsDdbEsGroupEntity, groupEntity);\n container.registerInstance(CmsDdbEsModelEntity, modelEntity);\n container.registerInstance(CmsDdbEsEntryEntity, entryEntity);\n container.registerInstance(CmsDdbEsEntriesEsEntity, entriesEsEntity);\n }\n});\n"],"names":["HeadlessCmsDdbEsFeature","createFeature","container","FilterUtilFeature","db","DynamoDBClient","documentClient","tableInstance","createTable","process","tableElasticsearchInstance","createOpenSearchTable","groupEntity","createGroupEntity","ENTITIES","modelEntity","createModelEntity","entryEntity","createEntryEntity","entriesEsEntity","createOpenSearchEntity","CmsDdbEsTable","CmsDdbEsOsTable","CmsDdbEsGroupEntity","CmsDdbEsModelEntity","CmsDdbEsEntryEntity","CmsDdbEsEntriesEsEntity"],"mappings":";;;;;;;;;;;;;;AAoBO,MAAMA,0BAA0BC,cAAc;IACjD,MAAM;IACN,UAAUC,CAAAA;QACNC,kBAAkB,QAAQ,CAACD;QAE3B,MAAME,KAAKF,UAAU,OAAO,CAACG;QAC7B,MAAMC,iBAAiBF,GAAG,MAAM;QAEhC,MAAMG,gBAAgBC,YAAY;YAC9B,MAAMC,QAAQ,GAAG,CAAC,QAAQ;YAC1BH;QACJ;QACA,MAAMI,6BAA6BC,sBAAsB;YACrD,MAAMF,QAAQ,GAAG,CAAC,mBAAmB;YACrCH;QACJ;QAEA,MAAMM,cAAcC,kBAAkB;YAClC,YAAYC,SAAS,MAAM;YAC3B,OAAOP;QACX;QACA,MAAMQ,cAAcC,kBAAkB;YAClC,YAAYF,SAAS,MAAM;YAC3B,OAAOP;QACX;QACA,MAAMU,cAAcC,kBAAkB;YAClC,YAAYJ,SAAS,OAAO;YAC5B,OAAOP;QACX;QACA,MAAMY,kBAAkBC,uBAAuB;YAC3C,YAAYN,SAAS,UAAU;YAC/B,OAAOJ;QACX;QAGAR,UAAU,gBAAgB,CAACmB,eAAed;QAC1CL,UAAU,gBAAgB,CAACoB,iBAAiBZ;QAC5CR,UAAU,gBAAgB,CAACqB,qBAAqBX;QAChDV,UAAU,gBAAgB,CAACsB,qBAAqBT;QAChDb,UAAU,gBAAgB,CAACuB,qBAAqBR;QAChDf,UAAU,gBAAgB,CAACwB,yBAAyBP;IACxD;AACJ"}
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare const createStorageOperations: StorageOperationsFactory;
|
|
1
|
+
export { HeadlessCmsDdbEsFeature } from "./feature.js";
|
|
2
|
+
export { HeadlessCmsDdbEsRequestFeature } from "./requestFeature.js";
|
package/index.js
CHANGED
|
@@ -1,225 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var _exportNames = {
|
|
8
|
-
createStorageOperations: true
|
|
9
|
-
};
|
|
10
|
-
exports.createStorageOperations = void 0;
|
|
11
|
-
var _filters = _interopRequireDefault(require("@webiny/db-dynamodb/plugins/filters"));
|
|
12
|
-
var _elasticsearch = _interopRequireDefault(require("./elasticsearch"));
|
|
13
|
-
var _dynamoDb = _interopRequireDefault(require("./dynamoDb"));
|
|
14
|
-
var _system = require("./operations/system");
|
|
15
|
-
var _model = require("./operations/model");
|
|
16
|
-
var _entry = require("./operations/entry");
|
|
17
|
-
var _types = require("./types");
|
|
18
|
-
var _table = require("./definitions/table");
|
|
19
|
-
var _tableElasticsearch = require("./definitions/tableElasticsearch");
|
|
20
|
-
var _group = require("./definitions/group");
|
|
21
|
-
var _model2 = require("./definitions/model");
|
|
22
|
-
var _entry2 = require("./definitions/entry");
|
|
23
|
-
var _entryElasticsearch = require("./definitions/entryElasticsearch");
|
|
24
|
-
var _system2 = require("./definitions/system");
|
|
25
|
-
var _createElasticsearchIndex = require("./elasticsearch/createElasticsearchIndex");
|
|
26
|
-
var _plugins = require("@webiny/plugins");
|
|
27
|
-
var _group2 = require("./operations/group");
|
|
28
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
29
|
-
var _indices = require("./elasticsearch/indices");
|
|
30
|
-
var _deleteElasticsearchIndex = require("./elasticsearch/deleteElasticsearchIndex");
|
|
31
|
-
var _plugins2 = require("./plugins");
|
|
32
|
-
Object.keys(_plugins2).forEach(function (key) {
|
|
33
|
-
if (key === "default" || key === "__esModule") return;
|
|
34
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
35
|
-
if (key in exports && exports[key] === _plugins2[key]) return;
|
|
36
|
-
Object.defineProperty(exports, key, {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _plugins2[key];
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
var _plugins3 = require("./operations/entry/elasticsearch/filtering/plugins");
|
|
44
|
-
var _CmsEntryFilterPlugin = require("./plugins/CmsEntryFilterPlugin");
|
|
45
|
-
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
|
46
|
-
var _indexes = require("./operations/system/indexes");
|
|
47
|
-
var _createIndexTaskPlugin = require("./tasks/createIndexTaskPlugin");
|
|
48
|
-
var _api = require("@webiny/api");
|
|
49
|
-
const createStorageOperations = params => {
|
|
50
|
-
const {
|
|
51
|
-
attributes,
|
|
52
|
-
table,
|
|
53
|
-
esTable,
|
|
54
|
-
documentClient,
|
|
55
|
-
elasticsearch,
|
|
56
|
-
plugins: userPlugins
|
|
57
|
-
} = params;
|
|
58
|
-
const tableInstance = (0, _table.createTable)({
|
|
59
|
-
table,
|
|
60
|
-
documentClient
|
|
61
|
-
});
|
|
62
|
-
const tableElasticsearchInstance = (0, _tableElasticsearch.createElasticsearchTable)({
|
|
63
|
-
table: esTable,
|
|
64
|
-
documentClient
|
|
65
|
-
});
|
|
66
|
-
const entities = {
|
|
67
|
-
system: (0, _system2.createSystemEntity)({
|
|
68
|
-
entityName: _types.ENTITIES.SYSTEM,
|
|
69
|
-
table: tableInstance,
|
|
70
|
-
attributes: attributes ? attributes[_types.ENTITIES.SYSTEM] : {}
|
|
71
|
-
}),
|
|
72
|
-
groups: (0, _group.createGroupEntity)({
|
|
73
|
-
entityName: _types.ENTITIES.GROUPS,
|
|
74
|
-
table: tableInstance,
|
|
75
|
-
attributes: attributes ? attributes[_types.ENTITIES.GROUPS] : {}
|
|
76
|
-
}),
|
|
77
|
-
models: (0, _model2.createModelEntity)({
|
|
78
|
-
entityName: _types.ENTITIES.MODELS,
|
|
79
|
-
table: tableInstance,
|
|
80
|
-
attributes: attributes ? attributes[_types.ENTITIES.MODELS] : {}
|
|
81
|
-
}),
|
|
82
|
-
entries: (0, _entry2.createEntryEntity)({
|
|
83
|
-
entityName: _types.ENTITIES.ENTRIES,
|
|
84
|
-
table: tableInstance,
|
|
85
|
-
attributes: attributes ? attributes[_types.ENTITIES.ENTRIES] : {}
|
|
86
|
-
}),
|
|
87
|
-
entriesEs: (0, _entryElasticsearch.createEntryElasticsearchEntity)({
|
|
88
|
-
entityName: _types.ENTITIES.ENTRIES_ES,
|
|
89
|
-
table: tableElasticsearchInstance,
|
|
90
|
-
attributes: attributes ? attributes[_types.ENTITIES.ENTRIES_ES] : {}
|
|
91
|
-
})
|
|
92
|
-
};
|
|
93
|
-
const plugins = new _plugins.PluginsContainer([
|
|
94
|
-
/**
|
|
95
|
-
* DynamoDB filter plugins for the where conditions.
|
|
96
|
-
*/
|
|
97
|
-
(0, _filters.default)(),
|
|
98
|
-
/**
|
|
99
|
-
* Field plugins for DynamoDB.
|
|
100
|
-
*/
|
|
101
|
-
(0, _dynamoDb.default)(),
|
|
102
|
-
/**
|
|
103
|
-
* Field plugins for Elasticsearch.
|
|
104
|
-
*/
|
|
105
|
-
(0, _elasticsearch.default)(),
|
|
106
|
-
/**
|
|
107
|
-
* Built-in Elasticsearch index templates.
|
|
108
|
-
*/
|
|
109
|
-
(0, _indices.elasticsearchIndexPlugins)(),
|
|
110
|
-
/**
|
|
111
|
-
* Filter plugins used to apply filtering from where conditions to Elasticsearch query.
|
|
112
|
-
*/
|
|
113
|
-
(0, _plugins3.createFilterPlugins)(),
|
|
114
|
-
/**
|
|
115
|
-
* User defined custom plugins.
|
|
116
|
-
* They are at the end because we can then override existing plugins.
|
|
117
|
-
*/
|
|
118
|
-
...(userPlugins || [])]);
|
|
119
|
-
const entries = (0, _entry.createEntriesStorageOperations)({
|
|
120
|
-
entity: entities.entries,
|
|
121
|
-
esEntity: entities.entriesEs,
|
|
122
|
-
plugins,
|
|
123
|
-
elasticsearch
|
|
124
|
-
});
|
|
125
|
-
return {
|
|
126
|
-
name: "dynamodb:elasticsearch",
|
|
127
|
-
beforeInit: async context => {
|
|
128
|
-
context.db.registry.register({
|
|
129
|
-
item: entities.entries,
|
|
130
|
-
app: "cms",
|
|
131
|
-
tags: ["regular", entities.entries.name]
|
|
132
|
-
});
|
|
133
|
-
context.db.registry.register({
|
|
134
|
-
item: entities.entriesEs,
|
|
135
|
-
app: "cms",
|
|
136
|
-
tags: ["es", entities.entriesEs.name]
|
|
137
|
-
});
|
|
138
|
-
/**
|
|
139
|
-
* Attach the elasticsearch into context if it is not already attached.
|
|
140
|
-
*/
|
|
141
|
-
if (!context.elasticsearch) {
|
|
142
|
-
context.elasticsearch = elasticsearch;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Pass the plugins to the parent context.
|
|
146
|
-
*/
|
|
147
|
-
context.plugins.register([(0, _dynamoDb.default)(), (0, _createIndexTaskPlugin.createIndexTaskPluginTest)(), (0, _indices.elasticsearchIndexPlugins)()]);
|
|
148
|
-
/**
|
|
149
|
-
* We need to fetch all the plugin types in the list from the main container.
|
|
150
|
-
* This way we do not need to register plugins in the storage plugins contains.
|
|
151
|
-
*/
|
|
152
|
-
const types = [_apiElasticsearch.ElasticsearchQueryBuilderOperatorPlugin.type,
|
|
153
|
-
// Headless CMS
|
|
154
|
-
"cms-model-field-to-graphql", _CmsEntryFilterPlugin.CmsEntryFilterPlugin.type, _plugins2.CmsEntryElasticsearchBodyModifierPlugin.type, _plugins2.CmsEntryElasticsearchFullTextSearchPlugin.type, _plugins2.CmsEntryElasticsearchIndexPlugin.type, _plugins2.CmsEntryElasticsearchQueryBuilderValueSearchPlugin.type, _plugins2.CmsEntryElasticsearchQueryModifierPlugin.type, _plugins2.CmsEntryElasticsearchSortModifierPlugin.type, _plugins2.CmsElasticsearchModelFieldPlugin.type, _apiHeadlessCms.StorageOperationsCmsModelPlugin.type, _apiHeadlessCms.StorageTransformPlugin.type, _plugins2.CmsEntryElasticsearchValuesModifier.type, _api.CompressorPlugin.type];
|
|
155
|
-
for (const type of types) {
|
|
156
|
-
plugins.mergeByType(context.plugins, type);
|
|
157
|
-
}
|
|
158
|
-
entries.dataLoaders.clearAll();
|
|
159
|
-
},
|
|
160
|
-
init: async context => {
|
|
161
|
-
/**
|
|
162
|
-
* We need to create indexes on before model create and on clone (create from).
|
|
163
|
-
* Other apps create indexes on locale creation.
|
|
164
|
-
*/
|
|
165
|
-
await (0, _indexes.createElasticsearchIndexesOnLocaleAfterCreate)({
|
|
166
|
-
context,
|
|
167
|
-
client: elasticsearch,
|
|
168
|
-
plugins
|
|
169
|
-
});
|
|
170
|
-
context.cms.onModelBeforeCreate.subscribe(async ({
|
|
171
|
-
model
|
|
172
|
-
}) => {
|
|
173
|
-
await (0, _createElasticsearchIndex.createElasticsearchIndex)({
|
|
174
|
-
client: elasticsearch,
|
|
175
|
-
model,
|
|
176
|
-
plugins
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
context.cms.onModelBeforeCreateFrom.subscribe(async ({
|
|
180
|
-
model
|
|
181
|
-
}) => {
|
|
182
|
-
await (0, _createElasticsearchIndex.createElasticsearchIndex)({
|
|
183
|
-
client: elasticsearch,
|
|
184
|
-
model,
|
|
185
|
-
plugins
|
|
186
|
-
});
|
|
187
|
-
});
|
|
188
|
-
context.cms.onModelAfterDelete.subscribe(async ({
|
|
189
|
-
model
|
|
190
|
-
}) => {
|
|
191
|
-
await (0, _deleteElasticsearchIndex.deleteElasticsearchIndex)({
|
|
192
|
-
client: elasticsearch,
|
|
193
|
-
model
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
context.cms.onModelInitialize.subscribe(async ({
|
|
197
|
-
model
|
|
198
|
-
}) => {
|
|
199
|
-
await (0, _createElasticsearchIndex.createElasticsearchIndex)({
|
|
200
|
-
client: elasticsearch,
|
|
201
|
-
model,
|
|
202
|
-
plugins
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
},
|
|
206
|
-
getEntities: () => entities,
|
|
207
|
-
getTable: () => tableInstance,
|
|
208
|
-
getEsTable: () => tableElasticsearchInstance,
|
|
209
|
-
system: (0, _system.createSystemStorageOperations)({
|
|
210
|
-
entity: entities.system
|
|
211
|
-
}),
|
|
212
|
-
groups: (0, _group2.createGroupsStorageOperations)({
|
|
213
|
-
entity: entities.groups,
|
|
214
|
-
plugins
|
|
215
|
-
}),
|
|
216
|
-
models: (0, _model.createModelsStorageOperations)({
|
|
217
|
-
entity: entities.models,
|
|
218
|
-
elasticsearch
|
|
219
|
-
}),
|
|
220
|
-
entries
|
|
221
|
-
};
|
|
222
|
-
};
|
|
223
|
-
exports.createStorageOperations = createStorageOperations;
|
|
224
|
-
|
|
225
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { HeadlessCmsDdbEsFeature } from "./feature.js";
|
|
2
|
+
export { HeadlessCmsDdbEsRequestFeature } from "./requestFeature.js";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
|
|
4
|
+
import { CmsDdbEsEntriesEsEntity } from "../../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
5
|
+
import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
|
|
6
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
7
|
+
import { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchValuesModifier, CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
8
|
+
import { CompressionHandler } from "@webiny/utils/exports/api.js";
|
|
9
|
+
declare class DdbEsCreateEntryImpl implements CreateEntryStorageOperation.Interface {
|
|
10
|
+
private entity;
|
|
11
|
+
private esEntity;
|
|
12
|
+
private dataLoaders;
|
|
13
|
+
private storageModelProvider;
|
|
14
|
+
private fieldIndexRegistry;
|
|
15
|
+
private compressionHandler;
|
|
16
|
+
private indexProvider;
|
|
17
|
+
private valuesModifiers;
|
|
18
|
+
constructor(entity: CmsDdbEsEntryEntity.Interface, esEntity: CmsDdbEsEntriesEsEntity.Interface, dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface, fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface, compressionHandler: CompressionHandler.Interface, indexProvider: CmsModelOpenSearchIndexProvider.Interface, valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[]);
|
|
19
|
+
execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>>;
|
|
20
|
+
}
|
|
21
|
+
export declare const DdbEsCreateEntry: typeof DdbEsCreateEntryImpl & {
|
|
22
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js").ICreateEntryStorageOperation>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
|
|
4
|
+
import { CmsDdbEsEntriesEsEntity } from "../../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
5
|
+
import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
|
|
6
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
7
|
+
import { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchValuesModifier, CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
8
|
+
import { CompressionHandler } from "@webiny/utils/exports/api.js";
|
|
9
|
+
import { createConfigurations } from "@webiny/api-headless-cms-utils-os/configurations.js";
|
|
10
|
+
import { createTransformer } from "./transformations/index.js";
|
|
11
|
+
import { createEntryLatestKeys, createEntryPublishedKeys, createEntryRevisionKeys } from "./keys.js";
|
|
12
|
+
class DdbEsCreateEntryImpl {
|
|
13
|
+
constructor(entity, esEntity, dataLoaders, storageModelProvider, fieldIndexRegistry, compressionHandler, indexProvider, valuesModifiers){
|
|
14
|
+
this.entity = entity;
|
|
15
|
+
this.esEntity = esEntity;
|
|
16
|
+
this.dataLoaders = dataLoaders;
|
|
17
|
+
this.storageModelProvider = storageModelProvider;
|
|
18
|
+
this.fieldIndexRegistry = fieldIndexRegistry;
|
|
19
|
+
this.compressionHandler = compressionHandler;
|
|
20
|
+
this.indexProvider = indexProvider;
|
|
21
|
+
this.valuesModifiers = valuesModifiers;
|
|
22
|
+
}
|
|
23
|
+
async execute(initialModel, params) {
|
|
24
|
+
const { entry: initialEntry, storageEntry: initialStorageEntry } = params;
|
|
25
|
+
const model = this.storageModelProvider.getModel(initialModel);
|
|
26
|
+
const isPublished = "published" === initialEntry.status;
|
|
27
|
+
const locked = isPublished ? true : initialEntry.locked;
|
|
28
|
+
initialEntry.locked = locked;
|
|
29
|
+
initialStorageEntry.locked = locked;
|
|
30
|
+
const transformer = createTransformer({
|
|
31
|
+
fieldIndexRegistry: this.fieldIndexRegistry,
|
|
32
|
+
model,
|
|
33
|
+
entry: initialEntry,
|
|
34
|
+
storageEntry: initialStorageEntry,
|
|
35
|
+
compressionHandler: this.compressionHandler,
|
|
36
|
+
valuesModifiers: this.valuesModifiers
|
|
37
|
+
});
|
|
38
|
+
const { entry, storageEntry } = transformer.transformEntryKeys();
|
|
39
|
+
const esEntry = transformer.transformToIndex();
|
|
40
|
+
const configurations = createConfigurations(this.indexProvider);
|
|
41
|
+
const { index: esIndex } = await configurations.es({
|
|
42
|
+
model
|
|
43
|
+
});
|
|
44
|
+
const revisionKeys = createEntryRevisionKeys(entry);
|
|
45
|
+
const latestKeys = createEntryLatestKeys(entry);
|
|
46
|
+
const publishedKeys = createEntryPublishedKeys(entry);
|
|
47
|
+
const entityBatch = this.entity.createEntityWriter({
|
|
48
|
+
put: [
|
|
49
|
+
{
|
|
50
|
+
...revisionKeys,
|
|
51
|
+
data: {
|
|
52
|
+
...storageEntry,
|
|
53
|
+
locked
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
...latestKeys,
|
|
58
|
+
data: {
|
|
59
|
+
...storageEntry,
|
|
60
|
+
locked
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
});
|
|
65
|
+
if (isPublished) entityBatch.put({
|
|
66
|
+
...publishedKeys,
|
|
67
|
+
data: {
|
|
68
|
+
...storageEntry,
|
|
69
|
+
locked
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
try {
|
|
73
|
+
await entityBatch.execute();
|
|
74
|
+
this.dataLoaders.clearAll({
|
|
75
|
+
tenant: entry.tenant
|
|
76
|
+
});
|
|
77
|
+
} catch (ex) {
|
|
78
|
+
throw new error(ex.message || "Could not insert entry data into the DynamoDB table.", ex.code || "CREATE_ENTRY_ERROR", {
|
|
79
|
+
error: ex,
|
|
80
|
+
entry,
|
|
81
|
+
storageEntry
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
const esLatestData = await transformer.getElasticsearchLatestEntryData();
|
|
85
|
+
const elasticsearchEntityBatch = this.esEntity.createEntityWriter({
|
|
86
|
+
put: [
|
|
87
|
+
{
|
|
88
|
+
...latestKeys,
|
|
89
|
+
index: esIndex,
|
|
90
|
+
data: esLatestData
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
if (isPublished) {
|
|
95
|
+
const esPublishedData = await transformer.getElasticsearchPublishedEntryData();
|
|
96
|
+
elasticsearchEntityBatch.put({
|
|
97
|
+
...publishedKeys,
|
|
98
|
+
index: esIndex,
|
|
99
|
+
data: esPublishedData
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
await elasticsearchEntityBatch.execute();
|
|
104
|
+
} catch (ex) {
|
|
105
|
+
throw new error(ex.message || "Could not insert entry data into the Elasticsearch DynamoDB table.", ex.code || "CREATE_ES_ENTRY_ERROR", {
|
|
106
|
+
error: ex,
|
|
107
|
+
entry,
|
|
108
|
+
esEntry
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return initialStorageEntry;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
const DdbEsCreateEntry = CreateEntryStorageOperation.createImplementation({
|
|
115
|
+
implementation: DdbEsCreateEntryImpl,
|
|
116
|
+
dependencies: [
|
|
117
|
+
CmsDdbEsEntryEntity,
|
|
118
|
+
CmsDdbEsEntriesEsEntity,
|
|
119
|
+
CmsDdbEsDataLoaders,
|
|
120
|
+
CmsStorageModelProvider,
|
|
121
|
+
CmsEntryOpenSearchFieldIndexRegistry,
|
|
122
|
+
CompressionHandler,
|
|
123
|
+
CmsModelOpenSearchIndexProvider,
|
|
124
|
+
[
|
|
125
|
+
CmsEntryOpenSearchValuesModifier,
|
|
126
|
+
{
|
|
127
|
+
multiple: true
|
|
128
|
+
}
|
|
129
|
+
]
|
|
130
|
+
]
|
|
131
|
+
});
|
|
132
|
+
export { DdbEsCreateEntry };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=DdbEsCreateEntry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations/entry/DdbEsCreateEntry.js","sources":["../../../src/operations/entry/DdbEsCreateEntry.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsCreateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { CreateEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsDdbEsEntriesEsEntity } from \"~/abstractions/CmsDdbEsEntriesEsEntity.js\";\nimport { CmsDdbEsDataLoaders } from \"~/abstractions/CmsDdbEsDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport {\n CmsEntryOpenSearchFieldIndexRegistry,\n CmsEntryOpenSearchValuesModifier,\n CmsModelOpenSearchIndexProvider\n} from \"@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js\";\nimport { CompressionHandler } from \"@webiny/utils/exports/api.js\";\nimport { createConfigurations } from \"@webiny/api-headless-cms-utils-os/configurations.js\";\nimport { createTransformer } from \"./transformations/index.js\";\nimport {\n createEntryLatestKeys,\n createEntryPublishedKeys,\n createEntryRevisionKeys\n} from \"./keys.js\";\n\nclass DdbEsCreateEntryImpl implements CreateEntryStorageOperation.Interface {\n constructor(\n private entity: CmsDdbEsEntryEntity.Interface,\n private esEntity: CmsDdbEsEntriesEsEntity.Interface,\n private dataLoaders: CmsDdbEsDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface,\n private fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface,\n private compressionHandler: CompressionHandler.Interface,\n private indexProvider: CmsModelOpenSearchIndexProvider.Interface,\n private valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[]\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsCreateParams<T>\n ) {\n const { entry: initialEntry, storageEntry: initialStorageEntry } = params;\n\n const model = this.storageModelProvider.getModel<T>(initialModel);\n\n const isPublished = initialEntry.status === \"published\";\n const locked = isPublished ? true : initialEntry.locked;\n\n initialEntry.locked = locked;\n initialStorageEntry.locked = locked;\n\n const transformer = createTransformer<T>({\n fieldIndexRegistry: this.fieldIndexRegistry,\n model,\n entry: initialEntry,\n storageEntry: initialStorageEntry,\n compressionHandler: this.compressionHandler,\n valuesModifiers: this.valuesModifiers\n });\n\n const { entry, storageEntry } = transformer.transformEntryKeys();\n\n const esEntry = transformer.transformToIndex();\n\n const configurations = createConfigurations(this.indexProvider);\n const { index: esIndex } = await configurations.es({\n model\n });\n\n const revisionKeys = createEntryRevisionKeys(entry);\n const latestKeys = createEntryLatestKeys(entry);\n const publishedKeys = createEntryPublishedKeys(entry);\n\n const entityBatch = this.entity.createEntityWriter({\n put: [\n {\n ...revisionKeys,\n data: {\n ...storageEntry,\n locked\n }\n },\n {\n ...latestKeys,\n data: {\n ...storageEntry,\n locked\n }\n }\n ]\n });\n\n if (isPublished) {\n entityBatch.put({\n ...publishedKeys,\n data: {\n ...storageEntry,\n locked\n }\n });\n }\n\n try {\n await entityBatch.execute();\n this.dataLoaders.clearAll({\n tenant: entry.tenant\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not insert entry data into the DynamoDB table.\",\n ex.code || \"CREATE_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n storageEntry\n }\n );\n }\n\n const esLatestData = await transformer.getElasticsearchLatestEntryData();\n\n const elasticsearchEntityBatch = this.esEntity.createEntityWriter({\n put: [\n {\n ...latestKeys,\n index: esIndex,\n data: esLatestData\n }\n ]\n });\n\n if (isPublished) {\n const esPublishedData = await transformer.getElasticsearchPublishedEntryData();\n elasticsearchEntityBatch.put({\n ...publishedKeys,\n index: esIndex,\n data: esPublishedData\n });\n }\n\n try {\n await elasticsearchEntityBatch.execute();\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not insert entry data into the Elasticsearch DynamoDB table.\",\n ex.code || \"CREATE_ES_ENTRY_ERROR\",\n {\n error: ex,\n entry,\n esEntry\n }\n );\n }\n\n return initialStorageEntry;\n }\n}\n\nexport const DdbEsCreateEntry = CreateEntryStorageOperation.createImplementation({\n implementation: DdbEsCreateEntryImpl,\n dependencies: [\n CmsDdbEsEntryEntity,\n CmsDdbEsEntriesEsEntity,\n CmsDdbEsDataLoaders,\n CmsStorageModelProvider,\n CmsEntryOpenSearchFieldIndexRegistry,\n CompressionHandler,\n CmsModelOpenSearchIndexProvider,\n [CmsEntryOpenSearchValuesModifier, { multiple: true }]\n ]\n});\n"],"names":["DdbEsCreateEntryImpl","entity","esEntity","dataLoaders","storageModelProvider","fieldIndexRegistry","compressionHandler","indexProvider","valuesModifiers","initialModel","params","initialEntry","initialStorageEntry","model","isPublished","locked","transformer","createTransformer","entry","storageEntry","esEntry","configurations","createConfigurations","esIndex","revisionKeys","createEntryRevisionKeys","latestKeys","createEntryLatestKeys","publishedKeys","createEntryPublishedKeys","entityBatch","ex","WebinyError","esLatestData","elasticsearchEntityBatch","esPublishedData","DdbEsCreateEntry","CreateEntryStorageOperation","CmsDdbEsEntryEntity","CmsDdbEsEntriesEsEntity","CmsDdbEsDataLoaders","CmsStorageModelProvider","CmsEntryOpenSearchFieldIndexRegistry","CompressionHandler","CmsModelOpenSearchIndexProvider","CmsEntryOpenSearchValuesModifier"],"mappings":";;;;;;;;;;;AAyBA,MAAMA;IACF,YACYC,MAAqC,EACrCC,QAA2C,EAC3CC,WAA0C,EAC1CC,oBAAuD,EACvDC,kBAAkE,EAClEC,kBAAgD,EAChDC,aAAwD,EACxDC,eAA6D,CACvE;aARUP,MAAM,GAANA;aACAC,QAAQ,GAARA;aACAC,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;aACAC,kBAAkB,GAAlBA;aACAC,kBAAkB,GAAlBA;aACAC,aAAa,GAAbA;aACAC,eAAe,GAAfA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAAgD,EAClD;QACE,MAAM,EAAE,OAAOC,YAAY,EAAE,cAAcC,mBAAmB,EAAE,GAAGF;QAEnE,MAAMG,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAIJ;QAEpD,MAAMK,cAAcH,AAAwB,gBAAxBA,aAAa,MAAM;QACvC,MAAMI,SAASD,cAAc,OAAOH,aAAa,MAAM;QAEvDA,aAAa,MAAM,GAAGI;QACtBH,oBAAoB,MAAM,GAAGG;QAE7B,MAAMC,cAAcC,kBAAqB;YACrC,oBAAoB,IAAI,CAAC,kBAAkB;YAC3CJ;YACA,OAAOF;YACP,cAAcC;YACd,oBAAoB,IAAI,CAAC,kBAAkB;YAC3C,iBAAiB,IAAI,CAAC,eAAe;QACzC;QAEA,MAAM,EAAEM,KAAK,EAAEC,YAAY,EAAE,GAAGH,YAAY,kBAAkB;QAE9D,MAAMI,UAAUJ,YAAY,gBAAgB;QAE5C,MAAMK,iBAAiBC,qBAAqB,IAAI,CAAC,aAAa;QAC9D,MAAM,EAAE,OAAOC,OAAO,EAAE,GAAG,MAAMF,eAAe,EAAE,CAAC;YAC/CR;QACJ;QAEA,MAAMW,eAAeC,wBAAwBP;QAC7C,MAAMQ,aAAaC,sBAAsBT;QACzC,MAAMU,gBAAgBC,yBAAyBX;QAE/C,MAAMY,cAAc,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;YAC/C,KAAK;gBACD;oBACI,GAAGN,YAAY;oBACf,MAAM;wBACF,GAAGL,YAAY;wBACfJ;oBACJ;gBACJ;gBACA;oBACI,GAAGW,UAAU;oBACb,MAAM;wBACF,GAAGP,YAAY;wBACfJ;oBACJ;gBACJ;aACH;QACL;QAEA,IAAID,aACAgB,YAAY,GAAG,CAAC;YACZ,GAAGF,aAAa;YAChB,MAAM;gBACF,GAAGT,YAAY;gBACfJ;YACJ;QACJ;QAGJ,IAAI;YACA,MAAMe,YAAY,OAAO;YACzB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;gBACtB,QAAQZ,MAAM,MAAM;YACxB;QACJ,EAAE,OAAOa,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,wDACdA,GAAG,IAAI,IAAI,sBACX;gBACI,OAAOA;gBACPb;gBACAC;YACJ;QAER;QAEA,MAAMc,eAAe,MAAMjB,YAAY,+BAA+B;QAEtE,MAAMkB,2BAA2B,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAC9D,KAAK;gBACD;oBACI,GAAGR,UAAU;oBACb,OAAOH;oBACP,MAAMU;gBACV;aACH;QACL;QAEA,IAAInB,aAAa;YACb,MAAMqB,kBAAkB,MAAMnB,YAAY,kCAAkC;YAC5EkB,yBAAyB,GAAG,CAAC;gBACzB,GAAGN,aAAa;gBAChB,OAAOL;gBACP,MAAMY;YACV;QACJ;QAEA,IAAI;YACA,MAAMD,yBAAyB,OAAO;QAC1C,EAAE,OAAOH,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,sEACdA,GAAG,IAAI,IAAI,yBACX;gBACI,OAAOA;gBACPb;gBACAE;YACJ;QAER;QAEA,OAAOR;IACX;AACJ;AAEO,MAAMwB,mBAAmBC,4BAA4B,oBAAoB,CAAC;IAC7E,gBAAgBrC;IAChB,cAAc;QACVsC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACA;YAACC;YAAkC;gBAAE,UAAU;YAAK;SAAE;KACzD;AACL"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateRevisionFromParams } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import { CreateEntryRevisionFromStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js";
|
|
3
|
+
import { CmsDdbEsEntryEntity } from "../../abstractions/CmsDdbEsEntryEntity.js";
|
|
4
|
+
import { CmsDdbEsEntriesEsEntity } from "../../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
5
|
+
import { CmsDdbEsDataLoaders } from "../../abstractions/CmsDdbEsDataLoaders.js";
|
|
6
|
+
import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
|
|
7
|
+
import { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchValuesModifier, CmsModelOpenSearchIndexProvider } from "@webiny/api-headless-cms-utils-os/exports/api/cms/opensearch.js";
|
|
8
|
+
import { CompressionHandler } from "@webiny/utils/exports/api.js";
|
|
9
|
+
declare class DdbEsCreateEntryRevisionFromImpl implements CreateEntryRevisionFromStorageOperation.Interface {
|
|
10
|
+
private entity;
|
|
11
|
+
private esEntity;
|
|
12
|
+
private dataLoaders;
|
|
13
|
+
private storageModelProvider;
|
|
14
|
+
private fieldIndexRegistry;
|
|
15
|
+
private compressionHandler;
|
|
16
|
+
private indexProvider;
|
|
17
|
+
private valuesModifiers;
|
|
18
|
+
constructor(entity: CmsDdbEsEntryEntity.Interface, esEntity: CmsDdbEsEntriesEsEntity.Interface, dataLoaders: CmsDdbEsDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface, fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface, compressionHandler: CompressionHandler.Interface, indexProvider: CmsModelOpenSearchIndexProvider.Interface, valuesModifiers: CmsEntryOpenSearchValuesModifier.Interface[]);
|
|
19
|
+
execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>>;
|
|
20
|
+
}
|
|
21
|
+
export declare const DdbEsCreateEntryRevisionFrom: typeof DdbEsCreateEntryRevisionFromImpl & {
|
|
22
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js").ICreateEntryRevisionFromStorageOperation>;
|
|
23
|
+
};
|
|
24
|
+
export {};
|