@webiny/api-headless-cms-ddb-es 6.0.0-alpha.5 → 6.0.0-rc.0
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 -6
- package/definitions/entry.js +5 -174
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -7
- package/definitions/group.js +5 -58
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -7
- 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 -13
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/longText.js +10 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.js +10 -18
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +1 -1
- package/elasticsearch/createElasticsearchIndex.js +7 -15
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +1 -1
- 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 -11
- 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 +1 -1
- package/elasticsearch/search/searchableJson.js +9 -16
- package/elasticsearch/search/searchableJson.js.map +1 -1
- 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 +9 -9
- 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 +98 -133
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +0 -2
- 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 +3 -3
- 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 +2 -2
- package/operations/entry/elasticsearch/body.js +21 -28
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields.d.ts +2 -2
- 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 +9 -17
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +6 -5
- 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 +1 -1
- package/operations/entry/elasticsearch/filtering/path.js +5 -15
- 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 +7 -15
- 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 +2 -2
- 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 -27
- 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 +2 -2
- 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 +1 -2
- 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 +2 -2
- 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 +1 -1
- 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 +2 -2
- package/operations/entry/elasticsearch/plugins/sortModifier.js +3 -10
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +1 -8
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
- package/operations/entry/elasticsearch/sort.d.ts +3 -3
- package/operations/entry/elasticsearch/sort.js +51 -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 +2 -2
- package/operations/entry/elasticsearch/types.js +1 -5
- package/operations/entry/elasticsearch/types.js.map +1 -1
- package/operations/entry/index.d.ts +5 -4
- package/operations/entry/index.js +333 -515
- 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 +16 -16
- 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 +6 -6
- package/operations/entry/transformations/transformEntryToIndex.js +3 -10
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +5 -4
- package/operations/group/index.js +39 -73
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +3 -3
- package/operations/model/index.js +38 -57
- package/operations/model/index.js.map +1 -1
- package/package.json +27 -32
- 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 +1 -1
- 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 +2 -2
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +1 -1
- 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 +23 -26
- package/types.js +5 -8
- package/types.js.map +1 -1
- package/values/NoValueContainer.js +1 -8
- package/values/NoValueContainer.js.map +1 -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/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -14
- package/elasticsearch/indices/japanese.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/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":["DataLoader","createPartitionKey","createRevisionSortKey","parseIdentifier","createBatchScheduleFn","createGetRevisionById","params","entity","tenant","ids","reader","createEntityReader","keys","Set","id","partitionKey","version","sortKey","key","has","add","get","PK","SK","items","execute","map","item","data","filter","batchScheduleFn"],"sources":["getRevisionById.ts"],"sourcesContent":["import DataLoader from \"dataloader\";\nimport type { CmsStorageEntry } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createPartitionKey, createRevisionSortKey } from \"~/operations/entry/keys.js\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { createBatchScheduleFn } from \"./createBatchScheduleFn.js\";\n\nexport const createGetRevisionById = (params: IDataLoaderParams) => {\n const { entity, tenant } = params;\n\n return new DataLoader<string, CmsStorageEntry[]>(\n async ids => {\n const reader = entity.createEntityReader();\n\n const keys = new Set<string>();\n\n for (const id of ids) {\n const partitionKey = createPartitionKey({\n tenant,\n id\n });\n const { version } = parseIdentifier(id);\n if (version === null) {\n continue;\n }\n const sortKey = createRevisionSortKey({\n version\n });\n const key = `${partitionKey}__${sortKey}`;\n if (keys.has(key)) {\n continue;\n }\n keys.add(key);\n\n reader.get({\n PK: partitionKey,\n SK: sortKey\n });\n }\n\n const items = (await reader.execute()).map(item => {\n return item.data;\n });\n\n return ids.map(id => {\n return items.filter(item => {\n return id === item.id;\n });\n });\n },\n {\n batchScheduleFn: createBatchScheduleFn()\n }\n );\n};\n"],"mappings":"AAAA,OAAOA,UAAU,MAAM,YAAY;AAEnC,SAASC,kBAAkB,EAAEC,qBAAqB;AAElD,SAASC,eAAe,QAAQ,eAAe;AAC/C,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,qBAAqB,GAAIC,MAAyB,IAAK;EAChE,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAEjC,OAAO,IAAIN,UAAU,CACjB,MAAMS,GAAG,IAAI;IACT,MAAMC,MAAM,GAAGH,MAAM,CAACI,kBAAkB,CAAC,CAAC;IAE1C,MAAMC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;IAE9B,KAAK,MAAMC,EAAE,IAAIL,GAAG,EAAE;MAClB,MAAMM,YAAY,GAAGd,kBAAkB,CAAC;QACpCO,MAAM;QACNM;MACJ,CAAC,CAAC;MACF,MAAM;QAAEE;MAAQ,CAAC,GAAGb,eAAe,CAACW,EAAE,CAAC;MACvC,IAAIE,OAAO,KAAK,IAAI,EAAE;QAClB;MACJ;MACA,MAAMC,OAAO,GAAGf,qBAAqB,CAAC;QAClCc;MACJ,CAAC,CAAC;MACF,MAAME,GAAG,GAAG,GAAGH,YAAY,KAAKE,OAAO,EAAE;MACzC,IAAIL,IAAI,CAACO,GAAG,CAACD,GAAG,CAAC,EAAE;QACf;MACJ;MACAN,IAAI,CAACQ,GAAG,CAACF,GAAG,CAAC;MAEbR,MAAM,CAACW,GAAG,CAAC;QACPC,EAAE,EAAEP,YAAY;QAChBQ,EAAE,EAAEN;MACR,CAAC,CAAC;IACN;IAEA,MAAMO,KAAK,GAAG,CAAC,MAAMd,MAAM,CAACe,OAAO,CAAC,CAAC,EAAEC,GAAG,CAACC,IAAI,IAAI;MAC/C,OAAOA,IAAI,CAACC,IAAI;IACpB,CAAC,CAAC;IAEF,OAAOnB,GAAG,CAACiB,GAAG,CAACZ,EAAE,IAAI;MACjB,OAAOU,KAAK,CAACK,MAAM,CAACF,IAAI,IAAI;QACxB,OAAOb,EAAE,KAAKa,IAAI,CAACb,EAAE;MACzB,CAAC,CAAC;IACN,CAAC,CAAC;EACN,CAAC,EACD;IACIgB,eAAe,EAAE1B,qBAAqB,CAAC;EAC3C,CACJ,CAAC;AACL,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type DataLoader from "dataloader";
|
|
2
|
-
import type {
|
|
3
|
-
export * from "./DataLoaderCache";
|
|
2
|
+
import type { IDataLoaderParams } from "./types.js";
|
|
3
|
+
export * from "./DataLoaderCache.js";
|
|
4
4
|
interface Callable {
|
|
5
|
-
(params:
|
|
5
|
+
(params: IDataLoaderParams): DataLoader<any, any>;
|
|
6
6
|
}
|
|
7
7
|
export type DataLoaders = "getAllEntryRevisions" | "getRevisionById" | "getPublishedRevisionByEntryId" | "getLatestRevisionByEntryId";
|
|
8
8
|
export declare const getDataLoaderFactory: (name: string) => Callable;
|
|
@@ -1,40 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
getDataLoaderFactory: true
|
|
8
|
-
};
|
|
9
|
-
exports.getDataLoaderFactory = void 0;
|
|
10
|
-
var _getAllEntryRevisions = require("./getAllEntryRevisions");
|
|
11
|
-
var _getLatestRevisionByEntryId = require("./getLatestRevisionByEntryId");
|
|
12
|
-
var _getPublishedRevisionByEntryId = require("./getPublishedRevisionByEntryId");
|
|
13
|
-
var _getRevisionById = require("./getRevisionById");
|
|
14
|
-
var _DataLoaderCache = require("./DataLoaderCache");
|
|
15
|
-
Object.keys(_DataLoaderCache).forEach(function (key) {
|
|
16
|
-
if (key === "default" || key === "__esModule") return;
|
|
17
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
18
|
-
if (key in exports && exports[key] === _DataLoaderCache[key]) return;
|
|
19
|
-
Object.defineProperty(exports, key, {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
get: function () {
|
|
22
|
-
return _DataLoaderCache[key];
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
});
|
|
1
|
+
import { createGetAllEntryRevisions } from "./getAllEntryRevisions.js";
|
|
2
|
+
import { createGetLatestRevisionByEntryId } from "./getLatestRevisionByEntryId.js";
|
|
3
|
+
import { createGetPublishedRevisionByEntryId } from "./getPublishedRevisionByEntryId.js";
|
|
4
|
+
import { createGetRevisionById } from "./getRevisionById.js";
|
|
5
|
+
export * from "./DataLoaderCache.js";
|
|
26
6
|
const dataLoaders = {
|
|
27
|
-
getAllEntryRevisions:
|
|
28
|
-
getLatestRevisionByEntryId:
|
|
29
|
-
getPublishedRevisionByEntryId:
|
|
30
|
-
getRevisionById:
|
|
7
|
+
getAllEntryRevisions: createGetAllEntryRevisions,
|
|
8
|
+
getLatestRevisionByEntryId: createGetLatestRevisionByEntryId,
|
|
9
|
+
getPublishedRevisionByEntryId: createGetPublishedRevisionByEntryId,
|
|
10
|
+
getRevisionById: createGetRevisionById
|
|
31
11
|
};
|
|
32
|
-
const getDataLoaderFactory = name => {
|
|
12
|
+
export const getDataLoaderFactory = name => {
|
|
33
13
|
if (!dataLoaders[name]) {
|
|
34
14
|
throw new Error(`Missing data loader "${name}".`);
|
|
35
15
|
}
|
|
36
16
|
return dataLoaders[name];
|
|
37
17
|
};
|
|
38
|
-
exports.getDataLoaderFactory = getDataLoaderFactory;
|
|
39
18
|
|
|
40
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createGetAllEntryRevisions","createGetLatestRevisionByEntryId","createGetPublishedRevisionByEntryId","createGetRevisionById","dataLoaders","getAllEntryRevisions","getLatestRevisionByEntryId","getPublishedRevisionByEntryId","getRevisionById","getDataLoaderFactory","name","Error"],"sources":["index.ts"],"sourcesContent":["import type DataLoader from \"dataloader\";\nimport type { IDataLoaderParams } from \"./types.js\";\nimport { createGetAllEntryRevisions } from \"./getAllEntryRevisions.js\";\nimport { createGetLatestRevisionByEntryId } from \"./getLatestRevisionByEntryId.js\";\nimport { createGetPublishedRevisionByEntryId } from \"./getPublishedRevisionByEntryId.js\";\nimport { createGetRevisionById } from \"./getRevisionById.js\";\n\nexport * from \"./DataLoaderCache.js\";\n\ninterface Callable {\n (params: IDataLoaderParams): DataLoader<any, any>;\n}\n\nconst dataLoaders: Record<string, Callable> = {\n getAllEntryRevisions: createGetAllEntryRevisions,\n getLatestRevisionByEntryId: createGetLatestRevisionByEntryId,\n getPublishedRevisionByEntryId: createGetPublishedRevisionByEntryId,\n getRevisionById: createGetRevisionById\n};\n\nexport type DataLoaders =\n | \"getAllEntryRevisions\"\n | \"getRevisionById\"\n | \"getPublishedRevisionByEntryId\"\n | \"getLatestRevisionByEntryId\";\n\nexport const getDataLoaderFactory = (name: string) => {\n if (!dataLoaders[name]) {\n throw new Error(`Missing data loader \"${name}\".`);\n }\n return dataLoaders[name];\n};\n"],"mappings":"AAEA,SAASA,0BAA0B;AACnC,SAASC,gCAAgC;AACzC,SAASC,mCAAmC;AAC5C,SAASC,qBAAqB;AAE9B;AAMA,MAAMC,WAAqC,GAAG;EAC1CC,oBAAoB,EAAEL,0BAA0B;EAChDM,0BAA0B,EAAEL,gCAAgC;EAC5DM,6BAA6B,EAAEL,mCAAmC;EAClEM,eAAe,EAAEL;AACrB,CAAC;AAQD,OAAO,MAAMM,oBAAoB,GAAIC,IAAY,IAAK;EAClD,IAAI,CAACN,WAAW,CAACM,IAAI,CAAC,EAAE;IACpB,MAAM,IAAIC,KAAK,CAAC,wBAAwBD,IAAI,IAAI,CAAC;EACrD;EACA,OAAON,WAAW,CAACM,IAAI,CAAC;AAC5B,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export interface
|
|
3
|
-
entity:
|
|
1
|
+
import type { IEntryEntity } from "../../../definitions/types.js";
|
|
2
|
+
export interface IDataLoaderParams {
|
|
3
|
+
entity: IEntryEntity;
|
|
4
4
|
tenant: string;
|
|
5
|
-
locale: string;
|
|
6
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntryEntity } from \"~/definitions/types.js\";\n\nexport interface IDataLoaderParams {\n entity: IEntryEntity;\n tenant: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import type { CmsModel, CmsStorageEntry } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import type { CmsEntryValues, CmsModel, CmsStorageEntry } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import type { DataLoadersHandlerInterfaceClearAllParams, IDataLoadersHandler } from "../../types.js";
|
|
3
|
+
import type { IEntryEntity } from "../../definitions/types.js";
|
|
4
4
|
interface DataLoaderParams {
|
|
5
|
-
model: Pick<CmsModel, "tenant" | "
|
|
5
|
+
model: Pick<CmsModel, "tenant" | "modelId">;
|
|
6
6
|
ids: readonly string[];
|
|
7
7
|
}
|
|
8
|
-
interface
|
|
9
|
-
entity:
|
|
8
|
+
interface IDataLoadersHandlerParams {
|
|
9
|
+
entity: IEntryEntity;
|
|
10
10
|
}
|
|
11
11
|
export interface ClearAllParams {
|
|
12
|
-
model: Pick<CmsModel, "tenant" | "
|
|
12
|
+
model: Pick<CmsModel, "tenant" | "modelId">;
|
|
13
13
|
}
|
|
14
|
-
export declare class DataLoadersHandler implements
|
|
14
|
+
export declare class DataLoadersHandler implements IDataLoadersHandler {
|
|
15
15
|
private readonly entity;
|
|
16
16
|
private readonly cache;
|
|
17
|
-
constructor(params:
|
|
18
|
-
getAllEntryRevisions(params: DataLoaderParams): Promise<CmsStorageEntry[]>;
|
|
19
|
-
getRevisionById(params: DataLoaderParams): Promise<CmsStorageEntry[]>;
|
|
20
|
-
getPublishedRevisionByEntryId(params: DataLoaderParams): Promise<CmsStorageEntry[]>;
|
|
21
|
-
getLatestRevisionByEntryId(params: DataLoaderParams): Promise<CmsStorageEntry[]>;
|
|
17
|
+
constructor(params: IDataLoadersHandlerParams);
|
|
18
|
+
getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(params: DataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
19
|
+
getRevisionById<T extends CmsEntryValues = CmsEntryValues>(params: DataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
20
|
+
getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
21
|
+
getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(params: DataLoaderParams): Promise<CmsStorageEntry<T>[]>;
|
|
22
22
|
/**
|
|
23
23
|
* TODO @ts-refactor
|
|
24
24
|
* Maybe pass on the generics to DataLoader definition?
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.DataLoadersHandler = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _DataLoaderCache = require("./dataLoader/DataLoaderCache");
|
|
10
|
-
var _dataLoader = require("./dataLoader");
|
|
11
|
-
var _utils = require("@webiny/utils");
|
|
12
|
-
class DataLoadersHandler {
|
|
13
|
-
cache = new _DataLoaderCache.DataLoaderCache();
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { DataLoaderCache } from "./dataLoader/DataLoaderCache.js";
|
|
3
|
+
import { getDataLoaderFactory } from "./dataLoader/index.js";
|
|
4
|
+
import { parseIdentifier } from "@webiny/utils";
|
|
5
|
+
export class DataLoadersHandler {
|
|
6
|
+
cache = new DataLoaderCache();
|
|
14
7
|
constructor(params) {
|
|
15
8
|
this.entity = params.entity;
|
|
16
9
|
}
|
|
@@ -18,7 +11,7 @@ class DataLoadersHandler {
|
|
|
18
11
|
const ids = params.ids.map(id => {
|
|
19
12
|
const {
|
|
20
13
|
id: entryId
|
|
21
|
-
} =
|
|
14
|
+
} = parseIdentifier(id);
|
|
22
15
|
return entryId;
|
|
23
16
|
});
|
|
24
17
|
return await this.loadMany("getAllEntryRevisions", params, ids);
|
|
@@ -30,7 +23,7 @@ class DataLoadersHandler {
|
|
|
30
23
|
const ids = params.ids.map(id => {
|
|
31
24
|
const {
|
|
32
25
|
id: entryId
|
|
33
|
-
} =
|
|
26
|
+
} = parseIdentifier(id);
|
|
34
27
|
return entryId;
|
|
35
28
|
});
|
|
36
29
|
return await this.loadMany("getPublishedRevisionByEntryId", params, ids);
|
|
@@ -39,7 +32,7 @@ class DataLoadersHandler {
|
|
|
39
32
|
const ids = params.ids.map(id => {
|
|
40
33
|
const {
|
|
41
34
|
id: entryId
|
|
42
|
-
} =
|
|
35
|
+
} = parseIdentifier(id);
|
|
43
36
|
return entryId;
|
|
44
37
|
});
|
|
45
38
|
return await this.loadMany("getLatestRevisionByEntryId", params, ids);
|
|
@@ -55,18 +48,16 @@ class DataLoadersHandler {
|
|
|
55
48
|
} = params;
|
|
56
49
|
const cacheParams = {
|
|
57
50
|
tenant: model.tenant,
|
|
58
|
-
locale: model.locale,
|
|
59
51
|
name
|
|
60
52
|
};
|
|
61
53
|
let loader = this.cache.getDataLoader(cacheParams);
|
|
62
54
|
if (loader) {
|
|
63
55
|
return loader;
|
|
64
56
|
}
|
|
65
|
-
const factory =
|
|
57
|
+
const factory = getDataLoaderFactory(name);
|
|
66
58
|
loader = factory({
|
|
67
59
|
entity: this.entity,
|
|
68
|
-
tenant: model.tenant
|
|
69
|
-
locale: model.locale
|
|
60
|
+
tenant: model.tenant
|
|
70
61
|
});
|
|
71
62
|
this.cache.setDataLoader(cacheParams, loader);
|
|
72
63
|
return loader;
|
|
@@ -79,12 +70,12 @@ class DataLoadersHandler {
|
|
|
79
70
|
return results.reduce((acc, res) => {
|
|
80
71
|
if (Array.isArray(res) === false) {
|
|
81
72
|
if (res && res.message) {
|
|
82
|
-
throw new
|
|
73
|
+
throw new WebinyError(res.message, res.code, {
|
|
83
74
|
...res,
|
|
84
75
|
data: JSON.stringify(res.data || {})
|
|
85
76
|
});
|
|
86
77
|
}
|
|
87
|
-
throw new
|
|
78
|
+
throw new WebinyError("Result from the data loader must be an array of arrays which contain requested items.", "DATA_LOADER_RESULTS_ERROR", {
|
|
88
79
|
...params,
|
|
89
80
|
loader
|
|
90
81
|
});
|
|
@@ -94,14 +85,14 @@ class DataLoadersHandler {
|
|
|
94
85
|
}, []);
|
|
95
86
|
}
|
|
96
87
|
} catch (ex) {
|
|
97
|
-
throw new
|
|
88
|
+
throw new WebinyError(ex.message || "Data loader error.", ex.code || "DATA_LOADER_ERROR", {
|
|
98
89
|
error: ex,
|
|
99
90
|
...params,
|
|
100
91
|
loader,
|
|
101
92
|
ids
|
|
102
93
|
});
|
|
103
94
|
}
|
|
104
|
-
throw new
|
|
95
|
+
throw new WebinyError(`Data loader did not return array of items or empty array.`, "INVALID_DATA_LOADER_RESULT", {
|
|
105
96
|
loader,
|
|
106
97
|
ids,
|
|
107
98
|
results
|
|
@@ -111,6 +102,5 @@ class DataLoadersHandler {
|
|
|
111
102
|
this.cache.clearAll(params?.model);
|
|
112
103
|
}
|
|
113
104
|
}
|
|
114
|
-
exports.DataLoadersHandler = DataLoadersHandler;
|
|
115
105
|
|
|
116
106
|
//# sourceMappingURL=dataLoaders.js.map
|
|
@@ -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":"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","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
1
|
import type { PluginsContainer } from "@webiny/plugins";
|
|
2
|
-
import type { CmsEntryListParams, CmsEntryListWhere, CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
-
import type { PrimitiveValue, SearchBody } from "@webiny/api-elasticsearch/types";
|
|
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":"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","ignoreList":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { PluginsContainer } from "@webiny/plugins";
|
|
2
|
-
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
|
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 {};
|