@webiny/api-headless-cms-ddb-es 0.0.0-unstable.496cf268ac → 0.0.0-unstable.5387e5f7c8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -30
- package/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
- package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
- package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
- package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsModelEntity.js +5 -0
- package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
- package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsOsTable.js +5 -0
- package/abstractions/CmsDdbEsOsTable.js.map +1 -0
- package/abstractions/CmsDdbEsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsTable.js +5 -0
- package/abstractions/CmsDdbEsTable.js.map +1 -0
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +10 -87
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +10 -64
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +10 -108
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/feature.d.ts +10 -0
- package/feature.js +69 -0
- package/feature.js.map +1 -0
- package/index.d.ts +1 -3
- package/index.js +1 -214
- package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
- package/operations/entry/DdbEsCreateEntry.js +134 -0
- package/operations/entry/DdbEsCreateEntry.js.map +1 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
- package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
- package/operations/entry/DdbEsDeleteEntry.js +79 -0
- package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
- package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js +80 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
- package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetEntry.d.ts +14 -0
- package/operations/entry/DdbEsGetEntry.js +27 -0
- package/operations/entry/DdbEsGetEntry.js.map +1 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
- package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
- package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisionById.js +34 -0
- package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
- package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisions.js +33 -0
- package/operations/entry/DdbEsGetRevisions.js.map +1 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js +76 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbEsListEntries.d.ts +25 -0
- package/operations/entry/DdbEsListEntries.js +91 -0
- package/operations/entry/DdbEsListEntries.js.map +1 -0
- package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
- package/operations/entry/DdbEsMoveEntry.js +113 -0
- package/operations/entry/DdbEsMoveEntry.js.map +1 -0
- package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
- package/operations/entry/DdbEsMoveToBin.js +137 -0
- package/operations/entry/DdbEsMoveToBin.js.map +1 -0
- package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsPublishEntry.js +231 -0
- package/operations/entry/DdbEsPublishEntry.js.map +1 -0
- package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
- package/operations/entry/DdbEsRestoreFromBin.js +137 -0
- package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
- package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsUnpublishEntry.js +127 -0
- package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
- package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
- package/operations/entry/DdbEsUpdateEntry.js +175 -0
- package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +27 -0
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
- package/operations/entry/dataLoader/constants.d.ts +1 -0
- package/operations/entry/dataLoader/constants.js +5 -0
- package/operations/entry/dataLoader/constants.js.map +1 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js +10 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js +24 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +34 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +34 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
- package/operations/entry/dataLoader/getRevisionById.js +40 -0
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
- package/operations/entry/dataLoader/index.d.ts +8 -0
- package/operations/entry/dataLoader/index.js +18 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +6 -0
- package/operations/entry/dataLoader/types.js +0 -0
- package/operations/entry/dataLoaders.d.ts +18 -39
- package/operations/entry/dataLoaders.js +91 -306
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +55 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +46 -27
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +5 -17
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/storageEntryUtils.d.ts +7 -0
- package/operations/entry/storageEntryUtils.js +14 -0
- package/operations/entry/storageEntryUtils.js.map +1 -0
- package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
- package/operations/entry/transformations/convertEntryKeys.js +25 -0
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
- package/operations/entry/transformations/index.d.ts +32 -0
- package/operations/entry/transformations/index.js +91 -0
- package/operations/entry/transformations/index.js.map +1 -0
- package/operations/entry/transformations/modifyEntryValues.d.ts +53 -0
- package/operations/entry/transformations/modifyEntryValues.js +16 -0
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
- package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
- package/operations/entry/transformations/transformEntryKeys.js +17 -0
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
- package/operations/group/DdbEsCreateGroup.d.ts +12 -0
- package/operations/group/DdbEsCreateGroup.js +35 -0
- package/operations/group/DdbEsCreateGroup.js.map +1 -0
- package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
- package/operations/group/DdbEsDeleteGroup.js +31 -0
- package/operations/group/DdbEsDeleteGroup.js.map +1 -0
- package/operations/group/DdbEsGetGroup.d.ts +12 -0
- package/operations/group/DdbEsGetGroup.js +31 -0
- package/operations/group/DdbEsGetGroup.js.map +1 -0
- package/operations/group/DdbEsListGroups.d.ts +14 -0
- package/operations/group/DdbEsListGroups.js +52 -0
- package/operations/group/DdbEsListGroups.js.map +1 -0
- package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
- package/operations/group/DdbEsUpdateGroup.js +35 -0
- package/operations/group/DdbEsUpdateGroup.js.map +1 -0
- package/operations/group/feature.d.ts +4 -0
- package/operations/group/feature.js +19 -0
- package/operations/group/feature.js.map +1 -0
- package/operations/group/keys.d.ts +15 -0
- package/operations/group/keys.js +17 -0
- package/operations/group/keys.js.map +1 -0
- package/operations/model/DdbEsCreateModel.d.ts +16 -0
- package/operations/model/DdbEsCreateModel.js +56 -0
- package/operations/model/DdbEsCreateModel.js.map +1 -0
- package/operations/model/DdbEsDeleteModel.d.ts +12 -0
- package/operations/model/DdbEsDeleteModel.js +31 -0
- package/operations/model/DdbEsDeleteModel.js.map +1 -0
- package/operations/model/DdbEsGetModel.d.ts +12 -0
- package/operations/model/DdbEsGetModel.js +30 -0
- package/operations/model/DdbEsGetModel.js.map +1 -0
- package/operations/model/DdbEsListModels.d.ts +12 -0
- package/operations/model/DdbEsListModels.js +36 -0
- package/operations/model/DdbEsListModels.js.map +1 -0
- package/operations/model/DdbEsUpdateModel.d.ts +12 -0
- package/operations/model/DdbEsUpdateModel.js +36 -0
- package/operations/model/DdbEsUpdateModel.js.map +1 -0
- package/operations/model/feature.d.ts +4 -0
- package/operations/model/feature.js +19 -0
- package/operations/model/feature.js.map +1 -0
- package/operations/model/keys.d.ts +15 -0
- package/operations/model/keys.js +17 -0
- package/operations/model/keys.js.map +1 -0
- package/package.json +48 -41
- package/registry/CmsEntitiesDbRegistryDecorator.d.ts +27 -0
- package/registry/CmsEntitiesDbRegistryDecorator.js +46 -0
- package/registry/CmsEntitiesDbRegistryDecorator.js.map +1 -0
- package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
- package/tasks/CreateElasticsearchIndexTask.js +40 -0
- package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
- package/types.d.ts +13 -155
- package/types.js +9 -41
- package/types.js.map +1 -1
- package/configurations.d.ts +0 -12
- package/configurations.js +0 -35
- package/configurations.js.map +0 -1
- package/definitions/entryElasticsearch.d.ts +0 -8
- package/definitions/entryElasticsearch.js +0 -37
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/settings.d.ts +0 -8
- package/definitions/settings.js +0 -53
- package/definitions/settings.js.map +0 -1
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -41
- package/definitions/system.js.map +0 -1
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -21
- package/definitions/table.js.map +0 -1
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -21
- package/definitions/tableElasticsearch.js.map +0 -1
- package/dynamoDb/index.d.ts +0 -2
- package/dynamoDb/index.js +0 -11
- package/dynamoDb/index.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -86
- package/dynamoDb/storage/date.js.map +0 -1
- package/dynamoDb/storage/longText.d.ts +0 -10
- package/dynamoDb/storage/longText.js +0 -93
- package/dynamoDb/storage/longText.js.map +0 -1
- package/dynamoDb/storage/richText.d.ts +0 -7
- package/dynamoDb/storage/richText.js +0 -110
- package/dynamoDb/storage/richText.js.map +0 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
- package/elasticsearch/createElasticsearchIndex.js +0 -49
- package/elasticsearch/createElasticsearchIndex.js.map +0 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
- package/elasticsearch/deleteElasticsearchIndex.js +0 -36
- package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -11
- package/elasticsearch/index.js.map +0 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js +0 -86
- package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
- package/elasticsearch/indexing/defaultFieldIndexing.js +0 -52
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
- package/elasticsearch/indexing/index.d.ts +0 -2
- package/elasticsearch/indexing/index.js +0 -15
- package/elasticsearch/indexing/index.js.map +0 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
- package/elasticsearch/indexing/longTextIndexing.js +0 -46
- package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js +0 -39
- package/elasticsearch/indexing/numberIndexing.js.map +0 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
- package/elasticsearch/indexing/objectIndexing.js +0 -196
- package/elasticsearch/indexing/objectIndexing.js.map +0 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -29
- package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
- package/elasticsearch/indices/base.d.ts +0 -2
- package/elasticsearch/indices/base.js +0 -12
- package/elasticsearch/indices/base.js.map +0 -1
- package/elasticsearch/indices/index.d.ts +0 -1
- package/elasticsearch/indices/index.js +0 -12
- package/elasticsearch/indices/index.js.map +0 -1
- package/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -13
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -10
- package/elasticsearch/search/index.js.map +0 -1
- package/elasticsearch/search/refSearch.d.ts +0 -2
- package/elasticsearch/search/refSearch.js +0 -29
- package/elasticsearch/search/refSearch.js.map +0 -1
- package/elasticsearch/search/timeSearch.d.ts +0 -2
- package/elasticsearch/search/timeSearch.js +0 -26
- package/elasticsearch/search/timeSearch.js.map +0 -1
- package/helpers/entryIndexHelpers.d.ts +0 -18
- package/helpers/entryIndexHelpers.js +0 -175
- package/helpers/entryIndexHelpers.js.map +0 -1
- package/helpers/index.d.ts +0 -1
- package/helpers/index.js +0 -16
- package/helpers/index.js.map +0 -1
- package/index.js.map +0 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -32
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
- package/operations/entry/elasticsearch/body.d.ts +0 -13
- package/operations/entry/elasticsearch/body.js +0 -140
- package/operations/entry/elasticsearch/body.js.map +0 -1
- package/operations/entry/elasticsearch/fields.d.ts +0 -9
- package/operations/entry/elasticsearch/fields.js +0 -229
- package/operations/entry/elasticsearch/fields.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -8
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -57
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -17
- package/operations/entry/elasticsearch/filtering/exec.js +0 -172
- package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
- package/operations/entry/elasticsearch/filtering/index.js +0 -16
- package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +0 -15
- package/operations/entry/elasticsearch/filtering/path.js +0 -44
- package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -28
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -13
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -65
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -48
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/populated.js +0 -23
- package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
- package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
- package/operations/entry/elasticsearch/filtering/values.js +0 -22
- package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -12
- package/operations/entry/elasticsearch/fullTextSearch.js +0 -89
- package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
- package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -25
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +0 -17
- package/operations/entry/elasticsearch/initialQuery.js +0 -103
- package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
- package/operations/entry/elasticsearch/keyword.d.ts +0 -2
- package/operations/entry/elasticsearch/keyword.js +0 -34
- package/operations/entry/elasticsearch/keyword.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -16
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -8
- package/operations/entry/elasticsearch/plugins/operator.js +0 -37
- package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -16
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
- package/operations/entry/elasticsearch/plugins/search.js +0 -24
- package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
- package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -16
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
- package/operations/entry/elasticsearch/sort.d.ts +0 -12
- package/operations/entry/elasticsearch/sort.js +0 -82
- package/operations/entry/elasticsearch/sort.js.map +0 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -16
- package/operations/entry/elasticsearch/transformValueForSearch.js +0 -30
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
- package/operations/entry/elasticsearch/types.d.ts +0 -41
- package/operations/entry/elasticsearch/types.js +0 -5
- package/operations/entry/elasticsearch/types.js.map +0 -1
- package/operations/entry/index.d.ts +0 -11
- package/operations/entry/index.js +0 -1128
- package/operations/entry/index.js.map +0 -1
- package/operations/group/index.d.ts +0 -8
- package/operations/group/index.js +0 -165
- package/operations/group/index.js.map +0 -1
- package/operations/model/index.d.ts +0 -8
- package/operations/model/index.js +0 -171
- package/operations/model/index.js.map +0 -1
- package/operations/settings/index.d.ts +0 -6
- package/operations/settings/index.js +0 -111
- package/operations/settings/index.js.map +0 -1
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -82
- package/operations/system/index.js.map +0 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -21
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -22
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -18
- package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -28
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -12
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -31
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -37
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -18
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -22
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -18
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -22
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
- package/plugins/CmsEntryFilterPlugin.js +0 -24
- package/plugins/CmsEntryFilterPlugin.js.map +0 -1
- package/plugins/index.d.ts +0 -7
- package/plugins/index.js +0 -82
- package/plugins/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb-es",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.0-unstable.5387e5f7c8",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
5
9
|
"keywords": [
|
|
6
10
|
"@webiny/api-headless-cms",
|
|
7
11
|
"storage-operations",
|
|
8
12
|
"dynamodb",
|
|
9
13
|
"elasticsearch",
|
|
10
|
-
"
|
|
14
|
+
"ddb-es",
|
|
15
|
+
"cms:ddb-es",
|
|
16
|
+
"opensearch",
|
|
17
|
+
"ddb-os",
|
|
18
|
+
"cms:ddb-os"
|
|
11
19
|
],
|
|
12
20
|
"repository": {
|
|
13
21
|
"type": "git",
|
|
@@ -22,47 +30,46 @@
|
|
|
22
30
|
],
|
|
23
31
|
"license": "MIT",
|
|
24
32
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@webiny/api": "0.0.0-unstable.
|
|
27
|
-
"@webiny/api-
|
|
28
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
29
|
-
"@webiny/
|
|
30
|
-
"@webiny/
|
|
31
|
-
"@webiny/
|
|
32
|
-
"@webiny/
|
|
33
|
-
"@webiny/
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
33
|
+
"@webiny/api": "0.0.0-unstable.5387e5f7c8",
|
|
34
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.5387e5f7c8",
|
|
35
|
+
"@webiny/api-headless-cms-storage": "0.0.0-unstable.5387e5f7c8",
|
|
36
|
+
"@webiny/api-headless-cms-utils-os": "0.0.0-unstable.5387e5f7c8",
|
|
37
|
+
"@webiny/api-opensearch": "0.0.0-unstable.5387e5f7c8",
|
|
38
|
+
"@webiny/api-opensearch-aws": "0.0.0-unstable.5387e5f7c8",
|
|
39
|
+
"@webiny/api-search-index-tasks": "0.0.0-unstable.5387e5f7c8",
|
|
40
|
+
"@webiny/db": "0.0.0-unstable.5387e5f7c8",
|
|
41
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.5387e5f7c8",
|
|
42
|
+
"@webiny/error": "0.0.0-unstable.5387e5f7c8",
|
|
43
|
+
"@webiny/feature": "0.0.0-unstable.5387e5f7c8",
|
|
44
|
+
"@webiny/plugins": "0.0.0-unstable.5387e5f7c8",
|
|
45
|
+
"@webiny/stdlib": "0.0.21",
|
|
46
|
+
"@webiny/utils": "0.0.0-unstable.5387e5f7c8",
|
|
47
|
+
"dataloader": "2.2.3",
|
|
48
|
+
"lodash": "4.18.1"
|
|
38
49
|
},
|
|
39
50
|
"devDependencies": {
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"@
|
|
43
|
-
"@
|
|
44
|
-
"@
|
|
45
|
-
"@webiny/api-
|
|
46
|
-
"@webiny/
|
|
47
|
-
"@webiny/
|
|
48
|
-
"@webiny/
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"ttypescript": "^1.5.12",
|
|
57
|
-
"typescript": "4.7.4"
|
|
51
|
+
"@types/jsonpack": "1.1.6",
|
|
52
|
+
"@webiny/api-core": "0.0.0-unstable.5387e5f7c8",
|
|
53
|
+
"@webiny/api-core-testing": "0.0.0-unstable.5387e5f7c8",
|
|
54
|
+
"@webiny/api-graphql": "0.0.0-unstable.5387e5f7c8",
|
|
55
|
+
"@webiny/api-search-index-tasks-ddb-os": "0.0.0-unstable.5387e5f7c8",
|
|
56
|
+
"@webiny/api-sync-ddb-to-opensearch": "0.0.0-unstable.5387e5f7c8",
|
|
57
|
+
"@webiny/background-tasks": "0.0.0-unstable.5387e5f7c8",
|
|
58
|
+
"@webiny/build-tools": "0.0.0-unstable.5387e5f7c8",
|
|
59
|
+
"@webiny/di": "2.0.0",
|
|
60
|
+
"@webiny/event-handler-core": "0.0.0-unstable.5387e5f7c8",
|
|
61
|
+
"@webiny/handler": "0.0.0-unstable.5387e5f7c8",
|
|
62
|
+
"@webiny/wcp": "0.0.0-unstable.5387e5f7c8",
|
|
63
|
+
"jest-dynalite": "3.6.1",
|
|
64
|
+
"rimraf": "6.1.3",
|
|
65
|
+
"typescript": "7.0.2",
|
|
66
|
+
"vitest": "4.1.11"
|
|
58
67
|
},
|
|
59
68
|
"publishConfig": {
|
|
60
|
-
"access": "public"
|
|
61
|
-
"directory": "dist"
|
|
62
|
-
},
|
|
63
|
-
"scripts": {
|
|
64
|
-
"build": "yarn webiny run build",
|
|
65
|
-
"watch": "yarn webiny run watch"
|
|
69
|
+
"access": "public"
|
|
66
70
|
},
|
|
67
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "b8aec8a1be3f25c3b428b357fe1e352c7cbff9ae",
|
|
72
|
+
"webiny": {
|
|
73
|
+
"publishFrom": "dist"
|
|
74
|
+
}
|
|
68
75
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DbRegistry } from "@webiny/db/exports/api/db.js";
|
|
2
|
+
import { CmsDdbEsEntryEntity } from "../abstractions/CmsDdbEsEntryEntity.js";
|
|
3
|
+
import { CmsDdbEsEntriesEsEntity } from "../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
4
|
+
/**
|
|
5
|
+
* Adds the CMS entities to every request's DbRegistry.
|
|
6
|
+
*
|
|
7
|
+
* DbRegistry is container scoped: each request (child) container builds its own, empty registry. The
|
|
8
|
+
* DDB to OpenSearch sync looks up two CMS entities in it (the DynamoDB entries entity and the
|
|
9
|
+
* OpenSearch entries entity), so every one of those registries needs them.
|
|
10
|
+
*
|
|
11
|
+
* The CMS storage feature runs once, in the root, before any request exists, so it can't register into
|
|
12
|
+
* per-request registries directly. Instead it registers this decorator in the root. Decorators on a
|
|
13
|
+
* container-scoped registration apply to every instance as it is built, so this constructor runs once
|
|
14
|
+
* per request registry and adds the two entities. Every other call passes through to the registry.
|
|
15
|
+
*/
|
|
16
|
+
declare class CmsEntitiesDbRegistryDecoratorImpl implements DbRegistry.Interface {
|
|
17
|
+
private readonly decoratee;
|
|
18
|
+
constructor(entryEntity: CmsDdbEsEntryEntity.Interface, entriesEsEntity: CmsDdbEsEntriesEsEntity.Interface, decoratee: DbRegistry.Interface);
|
|
19
|
+
register<T = unknown>(params: DbRegistry.RegisterParams<T>): void;
|
|
20
|
+
getOneItem<T = unknown>(cb: (item: DbRegistry.RegistryItem<T>) => boolean): DbRegistry.RegistryItem<T>;
|
|
21
|
+
getItem<T = unknown>(cb: (item: DbRegistry.RegistryItem<T>) => boolean): DbRegistry.RegistryItem<T> | null;
|
|
22
|
+
getItems<T = unknown>(cb: (item: DbRegistry.RegistryItem<T>) => boolean): DbRegistry.RegistryItem<T>[];
|
|
23
|
+
}
|
|
24
|
+
export declare const CmsEntitiesDbRegistryDecorator: typeof CmsEntitiesDbRegistryDecoratorImpl & {
|
|
25
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/db/features/DbRegistry/abstractions").IRegistry>;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DbRegistry } from "@webiny/db/exports/api/db.js";
|
|
2
|
+
import { CmsDdbEsEntryEntity } from "../abstractions/CmsDdbEsEntryEntity.js";
|
|
3
|
+
import { CmsDdbEsEntriesEsEntity } from "../abstractions/CmsDdbEsEntriesEsEntity.js";
|
|
4
|
+
class CmsEntitiesDbRegistryDecoratorImpl {
|
|
5
|
+
constructor(entryEntity, entriesEsEntity, decoratee){
|
|
6
|
+
this.decoratee = decoratee;
|
|
7
|
+
decoratee.register({
|
|
8
|
+
item: entryEntity,
|
|
9
|
+
app: "cms",
|
|
10
|
+
tags: [
|
|
11
|
+
"regular",
|
|
12
|
+
entryEntity.name
|
|
13
|
+
]
|
|
14
|
+
});
|
|
15
|
+
decoratee.register({
|
|
16
|
+
item: entriesEsEntity,
|
|
17
|
+
app: "cms",
|
|
18
|
+
tags: [
|
|
19
|
+
"es",
|
|
20
|
+
entriesEsEntity.name
|
|
21
|
+
]
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
register(params) {
|
|
25
|
+
this.decoratee.register(params);
|
|
26
|
+
}
|
|
27
|
+
getOneItem(cb) {
|
|
28
|
+
return this.decoratee.getOneItem(cb);
|
|
29
|
+
}
|
|
30
|
+
getItem(cb) {
|
|
31
|
+
return this.decoratee.getItem(cb);
|
|
32
|
+
}
|
|
33
|
+
getItems(cb) {
|
|
34
|
+
return this.decoratee.getItems(cb);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const CmsEntitiesDbRegistryDecorator = DbRegistry.createDecorator({
|
|
38
|
+
decorator: CmsEntitiesDbRegistryDecoratorImpl,
|
|
39
|
+
dependencies: [
|
|
40
|
+
CmsDdbEsEntryEntity,
|
|
41
|
+
CmsDdbEsEntriesEsEntity
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
export { CmsEntitiesDbRegistryDecorator };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=CmsEntitiesDbRegistryDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry/CmsEntitiesDbRegistryDecorator.js","sources":["../../src/registry/CmsEntitiesDbRegistryDecorator.ts"],"sourcesContent":["import { DbRegistry } from \"@webiny/db/exports/api/db.js\";\nimport { CmsDdbEsEntryEntity } from \"~/abstractions/CmsDdbEsEntryEntity.js\";\nimport { CmsDdbEsEntriesEsEntity } from \"~/abstractions/CmsDdbEsEntriesEsEntity.js\";\n\n/**\n * Adds the CMS entities to every request's DbRegistry.\n *\n * DbRegistry is container scoped: each request (child) container builds its own, empty registry. The\n * DDB to OpenSearch sync looks up two CMS entities in it (the DynamoDB entries entity and the\n * OpenSearch entries entity), so every one of those registries needs them.\n *\n * The CMS storage feature runs once, in the root, before any request exists, so it can't register into\n * per-request registries directly. Instead it registers this decorator in the root. Decorators on a\n * container-scoped registration apply to every instance as it is built, so this constructor runs once\n * per request registry and adds the two entities. Every other call passes through to the registry.\n */\nclass CmsEntitiesDbRegistryDecoratorImpl implements DbRegistry.Interface {\n public constructor(\n entryEntity: CmsDdbEsEntryEntity.Interface,\n entriesEsEntity: CmsDdbEsEntriesEsEntity.Interface,\n private readonly decoratee: DbRegistry.Interface\n ) {\n decoratee.register({\n item: entryEntity,\n app: \"cms\",\n tags: [\"regular\", entryEntity.name]\n });\n decoratee.register({\n item: entriesEsEntity,\n app: \"cms\",\n tags: [\"es\", entriesEsEntity.name]\n });\n }\n\n public register<T = unknown>(params: DbRegistry.RegisterParams<T>): void {\n this.decoratee.register(params);\n }\n\n public getOneItem<T = unknown>(\n cb: (item: DbRegistry.RegistryItem<T>) => boolean\n ): DbRegistry.RegistryItem<T> {\n return this.decoratee.getOneItem(cb);\n }\n\n public getItem<T = unknown>(\n cb: (item: DbRegistry.RegistryItem<T>) => boolean\n ): DbRegistry.RegistryItem<T> | null {\n return this.decoratee.getItem(cb);\n }\n\n public getItems<T = unknown>(\n cb: (item: DbRegistry.RegistryItem<T>) => boolean\n ): DbRegistry.RegistryItem<T>[] {\n return this.decoratee.getItems(cb);\n }\n}\n\nexport const CmsEntitiesDbRegistryDecorator = DbRegistry.createDecorator({\n decorator: CmsEntitiesDbRegistryDecoratorImpl,\n dependencies: [CmsDdbEsEntryEntity, CmsDdbEsEntriesEsEntity]\n});\n"],"names":["CmsEntitiesDbRegistryDecoratorImpl","entryEntity","entriesEsEntity","decoratee","params","cb","CmsEntitiesDbRegistryDecorator","DbRegistry","CmsDdbEsEntryEntity","CmsDdbEsEntriesEsEntity"],"mappings":";;;AAgBA,MAAMA;IACF,YACIC,WAA0C,EAC1CC,eAAkD,EACjCC,SAA+B,CAClD;aADmBA,SAAS,GAATA;QAEjBA,UAAU,QAAQ,CAAC;YACf,MAAMF;YACN,KAAK;YACL,MAAM;gBAAC;gBAAWA,YAAY,IAAI;aAAC;QACvC;QACAE,UAAU,QAAQ,CAAC;YACf,MAAMD;YACN,KAAK;YACL,MAAM;gBAAC;gBAAMA,gBAAgB,IAAI;aAAC;QACtC;IACJ;IAEO,SAAsBE,MAAoC,EAAQ;QACrE,IAAI,CAAC,SAAS,CAAC,QAAQ,CAACA;IAC5B;IAEO,WACHC,EAAiD,EACvB;QAC1B,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAACA;IACrC;IAEO,QACHA,EAAiD,EAChB;QACjC,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACA;IAClC;IAEO,SACHA,EAAiD,EACrB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAACA;IACnC;AACJ;AAEO,MAAMC,iCAAiCC,WAAW,eAAe,CAAC;IACrE,WAAWP;IACX,cAAc;QAACQ;QAAqBC;KAAwB;AAChE"}
|
|
@@ -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,164 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { DynamoDBTypes, TableConstructor } from "dynamodb-toolbox/dist/classes/Table";
|
|
4
|
-
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
5
|
-
import { EntityAttributeConfig, EntityCompositeAttributes } from "dynamodb-toolbox/dist/classes/Entity";
|
|
6
|
-
import { Client } from "@elastic/elasticsearch";
|
|
7
|
-
import { Entity, Table } from "dynamodb-toolbox";
|
|
8
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
9
|
-
/**
|
|
10
|
-
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
11
|
-
*
|
|
12
|
-
* @category Elasticsearch
|
|
13
|
-
* @category CmsEntry
|
|
14
|
-
*/
|
|
15
|
-
export interface CmsIndexEntry extends CmsEntry {
|
|
16
|
-
/**
|
|
17
|
-
* Values that are not going to be indexed.
|
|
18
|
-
*/
|
|
19
|
-
rawValues: Record<string, any>;
|
|
20
|
-
/**
|
|
21
|
-
* A first part of the ID, without the revision.
|
|
22
|
-
* For example, we can search for all the revisions of the given entry.
|
|
23
|
-
*/
|
|
24
|
-
primaryId: string;
|
|
25
|
-
/**
|
|
26
|
-
* Dev can add what ever keys they want and need. Just need to be careful not to break the entry.
|
|
27
|
-
*/
|
|
28
|
-
[key: string]: any;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.
|
|
32
|
-
*
|
|
33
|
-
* @category Elasticsearch
|
|
34
|
-
* @category CmsEntry
|
|
35
|
-
*/
|
|
36
|
-
interface CmsModelFieldToElasticsearchToParams {
|
|
37
|
-
plugins: PluginsContainer;
|
|
38
|
-
model: CmsModel;
|
|
39
|
-
field: CmsModelField;
|
|
40
|
-
/**
|
|
41
|
-
* Raw value on the entry - before prepare for storage.
|
|
42
|
-
*/
|
|
43
|
-
rawValue: any;
|
|
44
|
-
/**
|
|
45
|
-
* Value prepared for storage received from base api-headless-cms package.
|
|
46
|
-
*/
|
|
47
|
-
value: any;
|
|
48
|
-
getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;
|
|
49
|
-
getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Arguments for the method that is transforming content entry from Elasticsearch into the original one.
|
|
53
|
-
*
|
|
54
|
-
* @category Elasticsearch
|
|
55
|
-
* @category CmsEntry
|
|
56
|
-
*/
|
|
57
|
-
interface CmsModelFieldToElasticsearchFromParams {
|
|
58
|
-
plugins: PluginsContainer;
|
|
59
|
-
model: CmsModel;
|
|
60
|
-
field: CmsModelField;
|
|
61
|
-
value: any;
|
|
62
|
-
rawValue: any;
|
|
63
|
-
getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;
|
|
64
|
-
getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;
|
|
65
|
-
}
|
|
66
|
-
interface ToIndexValue {
|
|
67
|
-
/**
|
|
68
|
-
* Use this key to store value for indexing.
|
|
69
|
-
*/
|
|
70
|
-
value?: any;
|
|
71
|
-
/**
|
|
72
|
-
* Use this key to tell ES that this value should not be indexed.
|
|
73
|
-
*/
|
|
74
|
-
rawValue?: any;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* A plugin defining transformation of entry for Elasticsearch.
|
|
78
|
-
*
|
|
79
|
-
* @category Plugin
|
|
80
|
-
* @category ContentModelField
|
|
81
|
-
* @category CmsEntry
|
|
82
|
-
* @category Elasticsearch
|
|
83
|
-
*/
|
|
84
|
-
export interface CmsModelFieldToElasticsearchPlugin extends Plugin {
|
|
85
|
-
/**
|
|
86
|
-
* A plugin type
|
|
87
|
-
*/
|
|
88
|
-
type: "cms-model-field-to-elastic-search";
|
|
89
|
-
/**
|
|
90
|
-
* A unique identifier of the field type (text, number, json, myField, ...).
|
|
91
|
-
*
|
|
92
|
-
* ```ts
|
|
93
|
-
* fieldType: "myField"
|
|
94
|
-
* ```
|
|
95
|
-
*/
|
|
96
|
-
fieldType: string;
|
|
97
|
-
/**
|
|
98
|
-
* If you need to define a type when building an Elasticsearch query.
|
|
99
|
-
* 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.
|
|
100
|
-
*
|
|
101
|
-
* ```ts
|
|
102
|
-
* unmappedType: "date"
|
|
103
|
-
* ```
|
|
104
|
-
*/
|
|
105
|
-
unmappedType?: (field: CmsModelField) => string;
|
|
106
|
-
/**
|
|
107
|
-
* 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.
|
|
108
|
-
* It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.
|
|
109
|
-
*
|
|
110
|
-
* ```ts
|
|
111
|
-
* toIndex({ value }) {
|
|
112
|
-
* return {
|
|
113
|
-
* value: value, // This will be stored and indexed
|
|
114
|
-
* rawValue: JSON.stringify(value) // This will be stored but excluded from indexing
|
|
115
|
-
* };
|
|
116
|
-
* }
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;
|
|
120
|
-
/**
|
|
121
|
-
* This is meant to revert a transformation done in the `toIndex` method.
|
|
122
|
-
* You have access to "value" or a "rawValue", depending on what you returned from `toIndex`.
|
|
123
|
-
*
|
|
124
|
-
* ```ts
|
|
125
|
-
* fromIndex({ value, rawValue }) {
|
|
126
|
-
* return JSON.parse(rawValue);
|
|
127
|
-
* }
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;
|
|
131
|
-
}
|
|
132
|
-
export declare type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;
|
|
133
|
-
export declare type Attributes = Record<string, AttributeDefinition>;
|
|
1
|
+
import type { CmsContext, CmsEntryValues, CmsModel, CmsStorageEntry } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
export { CmsContext };
|
|
134
3
|
export declare enum ENTITIES {
|
|
135
|
-
SYSTEM = "CmsSystem",
|
|
136
|
-
SETTINGS = "CmsSettings",
|
|
137
4
|
GROUPS = "CmsGroups",
|
|
138
5
|
MODELS = "CmsModels",
|
|
139
6
|
ENTRIES = "CmsEntries",
|
|
140
7
|
ENTRIES_ES = "CmsEntriesElasticsearch"
|
|
141
8
|
}
|
|
142
|
-
export interface
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
export interface StorageOperationsFactoryParams {
|
|
146
|
-
documentClient: DocumentClient;
|
|
147
|
-
elasticsearch: Client;
|
|
148
|
-
table?: TableModifier;
|
|
149
|
-
esTable?: TableModifier;
|
|
150
|
-
attributes?: Record<ENTITIES, Attributes>;
|
|
151
|
-
plugins?: PluginCollection;
|
|
152
|
-
}
|
|
153
|
-
export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {
|
|
154
|
-
getTable: () => Table;
|
|
155
|
-
getEsTable: () => Table;
|
|
156
|
-
getEntities: () => Record<"system" | "settings" | "groups" | "models" | "entries" | "entriesEs", Entity<any>>;
|
|
9
|
+
export interface DataLoadersHandlerInterfaceClearAllParams {
|
|
10
|
+
tenant: string;
|
|
157
11
|
}
|
|
158
|
-
export interface
|
|
159
|
-
|
|
12
|
+
export interface DataLoadersHandlerDataLoaderParams {
|
|
13
|
+
model: Pick<CmsModel, "tenant" | "modelId">;
|
|
14
|
+
ids: readonly string[];
|
|
160
15
|
}
|
|
161
|
-
export interface
|
|
162
|
-
|
|
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>[]>;
|
|
21
|
+
clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
|
|
163
22
|
}
|
|
164
|
-
export {};
|
package/types.js
CHANGED
|
@@ -1,42 +1,10 @@
|
|
|
1
|
-
|
|
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;
|
|
7
|
+
}({});
|
|
8
|
+
export { types_ENTITIES as ENTITIES };
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ENTITIES = void 0;
|
|
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;
|
|
34
|
-
exports.ENTITIES = ENTITIES;
|
|
35
|
-
(function (ENTITIES) {
|
|
36
|
-
ENTITIES["SYSTEM"] = "CmsSystem";
|
|
37
|
-
ENTITIES["SETTINGS"] = "CmsSettings";
|
|
38
|
-
ENTITIES["GROUPS"] = "CmsGroups";
|
|
39
|
-
ENTITIES["MODELS"] = "CmsModels";
|
|
40
|
-
ENTITIES["ENTRIES"] = "CmsEntries";
|
|
41
|
-
ENTITIES["ENTRIES_ES"] = "CmsEntriesElasticsearch";
|
|
42
|
-
})(ENTITIES || (exports.ENTITIES = ENTITIES = {}));
|
|
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,12 +0,0 @@
|
|
|
1
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
interface ElasticsearchConfig {
|
|
3
|
-
index: string;
|
|
4
|
-
}
|
|
5
|
-
interface CmsElasticsearchParams {
|
|
6
|
-
model: CmsModel;
|
|
7
|
-
}
|
|
8
|
-
interface Configurations {
|
|
9
|
-
es: (params: CmsElasticsearchParams) => ElasticsearchConfig;
|
|
10
|
-
}
|
|
11
|
-
export declare const configurations: Configurations;
|
|
12
|
-
export {};
|
package/configurations.js
DELETED
|
@@ -1,35 +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
|
-
const configurations = {
|
|
10
|
-
es({
|
|
11
|
-
model
|
|
12
|
-
}) {
|
|
13
|
-
const {
|
|
14
|
-
tenant,
|
|
15
|
-
locale
|
|
16
|
-
} = model;
|
|
17
|
-
if (!tenant) {
|
|
18
|
-
throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
|
|
19
|
-
} else if (!locale) {
|
|
20
|
-
throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
|
|
21
|
-
}
|
|
22
|
-
const sharedIndex = process.env.ELASTICSEARCH_SHARED_INDEXES === "true";
|
|
23
|
-
const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
|
|
24
|
-
const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || "";
|
|
25
|
-
if (!prefix) {
|
|
26
|
-
return {
|
|
27
|
-
index
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
return {
|
|
31
|
-
index: prefix + index
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
exports.configurations = configurations;
|
package/configurations.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["configurations","es","model","tenant","locale","WebinyError","sharedIndex","process","env","ELASTICSEARCH_SHARED_INDEXES","index","modelId","join","toLowerCase","prefix","ELASTIC_SEARCH_INDEX_PREFIX"],"sources":["configurations.ts"],"sourcesContent":["import { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\n\ninterface ElasticsearchConfig {\n index: string;\n}\n\ninterface CmsElasticsearchParams {\n model: CmsModel;\n}\ninterface Configurations {\n es: (params: CmsElasticsearchParams) => ElasticsearchConfig;\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 = process.env.ELASTICSEARCH_SHARED_INDEXES === \"true\";\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = process.env.ELASTIC_SEARCH_INDEX_PREFIX || \"\";\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n }\n};\n"],"mappings":";;;;;;;AACA;AAaO,MAAMA,cAA8B,GAAG;EAC1CC,EAAE,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,KAAK;IAEhC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CAChB,4EAA2E,EAC5E,cAAc,CACjB;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CAChB,4EAA2E,EAC5E,cAAc,CACjB;IACL;IAEA,MAAMC,WAAW,GAAGC,OAAO,CAACC,GAAG,CAACC,4BAA4B,KAAK,MAAM;IACvE,MAAMC,KAAK,GAAG,CAACJ,WAAW,GAAG,MAAM,GAAGH,MAAM,EAAE,cAAc,EAAEC,MAAM,EAAEF,KAAK,CAACS,OAAO,CAAC,CAC/EC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,EAAE;IAElB,MAAMC,MAAM,GAAGP,OAAO,CAACC,GAAG,CAACO,2BAA2B,IAAI,EAAE;IAC5D,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL;AACJ,CAAC;AAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
-
import { Attributes } from "../types";
|
|
3
|
-
export interface CreateEntryElasticsearchEntityParams {
|
|
4
|
-
table: Table;
|
|
5
|
-
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
|
-
}
|
|
8
|
-
export declare const createEntryElasticsearchEntity: (params: CreateEntryElasticsearchEntityParams) => Entity<any>;
|
|
@@ -1,37 +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.createEntryElasticsearchEntity = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
|
-
var _dynamodbToolbox = require("dynamodb-toolbox");
|
|
10
|
-
const createEntryElasticsearchEntity = params => {
|
|
11
|
-
const {
|
|
12
|
-
table,
|
|
13
|
-
entityName,
|
|
14
|
-
attributes
|
|
15
|
-
} = params;
|
|
16
|
-
return new _dynamodbToolbox.Entity({
|
|
17
|
-
name: entityName,
|
|
18
|
-
table,
|
|
19
|
-
attributes: (0, _objectSpread2.default)({
|
|
20
|
-
PK: {
|
|
21
|
-
type: "string",
|
|
22
|
-
partitionKey: true
|
|
23
|
-
},
|
|
24
|
-
SK: {
|
|
25
|
-
type: "string",
|
|
26
|
-
sortKey: true
|
|
27
|
-
},
|
|
28
|
-
index: {
|
|
29
|
-
type: "string"
|
|
30
|
-
},
|
|
31
|
-
data: {
|
|
32
|
-
type: "map"
|
|
33
|
-
}
|
|
34
|
-
}, attributes || {})
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
exports.createEntryElasticsearchEntity = createEntryElasticsearchEntity;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createEntryElasticsearchEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","index","data"],"sources":["entryElasticsearch.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\nexport interface CreateEntryElasticsearchEntityParams {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryElasticsearchEntity = (\n params: CreateEntryElasticsearchEntityParams\n): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n index: {\n type: \"string\"\n },\n data: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;AAAA;AAQO,MAAMA,8BAA8B,GACvCC,MAA4C,IAC9B;EACd,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,uBAAM,CAAC;IACdC,IAAI,EAAEH,UAAU;IAChBD,KAAK;IACLE,UAAU;MACNG,EAAE,EAAE;QACAC,IAAI,EAAE,QAAQ;QACdC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAF,IAAI,EAAE,QAAQ;QACdG,OAAO,EAAE;MACb,CAAC;MACDC,KAAK,EAAE;QACHJ,IAAI,EAAE;MACV,CAAC;MACDK,IAAI,EAAE;QACFL,IAAI,EAAE;MACV;IAAC,GACGJ,UAAU,IAAI,CAAC,CAAC;EAE5B,CAAC,CAAC;AACN,CAAC;AAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Entity, Table } from "dynamodb-toolbox";
|
|
2
|
-
import { Attributes } from "../types";
|
|
3
|
-
export interface CreateSettingsEntityParams {
|
|
4
|
-
table: Table;
|
|
5
|
-
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
|
-
}
|
|
8
|
-
export declare const createSettingsEntity: (params: CreateSettingsEntityParams) => Entity<any>;
|