@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
|
@@ -1,183 +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.createModelsStorageOperations = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _configurations = require("../../configurations");
|
|
10
|
-
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
11
|
-
var _query = require("@webiny/db-dynamodb/utils/query");
|
|
12
|
-
var _dbDynamodb = require("@webiny/db-dynamodb");
|
|
13
|
-
const createPartitionKey = params => {
|
|
14
|
-
const {
|
|
15
|
-
tenant,
|
|
16
|
-
locale
|
|
17
|
-
} = params;
|
|
18
|
-
return `T#${tenant}#L#${locale}#CMS#CM`;
|
|
19
|
-
};
|
|
20
|
-
const createSortKey = params => {
|
|
21
|
-
return params.modelId;
|
|
22
|
-
};
|
|
23
|
-
const createKeys = params => {
|
|
24
|
-
return {
|
|
25
|
-
PK: createPartitionKey(params),
|
|
26
|
-
SK: createSortKey(params)
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
const createType = () => {
|
|
30
|
-
return "cms.model";
|
|
31
|
-
};
|
|
32
|
-
const createModelsStorageOperations = params => {
|
|
33
|
-
const {
|
|
34
|
-
entity,
|
|
35
|
-
elasticsearch
|
|
36
|
-
} = params;
|
|
37
|
-
const create = async params => {
|
|
38
|
-
const {
|
|
39
|
-
model
|
|
40
|
-
} = params;
|
|
41
|
-
const {
|
|
42
|
-
index
|
|
43
|
-
} = _configurations.configurations.es({
|
|
44
|
-
model
|
|
45
|
-
});
|
|
46
|
-
const keys = createKeys(model);
|
|
47
|
-
let error;
|
|
48
|
-
try {
|
|
49
|
-
await (0, _dbDynamodb.put)({
|
|
50
|
-
entity,
|
|
51
|
-
item: {
|
|
52
|
-
...(0, _cleanup.cleanupItem)(entity, model),
|
|
53
|
-
...keys,
|
|
54
|
-
TYPE: createType()
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return model;
|
|
58
|
-
} catch (ex) {
|
|
59
|
-
error = ex;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* In case of DynamoDB error we need to remove the index we created.
|
|
63
|
-
*/
|
|
64
|
-
try {
|
|
65
|
-
await elasticsearch.indices.delete({
|
|
66
|
-
index,
|
|
67
|
-
ignore_unavailable: true
|
|
68
|
-
});
|
|
69
|
-
} catch (ex) {
|
|
70
|
-
throw new _error.default(`Could not delete elasticsearch index "${index}" after model record failed to be created.`, "DELETE_MODEL_INDEX_ERROR", {
|
|
71
|
-
dynamodbError: error,
|
|
72
|
-
elasticsearchError: ex
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
throw error;
|
|
76
|
-
};
|
|
77
|
-
const update = async params => {
|
|
78
|
-
const {
|
|
79
|
-
model
|
|
80
|
-
} = params;
|
|
81
|
-
const keys = createKeys(model);
|
|
82
|
-
try {
|
|
83
|
-
await (0, _dbDynamodb.put)({
|
|
84
|
-
entity,
|
|
85
|
-
item: {
|
|
86
|
-
...(0, _cleanup.cleanupItem)(entity, model),
|
|
87
|
-
...keys,
|
|
88
|
-
TYPE: createType()
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
return model;
|
|
92
|
-
} catch (ex) {
|
|
93
|
-
throw new _error.default(ex.message || "Could not update model.", ex.code || "MODEL_UPDATE_ERROR", {
|
|
94
|
-
error: ex,
|
|
95
|
-
model,
|
|
96
|
-
keys
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
const deleteModel = async params => {
|
|
101
|
-
const {
|
|
102
|
-
model
|
|
103
|
-
} = params;
|
|
104
|
-
const keys = createKeys(model);
|
|
105
|
-
const {
|
|
106
|
-
index
|
|
107
|
-
} = _configurations.configurations.es({
|
|
108
|
-
model
|
|
109
|
-
});
|
|
110
|
-
try {
|
|
111
|
-
await (0, _dbDynamodb.deleteItem)({
|
|
112
|
-
entity,
|
|
113
|
-
keys
|
|
114
|
-
});
|
|
115
|
-
} catch (ex) {
|
|
116
|
-
throw new _error.default(ex.message || "Could not delete model.", ex.code || "MODEL_DELETE_ERROR", {
|
|
117
|
-
error: ex,
|
|
118
|
-
model,
|
|
119
|
-
keys
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* Always delete the model index after deleting the model.
|
|
124
|
-
*/
|
|
125
|
-
try {
|
|
126
|
-
await elasticsearch.indices.delete({
|
|
127
|
-
index,
|
|
128
|
-
ignore_unavailable: true
|
|
129
|
-
});
|
|
130
|
-
} catch (ex) {
|
|
131
|
-
throw new _error.default(`Could not delete elasticsearch index "${index}" after model record delete.`, "DELETE_MODEL_INDEX_ERROR", {
|
|
132
|
-
error: ex,
|
|
133
|
-
index,
|
|
134
|
-
model
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
return model;
|
|
138
|
-
};
|
|
139
|
-
const get = async params => {
|
|
140
|
-
const keys = createKeys(params);
|
|
141
|
-
try {
|
|
142
|
-
return await (0, _dbDynamodb.getClean)({
|
|
143
|
-
entity,
|
|
144
|
-
keys
|
|
145
|
-
});
|
|
146
|
-
} catch (ex) {
|
|
147
|
-
throw new _error.default(ex.message || "Could not get model.", ex.code || "MODEL_GET_ERROR", {
|
|
148
|
-
error: ex,
|
|
149
|
-
keys
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
const list = async params => {
|
|
154
|
-
const {
|
|
155
|
-
where
|
|
156
|
-
} = params;
|
|
157
|
-
const queryAllParams = {
|
|
158
|
-
entity,
|
|
159
|
-
partitionKey: createPartitionKey(where),
|
|
160
|
-
options: {
|
|
161
|
-
gte: " "
|
|
162
|
-
}
|
|
163
|
-
};
|
|
164
|
-
try {
|
|
165
|
-
return await (0, _query.queryAllClean)(queryAllParams);
|
|
166
|
-
} catch (ex) {
|
|
167
|
-
throw new _error.default(ex.message || "Could not list models.", ex.code || "MODEL_LIST_ERROR", {
|
|
168
|
-
error: ex,
|
|
169
|
-
partitionKey: queryAllParams.partitionKey
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
return {
|
|
174
|
-
create,
|
|
175
|
-
update,
|
|
176
|
-
delete: deleteModel,
|
|
177
|
-
get,
|
|
178
|
-
list
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
exports.createModelsStorageOperations = createModelsStorageOperations;
|
|
182
|
-
|
|
183
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_configurations","_cleanup","_query","_dbDynamodb","createPartitionKey","params","tenant","locale","createSortKey","modelId","createKeys","PK","SK","createType","createModelsStorageOperations","entity","elasticsearch","create","model","index","configurations","es","keys","error","put","item","cleanupItem","TYPE","ex","indices","delete","ignore_unavailable","WebinyError","dynamodbError","elasticsearchError","update","message","code","deleteModel","deleteItem","get","getClean","list","where","queryAllParams","partitionKey","options","gte","queryAllClean","exports"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsModelStorageOperations,\n CmsModelStorageOperationsCreateParams,\n CmsModelStorageOperationsDeleteParams,\n CmsModelStorageOperationsGetParams,\n CmsModelStorageOperationsListParams,\n CmsModelStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport type { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport { configurations } from \"~/configurations\";\nimport type { Client } from \"@elastic/elasticsearch\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\nimport type { QueryAllParams } from \"@webiny/db-dynamodb/utils/query\";\nimport { queryAllClean } from \"@webiny/db-dynamodb/utils/query\";\nimport { deleteItem, getClean, put } from \"@webiny/db-dynamodb\";\n\ninterface PartitionKeysParams {\n tenant: string;\n locale: string;\n}\n\nconst createPartitionKey = (params: PartitionKeysParams): string => {\n const { tenant, locale } = params;\n return `T#${tenant}#L#${locale}#CMS#CM`;\n};\n\ninterface SortKeyParams {\n modelId: string;\n}\n\nconst createSortKey = (params: SortKeyParams): string => {\n return params.modelId;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\n\nconst createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params)\n };\n};\n\nconst createType = (): string => {\n return \"cms.model\";\n};\n\nexport interface CreateModelsStorageOperationsParams {\n entity: Entity<any>;\n elasticsearch: Client;\n}\n\nexport const createModelsStorageOperations = (\n params: CreateModelsStorageOperationsParams\n): CmsModelStorageOperations => {\n const { entity, elasticsearch } = params;\n\n const create = async (params: CmsModelStorageOperationsCreateParams) => {\n const { model } = params;\n\n const { index } = configurations.es({\n model\n });\n\n const keys = createKeys(model);\n\n let error;\n try {\n await put({\n entity,\n item: {\n ...cleanupItem(entity, model),\n ...keys,\n TYPE: createType()\n }\n });\n return model;\n } catch (ex) {\n error = ex;\n }\n /**\n * In case of DynamoDB error we need to remove the index we created.\n */\n try {\n await elasticsearch.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not delete elasticsearch index \"${index}\" after model record failed to be created.`,\n \"DELETE_MODEL_INDEX_ERROR\",\n {\n dynamodbError: error,\n elasticsearchError: ex\n }\n );\n }\n throw error;\n };\n\n const update = async (params: CmsModelStorageOperationsUpdateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await put({\n entity,\n item: {\n ...cleanupItem(entity, model),\n ...keys,\n TYPE: createType()\n }\n });\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update model.\",\n ex.code || \"MODEL_UPDATE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const deleteModel = async (params: CmsModelStorageOperationsDeleteParams) => {\n const { model } = params;\n const keys = createKeys(model);\n\n const { index } = configurations.es({\n model\n });\n\n try {\n await deleteItem({\n entity,\n keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n /**\n * Always delete the model index after deleting the model.\n */\n try {\n await elasticsearch.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n throw new WebinyError(\n `Could not delete elasticsearch index \"${index}\" after model record delete.`,\n \"DELETE_MODEL_INDEX_ERROR\",\n {\n error: ex,\n index,\n model\n }\n );\n }\n\n return model;\n };\n\n const get = async (params: CmsModelStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n return await getClean<CmsModel>({\n entity,\n keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get model.\",\n ex.code || \"MODEL_GET_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n const list = async (params: CmsModelStorageOperationsListParams) => {\n const { where } = params;\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n };\n try {\n return await queryAllClean<CmsModel>(queryAllParams);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list models.\",\n ex.code || \"MODEL_LIST_ERROR\",\n {\n error: ex,\n partitionKey: queryAllParams.partitionKey\n }\n );\n }\n };\n\n return {\n create,\n update,\n delete: deleteModel,\n get,\n list\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAWA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE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,cAAc,CAAC;IACxD,CAAC,CAAC,OAAOhB,EAAE,EAAE;MACT,MAAM,IAAII,cAAW,CACjBJ,EAAE,CAACQ,OAAO,IAAI,wBAAwB,EACtCR,EAAE,CAACS,IAAI,IAAI,kBAAkB,EAC7B;QACId,KAAK,EAAEK,EAAE;QACTiB,YAAY,EAAED,cAAc,CAACC;MACjC,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACH5B,MAAM;IACNkB,MAAM;IACNL,MAAM,EAAEQ,WAAW;IACnBE,GAAG;IACHE;EACJ,CAAC;AACL,CAAC;AAACO,OAAA,CAAAnC,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CmsSystemStorageOperations } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import type { Entity } from "@webiny/db-dynamodb/toolbox";
|
|
3
|
-
export interface CreateSystemStorageOperationsParams {
|
|
4
|
-
entity: Entity<any>;
|
|
5
|
-
}
|
|
6
|
-
export declare const createSystemStorageOperations: (params: CreateSystemStorageOperationsParams) => CmsSystemStorageOperations;
|
|
@@ -1,94 +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.createSystemStorageOperations = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _get = require("@webiny/db-dynamodb/utils/get");
|
|
10
|
-
var _dbDynamodb = require("@webiny/db-dynamodb");
|
|
11
|
-
const createPartitionKey = ({
|
|
12
|
-
tenant
|
|
13
|
-
}) => {
|
|
14
|
-
return `T#${tenant.toLowerCase()}#SYSTEM`;
|
|
15
|
-
};
|
|
16
|
-
const createSortKey = () => {
|
|
17
|
-
return "CMS";
|
|
18
|
-
};
|
|
19
|
-
const createKeys = params => {
|
|
20
|
-
return {
|
|
21
|
-
PK: createPartitionKey(params),
|
|
22
|
-
SK: createSortKey()
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
const createSystemStorageOperations = params => {
|
|
26
|
-
const {
|
|
27
|
-
entity
|
|
28
|
-
} = params;
|
|
29
|
-
const create = async ({
|
|
30
|
-
system
|
|
31
|
-
}) => {
|
|
32
|
-
const keys = createKeys(system);
|
|
33
|
-
try {
|
|
34
|
-
await (0, _dbDynamodb.put)({
|
|
35
|
-
entity,
|
|
36
|
-
item: {
|
|
37
|
-
...system,
|
|
38
|
-
...keys
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
return system;
|
|
42
|
-
} catch (ex) {
|
|
43
|
-
throw new _error.default(ex.message || "Could not create system.", ex.code || "CREATE_SYSTEM_ERROR", {
|
|
44
|
-
error: ex,
|
|
45
|
-
system,
|
|
46
|
-
keys
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const update = async params => {
|
|
51
|
-
const {
|
|
52
|
-
system
|
|
53
|
-
} = params;
|
|
54
|
-
const keys = createKeys(system);
|
|
55
|
-
try {
|
|
56
|
-
await (0, _dbDynamodb.put)({
|
|
57
|
-
entity,
|
|
58
|
-
item: {
|
|
59
|
-
...system,
|
|
60
|
-
...keys
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
return system;
|
|
64
|
-
} catch (ex) {
|
|
65
|
-
throw new _error.default(ex.message || "Could not update system.", ex.code || "UPDATE_SYSTEM_ERROR", {
|
|
66
|
-
error: ex,
|
|
67
|
-
system,
|
|
68
|
-
keys
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
const get = async params => {
|
|
73
|
-
const keys = createKeys(params);
|
|
74
|
-
try {
|
|
75
|
-
return await (0, _get.getClean)({
|
|
76
|
-
entity,
|
|
77
|
-
keys
|
|
78
|
-
});
|
|
79
|
-
} catch (ex) {
|
|
80
|
-
throw new _error.default(ex.message || "Could not get system.", ex.code || "GET_SYSTEM_ERROR", {
|
|
81
|
-
error: ex,
|
|
82
|
-
keys
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
return {
|
|
87
|
-
create,
|
|
88
|
-
update,
|
|
89
|
-
get
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
exports.createSystemStorageOperations = createSystemStorageOperations;
|
|
93
|
-
|
|
94
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_get","_dbDynamodb","createPartitionKey","tenant","toLowerCase","createSortKey","createKeys","params","PK","SK","createSystemStorageOperations","entity","create","system","keys","put","item","ex","WebinyError","message","code","error","update","get","getClean","exports"],"sources":["index.ts"],"sourcesContent":["import type {\n CmsSystem,\n CmsSystemStorageOperations,\n CmsSystemStorageOperationsCreateParams,\n CmsSystemStorageOperationsGetParams,\n CmsSystemStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport type { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport { getClean } from \"@webiny/db-dynamodb/utils/get\";\nimport { put } from \"@webiny/db-dynamodb\";\n\nexport interface CreateSystemStorageOperationsParams {\n entity: Entity<any>;\n}\n\ninterface PartitionKeyParams {\n tenant: string;\n}\nconst createPartitionKey = ({ tenant }: PartitionKeyParams): string => {\n return `T#${tenant.toLowerCase()}#SYSTEM`;\n};\nconst createSortKey = (): string => {\n return \"CMS\";\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey()\n };\n};\n\nexport const createSystemStorageOperations = (\n params: CreateSystemStorageOperationsParams\n): CmsSystemStorageOperations => {\n const { entity } = params;\n\n const create = async ({ system }: CmsSystemStorageOperationsCreateParams) => {\n const keys = createKeys(system);\n try {\n await put({\n entity,\n item: {\n ...system,\n ...keys\n }\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create system.\",\n ex.code || \"CREATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const update = async (params: CmsSystemStorageOperationsUpdateParams) => {\n const { system } = params;\n\n const keys = createKeys(system);\n\n try {\n await put({\n entity,\n item: {\n ...system,\n ...keys\n }\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update system.\",\n ex.code || \"UPDATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsSystemStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n return await getClean<CmsSystem>({\n entity,\n keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get system.\",\n ex.code || \"GET_SYSTEM_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n return {\n create,\n update,\n get\n };\n};\n"],"mappings":";;;;;;;AAQA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,MAAMG,kBAAkB,GAAGA,CAAC;EAAEC;AAA2B,CAAC,KAAa;EACnE,OAAO,KAAKA,MAAM,CAACC,WAAW,CAAC,CAAC,SAAS;AAC7C,CAAC;AACD,MAAMC,aAAa,GAAGA,CAAA,KAAc;EAChC,OAAO,KAAK;AAChB,CAAC;AAMD,MAAMC,UAAU,GAAIC,MAA0B,IAAW;EACrD,OAAO;IACHC,EAAE,EAAEN,kBAAkB,CAACK,MAAM,CAAC;IAC9BE,EAAE,EAAEJ,aAAa,CAAC;EACtB,CAAC;AACL,CAAC;AAEM,MAAMK,6BAA6B,GACtCH,MAA2C,IACd;EAC7B,MAAM;IAAEI;EAAO,CAAC,GAAGJ,MAAM;EAEzB,MAAMK,MAAM,GAAG,MAAAA,CAAO;IAAEC;EAA+C,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BAAuB,EACrCF,EAAE,CAACG,IAAI,IAAI,kBAAkB,EAC7B;QACIC,KAAK,EAAEJ,EAAE;QACTH;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHF,MAAM;IACNU,MAAM;IACNC;EACJ,CAAC;AACL,CAAC;AAACE,OAAA,CAAAf,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { CmsContext } from "../../types";
|
|
2
|
-
import type { PluginsContainer } from "@webiny/plugins";
|
|
3
|
-
import type { Client } from "@elastic/elasticsearch";
|
|
4
|
-
interface Params {
|
|
5
|
-
context: CmsContext;
|
|
6
|
-
client: Client;
|
|
7
|
-
plugins: PluginsContainer;
|
|
8
|
-
}
|
|
9
|
-
export declare const createElasticsearchIndexesOnLocaleAfterCreate: (params: Params) => Promise<void>;
|
|
10
|
-
export {};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createElasticsearchIndexesOnLocaleAfterCreate = void 0;
|
|
7
|
-
var _createElasticsearchIndex = require("../../elasticsearch/createElasticsearchIndex");
|
|
8
|
-
const createElasticsearchIndexesOnLocaleAfterCreate = async params => {
|
|
9
|
-
const {
|
|
10
|
-
context,
|
|
11
|
-
client,
|
|
12
|
-
plugins
|
|
13
|
-
} = params;
|
|
14
|
-
context.i18n.locales.onLocaleAfterCreate.subscribe(async ({
|
|
15
|
-
locale,
|
|
16
|
-
tenant
|
|
17
|
-
}) => {
|
|
18
|
-
/**
|
|
19
|
-
* Get all the code models and create the indexes for them.
|
|
20
|
-
*/
|
|
21
|
-
const models = await context.security.withoutAuthorization(async () => {
|
|
22
|
-
return (await context.cms.listModels()).map(model => {
|
|
23
|
-
return {
|
|
24
|
-
...model,
|
|
25
|
-
tenant,
|
|
26
|
-
locale: locale.code
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
for (const model of models) {
|
|
31
|
-
await (0, _createElasticsearchIndex.createElasticsearchIndex)({
|
|
32
|
-
client,
|
|
33
|
-
plugins,
|
|
34
|
-
model
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
exports.createElasticsearchIndexesOnLocaleAfterCreate = createElasticsearchIndexesOnLocaleAfterCreate;
|
|
40
|
-
|
|
41
|
-
//# sourceMappingURL=indexes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_createElasticsearchIndex","require","createElasticsearchIndexesOnLocaleAfterCreate","params","context","client","plugins","i18n","locales","onLocaleAfterCreate","subscribe","locale","tenant","models","security","withoutAuthorization","cms","listModels","map","model","code","createElasticsearchIndex","exports"],"sources":["indexes.ts"],"sourcesContent":["import type { CmsContext } from \"~/types\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { Client } from \"@elastic/elasticsearch\";\nimport { createElasticsearchIndex } from \"~/elasticsearch/createElasticsearchIndex\";\n\ninterface Params {\n context: CmsContext;\n client: Client;\n plugins: PluginsContainer;\n}\n\nexport const createElasticsearchIndexesOnLocaleAfterCreate = async (params: Params) => {\n const { context, client, plugins } = params;\n\n context.i18n.locales.onLocaleAfterCreate.subscribe(async ({ locale, tenant }) => {\n /**\n * Get all the code models and create the indexes for them.\n */\n const models = await context.security.withoutAuthorization(async () => {\n return (await context.cms.listModels()).map(model => {\n return {\n ...model,\n tenant,\n locale: locale.code\n };\n });\n });\n\n for (const model of models) {\n await createElasticsearchIndex({\n client,\n plugins,\n model\n });\n }\n });\n};\n"],"mappings":";;;;;;AAGA,IAAAA,yBAAA,GAAAC,OAAA;AAQO,MAAMC,6CAA6C,GAAG,MAAOC,MAAc,IAAK;EACnF,MAAM;IAAEC,OAAO;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGH,MAAM;EAE3CC,OAAO,CAACG,IAAI,CAACC,OAAO,CAACC,mBAAmB,CAACC,SAAS,CAAC,OAAO;IAAEC,MAAM;IAAEC;EAAO,CAAC,KAAK;IAC7E;AACR;AACA;IACQ,MAAMC,MAAM,GAAG,MAAMT,OAAO,CAACU,QAAQ,CAACC,oBAAoB,CAAC,YAAY;MACnE,OAAO,CAAC,MAAMX,OAAO,CAACY,GAAG,CAACC,UAAU,CAAC,CAAC,EAAEC,GAAG,CAACC,KAAK,IAAI;QACjD,OAAO;UACH,GAAGA,KAAK;UACRP,MAAM;UACND,MAAM,EAAEA,MAAM,CAACS;QACnB,CAAC;MACL,CAAC,CAAC;IACN,CAAC,CAAC;IAEF,KAAK,MAAMD,KAAK,IAAIN,MAAM,EAAE;MACxB,MAAM,IAAAQ,kDAAwB,EAAC;QAC3BhB,MAAM;QACNC,OAAO;QACPa;MACJ,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACG,OAAA,CAAApB,6CAAA,GAAAA,6CAAA","ignoreList":[]}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import type { CmsModelFieldType } from "@webiny/api-headless-cms/types";
|
|
3
|
-
/**
|
|
4
|
-
* A plugin which allows you to map a custom GraphQL field to an Elasticsearch field.
|
|
5
|
-
*
|
|
6
|
-
* This is useful when you want to create a custom field in the CMS GraphQL Schema, and you want to map it to an Elasticsearch field.
|
|
7
|
-
*/
|
|
8
|
-
export interface CmsModelFieldPluginParams {
|
|
9
|
-
/**
|
|
10
|
-
* The type of the field.
|
|
11
|
-
* Can be something custom, like "my-field-type".
|
|
12
|
-
*/
|
|
13
|
-
fieldType: CmsModelFieldType;
|
|
14
|
-
/**
|
|
15
|
-
* The ID of the field on the GraphQL side
|
|
16
|
-
*/
|
|
17
|
-
fieldId: string;
|
|
18
|
-
/**
|
|
19
|
-
* The path to the field in the Elasticsearch document.
|
|
20
|
-
*/
|
|
21
|
-
path: string;
|
|
22
|
-
/**
|
|
23
|
-
* If the field should be applied only to specific models.
|
|
24
|
-
* Or excluded from the specific models.
|
|
25
|
-
*
|
|
26
|
-
* The default is to apply to all models.
|
|
27
|
-
*/
|
|
28
|
-
models?: {
|
|
29
|
-
include?: string[];
|
|
30
|
-
exclude?: string[];
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* The unmapped type of the field.
|
|
34
|
-
* In most cases, this will be undefined.
|
|
35
|
-
* When does it need to be set?
|
|
36
|
-
*
|
|
37
|
-
* When you are using a custom field type, other than the ones that are defined in the CMS.
|
|
38
|
-
* Let's say you create a field of type `my-field-type`, in which you want to store dates. By the default, it will, in most cases be set as string - if you did not specify the value transformer.
|
|
39
|
-
* If you want to be able to sort/filter properly by this field, you need to specify the unmapped type as "date".
|
|
40
|
-
*/
|
|
41
|
-
unmappedType?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Is this field searchable?
|
|
44
|
-
* If set to false, an error will be thrown when trying to search/filter by this field.
|
|
45
|
-
*/
|
|
46
|
-
searchable?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Is this field sortable?
|
|
49
|
-
* If set to false, an error will be thrown when trying to sort by this field.
|
|
50
|
-
*/
|
|
51
|
-
sortable?: boolean;
|
|
52
|
-
/**
|
|
53
|
-
* If the .keyword should be applied when doing the filtering or sorting on the field.
|
|
54
|
-
*/
|
|
55
|
-
keyword?: boolean;
|
|
56
|
-
}
|
|
57
|
-
export declare class CmsElasticsearchModelFieldPlugin extends Plugin {
|
|
58
|
-
static readonly type: string;
|
|
59
|
-
private readonly field;
|
|
60
|
-
get fieldType(): string;
|
|
61
|
-
get fieldId(): string;
|
|
62
|
-
get path(): string;
|
|
63
|
-
get unmappedType(): string | undefined;
|
|
64
|
-
get searchable(): boolean | undefined;
|
|
65
|
-
get sortable(): boolean | undefined;
|
|
66
|
-
get keyword(): boolean | undefined;
|
|
67
|
-
constructor(field: CmsModelFieldPluginParams);
|
|
68
|
-
canBeApplied(modelId: string): boolean;
|
|
69
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.CmsElasticsearchModelFieldPlugin = void 0;
|
|
7
|
-
var _plugins = require("@webiny/plugins");
|
|
8
|
-
/**
|
|
9
|
-
* A plugin which allows you to map a custom GraphQL field to an Elasticsearch field.
|
|
10
|
-
*
|
|
11
|
-
* This is useful when you want to create a custom field in the CMS GraphQL Schema, and you want to map it to an Elasticsearch field.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
class CmsElasticsearchModelFieldPlugin extends _plugins.Plugin {
|
|
15
|
-
static type = "headlessCms.elasticsearch.model.field";
|
|
16
|
-
get fieldType() {
|
|
17
|
-
return this.field.fieldType;
|
|
18
|
-
}
|
|
19
|
-
get fieldId() {
|
|
20
|
-
return this.field.fieldId;
|
|
21
|
-
}
|
|
22
|
-
get path() {
|
|
23
|
-
return this.field.path;
|
|
24
|
-
}
|
|
25
|
-
get unmappedType() {
|
|
26
|
-
return this.field.unmappedType;
|
|
27
|
-
}
|
|
28
|
-
get searchable() {
|
|
29
|
-
return this.field.searchable;
|
|
30
|
-
}
|
|
31
|
-
get sortable() {
|
|
32
|
-
return this.field.sortable;
|
|
33
|
-
}
|
|
34
|
-
get keyword() {
|
|
35
|
-
return this.field.keyword;
|
|
36
|
-
}
|
|
37
|
-
constructor(field) {
|
|
38
|
-
super();
|
|
39
|
-
this.field = field;
|
|
40
|
-
}
|
|
41
|
-
canBeApplied(modelId) {
|
|
42
|
-
if (this.field.models?.include?.length) {
|
|
43
|
-
return this.field.models.include.includes(modelId);
|
|
44
|
-
} else if (this.field.models?.exclude?.length) {
|
|
45
|
-
return this.field.models.exclude.includes(modelId) === false;
|
|
46
|
-
}
|
|
47
|
-
return true;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.CmsElasticsearchModelFieldPlugin = CmsElasticsearchModelFieldPlugin;
|
|
51
|
-
|
|
52
|
-
//# sourceMappingURL=CmsElasticsearchModelFieldPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","CmsElasticsearchModelFieldPlugin","Plugin","type","fieldType","field","fieldId","path","unmappedType","searchable","sortable","keyword","constructor","canBeApplied","modelId","models","include","length","includes","exclude","exports"],"sources":["CmsElasticsearchModelFieldPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsModelFieldType } from \"@webiny/api-headless-cms/types\";\n\n/**\n * A plugin which allows you to map a custom GraphQL field to an Elasticsearch field.\n *\n * This is useful when you want to create a custom field in the CMS GraphQL Schema, and you want to map it to an Elasticsearch field.\n */\nexport interface CmsModelFieldPluginParams {\n /**\n * The type of the field.\n * Can be something custom, like \"my-field-type\".\n */\n fieldType: CmsModelFieldType;\n /**\n * The ID of the field on the GraphQL side\n */\n fieldId: string;\n /**\n * The path to the field in the Elasticsearch document.\n */\n path: string;\n /**\n * If the field should be applied only to specific models.\n * Or excluded from the specific models.\n *\n * The default is to apply to all models.\n */\n models?: {\n include?: string[];\n exclude?: string[];\n };\n /**\n * The unmapped type of the field.\n * In most cases, this will be undefined.\n * When does it need to be set?\n *\n * When you are using a custom field type, other than the ones that are defined in the CMS.\n * Let's say you create a field of type `my-field-type`, in which you want to store dates. By the default, it will, in most cases be set as string - if you did not specify the value transformer.\n * If you want to be able to sort/filter properly by this field, you need to specify the unmapped type as \"date\".\n */\n unmappedType?: string;\n /**\n * Is this field searchable?\n * If set to false, an error will be thrown when trying to search/filter by this field.\n */\n searchable?: boolean;\n /**\n * Is this field sortable?\n * If set to false, an error will be thrown when trying to sort by this field.\n */\n sortable?: boolean;\n /**\n * If the .keyword should be applied when doing the filtering or sorting on the field.\n */\n keyword?: boolean;\n}\n\nexport class CmsElasticsearchModelFieldPlugin extends Plugin {\n public static override readonly type: string = \"headlessCms.elasticsearch.model.field\";\n\n private readonly field: CmsModelFieldPluginParams;\n\n public get fieldType() {\n return this.field.fieldType;\n }\n public get fieldId() {\n return this.field.fieldId;\n }\n public get path() {\n return this.field.path;\n }\n\n public get unmappedType() {\n return this.field.unmappedType;\n }\n\n public get searchable() {\n return this.field.searchable;\n }\n\n public get sortable() {\n return this.field.sortable;\n }\n\n public get keyword() {\n return this.field.keyword;\n }\n\n public constructor(field: CmsModelFieldPluginParams) {\n super();\n this.field = field;\n }\n\n public canBeApplied(modelId: string): boolean {\n if (this.field.models?.include?.length) {\n return this.field.models.include.includes(modelId);\n } else if (this.field.models?.exclude?.length) {\n return this.field.models.exclude.includes(modelId) === false;\n }\n return true;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGA;AACA;AACA;AACA;AACA;;AAmDO,MAAMC,gCAAgC,SAASC,eAAM,CAAC;EACzD,OAAgCC,IAAI,GAAW,uCAAuC;EAItF,IAAWC,SAASA,CAAA,EAAG;IACnB,OAAO,IAAI,CAACC,KAAK,CAACD,SAAS;EAC/B;EACA,IAAWE,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACD,KAAK,CAACC,OAAO;EAC7B;EACA,IAAWC,IAAIA,CAAA,EAAG;IACd,OAAO,IAAI,CAACF,KAAK,CAACE,IAAI;EAC1B;EAEA,IAAWC,YAAYA,CAAA,EAAG;IACtB,OAAO,IAAI,CAACH,KAAK,CAACG,YAAY;EAClC;EAEA,IAAWC,UAAUA,CAAA,EAAG;IACpB,OAAO,IAAI,CAACJ,KAAK,CAACI,UAAU;EAChC;EAEA,IAAWC,QAAQA,CAAA,EAAG;IAClB,OAAO,IAAI,CAACL,KAAK,CAACK,QAAQ;EAC9B;EAEA,IAAWC,OAAOA,CAAA,EAAG;IACjB,OAAO,IAAI,CAACN,KAAK,CAACM,OAAO;EAC7B;EAEOC,WAAWA,CAACP,KAAgC,EAAE;IACjD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,KAAK,GAAGA,KAAK;EACtB;EAEOQ,YAAYA,CAACC,OAAe,EAAW;IAC1C,IAAI,IAAI,CAACT,KAAK,CAACU,MAAM,EAAEC,OAAO,EAAEC,MAAM,EAAE;MACpC,OAAO,IAAI,CAACZ,KAAK,CAACU,MAAM,CAACC,OAAO,CAACE,QAAQ,CAACJ,OAAO,CAAC;IACtD,CAAC,MAAM,IAAI,IAAI,CAACT,KAAK,CAACU,MAAM,EAAEI,OAAO,EAAEF,MAAM,EAAE;MAC3C,OAAO,IAAI,CAACZ,KAAK,CAACU,MAAM,CAACI,OAAO,CAACD,QAAQ,CAACJ,OAAO,CAAC,KAAK,KAAK;IAChE;IACA,OAAO,IAAI;EACf;AACJ;AAACM,OAAA,CAAAnB,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { ModifyBodyCallable, ModifyBodyParams as BaseModifyBodyParams } from "@webiny/api-elasticsearch";
|
|
2
|
-
import { ElasticsearchBodyModifierPlugin } from "@webiny/api-elasticsearch";
|
|
3
|
-
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
|
4
|
-
export interface ModifyBodyParams extends BaseModifyBodyParams {
|
|
5
|
-
model: CmsModel;
|
|
6
|
-
where: {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export interface CmsEntryElasticsearchBodyModifierPluginConfig {
|
|
11
|
-
modifyBody: ModifyBodyCallable<ModifyBodyParams>;
|
|
12
|
-
/**
|
|
13
|
-
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
14
|
-
*/
|
|
15
|
-
modelId?: string;
|
|
16
|
-
}
|
|
17
|
-
export declare class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {
|
|
18
|
-
static readonly type: string;
|
|
19
|
-
readonly modelId?: string;
|
|
20
|
-
constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig);
|
|
21
|
-
}
|
|
22
|
-
export declare const createCmsEntryElasticsearchBodyModifierPlugin: (config: CmsEntryElasticsearchBodyModifierPluginConfig) => CmsEntryElasticsearchBodyModifierPlugin;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createCmsEntryElasticsearchBodyModifierPlugin = exports.CmsEntryElasticsearchBodyModifierPlugin = void 0;
|
|
7
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
8
|
-
class CmsEntryElasticsearchBodyModifierPlugin extends _apiElasticsearch.ElasticsearchBodyModifierPlugin {
|
|
9
|
-
static type = "cms.elasticsearch.modifier.body.entry";
|
|
10
|
-
constructor(config) {
|
|
11
|
-
super(config.modifyBody);
|
|
12
|
-
this.modelId = config.modelId;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.CmsEntryElasticsearchBodyModifierPlugin = CmsEntryElasticsearchBodyModifierPlugin;
|
|
16
|
-
const createCmsEntryElasticsearchBodyModifierPlugin = config => {
|
|
17
|
-
return new CmsEntryElasticsearchBodyModifierPlugin(config);
|
|
18
|
-
};
|
|
19
|
-
exports.createCmsEntryElasticsearchBodyModifierPlugin = createCmsEntryElasticsearchBodyModifierPlugin;
|
|
20
|
-
|
|
21
|
-
//# sourceMappingURL=CmsEntryElasticsearchBodyModifierPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_apiElasticsearch","require","CmsEntryElasticsearchBodyModifierPlugin","ElasticsearchBodyModifierPlugin","type","constructor","config","modifyBody","modelId","exports","createCmsEntryElasticsearchBodyModifierPlugin"],"sources":["CmsEntryElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import type {\n ModifyBodyCallable,\n ModifyBodyParams as BaseModifyBodyParams\n} from \"@webiny/api-elasticsearch\";\nimport { ElasticsearchBodyModifierPlugin } from \"@webiny/api-elasticsearch\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyBodyParams extends BaseModifyBodyParams {\n model: CmsModel;\n where: {\n [key: string]: any;\n };\n}\n\nexport interface CmsEntryElasticsearchBodyModifierPluginConfig {\n modifyBody: ModifyBodyCallable<ModifyBodyParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.body.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig) {\n super(config.modifyBody);\n\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchBodyModifierPlugin = (\n config: CmsEntryElasticsearchBodyModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchBodyModifierPlugin(config);\n};\n"],"mappings":";;;;;;AAIA,IAAAA,iBAAA,GAAAC,OAAA;AAkBO,MAAMC,uCAAuC,SAASC,iDAA+B,CAAmB;EAC3G,OAAgCC,IAAI,GAAW,uCAAuC;EAI/EC,WAAWA,CAACC,MAAqD,EAAE;IACtE,KAAK,CAACA,MAAM,CAACC,UAAU,CAAC;IAExB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAACC,OAAA,CAAAP,uCAAA,GAAAA,uCAAA;AAEM,MAAMQ,6CAA6C,GACtDJ,MAAqD,IACpD;EACD,OAAO,IAAIJ,uCAAuC,CAACI,MAAM,CAAC;AAC9D,CAAC;AAACG,OAAA,CAAAC,6CAAA,GAAAA,6CAAA","ignoreList":[]}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import type { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
|
|
3
|
-
import type { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
|
|
4
|
-
export interface CmsEntryElasticsearchFullTextSearchPluginCbParams {
|
|
5
|
-
model: CmsModel;
|
|
6
|
-
query: ElasticsearchBoolQueryConfig;
|
|
7
|
-
term: string;
|
|
8
|
-
fields: CmsModelField[];
|
|
9
|
-
createFieldPath: (field: CmsModelField) => string;
|
|
10
|
-
prepareTerm: (term: string) => string;
|
|
11
|
-
}
|
|
12
|
-
export interface CmsEntryElasticsearchFullTextSearchPluginParams {
|
|
13
|
-
models?: string[];
|
|
14
|
-
apply: (params: CmsEntryElasticsearchFullTextSearchPluginCbParams) => void;
|
|
15
|
-
}
|
|
16
|
-
export declare class CmsEntryElasticsearchFullTextSearchPlugin extends Plugin {
|
|
17
|
-
static readonly type: string;
|
|
18
|
-
private readonly params;
|
|
19
|
-
get models(): string[] | undefined;
|
|
20
|
-
constructor(params: CmsEntryElasticsearchFullTextSearchPluginParams);
|
|
21
|
-
apply(params: CmsEntryElasticsearchFullTextSearchPluginCbParams): void;
|
|
22
|
-
}
|
|
23
|
-
export declare const createCmsEntryElasticsearchFullTextSearchPlugin: (params: CmsEntryElasticsearchFullTextSearchPluginParams) => CmsEntryElasticsearchFullTextSearchPlugin;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createCmsEntryElasticsearchFullTextSearchPlugin = exports.CmsEntryElasticsearchFullTextSearchPlugin = void 0;
|
|
7
|
-
var _plugins = require("@webiny/plugins");
|
|
8
|
-
class CmsEntryElasticsearchFullTextSearchPlugin extends _plugins.Plugin {
|
|
9
|
-
static type = "headless-cms.elasticsearch.entry.fullTextSearch";
|
|
10
|
-
get models() {
|
|
11
|
-
return this.params.models;
|
|
12
|
-
}
|
|
13
|
-
constructor(params) {
|
|
14
|
-
super();
|
|
15
|
-
this.params = params;
|
|
16
|
-
}
|
|
17
|
-
apply(params) {
|
|
18
|
-
return this.params.apply(params);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.CmsEntryElasticsearchFullTextSearchPlugin = CmsEntryElasticsearchFullTextSearchPlugin;
|
|
22
|
-
const createCmsEntryElasticsearchFullTextSearchPlugin = params => {
|
|
23
|
-
return new CmsEntryElasticsearchFullTextSearchPlugin(params);
|
|
24
|
-
};
|
|
25
|
-
exports.createCmsEntryElasticsearchFullTextSearchPlugin = createCmsEntryElasticsearchFullTextSearchPlugin;
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=CmsEntryElasticsearchFullTextSearchPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","CmsEntryElasticsearchFullTextSearchPlugin","Plugin","type","models","params","constructor","apply","exports","createCmsEntryElasticsearchFullTextSearchPlugin"],"sources":["CmsEntryElasticsearchFullTextSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\nimport type { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CmsEntryElasticsearchFullTextSearchPluginCbParams {\n model: CmsModel;\n query: ElasticsearchBoolQueryConfig;\n term: string;\n fields: CmsModelField[];\n createFieldPath: (field: CmsModelField) => string;\n prepareTerm: (term: string) => string;\n}\nexport interface CmsEntryElasticsearchFullTextSearchPluginParams {\n models?: string[];\n apply: (params: CmsEntryElasticsearchFullTextSearchPluginCbParams) => void;\n}\nexport class CmsEntryElasticsearchFullTextSearchPlugin extends Plugin {\n public static override readonly type: string =\n \"headless-cms.elasticsearch.entry.fullTextSearch\";\n\n private readonly params: CmsEntryElasticsearchFullTextSearchPluginParams;\n\n public get models() {\n return this.params.models;\n }\n\n public constructor(params: CmsEntryElasticsearchFullTextSearchPluginParams) {\n super();\n this.params = params;\n }\n\n public apply(params: CmsEntryElasticsearchFullTextSearchPluginCbParams): void {\n return this.params.apply(params);\n }\n}\n\nexport const createCmsEntryElasticsearchFullTextSearchPlugin = (\n params: CmsEntryElasticsearchFullTextSearchPluginParams\n) => {\n return new CmsEntryElasticsearchFullTextSearchPlugin(params);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAgBO,MAAMC,yCAAyC,SAASC,eAAM,CAAC;EAClE,OAAgCC,IAAI,GAChC,iDAAiD;EAIrD,IAAWC,MAAMA,CAAA,EAAG;IAChB,OAAO,IAAI,CAACC,MAAM,CAACD,MAAM;EAC7B;EAEOE,WAAWA,CAACD,MAAuD,EAAE;IACxE,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOE,KAAKA,CAACF,MAAyD,EAAQ;IAC1E,OAAO,IAAI,CAACA,MAAM,CAACE,KAAK,CAACF,MAAM,CAAC;EACpC;AACJ;AAACG,OAAA,CAAAP,yCAAA,GAAAA,yCAAA;AAEM,MAAMQ,+CAA+C,GACxDJ,MAAuD,IACtD;EACD,OAAO,IAAIJ,yCAAyC,CAACI,MAAM,CAAC;AAChE,CAAC;AAACG,OAAA,CAAAC,+CAAA,GAAAA,+CAAA","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.CmsEntryElasticsearchIndexPlugin = void 0;
|
|
7
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
8
|
-
class CmsEntryElasticsearchIndexPlugin extends _apiElasticsearch.ElasticsearchIndexPlugin {
|
|
9
|
-
static type = "cms.entry.elasticsearch.index";
|
|
10
|
-
}
|
|
11
|
-
exports.CmsEntryElasticsearchIndexPlugin = CmsEntryElasticsearchIndexPlugin;
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=CmsEntryElasticsearchIndexPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_apiElasticsearch","require","CmsEntryElasticsearchIndexPlugin","ElasticsearchIndexPlugin","type","exports"],"sources":["CmsEntryElasticsearchIndexPlugin.ts"],"sourcesContent":["import { ElasticsearchIndexPlugin } from \"@webiny/api-elasticsearch\";\n\nexport class CmsEntryElasticsearchIndexPlugin extends ElasticsearchIndexPlugin {\n public static override readonly type: string = \"cms.entry.elasticsearch.index\";\n}\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAEO,MAAMC,gCAAgC,SAASC,0CAAwB,CAAC;EAC3E,OAAgCC,IAAI,GAAW,+BAA+B;AAClF;AAACC,OAAA,CAAAH,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|