@webiny/api-headless-cms-ddb-es 6.0.0-beta.0 → 6.0.0-rc.1
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/configurations.d.ts +4 -5
- package/configurations.js +12 -24
- package/configurations.js.map +1 -1
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +5 -174
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +5 -58
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +5 -102
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +59 -0
- package/definitions/types.js +3 -0
- package/definitions/types.js.map +1 -0
- package/dynamoDb/index.d.ts +2 -2
- package/dynamoDb/index.js +5 -14
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/longText.js +11 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.d.ts +0 -5
- package/dynamoDb/storage/richText.js +25 -80
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
- package/elasticsearch/createElasticsearchIndex.js +7 -15
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +2 -2
- package/elasticsearch/deleteElasticsearchIndex.js +3 -10
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/elasticsearch/index.d.ts +1 -1
- package/elasticsearch/index.js +3 -11
- package/elasticsearch/index.js.map +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.js +1 -8
- package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.js +1 -8
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
- package/elasticsearch/indexing/index.d.ts +1 -1
- package/elasticsearch/indexing/index.js +8 -16
- package/elasticsearch/indexing/index.js.map +1 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +1 -1
- package/elasticsearch/indexing/jsonIndexing.js +1 -8
- package/elasticsearch/indexing/jsonIndexing.js.map +1 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
- package/elasticsearch/indexing/longTextIndexing.js +1 -8
- package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
- package/elasticsearch/indexing/numberIndexing.js +1 -8
- package/elasticsearch/indexing/numberIndexing.js.map +1 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
- package/elasticsearch/indexing/objectIndexing.js +6 -13
- package/elasticsearch/indexing/objectIndexing.js.map +1 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
- package/elasticsearch/indexing/richTextIndexing.js +1 -8
- package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
- package/elasticsearch/indices/base.d.ts +1 -1
- package/elasticsearch/indices/base.js +4 -10
- package/elasticsearch/indices/base.js.map +1 -1
- package/elasticsearch/indices/index.d.ts +1 -1
- package/elasticsearch/indices/index.js +3 -11
- package/elasticsearch/indices/index.js.map +1 -1
- package/elasticsearch/search/index.d.ts +1 -1
- package/elasticsearch/search/index.js +4 -10
- package/elasticsearch/search/index.js.map +1 -1
- package/elasticsearch/search/refSearch.d.ts +1 -1
- package/elasticsearch/search/refSearch.js +3 -10
- package/elasticsearch/search/refSearch.js.map +1 -1
- package/elasticsearch/search/searchableJson.d.ts +2 -0
- package/elasticsearch/search/searchableJson.js +53 -0
- package/elasticsearch/search/searchableJson.js.map +1 -0
- package/elasticsearch/search/timeSearch.d.ts +1 -1
- package/elasticsearch/search/timeSearch.js +3 -10
- package/elasticsearch/search/timeSearch.js.map +1 -1
- package/helpers/entryIndexHelpers.d.ts +10 -10
- package/helpers/entryIndexHelpers.js +32 -26
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.d.ts +1 -1
- package/helpers/fieldIdentifier.js +2 -10
- package/helpers/fieldIdentifier.js.map +1 -1
- package/helpers/index.d.ts +2 -2
- package/helpers/index.js +2 -27
- package/helpers/index.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +108 -134
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -3
- package/operations/entry/dataLoader/DataLoaderCache.js +2 -9
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +1 -7
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +4 -10
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
- package/operations/entry/dataLoader/getAllEntryRevisions.js +11 -24
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +18 -30
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +18 -30
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
- package/operations/entry/dataLoader/getRevisionById.js +23 -35
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.d.ts +5 -5
- package/operations/entry/dataLoader/index.js +10 -31
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +3 -4
- package/operations/entry/dataLoader/types.js +1 -5
- package/operations/entry/dataLoader/types.js.map +1 -1
- package/operations/entry/dataLoaders.d.ts +13 -13
- package/operations/entry/dataLoaders.js +15 -25
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +1 -8
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
- package/operations/entry/elasticsearch/body.d.ts +3 -3
- package/operations/entry/elasticsearch/body.js +21 -28
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields.d.ts +3 -3
- package/operations/entry/elasticsearch/fields.js +110 -24
- package/operations/entry/elasticsearch/fields.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +10 -17
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +7 -6
- package/operations/entry/elasticsearch/filtering/exec.js +48 -45
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/index.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/index.js +1 -16
- package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +2 -1
- package/operations/entry/elasticsearch/filtering/path.js +9 -17
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +6 -14
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js +5 -12
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +7 -15
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +15 -16
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/populated.js +1 -8
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/values.js +4 -12
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +3 -3
- package/operations/entry/elasticsearch/fullTextSearch.js +6 -12
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.js +1 -8
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
- package/operations/entry/elasticsearch/initialQuery.js +9 -26
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
- package/operations/entry/elasticsearch/keyword.d.ts +1 -1
- package/operations/entry/elasticsearch/keyword.js +4 -9
- package/operations/entry/elasticsearch/keyword.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +3 -10
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -3
- package/operations/entry/elasticsearch/plugins/operator.js +4 -19
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/queryModifier.js +3 -10
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/search.d.ts +2 -2
- package/operations/entry/elasticsearch/plugins/search.js +5 -13
- package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/sortModifier.js +3 -10
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
- package/operations/entry/elasticsearch/sort.d.ts +4 -4
- package/operations/entry/elasticsearch/sort.js +57 -33
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
- package/operations/entry/elasticsearch/transformValueForSearch.js +4 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.d.ts +5 -5
- package/operations/entry/elasticsearch/types.js +1 -5
- package/operations/entry/elasticsearch/types.js.map +1 -1
- package/operations/entry/index.d.ts +7 -6
- package/operations/entry/index.js +634 -735
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +56 -19
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +3 -12
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
- package/operations/entry/transformations/convertEntryKeys.js +2 -10
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +17 -17
- package/operations/entry/transformations/index.js +22 -30
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +27 -34
- package/operations/entry/transformations/modifyEntryValues.js +1 -8
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
- package/operations/entry/transformations/transformEntryKeys.js +4 -11
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +7 -7
- package/operations/entry/transformations/transformEntryToIndex.js +3 -10
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +6 -5
- package/operations/group/index.js +39 -73
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +4 -4
- package/operations/model/index.js +38 -57
- package/operations/model/index.js.map +1 -1
- package/package.json +29 -41
- package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +1 -1
- package/plugins/CmsElasticsearchModelFieldPlugin.js +2 -8
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +2 -2
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +2 -9
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +12 -12
- package/plugins/CmsEntryElasticsearchValuesModifier.js +4 -12
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
- package/plugins/CmsEntryFilterPlugin.js +2 -9
- package/plugins/CmsEntryFilterPlugin.js.map +1 -1
- package/plugins/index.d.ts +8 -8
- package/plugins/index.js +8 -93
- package/plugins/index.js.map +1 -1
- package/tasks/createIndexTaskPlugin.d.ts +2 -2
- package/tasks/createIndexTaskPlugin.js +36 -62
- package/tasks/createIndexTaskPlugin.js.map +1 -1
- package/types.d.ts +28 -33
- package/types.js +5 -8
- package/types.js.map +1 -1
- package/values/NoValueContainer.d.ts +5 -0
- package/values/NoValueContainer.js +13 -0
- package/values/NoValueContainer.js.map +1 -0
- package/definitions/entryElasticsearch.d.ts +0 -8
- package/definitions/entryElasticsearch.js +0 -38
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/system.d.ts +0 -8
- 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/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -84
- package/dynamoDb/storage/date.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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["WebinyError","DataLoaderCache","getDataLoaderFactory","parseIdentifier","DataLoadersHandler","cache","constructor","params","entity","getAllEntryRevisions","ids","map","id","entryId","loadMany","getRevisionById","getPublishedRevisionByEntryId","getLatestRevisionByEntryId","getLoader","name","model","cacheParams","tenant","loader","getDataLoader","factory","setDataLoader","results","Array","isArray","reduce","acc","res","message","code","data","JSON","stringify","push","ex","error","clearAll"],"sources":["dataLoaders.ts"],"sourcesContent":["import type DataLoader from \"dataloader\";\nimport WebinyError from \"@webiny/error\";\nimport type {\n CmsEntryValues,\n CmsModel,\n CmsStorageEntry\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CacheKeyParams } from \"~/operations/entry/dataLoader/DataLoaderCache.js\";\nimport { DataLoaderCache } from \"~/operations/entry/dataLoader/DataLoaderCache.js\";\nimport type { DataLoaders } from \"~/operations/entry/dataLoader/index.js\";\nimport { getDataLoaderFactory } from \"~/operations/entry/dataLoader/index.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport type { DataLoadersHandlerInterfaceClearAllParams, IDataLoadersHandler } from \"~/types.js\";\nimport type { IEntryEntity } from \"~/definitions/types.js\";\n\ninterface DataLoaderParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n ids: readonly string[];\n}\n\ninterface GetLoaderParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n}\n\ninterface IDataLoadersHandlerParams {\n entity: IEntryEntity;\n}\n\nexport interface ClearAllParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n}\n\nexport class DataLoadersHandler implements IDataLoadersHandler {\n private readonly entity;\n private readonly cache = new DataLoaderCache();\n\n public constructor(params: IDataLoadersHandlerParams) {\n this.entity = params.entity;\n }\n\n public async getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoaderParams\n ): Promise<CmsStorageEntry<T>[]> {\n const ids = params.ids.map(id => {\n const { id: entryId } = parseIdentifier(id);\n return entryId;\n });\n return await this.loadMany<T>(\"getAllEntryRevisions\", params, ids);\n }\n\n public async getRevisionById<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoaderParams\n ): Promise<CmsStorageEntry<T>[]> {\n return await this.loadMany<T>(\"getRevisionById\", params, params.ids);\n }\n\n public async getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoaderParams\n ): Promise<CmsStorageEntry<T>[]> {\n const ids = params.ids.map(id => {\n const { id: entryId } = parseIdentifier(id);\n return entryId;\n });\n return await this.loadMany<T>(\"getPublishedRevisionByEntryId\", params, ids);\n }\n\n public async getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoaderParams\n ): Promise<CmsStorageEntry<T>[]> {\n const ids = params.ids.map(id => {\n const { id: entryId } = parseIdentifier(id);\n return entryId;\n });\n return await this.loadMany<T>(\"getLatestRevisionByEntryId\", params, ids);\n }\n\n /**\n * TODO @ts-refactor\n * Maybe pass on the generics to DataLoader definition?\n */\n private getLoader(name: DataLoaders, params: GetLoaderParams): DataLoader<any, any> {\n const { model } = params;\n const cacheParams: CacheKeyParams = {\n tenant: model.tenant,\n name\n };\n let loader = this.cache.getDataLoader(cacheParams);\n if (loader) {\n return loader;\n }\n const factory = getDataLoaderFactory(name);\n loader = factory({\n entity: this.entity,\n tenant: model.tenant\n });\n this.cache.setDataLoader(cacheParams, loader);\n return loader;\n }\n\n private async loadMany<T extends CmsEntryValues = CmsEntryValues>(\n loader: DataLoaders,\n params: GetLoaderParams,\n ids: readonly string[]\n ): Promise<CmsStorageEntry<T>[]> {\n let results: CmsStorageEntry<T>[] = [];\n try {\n results = await this.getLoader(loader, params).loadMany(ids);\n if (Array.isArray(results) === true) {\n return results.reduce<CmsStorageEntry<T>[]>((acc, res) => {\n if (Array.isArray(res) === false) {\n if (res && res.message) {\n throw new WebinyError(res.message, res.code, {\n ...res,\n data: JSON.stringify(res.data || {})\n });\n }\n throw new WebinyError(\n \"Result from the data loader must be an array of arrays which contain requested items.\",\n \"DATA_LOADER_RESULTS_ERROR\",\n {\n ...params,\n loader\n }\n );\n }\n acc.push(...res);\n return acc;\n }, []);\n }\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Data loader error.\",\n ex.code || \"DATA_LOADER_ERROR\",\n {\n error: ex,\n ...params,\n loader,\n ids\n }\n );\n }\n throw new WebinyError(\n `Data loader did not return array of items or empty array.`,\n \"INVALID_DATA_LOADER_RESULT\",\n {\n loader,\n ids,\n results\n }\n );\n }\n\n public clearAll(params?: DataLoadersHandlerInterfaceClearAllParams): void {\n this.cache.clearAll(params?.model);\n }\n}\n"],"mappings":"AACA,OAAOA,WAAW,MAAM,eAAe;AAOvC,SAASC,eAAe;AAExB,SAASC,oBAAoB;AAC7B,SAASC,eAAe,QAAQ,eAAe;AAqB/C,OAAO,MAAMC,kBAAkB,CAAgC;EAE1CC,KAAK,GAAG,IAAIJ,eAAe,CAAC,CAAC;EAEvCK,WAAWA,CAACC,MAAiC,EAAE;IAClD,IAAI,CAACC,MAAM,GAAGD,MAAM,CAACC,MAAM;EAC/B;EAEA,MAAaC,oBAAoBA,CAC7BF,MAAwB,EACK;IAC7B,MAAMG,GAAG,GAAGH,MAAM,CAACG,GAAG,CAACC,GAAG,CAACC,EAAE,IAAI;MAC7B,MAAM;QAAEA,EAAE,EAAEC;MAAQ,CAAC,GAAGV,eAAe,CAACS,EAAE,CAAC;MAC3C,OAAOC,OAAO;IAClB,CAAC,CAAC;IACF,OAAO,MAAM,IAAI,CAACC,QAAQ,CAAI,sBAAsB,EAAEP,MAAM,EAAEG,GAAG,CAAC;EACtE;EAEA,MAAaK,eAAeA,CACxBR,MAAwB,EACK;IAC7B,OAAO,MAAM,IAAI,CAACO,QAAQ,CAAI,iBAAiB,EAAEP,MAAM,EAAEA,MAAM,CAACG,GAAG,CAAC;EACxE;EAEA,MAAaM,6BAA6BA,CACtCT,MAAwB,EACK;IAC7B,MAAMG,GAAG,GAAG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;IACtE,IAAI,CAACF,KAAK,CAACoC,QAAQ,CAAClC,MAAM,EAAEa,KAAK,CAAC;EACtC;AACJ","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.assignMinimumShouldMatchToQuery = void 0;
|
|
7
1
|
/**
|
|
8
2
|
* This function will assign a minimum_should_match for the query if conditions are met:
|
|
9
3
|
* * should is an array
|
|
@@ -16,7 +10,7 @@ exports.assignMinimumShouldMatchToQuery = void 0;
|
|
|
16
10
|
* Users can modify minimum_should_match value via the body or query modification plugins.
|
|
17
11
|
*/
|
|
18
12
|
|
|
19
|
-
const assignMinimumShouldMatchToQuery = ({
|
|
13
|
+
export const assignMinimumShouldMatchToQuery = ({
|
|
20
14
|
query,
|
|
21
15
|
value = 1
|
|
22
16
|
}) => {
|
|
@@ -29,6 +23,5 @@ const assignMinimumShouldMatchToQuery = ({
|
|
|
29
23
|
}
|
|
30
24
|
query.minimum_should_match = value > 0 ? value : 1;
|
|
31
25
|
};
|
|
32
|
-
exports.assignMinimumShouldMatchToQuery = assignMinimumShouldMatchToQuery;
|
|
33
26
|
|
|
34
27
|
//# sourceMappingURL=assignMinimumShouldMatchToQuery.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["assignMinimumShouldMatchToQuery","query","value","Array","isArray","should","length","minimum_should_match"
|
|
1
|
+
{"version":3,"names":["assignMinimumShouldMatchToQuery","query","value","Array","isArray","should","length","minimum_should_match"],"sources":["assignMinimumShouldMatchToQuery.ts"],"sourcesContent":["import type { BoolQueryConfig } from \"@webiny/api-elasticsearch/types.js\";\n\n/**\n * This function will assign a minimum_should_match for the query if conditions are met:\n * * should is an array\n * * it is not empty\n * * minimum_should_match is not already set\n *\n *\n * By the default we set it to 1 as we want at least one OR condition to produce results.\n *\n * Users can modify minimum_should_match value via the body or query modification plugins.\n */\ninterface Params {\n query: BoolQueryConfig;\n value?: number;\n}\nexport const assignMinimumShouldMatchToQuery = ({ query, value = 1 }: Params): void => {\n if (!Array.isArray(query.should)) {\n return;\n } else if (query.should.length === 0) {\n return;\n } else if (query.minimum_should_match) {\n return;\n }\n query.minimum_should_match = value > 0 ? value : 1;\n};\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA,OAAO,MAAMA,+BAA+B,GAAGA,CAAC;EAAEC,KAAK;EAAEC,KAAK,GAAG;AAAU,CAAC,KAAW;EACnF,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,KAAK,CAACI,MAAM,CAAC,EAAE;IAC9B;EACJ,CAAC,MAAM,IAAIJ,KAAK,CAACI,MAAM,CAACC,MAAM,KAAK,CAAC,EAAE;IAClC;EACJ,CAAC,MAAM,IAAIL,KAAK,CAACM,oBAAoB,EAAE;IACnC;EACJ;EACAN,KAAK,CAACM,oBAAoB,GAAGL,KAAK,GAAG,CAAC,GAAGA,KAAK,GAAG,CAAC;AACtD,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
2
|
-
import { CmsEntryListParams, CmsEntryListWhere, CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
-
import { PrimitiveValue, SearchBody } from "@webiny/api-elasticsearch/types";
|
|
1
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
|
2
|
+
import type { CmsEntryListParams, CmsEntryListWhere, CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
3
|
+
import type { PrimitiveValue, SearchBody } from "@webiny/api-elasticsearch/types.js";
|
|
4
4
|
interface Params {
|
|
5
5
|
plugins: PluginsContainer;
|
|
6
6
|
model: CmsModel;
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var _sortModifier = require("./plugins/sortModifier");
|
|
13
|
-
var _bodyModifier = require("./plugins/bodyModifier");
|
|
14
|
-
var _sort = require("./sort");
|
|
15
|
-
var _filtering = require("./filtering");
|
|
16
|
-
var _assignMinimumShouldMatchToQuery = require("./assignMinimumShouldMatchToQuery");
|
|
17
|
-
const createElasticsearchBody = ({
|
|
1
|
+
import { createModelFields } from "./fields.js";
|
|
2
|
+
import { createFullTextSearchFields } from "./fullTextSearchFields.js";
|
|
3
|
+
import { createInitialQuery } from "./initialQuery.js";
|
|
4
|
+
import { applyFullTextSearch } from "./fullTextSearch.js";
|
|
5
|
+
import { createQueryModifierPluginList } from "./plugins/queryModifier.js";
|
|
6
|
+
import { createSortModifierPluginList } from "./plugins/sortModifier.js";
|
|
7
|
+
import { createBodyModifierPluginList } from "./plugins/bodyModifier.js";
|
|
8
|
+
import { createElasticsearchSort } from "./sort.js";
|
|
9
|
+
import { createExecFiltering } from "./filtering/index.js";
|
|
10
|
+
import { assignMinimumShouldMatchToQuery } from "./assignMinimumShouldMatchToQuery.js";
|
|
11
|
+
export const createElasticsearchBody = ({
|
|
18
12
|
plugins,
|
|
19
13
|
model,
|
|
20
14
|
params
|
|
@@ -30,7 +24,7 @@ const createElasticsearchBody = ({
|
|
|
30
24
|
/**
|
|
31
25
|
* We need the model fields constructed as a key -> field value, so we do not need to iterate through array when we require some field.
|
|
32
26
|
*/
|
|
33
|
-
const modelFields =
|
|
27
|
+
const modelFields = createModelFields({
|
|
34
28
|
plugins,
|
|
35
29
|
model
|
|
36
30
|
});
|
|
@@ -38,21 +32,21 @@ const createElasticsearchBody = ({
|
|
|
38
32
|
/**
|
|
39
33
|
* We need the query modifier plugins.
|
|
40
34
|
*/
|
|
41
|
-
const queryModifierPlugins =
|
|
35
|
+
const queryModifierPlugins = createQueryModifierPluginList({
|
|
42
36
|
plugins,
|
|
43
37
|
model
|
|
44
38
|
});
|
|
45
39
|
/**
|
|
46
40
|
* We need the sort modifier plugins.
|
|
47
41
|
*/
|
|
48
|
-
const sortModifierPlugins =
|
|
42
|
+
const sortModifierPlugins = createSortModifierPluginList({
|
|
49
43
|
plugins,
|
|
50
44
|
model
|
|
51
45
|
});
|
|
52
46
|
/**
|
|
53
47
|
* We need the body modifier plugins.
|
|
54
48
|
*/
|
|
55
|
-
const bodyModifierPlugins =
|
|
49
|
+
const bodyModifierPlugins = createBodyModifierPluginList({
|
|
56
50
|
plugins,
|
|
57
51
|
model
|
|
58
52
|
});
|
|
@@ -60,7 +54,7 @@ const createElasticsearchBody = ({
|
|
|
60
54
|
* We need the fields which we can search through via the full text search.
|
|
61
55
|
*
|
|
62
56
|
*/
|
|
63
|
-
const fullTextSearchFields =
|
|
57
|
+
const fullTextSearchFields = createFullTextSearchFields({
|
|
64
58
|
model,
|
|
65
59
|
term,
|
|
66
60
|
fields
|
|
@@ -68,21 +62,21 @@ const createElasticsearchBody = ({
|
|
|
68
62
|
/**
|
|
69
63
|
* The initial elasticsearch query where we attach some default conditions we always need.
|
|
70
64
|
*/
|
|
71
|
-
const query =
|
|
65
|
+
const query = createInitialQuery({
|
|
72
66
|
where,
|
|
73
67
|
model
|
|
74
68
|
});
|
|
75
69
|
/**
|
|
76
70
|
* Apply the full text search, if term is set.
|
|
77
71
|
*/
|
|
78
|
-
|
|
72
|
+
applyFullTextSearch({
|
|
79
73
|
model,
|
|
80
74
|
plugins,
|
|
81
75
|
query,
|
|
82
76
|
term,
|
|
83
77
|
fields: fullTextSearchFields
|
|
84
78
|
});
|
|
85
|
-
const execFiltering =
|
|
79
|
+
const execFiltering = createExecFiltering({
|
|
86
80
|
model,
|
|
87
81
|
fields: modelFields,
|
|
88
82
|
plugins
|
|
@@ -98,7 +92,7 @@ const createElasticsearchBody = ({
|
|
|
98
92
|
where
|
|
99
93
|
});
|
|
100
94
|
}
|
|
101
|
-
const sort =
|
|
95
|
+
const sort = createElasticsearchSort({
|
|
102
96
|
plugins,
|
|
103
97
|
sort: initialSort,
|
|
104
98
|
modelFields,
|
|
@@ -116,7 +110,7 @@ const createElasticsearchBody = ({
|
|
|
116
110
|
should: query.should.length > 0 ? query.should : undefined,
|
|
117
111
|
filter: query.filter.length > 0 ? query.filter : undefined
|
|
118
112
|
};
|
|
119
|
-
|
|
113
|
+
assignMinimumShouldMatchToQuery({
|
|
120
114
|
query: boolQuery
|
|
121
115
|
});
|
|
122
116
|
const body = {
|
|
@@ -137,6 +131,5 @@ const createElasticsearchBody = ({
|
|
|
137
131
|
}
|
|
138
132
|
return body;
|
|
139
133
|
};
|
|
140
|
-
exports.createElasticsearchBody = createElasticsearchBody;
|
|
141
134
|
|
|
142
135
|
//# sourceMappingURL=body.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createModelFields","createFullTextSearchFields","createInitialQuery","applyFullTextSearch","createQueryModifierPluginList","createSortModifierPluginList","createBodyModifierPluginList","createElasticsearchSort","createExecFiltering","assignMinimumShouldMatchToQuery","createElasticsearchBody","plugins","model","params","fields","search","term","where","sort","initialSort","after","limit","modelFields","queryModifierPlugins","sortModifierPlugins","bodyModifierPlugins","fullTextSearchFields","query","execFiltering","pl","modifyQuery","modifySort","boolQuery","must","length","undefined","must_not","should","filter","body","bool","size","search_after","track_total_hits","modifyBody"],"sources":["body.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport type {\n CmsEntryListParams,\n CmsEntryListWhere,\n CmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { createModelFields } from \"./fields.js\";\nimport { createFullTextSearchFields } from \"./fullTextSearchFields.js\";\nimport { createInitialQuery } from \"./initialQuery.js\";\nimport { applyFullTextSearch } from \"./fullTextSearch.js\";\nimport { createQueryModifierPluginList } from \"./plugins/queryModifier.js\";\nimport { createSortModifierPluginList } from \"./plugins/sortModifier.js\";\nimport { createBodyModifierPluginList } from \"./plugins/bodyModifier.js\";\nimport { createElasticsearchSort } from \"./sort.js\";\nimport type {\n BoolQueryConfig,\n PrimitiveValue,\n SearchBody\n} from \"@webiny/api-elasticsearch/types.js\";\nimport { createExecFiltering } from \"./filtering/index.js\";\nimport { assignMinimumShouldMatchToQuery } from \"./assignMinimumShouldMatchToQuery.js\";\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n params: Omit<CmsEntryListParams, \"where\" | \"after\"> & {\n where: CmsEntryListWhere;\n after?: PrimitiveValue[];\n };\n}\nexport const createElasticsearchBody = ({ plugins, model, params }: Params): SearchBody => {\n const { fields, search: term, where, sort: initialSort, after, limit } = params;\n /**\n * We need the model fields constructed as a key -> field value, so we do not need to iterate through array when we require some field.\n */\n const modelFields = createModelFields({\n plugins,\n model\n });\n\n /**\n * We need the query modifier plugins.\n */\n const queryModifierPlugins = createQueryModifierPluginList({\n plugins,\n model\n });\n /**\n * We need the sort modifier plugins.\n */\n const sortModifierPlugins = createSortModifierPluginList({\n plugins,\n model\n });\n /**\n * We need the body modifier plugins.\n */\n const bodyModifierPlugins = createBodyModifierPluginList({\n plugins,\n model\n });\n /**\n * We need the fields which we can search through via the full text search.\n *\n */\n const fullTextSearchFields = createFullTextSearchFields({\n model,\n term,\n fields\n });\n /**\n * The initial elasticsearch query where we attach some default conditions we always need.\n */\n const query = createInitialQuery({\n where,\n model\n });\n /**\n * Apply the full text search, if term is set.\n */\n applyFullTextSearch({\n model,\n plugins,\n query,\n term,\n fields: fullTextSearchFields\n });\n\n const execFiltering = createExecFiltering({\n model,\n fields: modelFields,\n plugins\n });\n\n execFiltering({\n where,\n query\n });\n\n for (const pl of queryModifierPlugins) {\n pl.modifyQuery({ query, model, where });\n }\n\n const sort = createElasticsearchSort({\n plugins,\n sort: initialSort,\n modelFields,\n model\n });\n\n for (const pl of sortModifierPlugins) {\n pl.modifySort({\n sort,\n model\n });\n }\n\n const boolQuery: BoolQueryConfig = {\n must: query.must.length > 0 ? query.must : undefined,\n must_not: query.must_not.length > 0 ? query.must_not : undefined,\n should: query.should.length > 0 ? query.should : undefined,\n filter: query.filter.length > 0 ? query.filter : undefined\n };\n\n assignMinimumShouldMatchToQuery({\n query: boolQuery\n });\n\n const body: SearchBody = {\n query: {\n bool: boolQuery\n },\n sort,\n size: (limit || 0) + 1,\n search_after: after,\n track_total_hits: true\n };\n\n for (const pl of bodyModifierPlugins) {\n pl.modifyBody({\n body,\n model,\n where\n });\n }\n\n return body;\n};\n"],"mappings":"AAMA,SAASA,iBAAiB;AAC1B,SAASC,0BAA0B;AACnC,SAASC,kBAAkB;AAC3B,SAASC,mBAAmB;AAC5B,SAASC,6BAA6B;AACtC,SAASC,4BAA4B;AACrC,SAASC,4BAA4B;AACrC,SAASC,uBAAuB;AAMhC,SAASC,mBAAmB;AAC5B,SAASC,+BAA+B;AAUxC,OAAO,MAAMC,uBAAuB,GAAGA,CAAC;EAAEC,OAAO;EAAEC,KAAK;EAAEC;AAAe,CAAC,KAAiB;EACvF,MAAM;IAAEC,MAAM;IAAEC,MAAM,EAAEC,IAAI;IAAEC,KAAK;IAAEC,IAAI,EAAEC,WAAW;IAAEC,KAAK;IAAEC;EAAM,CAAC,GAAGR,MAAM;EAC/E;AACJ;AACA;EACI,MAAMS,WAAW,GAAGtB,iBAAiB,CAAC;IAClCW,OAAO;IACPC;EACJ,CAAC,CAAC;;EAEF;AACJ;AACA;EACI,MAAMW,oBAAoB,GAAGnB,6BAA6B,CAAC;IACvDO,OAAO;IACPC;EACJ,CAAC,CAAC;EACF;AACJ;AACA;EACI,MAAMY,mBAAmB,GAAGnB,4BAA4B,CAAC;IACrDM,OAAO;IACPC;EACJ,CAAC,CAAC;EACF;AACJ;AACA;EACI,MAAMa,mBAAmB,GAAGnB,4BAA4B,CAAC;IACrDK,OAAO;IACPC;EACJ,CAAC,CAAC;EACF;AACJ;AACA;AACA;EACI,MAAMc,oBAAoB,GAAGzB,0BAA0B,CAAC;IACpDW,KAAK;IACLI,IAAI;IACJF;E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AAC;IAC5BkB,KAAK,EAAEK;EACX,CAAC,CAAC;EAEF,MAAMO,IAAgB,GAAG;IACrBZ,KAAK,EAAE;MACHa,IAAI,EAAER;IACV,CAAC;IACDd,IAAI;IACJuB,IAAI,EAAE,CAACpB,KAAK,IAAI,CAAC,IAAI,CAAC;IACtBqB,YAAY,EAAEtB,KAAK;IACnBuB,gBAAgB,EAAE;EACtB,CAAC;EAED,KAAK,MAAMd,EAAE,IAAIJ,mBAAmB,EAAE;IAClCI,EAAE,CAACe,UAAU,CAAC;MACVL,IAAI;MACJ3B,KAAK;MACLK;IACJ,CAAC,CAAC;EACN;EAEA,OAAOsB,IAAI;AACf,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
2
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
1
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
|
2
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
3
3
|
interface Params {
|
|
4
4
|
plugins: PluginsContainer;
|
|
5
5
|
model: CmsModel;
|
|
6
6
|
}
|
|
7
7
|
export declare const createModelFields: ({ plugins, model }: Params) => {
|
|
8
|
-
[x: string]: import("./types").ModelField;
|
|
8
|
+
[x: string]: import("./types.js").ModelField;
|
|
9
9
|
};
|
|
10
10
|
export {};
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
});
|
|
7
|
-
exports.createModelFields = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _plugins = require("../../../plugins");
|
|
10
|
-
var _constants = require("@webiny/api-headless-cms/constants");
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { CmsElasticsearchModelFieldPlugin } from "../../../plugins/index.js";
|
|
3
|
+
import { ENTRY_META_FIELDS, isDateTimeEntryMetaField, isIdentityEntryMetaField } from "@webiny/api-headless-cms/constants.js";
|
|
4
|
+
import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
|
|
5
|
+
import { createModelField } from "@webiny/api-headless-cms";
|
|
11
6
|
const createSystemField = field => {
|
|
12
|
-
return {
|
|
7
|
+
return createModelField({
|
|
13
8
|
...field,
|
|
14
9
|
id: field.fieldId,
|
|
15
10
|
label: field.fieldId
|
|
16
|
-
};
|
|
11
|
+
});
|
|
17
12
|
};
|
|
18
13
|
const createSystemFields = () => {
|
|
19
|
-
const onMetaFields =
|
|
14
|
+
const onMetaFields = ENTRY_META_FIELDS.filter(isDateTimeEntryMetaField).reduce((current, fieldName) => {
|
|
20
15
|
return {
|
|
21
16
|
...current,
|
|
22
17
|
[fieldName]: {
|
|
@@ -38,7 +33,7 @@ const createSystemFields = () => {
|
|
|
38
33
|
}
|
|
39
34
|
};
|
|
40
35
|
}, {});
|
|
41
|
-
const byMetaFields =
|
|
36
|
+
const byMetaFields = ENTRY_META_FIELDS.filter(isIdentityEntryMetaField).reduce((current, fieldName) => {
|
|
42
37
|
return {
|
|
43
38
|
...current,
|
|
44
39
|
[fieldName]: {
|
|
@@ -94,13 +89,13 @@ const createSystemFields = () => {
|
|
|
94
89
|
fieldId: "wbyAco_location",
|
|
95
90
|
type: "object",
|
|
96
91
|
settings: {
|
|
97
|
-
fields: [{
|
|
92
|
+
fields: [createModelField({
|
|
98
93
|
id: "folderId",
|
|
99
94
|
fieldId: "folderId",
|
|
100
95
|
storageId: "folderId",
|
|
101
96
|
type: "text",
|
|
102
97
|
label: "Folder ID"
|
|
103
|
-
}]
|
|
98
|
+
})]
|
|
104
99
|
}
|
|
105
100
|
}),
|
|
106
101
|
parents: []
|
|
@@ -178,6 +173,93 @@ const createSystemFields = () => {
|
|
|
178
173
|
type: "text"
|
|
179
174
|
}),
|
|
180
175
|
parents: []
|
|
176
|
+
},
|
|
177
|
+
state: {
|
|
178
|
+
type: "object",
|
|
179
|
+
systemField: true,
|
|
180
|
+
searchable: true,
|
|
181
|
+
sortable: false,
|
|
182
|
+
field: createSystemField({
|
|
183
|
+
storageId: "object@state",
|
|
184
|
+
fieldId: "state",
|
|
185
|
+
type: "object",
|
|
186
|
+
settings: {
|
|
187
|
+
fields: [createModelField({
|
|
188
|
+
id: "stepId",
|
|
189
|
+
fieldId: "stepId",
|
|
190
|
+
storageId: "text@stepId",
|
|
191
|
+
type: "text",
|
|
192
|
+
label: "Step ID"
|
|
193
|
+
}), createModelField({
|
|
194
|
+
id: "stepName",
|
|
195
|
+
fieldId: "stepName",
|
|
196
|
+
storageId: "text@stepName",
|
|
197
|
+
type: "text",
|
|
198
|
+
label: "Step Name"
|
|
199
|
+
}), createModelField({
|
|
200
|
+
id: "state",
|
|
201
|
+
fieldId: "state",
|
|
202
|
+
storageId: "text@state",
|
|
203
|
+
type: "text",
|
|
204
|
+
label: "State"
|
|
205
|
+
})]
|
|
206
|
+
}
|
|
207
|
+
}),
|
|
208
|
+
parents: []
|
|
209
|
+
},
|
|
210
|
+
"state.stepId": {
|
|
211
|
+
type: "text",
|
|
212
|
+
systemField: true,
|
|
213
|
+
searchable: true,
|
|
214
|
+
sortable: false,
|
|
215
|
+
parents: [{
|
|
216
|
+
fieldId: "state",
|
|
217
|
+
type: "object",
|
|
218
|
+
storageId: "object@state"
|
|
219
|
+
}],
|
|
220
|
+
field: createSystemField({
|
|
221
|
+
id: "stepId",
|
|
222
|
+
fieldId: "stepId",
|
|
223
|
+
storageId: "text@stepId",
|
|
224
|
+
type: "text",
|
|
225
|
+
label: "Step ID"
|
|
226
|
+
})
|
|
227
|
+
},
|
|
228
|
+
"state.stepName": {
|
|
229
|
+
type: "text",
|
|
230
|
+
systemField: true,
|
|
231
|
+
searchable: true,
|
|
232
|
+
sortable: false,
|
|
233
|
+
parents: [{
|
|
234
|
+
fieldId: "state",
|
|
235
|
+
type: "object",
|
|
236
|
+
storageId: "object@state"
|
|
237
|
+
}],
|
|
238
|
+
field: createSystemField({
|
|
239
|
+
id: "stepName",
|
|
240
|
+
fieldId: "stepName",
|
|
241
|
+
storageId: "text@stepName",
|
|
242
|
+
type: "text",
|
|
243
|
+
label: "Step Name"
|
|
244
|
+
})
|
|
245
|
+
},
|
|
246
|
+
"state.state": {
|
|
247
|
+
type: "text",
|
|
248
|
+
systemField: true,
|
|
249
|
+
searchable: true,
|
|
250
|
+
sortable: false,
|
|
251
|
+
parents: [{
|
|
252
|
+
fieldId: "state",
|
|
253
|
+
type: "object",
|
|
254
|
+
storageId: "object@state"
|
|
255
|
+
}],
|
|
256
|
+
field: createSystemField({
|
|
257
|
+
id: "state",
|
|
258
|
+
fieldId: "state",
|
|
259
|
+
storageId: "text@state",
|
|
260
|
+
type: "text",
|
|
261
|
+
label: "State"
|
|
262
|
+
})
|
|
181
263
|
}
|
|
182
264
|
};
|
|
183
265
|
};
|
|
@@ -220,9 +302,10 @@ const buildFieldsList = params => {
|
|
|
220
302
|
parents
|
|
221
303
|
} = params;
|
|
222
304
|
return fields.reduce((result, field) => {
|
|
223
|
-
const
|
|
305
|
+
const fieldType = getBaseFieldType(field);
|
|
306
|
+
const plugin = plugins[fieldType];
|
|
224
307
|
if (!plugin) {
|
|
225
|
-
throw new
|
|
308
|
+
throw new WebinyError(`There is no plugin for field type "${field.type}".`);
|
|
226
309
|
}
|
|
227
310
|
const {
|
|
228
311
|
searchable,
|
|
@@ -244,14 +327,14 @@ const buildFieldsList = params => {
|
|
|
244
327
|
parents: [...parents, {
|
|
245
328
|
fieldId: field.fieldId,
|
|
246
329
|
storageId: field.storageId,
|
|
247
|
-
type:
|
|
330
|
+
type: fieldType
|
|
248
331
|
}]
|
|
249
332
|
});
|
|
250
333
|
Object.assign(result, childResult);
|
|
251
334
|
}
|
|
252
335
|
const identifier = [...parents.map(p => p.fieldId), field.fieldId].join(".");
|
|
253
336
|
result[identifier] = {
|
|
254
|
-
type:
|
|
337
|
+
type: fieldType,
|
|
255
338
|
parents,
|
|
256
339
|
searchable,
|
|
257
340
|
sortable,
|
|
@@ -263,12 +346,12 @@ const buildFieldsList = params => {
|
|
|
263
346
|
return result;
|
|
264
347
|
}, {});
|
|
265
348
|
};
|
|
266
|
-
const createModelFields = ({
|
|
349
|
+
export const createModelFields = ({
|
|
267
350
|
plugins,
|
|
268
351
|
model
|
|
269
352
|
}) => {
|
|
270
353
|
const fields = model.fields;
|
|
271
|
-
const fieldDefinitionPlugins = plugins.byType(
|
|
354
|
+
const fieldDefinitionPlugins = plugins.byType(CmsElasticsearchModelFieldPlugin.type).filter(plugin => {
|
|
272
355
|
return plugin.canBeApplied(model.modelId);
|
|
273
356
|
});
|
|
274
357
|
/**
|
|
@@ -306,10 +389,13 @@ const createModelFields = ({
|
|
|
306
389
|
...buildFieldsList({
|
|
307
390
|
fields,
|
|
308
391
|
plugins: fieldTypePlugins,
|
|
309
|
-
parents: [
|
|
392
|
+
parents: [{
|
|
393
|
+
fieldId: "values",
|
|
394
|
+
type: "object",
|
|
395
|
+
storageId: "values"
|
|
396
|
+
}]
|
|
310
397
|
})
|
|
311
398
|
};
|
|
312
399
|
};
|
|
313
|
-
exports.createModelFields = createModelFields;
|
|
314
400
|
|
|
315
401
|
//# sourceMappingURL=fields.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_plugins","_constants","createSystemField","field","id","fieldId","label","createSystemFields","onMetaFields","ENTRY_META_FIELDS","filter","isDateTimeEntryMetaField","reduce","current","fieldName","type","unmappedType","keyword","systemField","searchable","sortable","storageId","settings","parents","byMetaFields","isIdentityEntryMetaField","undefined","path","entryId","wbyAco_location","fields","version","status","wbyDeleted","binOriginalFolderId","buildCustomFields","params","fieldTypePlugins","collection","typePlugin","fieldType","fullTextSearch","buildFieldsList","plugins","result","plugin","WebinyError","childFields","length","childResult","Object","assign","identifier","map","p","join","createModelFields","model","fieldDefinitionPlugins","byType","CmsElasticsearchModelFieldPlugin","canBeApplied","modelId","unmappedTypes","acc","types","isSearchable","isSortable","exports"],"sources":["fields.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types\";\nimport { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\nimport { ModelFieldParent, ModelFields } from \"./types\";\nimport { CmsElasticsearchModelFieldPlugin } from \"~/plugins\";\nimport {\n ENTRY_META_FIELDS,\n isDateTimeEntryMetaField,\n isIdentityEntryMetaField\n} from \"@webiny/api-headless-cms/constants\";\n\ntype PartialCmsModelField = Partial<CmsModelField> &\n Pick<CmsModelField, \"storageId\" | \"fieldId\" | \"type\">;\nconst createSystemField = (field: PartialCmsModelField): CmsModelField => {\n return {\n ...field,\n id: field.fieldId,\n label: field.fieldId\n };\n};\n\nconst createSystemFields = (): ModelFields => {\n const onMetaFields = ENTRY_META_FIELDS.filter(isDateTimeEntryMetaField).reduce(\n (current, fieldName) => {\n return {\n ...current,\n [fieldName]: {\n type: \"date\",\n unmappedType: \"date\",\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: fieldName,\n fieldId: fieldName,\n type: \"text\",\n settings: {\n type: \"dateTimeWithoutTimezone\"\n }\n }),\n parents: []\n }\n };\n },\n {}\n );\n\n const byMetaFields = ENTRY_META_FIELDS.filter(isIdentityEntryMetaField).reduce(\n (current, fieldName) => {\n return {\n ...current,\n [fieldName]: {\n type: \"text\",\n unmappedType: undefined,\n systemField: true,\n searchable: true,\n sortable: true,\n path: `${fieldName}.id`,\n field: createSystemField({\n storageId: fieldName,\n fieldId: fieldName,\n type: \"text\"\n }),\n parents: []\n }\n };\n },\n {}\n );\n\n return {\n id: {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"id\",\n fieldId: \"id\",\n type: \"text\"\n }),\n parents: []\n },\n entryId: {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"entryId\",\n fieldId: \"entryId\",\n type: \"text\"\n }),\n parents: []\n },\n\n ...onMetaFields,\n ...byMetaFields,\n\n wbyAco_location: {\n type: \"object\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"location\",\n fieldId: \"wbyAco_location\",\n type: \"object\",\n settings: {\n fields: [\n {\n id: \"folderId\",\n fieldId: \"folderId\",\n storageId: \"folderId\",\n type: \"text\",\n label: \"Folder ID\"\n }\n ]\n }\n }),\n parents: []\n },\n \"wbyAco_location.folderId\": {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n id: \"folderId\",\n fieldId: \"folderId\",\n storageId: \"folderId\",\n type: \"text\",\n label: \"Folder ID\"\n }),\n parents: [\n {\n fieldId: \"wbyAco_location\",\n type: \"object\",\n storageId: \"location\"\n }\n ]\n },\n version: {\n type: \"number\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"version\",\n fieldId: \"version\",\n type: \"number\"\n }),\n parents: []\n },\n status: {\n type: \"string\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"status\",\n fieldId: \"status\",\n type: \"string\"\n }),\n parents: []\n },\n wbyDeleted: {\n type: \"boolean\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"wbyDeleted\",\n fieldId: \"wbyDeleted\",\n type: \"boolean\"\n }),\n parents: []\n },\n binOriginalFolderId: {\n type: \"text\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"binOriginalFolderId\",\n fieldId: \"binOriginalFolderId\",\n type: \"text\"\n }),\n parents: []\n }\n };\n};\n\ninterface UnmappedFieldTypes {\n [type: string]: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string | undefined;\n}\n\ninterface FieldTypePlugin {\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string | undefined;\n searchable: boolean;\n sortable: boolean;\n fullTextSearch?: boolean;\n}\n\ninterface FieldTypePlugins {\n [key: string]: FieldTypePlugin;\n}\n\ninterface BuildCustomFieldsParams {\n fields: CmsElasticsearchModelFieldPlugin[];\n fieldTypePlugins: FieldTypePlugins;\n}\n\nconst buildCustomFields = (params: BuildCustomFieldsParams) => {\n const { fields, fieldTypePlugins } = params;\n\n return fields.reduce<ModelFields>((collection, field) => {\n const typePlugin = fieldTypePlugins[field.fieldType];\n if (!typePlugin) {\n return collection;\n }\n let unmappedType: string | undefined = undefined;\n if (typePlugin.unmappedType) {\n unmappedType = typePlugin.unmappedType(field);\n }\n\n collection[field.fieldId] = {\n type: field.fieldType,\n field: createSystemField({\n storageId: field.fieldId,\n fieldId: field.fieldId,\n type: field.fieldType\n }),\n unmappedType,\n fullTextSearch: field.searchable ? typePlugin.fullTextSearch : false,\n searchable: field.searchable || typePlugin.searchable,\n sortable: field.sortable || typePlugin.sortable,\n systemField: false,\n path: field.path,\n parents: []\n };\n\n return collection;\n }, {});\n};\n\ninterface BuildParams {\n plugins: FieldTypePlugins;\n fields: CmsModelField[];\n parents: ModelFieldParent[];\n}\n\nconst buildFieldsList = (params: BuildParams): ModelFields => {\n const { plugins, fields, parents } = params;\n\n return fields.reduce<ModelFields>((result, field) => {\n const plugin = plugins[field.type];\n if (!plugin) {\n throw new WebinyError(`There is no plugin for field type \"${field.type}\".`);\n }\n\n const { searchable, sortable, unmappedType, fullTextSearch } = plugin;\n /**\n * If a field has child fields, go through them and add them to a result.\n */\n const childFields = field.settings?.fields || [];\n if (childFields.length > 0) {\n /**\n * Let's build all the child fields\n */\n const childResult = buildFieldsList({\n fields: childFields,\n plugins,\n parents: [\n ...parents,\n {\n fieldId: field.fieldId,\n storageId: field.storageId,\n type: field.type\n }\n ]\n });\n Object.assign(result, childResult);\n }\n\n const identifier = [...parents.map(p => p.fieldId), field.fieldId].join(\".\");\n\n result[identifier] = {\n type: field.type,\n parents,\n searchable,\n sortable,\n fullTextSearch,\n unmappedType: typeof unmappedType === \"function\" ? unmappedType(field) : undefined,\n systemField: false,\n field\n };\n\n return result;\n }, {});\n};\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n}\n\nexport const createModelFields = ({ plugins, model }: Params) => {\n const fields = model.fields;\n const fieldDefinitionPlugins = plugins\n .byType<CmsElasticsearchModelFieldPlugin>(CmsElasticsearchModelFieldPlugin.type)\n .filter(plugin => {\n return plugin.canBeApplied(model.modelId);\n });\n /**\n * Collect all unmappedType from elastic plugins.\n */\n const unmappedTypes = plugins\n .byType<CmsModelFieldToElasticsearchPlugin>(\"cms-model-field-to-elastic-search\")\n .reduce<UnmappedFieldTypes>((acc, plugin) => {\n if (!plugin.unmappedType) {\n return acc;\n }\n acc[plugin.fieldType] = plugin.unmappedType;\n return acc;\n }, {});\n /**\n * Collect all field types from the plugins.\n */\n const fieldTypePlugins = plugins\n .byType<CmsModelFieldToGraphQLPlugin>(\"cms-model-field-to-graphql\")\n .reduce<FieldTypePlugins>((types, plugin) => {\n const { fieldType, fullTextSearch } = plugin;\n types[fieldType] = {\n unmappedType: unmappedTypes[fieldType],\n searchable: plugin.isSearchable,\n sortable: plugin.isSortable,\n fullTextSearch\n };\n return types;\n }, {});\n\n return {\n ...createSystemFields(),\n ...buildCustomFields({\n fields: fieldDefinitionPlugins,\n fieldTypePlugins\n }),\n ...buildFieldsList({\n fields,\n plugins: fieldTypePlugins,\n parents: []\n })\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AASA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAQA,MAAMG,iBAAiB,GAAIC,KAA2B,IAAoB;EACtE,OAAO;IACH,GAAGA,KAAK;IACRC,EAAE,EAAED,KAAK,CAACE,OAAO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C,GAAG;MACfxB,YAAY,EAAE+C,aAAa,CAACvB,SAAS,CAAC;MACtCrB,UAAU,EAAE0B,MAAM,CAACqB,YAAY;MAC/B9C,QAAQ,EAAEyB,MAAM,CAACsB,UAAU;MAC3B1B;IACJ,CAAC;IACD,OAAOwB,KAAK;EAChB,CAAC,EAAE,CAAC,CAAC,CAAC;EAEV,OAAO;IACH,GAAG1D,kBAAkB,CAAC,CAAC;IACvB,GAAG4B,iBAAiB,CAAC;MACjBL,MAAM,EAAE4B,sBAAsB;MAC9BrB;IACJ,CAAC,CAAC;IACF,GAAGK,eAAe,CAAC;MACfZ,MAAM;MACNa,OAAO,EAAEN,gBAAgB;MACzBd,OAAO,EAAE;IACb,CAAC;EACL,CAAC;AACL,CAAC;AAAC6C,OAAA,CAAAZ,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["WebinyError","CmsElasticsearchModelFieldPlugin","ENTRY_META_FIELDS","isDateTimeEntryMetaField","isIdentityEntryMetaField","getBaseFieldType","createModelField","createSystemField","field","id","fieldId","label","createSystemFields","onMetaFields","filter","reduce","current","fieldName","type","unmappedType","keyword","systemField","searchable","sortable","storageId","settings","parents","byMetaFields","undefined","path","entryId","wbyAco_location","fields","version","status","wbyDeleted","binOriginalFolderId","state","buildCustomFields","params","fieldTypePlugins","collection","typePlugin","fieldType","fullTextSearch","buildFieldsList","plugins","result","plugin","childFields","length","childResult","Object","assign","identifier","map","p","join","createModelFields","model","fieldDefinitionPlugins","byType","canBeApplied","modelId","unmappedTypes","acc","types","isSearchable","isSortable"],"sources":["fields.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type {\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\nimport type { ModelFieldParent, ModelFields } from \"./types.js\";\nimport { CmsElasticsearchModelFieldPlugin } from \"~/plugins/index.js\";\nimport {\n ENTRY_META_FIELDS,\n isDateTimeEntryMetaField,\n isIdentityEntryMetaField\n} from \"@webiny/api-headless-cms/constants.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\nimport { createModelField } from \"@webiny/api-headless-cms\";\n\ntype PartialCmsModelField = Partial<CmsModelField> &\n Pick<CmsModelField, \"storageId\" | \"fieldId\" | \"type\">;\nconst createSystemField = (field: PartialCmsModelField): CmsModelField => {\n return createModelField({\n ...field,\n id: field.fieldId,\n label: field.fieldId\n });\n};\n\nconst createSystemFields = (): ModelFields => {\n const onMetaFields = ENTRY_META_FIELDS.filter(isDateTimeEntryMetaField).reduce(\n (current, fieldName) => {\n return {\n ...current,\n [fieldName]: {\n type: \"date\",\n unmappedType: \"date\",\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: fieldName,\n fieldId: fieldName,\n type: \"text\",\n settings: {\n type: \"dateTimeWithoutTimezone\"\n }\n }),\n parents: []\n }\n };\n },\n {}\n );\n\n const byMetaFields = ENTRY_META_FIELDS.filter(isIdentityEntryMetaField).reduce(\n (current, fieldName) => {\n return {\n ...current,\n [fieldName]: {\n type: \"text\",\n unmappedType: undefined,\n systemField: true,\n searchable: true,\n sortable: true,\n path: `${fieldName}.id`,\n field: createSystemField({\n storageId: fieldName,\n fieldId: fieldName,\n type: \"text\"\n }),\n parents: []\n }\n };\n },\n {}\n );\n\n return {\n id: {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"id\",\n fieldId: \"id\",\n type: \"text\"\n }),\n parents: []\n },\n entryId: {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"entryId\",\n fieldId: \"entryId\",\n type: \"text\"\n }),\n parents: []\n },\n\n ...onMetaFields,\n ...byMetaFields,\n\n wbyAco_location: {\n type: \"object\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"location\",\n fieldId: \"wbyAco_location\",\n type: \"object\",\n settings: {\n fields: [\n createModelField({\n id: \"folderId\",\n fieldId: \"folderId\",\n storageId: \"folderId\",\n type: \"text\",\n label: \"Folder ID\"\n })\n ]\n }\n }),\n parents: []\n },\n \"wbyAco_location.folderId\": {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n id: \"folderId\",\n fieldId: \"folderId\",\n storageId: \"folderId\",\n type: \"text\",\n label: \"Folder ID\"\n }),\n parents: [\n {\n fieldId: \"wbyAco_location\",\n type: \"object\",\n storageId: \"location\"\n }\n ]\n },\n version: {\n type: \"number\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: true,\n field: createSystemField({\n storageId: \"version\",\n fieldId: \"version\",\n type: \"number\"\n }),\n parents: []\n },\n status: {\n type: \"string\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"status\",\n fieldId: \"status\",\n type: \"string\"\n }),\n parents: []\n },\n wbyDeleted: {\n type: \"boolean\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"wbyDeleted\",\n fieldId: \"wbyDeleted\",\n type: \"boolean\"\n }),\n parents: []\n },\n binOriginalFolderId: {\n type: \"text\",\n unmappedType: undefined,\n keyword: false,\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"binOriginalFolderId\",\n fieldId: \"binOriginalFolderId\",\n type: \"text\"\n }),\n parents: []\n },\n state: {\n type: \"object\",\n systemField: true,\n searchable: true,\n sortable: false,\n field: createSystemField({\n storageId: \"object@state\",\n fieldId: \"state\",\n type: \"object\",\n settings: {\n fields: [\n createModelField({\n id: \"stepId\",\n fieldId: \"stepId\",\n storageId: \"text@stepId\",\n type: \"text\",\n label: \"Step ID\"\n }),\n createModelField({\n id: \"stepName\",\n fieldId: \"stepName\",\n storageId: \"text@stepName\",\n type: \"text\",\n label: \"Step Name\"\n }),\n createModelField({\n id: \"state\",\n fieldId: \"state\",\n storageId: \"text@state\",\n type: \"text\",\n label: \"State\"\n })\n ]\n }\n }),\n parents: []\n },\n \"state.stepId\": {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: false,\n parents: [\n {\n fieldId: \"state\",\n type: \"object\",\n storageId: \"object@state\"\n }\n ],\n field: createSystemField({\n id: \"stepId\",\n fieldId: \"stepId\",\n storageId: \"text@stepId\",\n type: \"text\",\n label: \"Step ID\"\n })\n },\n \"state.stepName\": {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: false,\n parents: [\n {\n fieldId: \"state\",\n type: \"object\",\n storageId: \"object@state\"\n }\n ],\n field: createSystemField({\n id: \"stepName\",\n fieldId: \"stepName\",\n storageId: \"text@stepName\",\n type: \"text\",\n label: \"Step Name\"\n })\n },\n \"state.state\": {\n type: \"text\",\n systemField: true,\n searchable: true,\n sortable: false,\n parents: [\n {\n fieldId: \"state\",\n type: \"object\",\n storageId: \"object@state\"\n }\n ],\n field: createSystemField({\n id: \"state\",\n fieldId: \"state\",\n storageId: \"text@state\",\n type: \"text\",\n label: \"State\"\n })\n }\n };\n};\n\ninterface UnmappedFieldTypes {\n [type: string]: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string | undefined;\n}\n\ninterface FieldTypePlugin {\n unmappedType?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">) => string | undefined;\n searchable: boolean;\n sortable: boolean;\n fullTextSearch?: boolean;\n}\n\ninterface FieldTypePlugins {\n [key: string]: FieldTypePlugin;\n}\n\ninterface BuildCustomFieldsParams {\n fields: CmsElasticsearchModelFieldPlugin[];\n fieldTypePlugins: FieldTypePlugins;\n}\n\nconst buildCustomFields = (params: BuildCustomFieldsParams) => {\n const { fields, fieldTypePlugins } = params;\n\n return fields.reduce<ModelFields>((collection, field) => {\n const typePlugin = fieldTypePlugins[field.fieldType];\n if (!typePlugin) {\n return collection;\n }\n let unmappedType: string | undefined = undefined;\n if (typePlugin.unmappedType) {\n unmappedType = typePlugin.unmappedType(field);\n }\n\n collection[field.fieldId] = {\n type: field.fieldType,\n field: createSystemField({\n storageId: field.fieldId,\n fieldId: field.fieldId,\n type: field.fieldType\n }),\n unmappedType,\n fullTextSearch: field.searchable ? typePlugin.fullTextSearch : false,\n searchable: field.searchable || typePlugin.searchable,\n sortable: field.sortable || typePlugin.sortable,\n systemField: false,\n path: field.path,\n parents: []\n };\n\n return collection;\n }, {});\n};\n\ninterface BuildParams {\n plugins: FieldTypePlugins;\n fields: CmsModelField[];\n parents: ModelFieldParent[];\n}\n\nconst buildFieldsList = (params: BuildParams): ModelFields => {\n const { plugins, fields, parents } = params;\n\n return fields.reduce<ModelFields>((result, field) => {\n const fieldType = getBaseFieldType(field);\n const plugin = plugins[fieldType];\n if (!plugin) {\n throw new WebinyError(`There is no plugin for field type \"${field.type}\".`);\n }\n\n const { searchable, sortable, unmappedType, fullTextSearch } = plugin;\n /**\n * If a field has child fields, go through them and add them to a result.\n */\n const childFields = field.settings?.fields || [];\n if (childFields.length > 0) {\n /**\n * Let's build all the child fields\n */\n const childResult = buildFieldsList({\n fields: childFields,\n plugins,\n parents: [\n ...parents,\n {\n fieldId: field.fieldId,\n storageId: field.storageId,\n type: fieldType\n }\n ]\n });\n Object.assign(result, childResult);\n }\n\n const identifier = [...parents.map(p => p.fieldId), field.fieldId].join(\".\");\n\n result[identifier] = {\n type: fieldType,\n parents,\n searchable,\n sortable,\n fullTextSearch,\n unmappedType: typeof unmappedType === \"function\" ? unmappedType(field) : undefined,\n systemField: false,\n field\n };\n\n return result;\n }, {});\n};\n\ninterface Params {\n plugins: PluginsContainer;\n model: CmsModel;\n}\n\nexport const createModelFields = ({ plugins, model }: Params) => {\n const fields = model.fields;\n const fieldDefinitionPlugins = plugins\n .byType<CmsElasticsearchModelFieldPlugin>(CmsElasticsearchModelFieldPlugin.type)\n .filter(plugin => {\n return plugin.canBeApplied(model.modelId);\n });\n /**\n * Collect all unmappedType from elastic plugins.\n */\n const unmappedTypes = plugins\n .byType<CmsModelFieldToElasticsearchPlugin>(\"cms-model-field-to-elastic-search\")\n .reduce<UnmappedFieldTypes>((acc, plugin) => {\n if (!plugin.unmappedType) {\n return acc;\n }\n acc[plugin.fieldType] = plugin.unmappedType;\n return acc;\n }, {});\n /**\n * Collect all field types from the plugins.\n */\n const fieldTypePlugins = plugins\n .byType<CmsModelFieldToGraphQLPlugin>(\"cms-model-field-to-graphql\")\n .reduce<FieldTypePlugins>((types, plugin) => {\n const { fieldType, fullTextSearch } = plugin;\n types[fieldType] = {\n unmappedType: unmappedTypes[fieldType],\n searchable: plugin.isSearchable,\n sortable: plugin.isSortable,\n fullTextSearch\n };\n return types;\n }, {});\n\n return {\n ...createSystemFields(),\n ...buildCustomFields({\n fields: fieldDefinitionPlugins,\n fieldTypePlugins\n }),\n ...buildFieldsList({\n fields,\n plugins: fieldTypePlugins,\n parents: [\n {\n fieldId: \"values\",\n type: \"object\",\n storageId: \"values\"\n }\n ]\n })\n };\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AASvC,SAASC,gCAAgC;AACzC,SACIC,iBAAiB,EACjBC,wBAAwB,EACxBC,wBAAwB,QACrB,uCAAuC;AAC9C,SAASC,gBAAgB,QAAQ,oDAAoD;AACrF,SAASC,gBAAgB,QAAQ,0BAA0B;AAI3D,MAAMC,iBAAiB,GAAIC,KAA2B,IAAoB;EACtE,OAAOF,gBAAgB,CAAC;IACpB,GAAGE,KAAK;IACRC,EAAE,EAAED,KAAK,CAACE,OAAO;IACjBC,KAAK,EAAEH,KAAK,CAACE;EACjB,CAAC,CAAC;AACN,CAAC;AAED,MAAME,kBAAkB,GAAGA,CAAA,KAAmB;EAC1C,MAAMC,YAAY,GAAGX,iBAAiB,CAACY,MAAM,CAACX,wBAAwB,CAAC,CAACY,MAAM,CAC1E,CAACC,OAAO,EAAEC,SAAS,K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"
|
|
2
|
-
import { ApplyFilteringCb } from "../../../../plugins/CmsEntryFilterPlugin";
|
|
1
|
+
import type { ElasticsearchQueryBuilderOperatorPlugins, ElasticsearchQuerySearchValuePlugins } from "../../../../operations/entry/elasticsearch/types.js";
|
|
2
|
+
import type { ApplyFilteringCb } from "../../../../plugins/CmsEntryFilterPlugin.js";
|
|
3
3
|
interface CreateParams {
|
|
4
4
|
operatorPlugins: ElasticsearchQueryBuilderOperatorPlugins;
|
|
5
5
|
searchPlugins: ElasticsearchQuerySearchValuePlugins;
|