@webiny/api-headless-cms-utils-os 0.0.0-unstable.0d717d18dd → 0.0.0-unstable.3fddf667ea

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.
Files changed (70) hide show
  1. package/configurations.d.ts +8 -9
  2. package/configurations.js +15 -22
  3. package/configurations.js.map +1 -1
  4. package/exports/api/cms/opensearch.d.ts +1 -0
  5. package/exports/api/cms/opensearch.js +1 -0
  6. package/features/CmsEntryOpenSearchBodyBuilder/CmsEntryOpenSearchBodyBuilder.d.ts +3 -1
  7. package/features/CmsEntryOpenSearchBodyBuilder/CmsEntryOpenSearchBodyBuilder.js +15 -5
  8. package/features/CmsEntryOpenSearchBodyBuilder/CmsEntryOpenSearchBodyBuilder.js.map +1 -1
  9. package/features/CmsEntryOpenSearchBodyBuilder/abstractions.d.ts +4 -0
  10. package/features/CmsEntryOpenSearchBodyBuilder/abstractions.js.map +1 -1
  11. package/features/CmsEntryOpenSearchExecFiltering/CmsEntryOpenSearchExecFiltering.js +2 -3
  12. package/features/CmsEntryOpenSearchExecFiltering/CmsEntryOpenSearchExecFiltering.js.map +1 -1
  13. package/features/CmsEntryOpenSearchFieldIndex/feature.js +10 -10
  14. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -1
  15. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +4 -4
  16. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -1
  17. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +11 -2
  18. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -1
  19. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js +1 -1
  20. package/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js.map +1 -1
  21. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js +1 -1
  22. package/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js.map +1 -1
  23. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +1 -1
  24. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +1 -1
  25. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -1
  26. package/features/CmsEntryOpenSearchIndexCreate/CmsEntryOpenSearchIndexCreate.js +3 -4
  27. package/features/CmsEntryOpenSearchIndexCreate/CmsEntryOpenSearchIndexCreate.js.map +1 -1
  28. package/features/CmsEntryOpenSearchIndexDelete/CmsEntryOpenSearchIndexDelete.js +3 -4
  29. package/features/CmsEntryOpenSearchIndexDelete/CmsEntryOpenSearchIndexDelete.js.map +1 -1
  30. package/features/CmsEntryOpenSearchUtilsFeature.js +2 -0
  31. package/features/CmsEntryOpenSearchUtilsFeature.js.map +1 -1
  32. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +1 -1
  33. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -1
  34. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.d.ts +8 -0
  35. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js +17 -0
  36. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js.map +1 -0
  37. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndexProvider.d.ts +12 -0
  38. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndexProvider.js +35 -0
  39. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndexProvider.js.map +1 -0
  40. package/features/CmsModelOpenSearchIndex/feature.d.ts +4 -0
  41. package/features/CmsModelOpenSearchIndex/feature.js +13 -0
  42. package/features/CmsModelOpenSearchIndex/feature.js.map +1 -0
  43. package/features/CmsModelOpenSearchIndex/index.d.ts +3 -0
  44. package/features/CmsModelOpenSearchIndex/index.js +3 -0
  45. package/helpers/fieldIdentifier.js +2 -2
  46. package/helpers/fieldIdentifier.js.map +1 -1
  47. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +2 -2
  48. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  49. package/operations/entry/elasticsearch/fields/system.d.ts +7 -0
  50. package/operations/entry/elasticsearch/fields/system.js +58 -0
  51. package/operations/entry/elasticsearch/fields/system.js.map +1 -0
  52. package/operations/entry/elasticsearch/fields.d.ts +4 -2
  53. package/operations/entry/elasticsearch/fields.js +6 -4
  54. package/operations/entry/elasticsearch/fields.js.map +1 -1
  55. package/operations/entry/elasticsearch/fullTextSearch.js +12 -3
  56. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  57. package/operations/entry/elasticsearch/initialQuery.d.ts +4 -0
  58. package/operations/entry/elasticsearch/initialQuery.js +2 -4
  59. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  60. package/operations/entry/elasticsearch/initialQuery.test.d.ts +1 -0
  61. package/operations/entry/elasticsearch/initialQuery.test.js +48 -0
  62. package/operations/entry/elasticsearch/initialQuery.test.js.map +1 -0
  63. package/operations/entry/elasticsearch/keyword.js +2 -2
  64. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  65. package/package.json +8 -7
  66. package/testing/createTestModelIndexName.d.ts +3 -0
  67. package/testing/createTestModelIndexName.js +11 -0
  68. package/testing/createTestModelIndexName.js.map +1 -0
  69. package/testing/index.d.ts +1 -0
  70. package/testing/index.js +1 -0
@@ -1,10 +1,9 @@
1
1
  import type { StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
2
- export declare const configurations: {
3
- es(params: {
4
- model: Pick<StorageCmsModel, "tenant" | "modelId">;
5
- }): {
6
- index: string;
7
- settings: import("@opensearch-project/opensearch/api/index.js").Indices_Create_RequestBody;
8
- shared: boolean;
9
- };
10
- };
2
+ import type { CmsModelOpenSearchIndexProvider, ICmsModelOpenSearchIndexProviderResult } from "./features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js";
3
+ export interface CmsElasticsearchParams {
4
+ model: StorageCmsModel;
5
+ }
6
+ export interface Configurations {
7
+ es: (params: CmsElasticsearchParams) => Promise<ICmsModelOpenSearchIndexProviderResult>;
8
+ }
9
+ export declare const createConfigurations: (provider: CmsModelOpenSearchIndexProvider.Interface) => Configurations;
package/configurations.js CHANGED
@@ -1,24 +1,17 @@
1
- import error from "@webiny/error";
2
- import { getBaseConfiguration, getOpenSearchIndexPrefix, isSharedOpenSearchIndex } from "@webiny/api-opensearch";
3
- const configurations = {
4
- es (params) {
5
- const { model } = params;
6
- const { tenant } = model;
7
- if (!tenant) throw new error('Missing "tenant" parameter when trying to create Elasticsearch index name.', "TENANT_ERROR");
8
- const shared = isSharedOpenSearchIndex();
9
- const index = [
10
- shared ? "root" : tenant,
11
- "headless-cms",
12
- model.modelId
13
- ].join("-").toLowerCase();
14
- const prefix = getOpenSearchIndexPrefix();
15
- return {
16
- index: prefix ? prefix + index : index,
17
- settings: getBaseConfiguration(),
18
- shared
19
- };
20
- }
21
- };
22
- export { configurations };
1
+ import { getOpenSearchIndexPrefix } from "@webiny/api-opensearch";
2
+ const createConfigurations = (provider)=>({
3
+ async es ({ model }) {
4
+ const result = await provider.execute({
5
+ model
6
+ });
7
+ const prefix = getOpenSearchIndexPrefix();
8
+ if (!prefix) return result;
9
+ return {
10
+ ...result,
11
+ index: prefix + result.index
12
+ };
13
+ }
14
+ });
15
+ export { createConfigurations };
23
16
 
24
17
  //# sourceMappingURL=configurations.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configurations.js","sources":["../src/configurations.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport {\n getBaseConfiguration,\n getOpenSearchIndexPrefix,\n isSharedOpenSearchIndex\n} from \"@webiny/api-opensearch\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport const configurations = {\n es(params: { model: Pick<StorageCmsModel, \"tenant\" | \"modelId\"> }) {\n const { model } = params;\n const { tenant } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n }\n\n const shared = isSharedOpenSearchIndex();\n const index = [shared ? \"root\" : tenant, \"headless-cms\", model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getOpenSearchIndexPrefix();\n\n return {\n index: prefix ? prefix + index : index,\n settings: getBaseConfiguration(),\n shared\n };\n }\n};\n"],"names":["configurations","params","model","tenant","WebinyError","shared","isSharedOpenSearchIndex","index","prefix","getOpenSearchIndexPrefix","getBaseConfiguration"],"mappings":";;AAQO,MAAMA,iBAAiB;IAC1B,IAAGC,MAA8D;QAC7D,MAAM,EAAEC,KAAK,EAAE,GAAGD;QAClB,MAAM,EAAEE,MAAM,EAAE,GAAGD;QAEnB,IAAI,CAACC,QACD,MAAM,IAAIC,MACN,8EACA;QAIR,MAAMC,SAASC;QACf,MAAMC,QAAQ;YAACF,SAAS,SAASF;YAAQ;YAAgBD,MAAM,OAAO;SAAC,CAClE,IAAI,CAAC,KACL,WAAW;QAEhB,MAAMM,SAASC;QAEf,OAAO;YACH,OAAOD,SAASA,SAASD,QAAQA;YACjC,UAAUG;YACVL;QACJ;IACJ;AACJ"}
1
+ {"version":3,"file":"configurations.js","sources":["../src/configurations.ts"],"sourcesContent":["import { getOpenSearchIndexPrefix } from \"@webiny/api-opensearch\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type {\n CmsModelOpenSearchIndexProvider,\n ICmsModelOpenSearchIndexProviderResult\n} from \"./features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js\";\n\nexport interface CmsElasticsearchParams {\n model: StorageCmsModel;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => Promise<ICmsModelOpenSearchIndexProviderResult>;\n}\n\nexport const createConfigurations = (\n provider: CmsModelOpenSearchIndexProvider.Interface\n): Configurations => ({\n async es({ model }) {\n const result = await provider.execute({ model });\n\n const prefix = getOpenSearchIndexPrefix();\n\n if (!prefix) {\n return result;\n }\n return {\n ...result,\n index: prefix + result.index\n };\n }\n});\n"],"names":["createConfigurations","provider","model","result","prefix","getOpenSearchIndexPrefix"],"mappings":";AAeO,MAAMA,uBAAuB,CAChCC,WACkB;QAClB,MAAM,IAAG,EAAEC,KAAK,EAAE;YACd,MAAMC,SAAS,MAAMF,SAAS,OAAO,CAAC;gBAAEC;YAAM;YAE9C,MAAME,SAASC;YAEf,IAAI,CAACD,QACD,OAAOD;YAEX,OAAO;gBACH,GAAGA,MAAM;gBACT,OAAOC,SAASD,OAAO,KAAK;YAChC;QACJ;IACJ"}
@@ -1,3 +1,4 @@
1
+ export { CmsModelOpenSearchIndexProvider, CmsModelOpenSearchIndex } from "../../../features/CmsModelOpenSearchIndex/index.js";
1
2
  export { CmsEntryOpenSearchUtilsFeature } from "../../../features/CmsEntryOpenSearchUtilsFeature.js";
2
3
  export { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchFieldIndex } from "../../../features/CmsEntryOpenSearchFieldIndex/index.js";
3
4
  export { CmsEntryOpenSearchFilterRegistry, CmsEntryOpenSearchFilter } from "../../../features/CmsEntryOpenSearchFilter/index.js";
@@ -1,3 +1,4 @@
1
+ export { CmsModelOpenSearchIndex, CmsModelOpenSearchIndexProvider } from "../../../features/CmsModelOpenSearchIndex/index.js";
1
2
  export { CmsEntryOpenSearchUtilsFeature } from "../../../features/CmsEntryOpenSearchUtilsFeature.js";
2
3
  export { CmsEntryOpenSearchFieldIndex, CmsEntryOpenSearchFieldIndexRegistry } from "../../../features/CmsEntryOpenSearchFieldIndex/index.js";
3
4
  export { CmsEntryOpenSearchFilter, CmsEntryOpenSearchFilterRegistry } from "../../../features/CmsEntryOpenSearchFilter/index.js";
@@ -1,6 +1,7 @@
1
1
  import type { SearchBody } from "@webiny/api-opensearch/types.js";
2
2
  import { OpenSearchFieldFactory } from "@webiny/api-opensearch/exports/api/opensearch.js";
3
3
  import { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
4
+ import { CmsEntrySystemField } from "@webiny/api-headless-cms/features/contentEntry/EntrySystemField/index.js";
4
5
  import { CmsEntryOpenSearchFieldIndexRegistry } from "../../features/CmsEntryOpenSearchFieldIndex/index.js";
5
6
  import { CmsEntryOpenSearchBodyModifier } from "../../features/CmsEntryOpenSearchBodyModifier/index.js";
6
7
  import { CmsEntryOpenSearchSortModifier } from "../../features/CmsEntryOpenSearchSortModifier/index.js";
@@ -21,7 +22,8 @@ declare class CmsEntryOpenSearchBodyBuilderImpl implements CmsEntryOpenSearchBod
21
22
  private readonly valueSearchRegistry;
22
23
  private readonly fullTextSearches;
23
24
  private readonly fieldFactory;
24
- constructor(execFiltering: CmsEntryOpenSearchExecFiltering.Interface, fieldPathFactory: CmsEntryOpenSearchFieldPathFactory.Interface, fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface, fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface, bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[], sortModifiers: CmsEntryOpenSearchSortModifier.Interface[], queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[], valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface, fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[], fieldFactory: OpenSearchFieldFactory.Interface);
25
+ private readonly entrySystemFields;
26
+ constructor(execFiltering: CmsEntryOpenSearchExecFiltering.Interface, fieldPathFactory: CmsEntryOpenSearchFieldPathFactory.Interface, fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface, fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface, bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[], sortModifiers: CmsEntryOpenSearchSortModifier.Interface[], queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[], valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface, fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[], fieldFactory: OpenSearchFieldFactory.Interface, entrySystemFields: CmsEntrySystemField.Interface[]);
25
27
  build(params: CmsEntryOpenSearchBodyBuilderAbstraction.Params): SearchBody;
26
28
  }
27
29
  export declare const CmsEntryOpenSearchBodyBuilder: typeof CmsEntryOpenSearchBodyBuilderImpl & {
@@ -1,5 +1,6 @@
1
1
  import { OpenSearchFieldFactory } from "@webiny/api-opensearch/exports/api/opensearch.js";
2
2
  import { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
3
+ import { CmsEntrySystemField } from "@webiny/api-headless-cms/features/contentEntry/EntrySystemField/index.js";
3
4
  import { CmsEntryOpenSearchFieldIndexRegistry } from "../CmsEntryOpenSearchFieldIndex/index.js";
4
5
  import { CmsEntryOpenSearchBodyModifier } from "../CmsEntryOpenSearchBodyModifier/index.js";
5
6
  import { CmsEntryOpenSearchSortModifier } from "../CmsEntryOpenSearchSortModifier/index.js";
@@ -16,7 +17,7 @@ import { assignMinimumShouldMatchToQuery } from "../../operations/entry/elastics
16
17
  import { createElasticsearchSort } from "./sort.js";
17
18
  import { CmsEntryOpenSearchBodyBuilder } from "./abstractions.js";
18
19
  class CmsEntryOpenSearchBodyBuilderImpl {
19
- constructor(execFiltering, fieldPathFactory, fieldRegistry, fieldIndexRegistry, bodyModifiers, sortModifiers, queryModifiers, valueSearchRegistry, fullTextSearches, fieldFactory){
20
+ constructor(execFiltering, fieldPathFactory, fieldRegistry, fieldIndexRegistry, bodyModifiers, sortModifiers, queryModifiers, valueSearchRegistry, fullTextSearches, fieldFactory, entrySystemFields){
20
21
  this.execFiltering = execFiltering;
21
22
  this.fieldPathFactory = fieldPathFactory;
22
23
  this.fieldRegistry = fieldRegistry;
@@ -27,14 +28,16 @@ class CmsEntryOpenSearchBodyBuilderImpl {
27
28
  this.valueSearchRegistry = valueSearchRegistry;
28
29
  this.fullTextSearches = fullTextSearches;
29
30
  this.fieldFactory = fieldFactory;
31
+ this.entrySystemFields = entrySystemFields;
30
32
  }
31
33
  build(params) {
32
- const { model } = params;
34
+ const { model, shared } = params;
33
35
  const { fields, search: term, where, sort: initialSort, after, limit } = params.params;
34
36
  const modelFields = createModelFields({
35
37
  model,
36
38
  fieldRegistry: this.fieldRegistry,
37
- fieldIndexRegistry: this.fieldIndexRegistry
39
+ fieldIndexRegistry: this.fieldIndexRegistry,
40
+ systemFields: this.entrySystemFields.map((systemField)=>systemField.field)
38
41
  });
39
42
  const applicableQueryModifiers = this.queryModifiers.filter((m)=>!m.modelId || m.modelId === model.modelId);
40
43
  const applicableSortModifiers = this.sortModifiers.filter((m)=>!m.modelId || m.modelId === model.modelId);
@@ -46,7 +49,8 @@ class CmsEntryOpenSearchBodyBuilderImpl {
46
49
  });
47
50
  const query = createInitialQuery({
48
51
  where,
49
- model
52
+ model,
53
+ shared
50
54
  });
51
55
  applyFullTextSearch({
52
56
  model,
@@ -136,7 +140,13 @@ const CmsEntryOpenSearchBodyBuilder_CmsEntryOpenSearchBodyBuilder = CmsEntryOpen
136
140
  multiple: true
137
141
  }
138
142
  ],
139
- OpenSearchFieldFactory
143
+ OpenSearchFieldFactory,
144
+ [
145
+ CmsEntrySystemField,
146
+ {
147
+ multiple: true
148
+ }
149
+ ]
140
150
  ]
141
151
  });
142
152
  export { CmsEntryOpenSearchBodyBuilder_CmsEntryOpenSearchBodyBuilder as CmsEntryOpenSearchBodyBuilder };
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchBodyBuilder/CmsEntryOpenSearchBodyBuilder.js","sources":["../../../src/features/CmsEntryOpenSearchBodyBuilder/CmsEntryOpenSearchBodyBuilder.ts"],"sourcesContent":["import type {\n QueryDslBoolQuery as BoolQueryConfig,\n SearchBody\n} from \"@webiny/api-opensearch/types.js\";\nimport { OpenSearchFieldFactory } from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { CmsEntryOpenSearchFieldIndexRegistry } from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\nimport { CmsEntryOpenSearchBodyModifier } from \"~/features/CmsEntryOpenSearchBodyModifier/index.js\";\nimport { CmsEntryOpenSearchSortModifier } from \"~/features/CmsEntryOpenSearchSortModifier/index.js\";\nimport { CmsEntryOpenSearchQueryModifier } from \"~/features/CmsEntryOpenSearchQueryModifier/index.js\";\nimport { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\nimport { CmsEntryOpenSearchFullTextSearch } from \"~/features/CmsEntryOpenSearchFullTextSearch/index.js\";\nimport { CmsEntryOpenSearchExecFiltering } from \"~/features/CmsEntryOpenSearchExecFiltering/index.js\";\nimport { CmsEntryOpenSearchFieldPathFactory } from \"~/features/CmsEntryOpenSearchFieldPathFactory/index.js\";\nimport { createModelFields } from \"~/operations/entry/elasticsearch/fields.js\";\nimport { createFullTextSearchFields } from \"~/operations/entry/elasticsearch/fullTextSearchFields.js\";\nimport { createInitialQuery } from \"~/operations/entry/elasticsearch/initialQuery.js\";\nimport { applyFullTextSearch } from \"~/operations/entry/elasticsearch/fullTextSearch.js\";\nimport { assignMinimumShouldMatchToQuery } from \"~/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js\";\nimport { createElasticsearchSort } from \"./sort.js\";\nimport { CmsEntryOpenSearchBodyBuilder as CmsEntryOpenSearchBodyBuilderAbstraction } from \"./abstractions.js\";\n\nclass CmsEntryOpenSearchBodyBuilderImpl\n implements CmsEntryOpenSearchBodyBuilderAbstraction.Interface\n{\n public constructor(\n private readonly execFiltering: CmsEntryOpenSearchExecFiltering.Interface,\n private readonly fieldPathFactory: CmsEntryOpenSearchFieldPathFactory.Interface,\n private readonly fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface,\n private readonly fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface,\n private readonly bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[],\n private readonly sortModifiers: CmsEntryOpenSearchSortModifier.Interface[],\n private readonly queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[],\n private readonly valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface,\n private readonly fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[],\n private readonly fieldFactory: OpenSearchFieldFactory.Interface\n ) {}\n\n public build(params: CmsEntryOpenSearchBodyBuilderAbstraction.Params): SearchBody {\n const { model } = params;\n const { fields, search: term, where, sort: initialSort, after, limit } = params.params;\n\n const modelFields = createModelFields({\n model,\n fieldRegistry: this.fieldRegistry,\n fieldIndexRegistry: this.fieldIndexRegistry\n });\n\n const applicableQueryModifiers = this.queryModifiers.filter(m => {\n return !m.modelId || m.modelId === model.modelId;\n });\n const applicableSortModifiers = this.sortModifiers.filter(\n m => !m.modelId || m.modelId === model.modelId\n );\n const applicableBodyModifiers = this.bodyModifiers.filter(m => {\n return !m.modelId || m.modelId === model.modelId;\n });\n\n const fullTextSearchFields = createFullTextSearchFields({\n fields: modelFields,\n term,\n targets: fields\n });\n\n const query = createInitialQuery({\n where,\n model\n });\n\n applyFullTextSearch({\n model,\n fullTextSearches: this.fullTextSearches,\n query,\n term,\n fields: fullTextSearchFields\n });\n\n this.execFiltering.execute({\n model,\n fields: modelFields,\n where,\n query\n });\n\n for (const modifier of applicableQueryModifiers) {\n modifier.modifyQuery({ query, model, where });\n }\n\n const sort = createElasticsearchSort({\n sort: initialSort,\n modelFields,\n model,\n fieldPathFactory: this.fieldPathFactory,\n valueSearchRegistry: this.valueSearchRegistry,\n fieldFactory: this.fieldFactory\n });\n\n for (const modifier of applicableSortModifiers) {\n modifier.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 modifier of applicableBodyModifiers) {\n modifier.modifyBody({\n body,\n model,\n where\n });\n }\n\n return body;\n }\n}\n\nexport const CmsEntryOpenSearchBodyBuilder =\n CmsEntryOpenSearchBodyBuilderAbstraction.createImplementation({\n implementation: CmsEntryOpenSearchBodyBuilderImpl,\n dependencies: [\n CmsEntryOpenSearchExecFiltering,\n CmsEntryOpenSearchFieldPathFactory,\n CmsModelFieldToGraphQLRegistry,\n CmsEntryOpenSearchFieldIndexRegistry,\n [CmsEntryOpenSearchBodyModifier, { multiple: true }],\n [CmsEntryOpenSearchSortModifier, { multiple: true }],\n [CmsEntryOpenSearchQueryModifier, { multiple: true }],\n CmsEntryOpenSearchValueSearchRegistry,\n [CmsEntryOpenSearchFullTextSearch, { multiple: true }],\n OpenSearchFieldFactory\n ]\n });\n"],"names":["CmsEntryOpenSearchBodyBuilderImpl","execFiltering","fieldPathFactory","fieldRegistry","fieldIndexRegistry","bodyModifiers","sortModifiers","queryModifiers","valueSearchRegistry","fullTextSearches","fieldFactory","params","model","fields","term","where","initialSort","after","limit","modelFields","createModelFields","applicableQueryModifiers","m","applicableSortModifiers","applicableBodyModifiers","fullTextSearchFields","createFullTextSearchFields","query","createInitialQuery","applyFullTextSearch","modifier","sort","createElasticsearchSort","boolQuery","undefined","assignMinimumShouldMatchToQuery","body","CmsEntryOpenSearchBodyBuilder","CmsEntryOpenSearchBodyBuilderAbstraction","CmsEntryOpenSearchExecFiltering","CmsEntryOpenSearchFieldPathFactory","CmsModelFieldToGraphQLRegistry","CmsEntryOpenSearchFieldIndexRegistry","CmsEntryOpenSearchBodyModifier","CmsEntryOpenSearchSortModifier","CmsEntryOpenSearchQueryModifier","CmsEntryOpenSearchValueSearchRegistry","CmsEntryOpenSearchFullTextSearch","OpenSearchFieldFactory"],"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AE,UAAU;YAAK;SAAE;QACpD;YAACC;YAAiC;gBAAE,UAAU;YAAK;SAAE;QACrDC;QACA;YAACC;YAAkC;gBAAE,UAAU;YAAK;SAAE;QACtDC;KACH;AACL"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchBodyBuilder/CmsEntryOpenSearchBodyBuilder.js","sources":["../../../src/features/CmsEntryOpenSearchBodyBuilder/CmsEntryOpenSearchBodyBuilder.ts"],"sourcesContent":["import type {\n QueryDslBoolQuery as BoolQueryConfig,\n SearchBody\n} from \"@webiny/api-opensearch/types.js\";\nimport { OpenSearchFieldFactory } from \"@webiny/api-opensearch/exports/api/opensearch.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { CmsEntrySystemField } from \"@webiny/api-headless-cms/features/contentEntry/EntrySystemField/index.js\";\nimport { CmsEntryOpenSearchFieldIndexRegistry } from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\nimport { CmsEntryOpenSearchBodyModifier } from \"~/features/CmsEntryOpenSearchBodyModifier/index.js\";\nimport { CmsEntryOpenSearchSortModifier } from \"~/features/CmsEntryOpenSearchSortModifier/index.js\";\nimport { CmsEntryOpenSearchQueryModifier } from \"~/features/CmsEntryOpenSearchQueryModifier/index.js\";\nimport { CmsEntryOpenSearchValueSearchRegistry } from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\nimport { CmsEntryOpenSearchFullTextSearch } from \"~/features/CmsEntryOpenSearchFullTextSearch/index.js\";\nimport { CmsEntryOpenSearchExecFiltering } from \"~/features/CmsEntryOpenSearchExecFiltering/index.js\";\nimport { CmsEntryOpenSearchFieldPathFactory } from \"~/features/CmsEntryOpenSearchFieldPathFactory/index.js\";\nimport { createModelFields } from \"~/operations/entry/elasticsearch/fields.js\";\nimport { createFullTextSearchFields } from \"~/operations/entry/elasticsearch/fullTextSearchFields.js\";\nimport { createInitialQuery } from \"~/operations/entry/elasticsearch/initialQuery.js\";\nimport { applyFullTextSearch } from \"~/operations/entry/elasticsearch/fullTextSearch.js\";\nimport { assignMinimumShouldMatchToQuery } from \"~/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js\";\nimport { createElasticsearchSort } from \"./sort.js\";\nimport { CmsEntryOpenSearchBodyBuilder as CmsEntryOpenSearchBodyBuilderAbstraction } from \"./abstractions.js\";\n\nclass CmsEntryOpenSearchBodyBuilderImpl\n implements CmsEntryOpenSearchBodyBuilderAbstraction.Interface\n{\n public constructor(\n private readonly execFiltering: CmsEntryOpenSearchExecFiltering.Interface,\n private readonly fieldPathFactory: CmsEntryOpenSearchFieldPathFactory.Interface,\n private readonly fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface,\n private readonly fieldIndexRegistry: CmsEntryOpenSearchFieldIndexRegistry.Interface,\n private readonly bodyModifiers: CmsEntryOpenSearchBodyModifier.Interface[],\n private readonly sortModifiers: CmsEntryOpenSearchSortModifier.Interface[],\n private readonly queryModifiers: CmsEntryOpenSearchQueryModifier.Interface[],\n private readonly valueSearchRegistry: CmsEntryOpenSearchValueSearchRegistry.Interface,\n private readonly fullTextSearches: CmsEntryOpenSearchFullTextSearch.Interface[],\n private readonly fieldFactory: OpenSearchFieldFactory.Interface,\n private readonly entrySystemFields: CmsEntrySystemField.Interface[]\n ) {}\n\n public build(params: CmsEntryOpenSearchBodyBuilderAbstraction.Params): SearchBody {\n const { model, shared } = params;\n const { fields, search: term, where, sort: initialSort, after, limit } = params.params;\n\n const modelFields = createModelFields({\n model,\n fieldRegistry: this.fieldRegistry,\n fieldIndexRegistry: this.fieldIndexRegistry,\n systemFields: this.entrySystemFields.map(systemField => systemField.field)\n });\n\n const applicableQueryModifiers = this.queryModifiers.filter(m => {\n return !m.modelId || m.modelId === model.modelId;\n });\n const applicableSortModifiers = this.sortModifiers.filter(\n m => !m.modelId || m.modelId === model.modelId\n );\n const applicableBodyModifiers = this.bodyModifiers.filter(m => {\n return !m.modelId || m.modelId === model.modelId;\n });\n\n const fullTextSearchFields = createFullTextSearchFields({\n fields: modelFields,\n term,\n targets: fields\n });\n\n const query = createInitialQuery({\n where,\n model,\n shared\n });\n\n applyFullTextSearch({\n model,\n fullTextSearches: this.fullTextSearches,\n query,\n term,\n fields: fullTextSearchFields\n });\n\n this.execFiltering.execute({\n model,\n fields: modelFields,\n where,\n query\n });\n\n for (const modifier of applicableQueryModifiers) {\n modifier.modifyQuery({ query, model, where });\n }\n\n const sort = createElasticsearchSort({\n sort: initialSort,\n modelFields,\n model,\n fieldPathFactory: this.fieldPathFactory,\n valueSearchRegistry: this.valueSearchRegistry,\n fieldFactory: this.fieldFactory\n });\n\n for (const modifier of applicableSortModifiers) {\n modifier.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 modifier of applicableBodyModifiers) {\n modifier.modifyBody({\n body,\n model,\n where\n });\n }\n\n return body;\n }\n}\n\nexport const CmsEntryOpenSearchBodyBuilder =\n CmsEntryOpenSearchBodyBuilderAbstraction.createImplementation({\n implementation: CmsEntryOpenSearchBodyBuilderImpl,\n dependencies: [\n CmsEntryOpenSearchExecFiltering,\n CmsEntryOpenSearchFieldPathFactory,\n CmsModelFieldToGraphQLRegistry,\n CmsEntryOpenSearchFieldIndexRegistry,\n [CmsEntryOpenSearchBodyModifier, { multiple: true }],\n [CmsEntryOpenSearchSortModifier, { multiple: true }],\n [CmsEntryOpenSearchQueryModifier, { multiple: true }],\n CmsEntryOpenSearchValueSearchRegistry,\n [CmsEntryOpenSearchFullTextSearch, { multiple: true }],\n OpenSearchFieldFactory,\n [CmsEntrySystemField, { multiple: true }]\n ]\n });\n"],"names":["CmsEntryOpenSearchBodyBuilderImpl","execFiltering","fieldPathFactory","fieldRegistry","fieldIndexRegistry","bodyModifiers","sortModifiers","queryModifiers","valueSearchRegistry","fullTextSearches","fieldFactory","entrySystemFields","params","model","shared","fields","term","where","initialSort","after","limit","modelFields","createModelFields","systemField","applicableQueryModifiers","m","applicableSortModifiers","applicableBodyModifiers","fullTextSearchFields","createFullTextSearchFields","query","createInitialQuery","applyFullTextSearch","modifier","sort","createElasticsearchSort","boolQuery","undefined","assignMinimumShouldMatchToQuery","body","CmsEntryOpenSearchBodyBuilder","CmsEntryOpenSearchBodyBuilderAbstraction","CmsEntryOpenSearchExecFiltering","CmsEntryOpenSearchFieldPathFactory","CmsModelFieldToGraphQLRegistry","CmsEntryOpenSearchFieldIndexRegistry","CmsEntryOpenSearchBodyModifier","CmsEntryOpenSearchSortModifier","CmsEntryOpenSearchQueryModifier","CmsEntryOpenSearchValueSearchRegistry","CmsEntryOpenSearchFullTextSearch","OpenSearchFieldFactory","CmsEntrySystemField"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,MAAMA;IAGF,YACqBC,aAAwD,EACxDC,gBAA8D,EAC9DC,aAAuD,EACvDC,kBAAkE,EAClEC,aAAyD,EACzDC,aAAyD,EACzDC,cAA2D,EAC3DC,mBAAoE,EACpEC,gBAA8D,EAC9DC,YAA8C,EAC9CC,iBAAkD,CACrE;aAXmBV,aAAa,GAAbA;aACAC,gBAAgB,GAAhBA;aACAC,aAAa,GAAbA;aACAC,kBAAkB,GAAlBA;aACAC,aAAa,GAAbA;aACAC,aAAa,GAAbA;aACAC,cAAc,GAAdA;aACAC,mBAAmB,GAAnBA;aACAC,gBAAgB,GAAhBA;aACAC,YAAY,GAAZA;aACAC,iBAAiB,GAAjBA;IAClB;IAEI,MAAMC,MAAuD,EAAc;QAC9E,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAE,GAAGF;QAC1B,MAAM,EAAEG,MAAM,EAAE,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AMoB,YAAYP,wBACnBO,SAAS,UAAU,CAAC;YAChBC;YACArB;QACJ;QAGJ,MAAMuB,YAA6B;YAC/B,MAAMN,MAAM,IAAI,CAAC,MAAM,GAAG,IAAIA,MAAM,IAAI,GAAGO;YAC3C,UAAUP,MAAM,QAAQ,CAAC,MAAM,GAAG,IAAIA,MAAM,QAAQ,GAAGO;YACvD,QAAQP,MAAM,MAAM,CAAC,MAAM,GAAG,IAAIA,MAAM,MAAM,GAAGO;YACjD,QAAQP,MAAM,MAAM,CAAC,MAAM,GAAG,IAAIA,MAAM,MAAM,GAAGO;QACrD;QAEAC,gCAAgC;YAC5B,OAAOF;QACX;QAEA,MAAMG,OAAmB;YACrB,OAAO;gBACH,MAAMH;YACV;YACAF;YACA,MAAOd,AAAAA,CAAAA,SAAS,KAAK;YACrB,cAAcD;YACd,kBAAkB;QACtB;QAEA,KAAK,MAAMc,YAAYN,wBACnBM,SAAS,UAAU,CAAC;YAChBM;YACA1B;YACAI;QACJ;QAGJ,OAAOsB;IACX;AACJ;AAEO,MAAMC,8DACTC,8BAAAA,oBAA6D,CAAC;IAC1D,gBAAgBzC;IAChB,cAAc;QACV0C;QACAC;QACAC;QACAC;QACA;YAACC;YAAgC;gBAAE,UAAU;YAAK;SAAE;QACpD;YAACC;YAAgC;gBAAE,UAAU;YAAK;SAAE;QACpD;YAACC;YAAiC;gBAAE,UAAU;YAAK;SAAE;QACrDC;QACA;YAACC;YAAkC;gBAAE,UAAU;YAAK;SAAE;QACtDC;QACA;YAACC;YAAqB;gBAAE,UAAU;YAAK;SAAE;KAC5C;AACL"}
@@ -3,6 +3,10 @@ import type { CmsEntryListParams, CmsEntryListWhere } from "@webiny/api-headless
3
3
  import type { PrimitiveValue, SearchBody } from "@webiny/api-opensearch/types.js";
4
4
  export interface ICmsEntryOpenSearchBodyBuilderParams {
5
5
  model: CmsModel;
6
+ /**
7
+ * Whether the model's index is shared between tenants, from CmsModelOpenSearchIndexProvider.
8
+ */
9
+ shared: boolean;
6
10
  params: Omit<CmsEntryListParams, "where" | "after"> & {
7
11
  where: CmsEntryListWhere;
8
12
  after?: PrimitiveValue[];
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchBodyBuilder/abstractions.js","sources":["../../../src/features/CmsEntryOpenSearchBodyBuilder/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type {\n CmsEntryListParams,\n CmsEntryListWhere\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { PrimitiveValue, SearchBody } from \"@webiny/api-opensearch/types.js\";\n\nexport interface ICmsEntryOpenSearchBodyBuilderParams {\n model: CmsModel;\n params: Omit<CmsEntryListParams, \"where\" | \"after\"> & {\n where: CmsEntryListWhere;\n after?: PrimitiveValue[];\n };\n}\n\nexport interface ICmsEntryOpenSearchBodyBuilder {\n build(params: ICmsEntryOpenSearchBodyBuilderParams): SearchBody;\n}\n\nexport const CmsEntryOpenSearchBodyBuilder = createAbstraction<ICmsEntryOpenSearchBodyBuilder>(\n \"Cms/Entry/OpenSearch/BodyBuilder\"\n);\n\nexport namespace CmsEntryOpenSearchBodyBuilder {\n export type Interface = ICmsEntryOpenSearchBodyBuilder;\n export type Params = ICmsEntryOpenSearchBodyBuilderParams;\n}\n"],"names":["CmsEntryOpenSearchBodyBuilder","createAbstraction"],"mappings":";AAoBO,MAAMA,gCAAgCC,kBACzC"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchBodyBuilder/abstractions.js","sources":["../../../src/features/CmsEntryOpenSearchBodyBuilder/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type {\n CmsEntryListParams,\n CmsEntryListWhere\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { PrimitiveValue, SearchBody } from \"@webiny/api-opensearch/types.js\";\n\nexport interface ICmsEntryOpenSearchBodyBuilderParams {\n model: CmsModel;\n /**\n * Whether the model's index is shared between tenants, from CmsModelOpenSearchIndexProvider.\n */\n shared: boolean;\n params: Omit<CmsEntryListParams, \"where\" | \"after\"> & {\n where: CmsEntryListWhere;\n after?: PrimitiveValue[];\n };\n}\n\nexport interface ICmsEntryOpenSearchBodyBuilder {\n build(params: ICmsEntryOpenSearchBodyBuilderParams): SearchBody;\n}\n\nexport const CmsEntryOpenSearchBodyBuilder = createAbstraction<ICmsEntryOpenSearchBodyBuilder>(\n \"Cms/Entry/OpenSearch/BodyBuilder\"\n);\n\nexport namespace CmsEntryOpenSearchBodyBuilder {\n export type Interface = ICmsEntryOpenSearchBodyBuilder;\n export type Params = ICmsEntryOpenSearchBodyBuilderParams;\n}\n"],"names":["CmsEntryOpenSearchBodyBuilder","createAbstraction"],"mappings":";AAwBO,MAAMA,gCAAgCC,kBACzC"}
@@ -34,7 +34,7 @@ class CmsEntryOpenSearchExecFilteringImpl {
34
34
  for(const key in where){
35
35
  const value = where[key];
36
36
  if (void 0 === value) continue;
37
- if ("AND" === key) {
37
+ else if ("AND" === key) {
38
38
  const childWhereList = getWhereValues(value, "AND");
39
39
  const childQuery = createBaseQuery();
40
40
  for (const childWhere of childWhereList)execFiltering({
@@ -48,8 +48,7 @@ class CmsEntryOpenSearchExecFilteringImpl {
48
48
  bool: childQueryBool
49
49
  });
50
50
  continue;
51
- }
52
- if ("OR" === key) {
51
+ } else if ("OR" === key) {
53
52
  const childWhereList = getWhereValues(value, "OR");
54
53
  const should = [];
55
54
  for (const childWhere of childWhereList){
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchExecFiltering/CmsEntryOpenSearchExecFiltering.js","sources":["../../../src/features/CmsEntryOpenSearchExecFiltering/CmsEntryOpenSearchExecFiltering.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { CmsEntryListWhere } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { QueryDslQueryContainer as Query } from \"@webiny/api-opensearch/types.js\";\nimport { parseWhereKey } from \"@webiny/api-opensearch\";\nimport { createBaseQuery } from \"~/operations/entry/elasticsearch/initialQuery.js\";\nimport { assignMinimumShouldMatchToQuery } from \"~/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js\";\nimport { CmsEntryOpenSearchFilterRegistry } from \"~/features/CmsEntryOpenSearchFilter/index.js\";\nimport { CmsEntryOpenSearchOperatorList } from \"~/features/CmsEntryOpenSearchOperatorList/index.js\";\nimport { CmsEntryOpenSearchValueTransformer } from \"~/features/CmsEntryOpenSearchValueTransformer/index.js\";\nimport { CmsEntryOpenSearchFieldPathFactory } from \"~/features/CmsEntryOpenSearchFieldPathFactory/index.js\";\nimport { CmsEntryOpenSearchExecFiltering as CmsEntryOpenSearchExecFilteringAbstraction } from \"./abstractions.js\";\nimport { getWhereValues } from \"./values.js\";\nimport { getPopulated } from \"./populated.js\";\nimport { createApplyFiltering } from \"./applyFiltering.js\";\n\ninterface InternalExecParams {\n where: CmsEntryListWhere;\n query: CmsEntryOpenSearchExecFilteringAbstraction.Params[\"query\"];\n isValues?: boolean;\n}\n\nclass CmsEntryOpenSearchExecFilteringImpl\n implements CmsEntryOpenSearchExecFilteringAbstraction.Interface\n{\n public constructor(\n private readonly operatorList: CmsEntryOpenSearchOperatorList.Interface,\n private readonly valueTransformer: CmsEntryOpenSearchValueTransformer.Interface,\n private readonly fieldPathFactory: CmsEntryOpenSearchFieldPathFactory.Interface,\n private readonly filterRegistry: CmsEntryOpenSearchFilterRegistry.Interface\n ) {}\n\n public execute(params: CmsEntryOpenSearchExecFilteringAbstraction.Params): void {\n const { model, fields, where, query } = params;\n\n const operators = this.operatorList.getAll();\n\n const applyFiltering = createApplyFiltering({\n operators,\n valueTransformer: this.valueTransformer,\n fieldPathFactory: this.fieldPathFactory\n });\n\n const getFilter = (type: string) => {\n return this.filterRegistry.get(type);\n };\n\n const execFiltering = (params: InternalExecParams) => {\n const { where: initialWhere, query, isValues = false } = params;\n const keys = Object.keys(initialWhere);\n if (keys.length === 0) {\n return;\n }\n const where = structuredClone(initialWhere);\n\n for (const key in where) {\n const value = where[key as keyof typeof where];\n if (value === undefined) {\n continue;\n } else if (key === \"AND\") {\n const childWhereList = getWhereValues(value, \"AND\");\n const childQuery = createBaseQuery();\n for (const childWhere of childWhereList) {\n execFiltering({ query: childQuery, where: childWhere, isValues });\n }\n const childQueryBool = getPopulated(childQuery);\n if (Object.keys(childQueryBool).length === 0) {\n continue;\n }\n query.filter.push({ bool: childQueryBool });\n continue;\n } else if (key === \"OR\") {\n const childWhereList = getWhereValues(value, \"OR\");\n const should: Query[] = [];\n for (const childWhere of childWhereList) {\n const childQuery = createBaseQuery();\n execFiltering({ query: childQuery, where: childWhere, isValues });\n const childQueryBool = getPopulated(childQuery);\n if (Object.keys(childQueryBool).length === 0) {\n continue;\n }\n should.push({ bool: childQueryBool });\n }\n if (should.length === 0) {\n continue;\n }\n query.should.push(...should);\n assignMinimumShouldMatchToQuery({ query });\n continue;\n } else if (key === \"values\") {\n execFiltering({\n query,\n where: where[key] as CmsEntryListWhere,\n isValues: true\n });\n continue;\n }\n const { field: whereFieldId, operator } = parseWhereKey(key);\n let fieldId: string = isValues ? `values.${whereFieldId}` : whereFieldId;\n\n const cmsModelField = model.fields.find(f => f.fieldId === fieldId);\n if (!cmsModelField && !fields[fieldId]) {\n throw new WebinyError(`There is no CMS Model Field \"${fieldId}\".`);\n } else if (cmsModelField) {\n fieldId = cmsModelField.fieldId;\n }\n\n const field = fields[fieldId];\n if (!field) {\n throw new WebinyError(\n `There is no field \"${fieldId}\".`,\n \"EXEC_FILTERING_ERROR\"\n );\n }\n const filter = getFilter(field.type);\n\n filter.exec({\n applyFiltering,\n getFilter,\n key,\n value,\n operator,\n field,\n fields,\n query\n });\n }\n };\n\n execFiltering({ where, query });\n }\n}\n\nexport const CmsEntryOpenSearchExecFiltering =\n CmsEntryOpenSearchExecFilteringAbstraction.createImplementation({\n implementation: CmsEntryOpenSearchExecFilteringImpl,\n dependencies: [\n CmsEntryOpenSearchOperatorList,\n CmsEntryOpenSearchValueTransformer,\n CmsEntryOpenSearchFieldPathFactory,\n CmsEntryOpenSearchFilterRegistry\n ]\n });\n"],"names":["CmsEntryOpenSearchExecFilteringImpl","operatorList","valueTransformer","fieldPathFactory","filterRegistry","params","model","fields","where","query","operators","applyFiltering","createApplyFiltering","getFilter","type","execFiltering","initialWhere","isValues","keys","Object","structuredClone","key","value","undefined","childWhereList","getWhereValues","childQuery","createBaseQuery","childWhere","childQueryBool","getPopulated","should","assignMinimumShouldMatchToQuery","whereFieldId","operator","parseWhereKey","fieldId","cmsModelField","f","WebinyError","field","filter","CmsEntryOpenSearchExecFiltering","CmsEntryOpenSearchExecFilteringAbstraction","CmsEntryOpenSearchOperatorList","CmsEntryOpenSearchValueTransformer","CmsEntryOpenSearchFieldPathFactory","CmsEntryOpenSearchFilterRegistry"],"mappings":";;;;;;;;;;;;AAqBA,MAAMA;IAGF,YACqBC,YAAsD,EACtDC,gBAA8D,EAC9DC,gBAA8D,EAC9DC,cAA0D,CAC7E;aAJmBH,YAAY,GAAZA;aACAC,gBAAgB,GAAhBA;aACAC,gBAAgB,GAAhBA;aACAC,cAAc,GAAdA;IAClB;IAEI,QAAQC,MAAyD,EAAQ;QAC5E,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGJ;QAExC,MAAMK,YAAY,IAAI,CAAC,YAAY,CAAC,MAAM;QAE1C,MAAMC,iBAAiBC,qBAAqB;YACxCF;YACA,kBAAkB,IAAI,CAAC,gBAAgB;YACvC,kBAAkB,IAAI,CAAC,gBAAgB;QAC3C;QAEA,MAAMG,YAAY,CAACC,OACR,IAAI,CAAC,cAAc,CAAC,GAAG,CAACA;QAGnC,MAAMC,gBAAgB,CAACV;YACnB,MAAM,EAAE,OAAOW,YAAY,EAAEP,KAAK,EAAEQ,WAAW,KAAK,EAAE,GAAGZ;YACzD,MAAMa,OAAOC,OAAO,IAAI,C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,cAAcd;gBACxD,IAAIe,UAAkBnB,WAAW,CAAC,OAAO,EAAEgB,cAAc,GAAGA;gBAE5D,MAAMI,gBAAgB/B,MAAM,MAAM,CAAC,IAAI,CAACgC,CAAAA,IAAKA,EAAE,OAAO,KAAKF;gBAC3D,IAAI,AAACC,iBAAkB9B,MAAM,CAAC6B,QAAQ,EAE/B;oBAAA,IAAIC,eACPD,UAAUC,cAAc,OAAO;gBACnC,OAHI,MAAM,IAAIE,MAAY,CAAC,6BAA6B,EAAEH,QAAQ,EAAE,CAAC;gBAKrE,MAAMI,QAAQjC,MAAM,CAAC6B,QAAQ;gBAC7B,IAAI,CAACI,OACD,MAAM,IAAID,MACN,CAAC,mBAAmB,EAAEH,QAAQ,EAAE,CAAC,EACjC;gBAGR,MAAMK,SAAS5B,UAAU2B,MAAM,IAAI;gBAEnCC,OAAO,IAAI,CAAC;oBACR9B;oBACAE;oBACAQ;oBACAC;oBACAY;oBACAM;oBACAjC;oBACAE;gBACJ;YACJ;QACJ;QAEAM,cAAc;YAAEP;YAAOC;QAAM;IACjC;AACJ;AAEO,MAAMiC,kEACTC,gCAAAA,oBAA+D,CAAC;IAC5D,gBAAgB3C;IAChB,cAAc;QACV4C;QACAC;QACAC;QACAC;KACH;AACL"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchExecFiltering/CmsEntryOpenSearchExecFiltering.js","sources":["../../../src/features/CmsEntryOpenSearchExecFiltering/CmsEntryOpenSearchExecFiltering.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { CmsEntryListWhere } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { QueryDslQueryContainer as Query } from \"@webiny/api-opensearch/types.js\";\nimport { parseWhereKey } from \"@webiny/api-opensearch\";\nimport { createBaseQuery } from \"~/operations/entry/elasticsearch/initialQuery.js\";\nimport { assignMinimumShouldMatchToQuery } from \"~/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js\";\nimport { CmsEntryOpenSearchFilterRegistry } from \"~/features/CmsEntryOpenSearchFilter/index.js\";\nimport { CmsEntryOpenSearchOperatorList } from \"~/features/CmsEntryOpenSearchOperatorList/index.js\";\nimport { CmsEntryOpenSearchValueTransformer } from \"~/features/CmsEntryOpenSearchValueTransformer/index.js\";\nimport { CmsEntryOpenSearchFieldPathFactory } from \"~/features/CmsEntryOpenSearchFieldPathFactory/index.js\";\nimport { CmsEntryOpenSearchExecFiltering as CmsEntryOpenSearchExecFilteringAbstraction } from \"./abstractions.js\";\nimport { getWhereValues } from \"./values.js\";\nimport { getPopulated } from \"./populated.js\";\nimport { createApplyFiltering } from \"./applyFiltering.js\";\n\ninterface InternalExecParams {\n where: CmsEntryListWhere;\n query: CmsEntryOpenSearchExecFilteringAbstraction.Params[\"query\"];\n isValues?: boolean;\n}\n\nclass CmsEntryOpenSearchExecFilteringImpl\n implements CmsEntryOpenSearchExecFilteringAbstraction.Interface\n{\n public constructor(\n private readonly operatorList: CmsEntryOpenSearchOperatorList.Interface,\n private readonly valueTransformer: CmsEntryOpenSearchValueTransformer.Interface,\n private readonly fieldPathFactory: CmsEntryOpenSearchFieldPathFactory.Interface,\n private readonly filterRegistry: CmsEntryOpenSearchFilterRegistry.Interface\n ) {}\n\n public execute(params: CmsEntryOpenSearchExecFilteringAbstraction.Params): void {\n const { model, fields, where, query } = params;\n\n const operators = this.operatorList.getAll();\n\n const applyFiltering = createApplyFiltering({\n operators,\n valueTransformer: this.valueTransformer,\n fieldPathFactory: this.fieldPathFactory\n });\n\n const getFilter = (type: string) => {\n return this.filterRegistry.get(type);\n };\n\n const execFiltering = (params: InternalExecParams) => {\n const { where: initialWhere, query, isValues = false } = params;\n const keys = Object.keys(initialWhere);\n if (keys.length === 0) {\n return;\n }\n const where = structuredClone(initialWhere);\n\n for (const key in where) {\n const value = where[key as keyof typeof where];\n if (value === undefined) {\n continue;\n } else if (key === \"AND\") {\n const childWhereList = getWhereValues(value, \"AND\");\n const childQuery = createBaseQuery();\n for (const childWhere of childWhereList) {\n execFiltering({ query: childQuery, where: childWhere, isValues });\n }\n const childQueryBool = getPopulated(childQuery);\n if (Object.keys(childQueryBool).length === 0) {\n continue;\n }\n query.filter.push({ bool: childQueryBool });\n continue;\n } else if (key === \"OR\") {\n const childWhereList = getWhereValues(value, \"OR\");\n const should: Query[] = [];\n for (const childWhere of childWhereList) {\n const childQuery = createBaseQuery();\n execFiltering({ query: childQuery, where: childWhere, isValues });\n const childQueryBool = getPopulated(childQuery);\n if (Object.keys(childQueryBool).length === 0) {\n continue;\n }\n should.push({ bool: childQueryBool });\n }\n if (should.length === 0) {\n continue;\n }\n query.should.push(...should);\n assignMinimumShouldMatchToQuery({ query });\n continue;\n } else if (key === \"values\") {\n execFiltering({\n query,\n where: where[key] as CmsEntryListWhere,\n isValues: true\n });\n continue;\n }\n const { field: whereFieldId, operator } = parseWhereKey(key);\n let fieldId: string = isValues ? `values.${whereFieldId}` : whereFieldId;\n\n const cmsModelField = model.fields.find(f => f.fieldId === fieldId);\n if (!cmsModelField && !fields[fieldId]) {\n throw new WebinyError(`There is no CMS Model Field \"${fieldId}\".`);\n } else if (cmsModelField) {\n fieldId = cmsModelField.fieldId;\n }\n\n const field = fields[fieldId];\n if (!field) {\n throw new WebinyError(\n `There is no field \"${fieldId}\".`,\n \"EXEC_FILTERING_ERROR\"\n );\n }\n const filter = getFilter(field.type);\n\n filter.exec({\n applyFiltering,\n getFilter,\n key,\n value,\n operator,\n field,\n fields,\n query\n });\n }\n };\n\n execFiltering({ where, query });\n }\n}\n\nexport const CmsEntryOpenSearchExecFiltering =\n CmsEntryOpenSearchExecFilteringAbstraction.createImplementation({\n implementation: CmsEntryOpenSearchExecFilteringImpl,\n dependencies: [\n CmsEntryOpenSearchOperatorList,\n CmsEntryOpenSearchValueTransformer,\n CmsEntryOpenSearchFieldPathFactory,\n CmsEntryOpenSearchFilterRegistry\n ]\n });\n"],"names":["CmsEntryOpenSearchExecFilteringImpl","operatorList","valueTransformer","fieldPathFactory","filterRegistry","params","model","fields","where","query","operators","applyFiltering","createApplyFiltering","getFilter","type","execFiltering","initialWhere","isValues","keys","Object","structuredClone","key","value","undefined","childWhereList","getWhereValues","childQuery","createBaseQuery","childWhere","childQueryBool","getPopulated","should","assignMinimumShouldMatchToQuery","whereFieldId","operator","parseWhereKey","fieldId","cmsModelField","f","WebinyError","field","filter","CmsEntryOpenSearchExecFiltering","CmsEntryOpenSearchExecFilteringAbstraction","CmsEntryOpenSearchOperatorList","CmsEntryOpenSearchValueTransformer","CmsEntryOpenSearchFieldPathFactory","CmsEntryOpenSearchFilterRegistry"],"mappings":";;;;;;;;;;;;AAqBA,MAAMA;IAGF,YACqBC,YAAsD,EACtDC,gBAA8D,EAC9DC,gBAA8D,EAC9DC,cAA0D,CAC7E;aAJmBH,YAAY,GAAZA;aACAC,gBAAgB,GAAhBA;aACAC,gBAAgB,GAAhBA;aACAC,cAAc,GAAdA;IAClB;IAEI,QAAQC,MAAyD,EAAQ;QAC5E,MAAM,EAAEC,KAAK,EAAEC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGJ;QAExC,MAAMK,YAAY,IAAI,CAAC,YAAY,CAAC,MAAM;QAE1C,MAAMC,iBAAiBC,qBAAqB;YACxCF;YACA,kBAAkB,IAAI,CAAC,gBAAgB;YACvC,kBAAkB,IAAI,CAAC,gBAAgB;QAC3C;QAEA,MAAMG,YAAY,CAACC,OACR,IAAI,CAAC,cAAc,CAAC,GAAG,CAACA;QAGnC,MAAMC,gBAAgB,CAACV;YACnB,MAAM,EAAE,OAAOW,YAAY,EAAEP,KAAK,EAAEQ,WAAW,KAAK,EAAE,GAAGZ;YACzD,MAAMa,OAAOC,OAAO,IAAI,CAACH;YACzB,IAAIE,AAAgB,MAAhBA,KAAK,MAAM,EACX;YAEJ,MAAMV,QAAQY,gBAAgBJ;YAE9B,IAAK,MAAMK,OAAOb,MAAO;gBACrB,MAAMc,QAAQd,KAAK,CAACa,IAA0B;gBAC9C,IAAIC,AAAUC,WAAVD,OACA;qBACG,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,CAAC6B,QAAQ,EAE/B;oBAAA,IAAIC,eACPD,UAAUC,cAAc,OAAO;gBACnC,OAHI,MAAM,IAAIE,MAAY,CAAC,6BAA6B,EAAEH,QAAQ,EAAE,CAAC;gBAKrE,MAAMI,QAAQjC,MAAM,CAAC6B,QAAQ;gBAC7B,IAAI,CAACI,OACD,MAAM,IAAID,MACN,CAAC,mBAAmB,EAAEH,QAAQ,EAAE,CAAC,EACjC;gBAGR,MAAMK,SAAS5B,UAAU2B,MAAM,IAAI;gBAEnCC,OAAO,IAAI,CAAC;oBACR9B;oBACAE;oBACAQ;oBACAC;oBACAY;oBACAM;oBACAjC;oBACAE;gBACJ;YACJ;QACJ;QAEAM,cAAc;YAAEP;YAAOC;QAAM;IACjC;AACJ;AAEO,MAAMiC,kEACTC,gCAAAA,oBAA+D,CAAC;IAC5D,gBAAgB3C;IAChB,cAAc;QACV4C;QACAC;QACAC;QACAC;KACH;AACL"}
@@ -12,16 +12,16 @@ import { TextEncryptedFieldIndex } from "./fields/TextEncryptedFieldIndex.js";
12
12
  const CmsEntryOpenSearchFieldIndexFeature = createFeature({
13
13
  name: "Cms/Entry/OpenSearch/FieldIndexFeature",
14
14
  register: (container)=>{
15
- container.register(RichTextFieldIndex).inSingletonScope();
16
- container.register(JsonFieldIndex).inSingletonScope();
17
- container.register(LongTextFieldIndex).inSingletonScope();
18
- container.register(NumberFieldIndex).inSingletonScope();
19
- container.register(DefaultFieldIndex).inSingletonScope();
20
- container.register(DateTimeFieldIndex).inSingletonScope();
21
- container.register(ObjectFieldIndex).inSingletonScope();
22
- container.register(TextCompressedFieldIndex).inSingletonScope();
23
- container.register(TextEncryptedFieldIndex).inSingletonScope();
24
- container.register(CmsEntryOpenSearchFieldIndexRegistry).inSingletonScope();
15
+ container.register(RichTextFieldIndex).inContainerScope();
16
+ container.register(JsonFieldIndex).inContainerScope();
17
+ container.register(LongTextFieldIndex).inContainerScope();
18
+ container.register(NumberFieldIndex).inContainerScope();
19
+ container.register(DefaultFieldIndex).inContainerScope();
20
+ container.register(DateTimeFieldIndex).inContainerScope();
21
+ container.register(ObjectFieldIndex).inContainerScope();
22
+ container.register(TextCompressedFieldIndex).inContainerScope();
23
+ container.register(TextEncryptedFieldIndex).inContainerScope();
24
+ container.register(CmsEntryOpenSearchFieldIndexRegistry).inContainerScope();
25
25
  }
26
26
  });
27
27
  export { CmsEntryOpenSearchFieldIndexFeature };
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/feature.js","sources":["../../../src/features/CmsEntryOpenSearchFieldIndex/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CmsEntryOpenSearchFieldIndexRegistry } from \"./CmsEntryOpenSearchFieldIndexRegistry.js\";\nimport { RichTextFieldIndex } from \"./fields/RichTextFieldIndex.js\";\nimport { JsonFieldIndex } from \"./fields/JsonFieldIndex.js\";\nimport { LongTextFieldIndex } from \"./fields/LongTextFieldIndex.js\";\nimport { NumberFieldIndex } from \"./fields/NumberFieldIndex.js\";\nimport { DefaultFieldIndex } from \"./fields/DefaultFieldIndex.js\";\nimport { DateTimeFieldIndex } from \"./fields/DateTimeFieldIndex.js\";\nimport { ObjectFieldIndex } from \"./fields/ObjectFieldIndex.js\";\nimport { TextCompressedFieldIndex } from \"./fields/TextCompressedFieldIndex.js\";\nimport { TextEncryptedFieldIndex } from \"./fields/TextEncryptedFieldIndex.js\";\n\nexport const CmsEntryOpenSearchFieldIndexFeature = createFeature({\n name: \"Cms/Entry/OpenSearch/FieldIndexFeature\",\n register: container => {\n container.register(RichTextFieldIndex).inSingletonScope();\n container.register(JsonFieldIndex).inSingletonScope();\n container.register(LongTextFieldIndex).inSingletonScope();\n container.register(NumberFieldIndex).inSingletonScope();\n container.register(DefaultFieldIndex).inSingletonScope();\n container.register(DateTimeFieldIndex).inSingletonScope();\n container.register(ObjectFieldIndex).inSingletonScope();\n container.register(TextCompressedFieldIndex).inSingletonScope();\n container.register(TextEncryptedFieldIndex).inSingletonScope();\n\n // must be registered last\n container.register(CmsEntryOpenSearchFieldIndexRegistry).inSingletonScope();\n }\n});\n"],"names":["CmsEntryOpenSearchFieldIndexFeature","createFeature","container","RichTextFieldIndex","JsonFieldIndex","LongTextFieldIndex","NumberFieldIndex","DefaultFieldIndex","DateTimeFieldIndex","ObjectFieldIndex","TextCompressedFieldIndex","TextEncryptedFieldIndex","CmsEntryOpenSearchFieldIndexRegistry"],"mappings":";;;;;;;;;;;AAYO,MAAMA,sCAAsCC,cAAc;IAC7D,MAAM;IACN,UAAUC,CAAAA;QACNA,UAAU,QAAQ,CAACC,oBAAoB,gBAAgB;QACvDD,UAAU,QAAQ,CAACE,gBAAgB,gBAAgB;QACnDF,UAAU,QAAQ,CAACG,oBAAoB,gBAAgB;QACvDH,UAAU,QAAQ,CAACI,kBAAkB,gBAAgB;QACrDJ,UAAU,QAAQ,CAACK,mBAAmB,gBAAgB;QACtDL,UAAU,QAAQ,CAACM,oBAAoB,gBAAgB;QACvDN,UAAU,QAAQ,CAACO,kBAAkB,gBAAgB;QACrDP,UAAU,QAAQ,CAACQ,0BAA0B,gBAAgB;QAC7DR,UAAU,QAAQ,CAACS,yBAAyB,gBAAgB;QAG5DT,UAAU,QAAQ,CAACU,sCAAsC,gBAAgB;IAC7E;AACJ"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/feature.js","sources":["../../../src/features/CmsEntryOpenSearchFieldIndex/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { CmsEntryOpenSearchFieldIndexRegistry } from \"./CmsEntryOpenSearchFieldIndexRegistry.js\";\nimport { RichTextFieldIndex } from \"./fields/RichTextFieldIndex.js\";\nimport { JsonFieldIndex } from \"./fields/JsonFieldIndex.js\";\nimport { LongTextFieldIndex } from \"./fields/LongTextFieldIndex.js\";\nimport { NumberFieldIndex } from \"./fields/NumberFieldIndex.js\";\nimport { DefaultFieldIndex } from \"./fields/DefaultFieldIndex.js\";\nimport { DateTimeFieldIndex } from \"./fields/DateTimeFieldIndex.js\";\nimport { ObjectFieldIndex } from \"./fields/ObjectFieldIndex.js\";\nimport { TextCompressedFieldIndex } from \"./fields/TextCompressedFieldIndex.js\";\nimport { TextEncryptedFieldIndex } from \"./fields/TextEncryptedFieldIndex.js\";\n\nexport const CmsEntryOpenSearchFieldIndexFeature = createFeature({\n name: \"Cms/Entry/OpenSearch/FieldIndexFeature\",\n register: container => {\n // Container scoped, so registering the feature once in the root still builds these per request:\n // several field indexes depend on the per-request CmsModelFieldToGraphQLRegistry, and the\n // registry collects field indexes that extensions register per request.\n container.register(RichTextFieldIndex).inContainerScope();\n container.register(JsonFieldIndex).inContainerScope();\n container.register(LongTextFieldIndex).inContainerScope();\n container.register(NumberFieldIndex).inContainerScope();\n container.register(DefaultFieldIndex).inContainerScope();\n container.register(DateTimeFieldIndex).inContainerScope();\n container.register(ObjectFieldIndex).inContainerScope();\n container.register(TextCompressedFieldIndex).inContainerScope();\n container.register(TextEncryptedFieldIndex).inContainerScope();\n\n // must be registered last\n container.register(CmsEntryOpenSearchFieldIndexRegistry).inContainerScope();\n }\n});\n"],"names":["CmsEntryOpenSearchFieldIndexFeature","createFeature","container","RichTextFieldIndex","JsonFieldIndex","LongTextFieldIndex","NumberFieldIndex","DefaultFieldIndex","DateTimeFieldIndex","ObjectFieldIndex","TextCompressedFieldIndex","TextEncryptedFieldIndex","CmsEntryOpenSearchFieldIndexRegistry"],"mappings":";;;;;;;;;;;AAYO,MAAMA,sCAAsCC,cAAc;IAC7D,MAAM;IACN,UAAUC,CAAAA;QAINA,UAAU,QAAQ,CAACC,oBAAoB,gBAAgB;QACvDD,UAAU,QAAQ,CAACE,gBAAgB,gBAAgB;QACnDF,UAAU,QAAQ,CAACG,oBAAoB,gBAAgB;QACvDH,UAAU,QAAQ,CAACI,kBAAkB,gBAAgB;QACrDJ,UAAU,QAAQ,CAACK,mBAAmB,gBAAgB;QACtDL,UAAU,QAAQ,CAACM,oBAAoB,gBAAgB;QACvDN,UAAU,QAAQ,CAACO,kBAAkB,gBAAgB;QACrDP,UAAU,QAAQ,CAACQ,0BAA0B,gBAAgB;QAC7DR,UAAU,QAAQ,CAACS,yBAAyB,gBAAgB;QAG5DT,UAAU,QAAQ,CAACU,sCAAsC,gBAAgB;IAC7E;AACJ"}
@@ -17,15 +17,15 @@ const convertNumberToTime = (value)=>{
17
17
  };
18
18
  const convertValueToIndex = (value, field)=>{
19
19
  if (!value) return null;
20
- if (field.settings?.type === "time") return convertTimeToNumber(value);
20
+ else if (field.settings?.type === "time") return convertTimeToNumber(value);
21
21
  return value;
22
22
  };
23
23
  const convertValueFromIndex = (value, field)=>{
24
24
  const type = field.settings?.type;
25
25
  if ("time" === type) return convertNumberToTime(value);
26
- if (!value) return null;
27
- if ("dateTimeWithTimezone" === type) return value;
28
- if ("date" === type) {
26
+ else if (!value) return null;
27
+ else if ("dateTimeWithTimezone" === type) return value;
28
+ else if ("date" === type) {
29
29
  const dateValue = new Date(value);
30
30
  return dateValue.toISOString().slice(0, 10);
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.ts"],"sourcesContent":["import type { CmsModelDateTimeField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\n\nconst convertTimeToNumber = (time?: string): number | null => {\n if (!time) {\n return null;\n }\n const [hours, minutes, seconds = 0] = time.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nconst convertNumberToTime = (value?: number): string | null => {\n if (value === undefined || value === null) {\n return null;\n }\n\n const hours = Math.floor(value / 60 / 60);\n const minutes = Math.floor((value - hours * 60 * 60) / 60);\n const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);\n\n return [hours, minutes, seconds].map(v => String(v).padStart(2, \"0\")).join(\":\");\n};\n\nconst convertValueToIndex = (value: string, field: CmsModelDateTimeField) => {\n if (!value) {\n return null;\n } else if (field.settings?.type === \"time\") {\n return convertTimeToNumber(value);\n }\n return value;\n};\n\nconst convertValueFromIndex = (\n value: string | number,\n field: CmsModelDateTimeField\n): string | null => {\n const type = field.settings?.type;\n if (type === \"time\") {\n return convertNumberToTime(value as number);\n } else if (!value) {\n return null;\n } else if (type === \"dateTimeWithTimezone\") {\n return value as string;\n } else if (type === \"date\") {\n const dateValue = new Date(value);\n return dateValue.toISOString().slice(0, 10);\n }\n return new Date(value).toISOString();\n};\n\nclass DateTimeFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = \"datetime\";\n\n public unmappedType(): string {\n return \"date\";\n }\n\n public toIndex({\n field,\n value\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n if (Array.isArray(value) === true) {\n return {\n value: value.map((v: string) => {\n return convertValueToIndex(v, field as CmsModelDateTimeField);\n })\n };\n }\n return {\n value: convertValueToIndex(value, field as CmsModelDateTimeField)\n };\n }\n\n public fromIndex({ field, value }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n if (Array.isArray(value) === true) {\n return value.map((v: string) => {\n return convertValueFromIndex(v, field as CmsModelDateTimeField);\n });\n }\n return convertValueFromIndex(value, field as CmsModelDateTimeField);\n }\n}\n\nexport const DateTimeFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: DateTimeFieldIndexImpl,\n dependencies: []\n});\n"],"names":["convertTimeToNumber","time","hours","minutes","seconds","Number","convertNumberToTime","value","Math","v","String","convertValueToIndex","field","convertValueFromIndex","type","dateValue","Date","DateTimeFieldIndexImpl","Array","DateTimeFieldIndex","CmsEntryOpenSearchFieldIndex"],"mappings":";AAGA,MAAMA,sBAAsB,CAACC;IACzB,IAAI,CAACA,MACD,OAAO;IAEX,MAAM,CAACC,OAAOC,SAASC,UAAU,CAAC,C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oBAAoBF,GAAGG;QAEtC;QAEJ,OAAO;YACH,OAAOD,oBAAoBJ,OAAOK;QACtC;IACJ;IAEO,UAAU,EAAEA,KAAK,EAAEL,KAAK,EAA0C,EAAO;QAC5E,IAAIW,AAAyB,SAAzBA,MAAM,OAAO,CAACX,QACd,OAAOA,MAAM,GAAG,CAAC,CAACE,IACPI,sBAAsBJ,GAAGG;QAGxC,OAAOC,sBAAsBN,OAAOK;IACxC;;aA7BgB,SAAS,GAAG;;AA8BhC;AAEO,MAAMO,qBAAqBC,6BAA6B,oBAAoB,CAAC;IAChF,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.ts"],"sourcesContent":["import type { CmsModelDateTimeField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\n\nconst convertTimeToNumber = (time?: string): number | null => {\n if (!time) {\n return null;\n }\n const [hours, minutes, seconds = 0] = time.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nconst convertNumberToTime = (value?: number): string | null => {\n if (value === undefined || value === null) {\n return null;\n }\n\n const hours = Math.floor(value / 60 / 60);\n const minutes = Math.floor((value - hours * 60 * 60) / 60);\n const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);\n\n return [hours, minutes, seconds].map(v => String(v).padStart(2, \"0\")).join(\":\");\n};\n\nconst convertValueToIndex = (value: string, field: CmsModelDateTimeField) => {\n if (!value) {\n return null;\n } else if (field.settings?.type === \"time\") {\n return convertTimeToNumber(value);\n }\n return value;\n};\n\nconst convertValueFromIndex = (\n value: string | number,\n field: CmsModelDateTimeField\n): string | null => {\n const type = field.settings?.type;\n if (type === \"time\") {\n return convertNumberToTime(value as number);\n } else if (!value) {\n return null;\n } else if (type === \"dateTimeWithTimezone\") {\n return value as string;\n } else if (type === \"date\") {\n const dateValue = new Date(value);\n return dateValue.toISOString().slice(0, 10);\n }\n return new Date(value).toISOString();\n};\n\nclass DateTimeFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = \"datetime\";\n\n public unmappedType(): string {\n return \"date\";\n }\n\n public toIndex({\n field,\n value\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n if (Array.isArray(value) === true) {\n return {\n value: value.map((v: string) => {\n return convertValueToIndex(v, field as CmsModelDateTimeField);\n })\n };\n }\n return {\n value: convertValueToIndex(value, field as CmsModelDateTimeField)\n };\n }\n\n public fromIndex({ field, value }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n if (Array.isArray(value) === true) {\n return value.map((v: string) => {\n return convertValueFromIndex(v, field as CmsModelDateTimeField);\n });\n }\n return convertValueFromIndex(value, field as CmsModelDateTimeField);\n }\n}\n\nexport const DateTimeFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: DateTimeFieldIndexImpl,\n dependencies: []\n});\n"],"names":["convertTimeToNumber","time","hours","minutes","seconds","Number","convertNumberToTime","value","Math","v","String","convertValueToIndex","field","convertValueFromIndex","type","dateValue","Date","DateTimeFieldIndexImpl","Array","DateTimeFieldIndex","CmsEntryOpenSearchFieldIndex"],"mappings":";AAGA,MAAMA,sBAAsB,CAACC;IACzB,IAAI,CAACA,MACD,OAAO;IAEX,MAAM,CAACC,OAAOC,SAASC,UAAU,CAAC,CAAC,GAAGH,KAAK,KAAK,CAAC,KAAK,GAAG,CAACI;IAC1D,OAAOH,AAAQ,KAARA,QAAa,KAAKC,AAAU,KAAVA,UAAeC;AAC5C;AAEA,MAAME,sBAAsB,CAACC;IACzB,IAAIA,QAAAA,OACA,OAAO;IAGX,MAAML,QAAQM,KAAK,KAAK,CAACD,QAAQ,KAAK;IACtC,MAAMJ,UAAUK,KAAK,KAAK,CAAED,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AAOK;IACxC;;aA7BgB,SAAS,GAAG;;AA8BhC;AAEO,MAAMO,qBAAqBC,6BAA6B,oBAAoB,CAAC;IAChF,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}
@@ -19,6 +19,10 @@ class ObjectFieldIndexImpl {
19
19
  model,
20
20
  fields
21
21
  });
22
+ if (initialValue[key]?._id) {
23
+ value._id = initialValue[key]._id;
24
+ rawValue._id = initialValue[key]._id;
25
+ }
22
26
  result.value.push(value);
23
27
  result.rawValue.push(rawValue);
24
28
  }
@@ -40,13 +44,18 @@ class ObjectFieldIndexImpl {
40
44
  const fields = field.settings?.fields || [];
41
45
  if (field.list) {
42
46
  const source = value || rawValue || [];
43
- return source.map((_, index)=>this.processFromIndex({
47
+ return source.map((_, index)=>{
48
+ const processed = this.processFromIndex({
44
49
  value: value ? value[index] || {} : {},
45
50
  rawValue: rawValue ? rawValue[index] || {} : {},
46
51
  getFieldIndex,
47
52
  model,
48
53
  fields
49
- }));
54
+ });
55
+ const sourceItem = value ? value[index] : rawValue ? rawValue[index] : null;
56
+ if (sourceItem?._id) processed._id = sourceItem._id;
57
+ return processed;
58
+ });
50
59
  }
51
60
  return this.processFromIndex({
52
61
  value,
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.ts"],"sourcesContent":["import type { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { getFieldIdentifiers } from \"~/helpers/index.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\n\ninterface ProcessToIndexParams {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue: Record<string, any>;\n getFieldIndex: (fieldType: string) => CmsEntryOpenSearchFieldIndex.Interface;\n model: CmsModel;\n}\n\ninterface ReducerValue {\n value: Record<string, any>;\n rawValue: Record<string, any>;\n}\n\ninterface ProcessFromIndexParams {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue?: Record<string, any> | null;\n getFieldIndex: (fieldType: string) => CmsEntryOpenSearchFieldIndex.Interface;\n model: CmsModel;\n}\n\nclass ObjectFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = \"object\";\n\n public toIndex({\n model,\n field,\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndex\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n if (!initialValue) {\n return { value: null };\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.list) {\n const result: { value: Record<string, any>[]; rawValue: Record<string, any>[] } = {\n value: [],\n rawValue: []\n };\n for (const key in initialValue) {\n const { value, rawValue } = this.processToIndex({\n value: initialValue[key],\n rawValue: initialRawValue[key],\n getFieldIndex,\n model,\n fields\n });\n\n result.value.push(value);\n result.rawValue.push(rawValue);\n }\n\n return {\n value: result.value.length > 0 ? result.value : undefined,\n rawValue: result.rawValue.length > 0 ? result.rawValue : undefined\n };\n }\n\n return this.processToIndex({\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndex,\n model,\n fields\n });\n }\n\n public fromIndex({\n field,\n value,\n rawValue,\n model,\n getFieldIndex\n }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n if (!value) {\n return null;\n }\n\n const fields = field.settings?.fields || [];\n\n if (field.list) {\n const source = value || rawValue || [];\n\n return source.map((_: any, index: number) =>\n this.processFromIndex({\n value: value ? value[index] || {} : {},\n rawValue: rawValue ? rawValue[index] || {} : {},\n getFieldIndex,\n model,\n fields\n })\n );\n }\n\n return this.processFromIndex({\n value,\n rawValue,\n getFieldIndex,\n model,\n fields\n });\n }\n\n private processToIndex(params: ProcessToIndexParams): ReducerValue {\n const {\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndex,\n model\n } = params;\n\n return fields.reduce<ReducerValue>(\n (values, field) => {\n const plugin = getFieldIndex(field.type);\n\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const { value, rawValue } = plugin.toIndex({\n model,\n field,\n value: sourceValue[\n identifiers.valueIdentifier || identifiers.rawValueIdentifier\n ],\n rawValue:\n sourceRawValue[\n identifiers.rawValueIdentifier || identifiers.valueIdentifier\n ],\n getFieldIndex\n });\n\n if (value !== undefined) {\n values.value[identifiers.valueIdentifier || identifiers.rawValueIdentifier] =\n value;\n }\n if (rawValue !== undefined) {\n values.rawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] =\n rawValue;\n }\n\n return values;\n },\n { value: {}, rawValue: {} }\n );\n }\n\n private processFromIndex = (params: ProcessFromIndexParams): Record<string, any> => {\n const {\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndex,\n model\n } = params;\n\n return fields.reduce<Record<string, any>>((values, field) => {\n const plugin = getFieldIndex(field.type);\n\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const value = plugin.fromIndex({\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue\n ? sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier]\n : null,\n getFieldIndex\n });\n\n if (value !== undefined) {\n values[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n\n return values;\n }, {});\n };\n}\n\nexport const ObjectFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: ObjectFieldIndexImpl,\n dependencies: []\n});\n"],"names":["ObjectFieldIndexImpl","model","field","initialValue","initialRawValue","getFieldIndex","fields","result","key","value","rawValue","undefined","source","_","index","params","sourceValue","sourceRawValue","values","plugin","identifiers","getFieldIdentifiers","ObjectFieldIndex","CmsEntryOpenSearchFieldIndex"],"mappings":";;AAyBA,MAAMA;IAGK,QAAQ,EACXC,KAAK,EACLC,KAAK,EACL,OAAO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gBACrE,IAAI,CAACkB,aACD,OAAOF;gBAGX,MAAMT,QAAQU,OAAO,SAAS,CAAC;oBAC3BlB;oBACAC;oBACA,OAAOc,WAAW,CAACI,YAAY,eAAe,IAAIA,YAAY,kBAAkB,CAAC;oBACjF,UAAUH,iBACJA,cAAc,CAACG,YAAY,kBAAkB,IAAIA,YAAY,eAAe,CAAC,GAC7E;oBACNf;gBACJ;gBAEA,IAAII,AAAUE,WAAVF,OACAS,MAAM,CAACE,YAAY,eAAe,IAAIA,YAAY,kBAAkB,CAAC,GAAGX;gBAG5E,OAAOS;YACX,GAAG,CAAC;QACR;;AACJ;AAEO,MAAMI,mBAAmBC,6BAA6B,oBAAoB,CAAC;IAC9E,gBAAgBvB;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.ts"],"sourcesContent":["import type { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { getFieldIdentifiers } from \"~/helpers/index.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\n\ninterface ProcessToIndexParams {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue: Record<string, any>;\n getFieldIndex: (fieldType: string) => CmsEntryOpenSearchFieldIndex.Interface;\n model: CmsModel;\n}\n\ninterface ReducerValue {\n value: Record<string, any>;\n rawValue: Record<string, any>;\n}\n\ninterface ProcessFromIndexParams {\n fields: CmsModelField[];\n value: Record<string, any>;\n rawValue?: Record<string, any> | null;\n getFieldIndex: (fieldType: string) => CmsEntryOpenSearchFieldIndex.Interface;\n model: CmsModel;\n}\n\nclass ObjectFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = \"object\";\n\n public toIndex({\n model,\n field,\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndex\n }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue {\n if (!initialValue) {\n return { value: null };\n }\n\n const fields = (field.settings?.fields || []) as CmsModelField[];\n\n if (field.list) {\n const result: { value: Record<string, any>[]; rawValue: Record<string, any>[] } = {\n value: [],\n rawValue: []\n };\n for (const key in initialValue) {\n const { value, rawValue } = this.processToIndex({\n value: initialValue[key],\n rawValue: initialRawValue[key],\n getFieldIndex,\n model,\n fields\n });\n\n if (initialValue[key]?._id) {\n value._id = initialValue[key]._id;\n rawValue._id = initialValue[key]._id;\n }\n\n result.value.push(value);\n result.rawValue.push(rawValue);\n }\n\n return {\n value: result.value.length > 0 ? result.value : undefined,\n rawValue: result.rawValue.length > 0 ? result.rawValue : undefined\n };\n }\n\n return this.processToIndex({\n value: initialValue,\n rawValue: initialRawValue,\n getFieldIndex,\n model,\n fields\n });\n }\n\n public fromIndex({\n field,\n value,\n rawValue,\n model,\n getFieldIndex\n }: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n if (!value) {\n return null;\n }\n\n const fields = field.settings?.fields || [];\n\n if (field.list) {\n const source = value || rawValue || [];\n\n return source.map((_: any, index: number) => {\n const processed = this.processFromIndex({\n value: value ? value[index] || {} : {},\n rawValue: rawValue ? rawValue[index] || {} : {},\n getFieldIndex,\n model,\n fields\n });\n const sourceItem = value ? value[index] : rawValue ? rawValue[index] : null;\n if (sourceItem?._id) {\n processed._id = sourceItem._id;\n }\n return processed;\n });\n }\n\n return this.processFromIndex({\n value,\n rawValue,\n getFieldIndex,\n model,\n fields\n });\n }\n\n private processToIndex(params: ProcessToIndexParams): ReducerValue {\n const {\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndex,\n model\n } = params;\n\n return fields.reduce<ReducerValue>(\n (values, field) => {\n const plugin = getFieldIndex(field.type);\n\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const { value, rawValue } = plugin.toIndex({\n model,\n field,\n value: sourceValue[\n identifiers.valueIdentifier || identifiers.rawValueIdentifier\n ],\n rawValue:\n sourceRawValue[\n identifiers.rawValueIdentifier || identifiers.valueIdentifier\n ],\n getFieldIndex\n });\n\n if (value !== undefined) {\n values.value[identifiers.valueIdentifier || identifiers.rawValueIdentifier] =\n value;\n }\n if (rawValue !== undefined) {\n values.rawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier] =\n rawValue;\n }\n\n return values;\n },\n { value: {}, rawValue: {} }\n );\n }\n\n private processFromIndex = (params: ProcessFromIndexParams): Record<string, any> => {\n const {\n fields,\n value: sourceValue,\n rawValue: sourceRawValue,\n getFieldIndex,\n model\n } = params;\n\n return fields.reduce<Record<string, any>>((values, field) => {\n const plugin = getFieldIndex(field.type);\n\n const identifiers = getFieldIdentifiers(sourceValue, sourceRawValue, field);\n if (!identifiers) {\n return values;\n }\n\n const value = plugin.fromIndex({\n model,\n field,\n value: sourceValue[identifiers.valueIdentifier || identifiers.rawValueIdentifier],\n rawValue: sourceRawValue\n ? sourceRawValue[identifiers.rawValueIdentifier || identifiers.valueIdentifier]\n : null,\n getFieldIndex\n });\n\n if (value !== undefined) {\n values[identifiers.valueIdentifier || identifiers.rawValueIdentifier] = value;\n }\n\n return values;\n }, {});\n };\n}\n\nexport const ObjectFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: ObjectFieldIndexImpl,\n dependencies: []\n});\n"],"names":["ObjectFieldIndexImpl","model","field","initialValue","initialRawValue","getFieldIndex","fields","result","key","value","rawValue","undefined","source","_","index","processed","sourceItem","params","sourceValue","sourceRawValue","values","plugin","identifiers","getFieldIdentifiers","ObjectFieldIndex","CmsEntryOpenSearchFieldIndex"],"mappings":";;AAyBA,MAAMA;IAGK,QAAQ,EACXC,KAAK,EACLC,KAAK,EACL,OAAOC,YAAY,EACnB,UAAUC,eAAe,EACzBC,aAAa,EACsB,EAAwC;QAC3E,IAAI,CAACF,cACD,OAAO;YAAE,OAAO;QAAK;QAGzB,M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ACxB,MAAM,EACFX,MAAM,EACN,OAAOY,WAAW,EAClB,UAAUC,cAAc,EACxBd,aAAa,EACbJ,KAAK,EACR,GAAGgB;YAEJ,OAAOX,OAAO,MAAM,CAAsB,CAACc,QAAQlB;gBAC/C,MAAMmB,SAAShB,cAAcH,MAAM,IAAI;gBAEvC,MAAMoB,cAAcC,oBAAoBL,aAAaC,gBAAgBjB;gBACrE,IAAI,CAACoB,aACD,OAAOF;gBAGX,MAAMX,QAAQY,OAAO,SAAS,CAAC;oBAC3BpB;oBACAC;oBACA,OAAOgB,WAAW,CAACI,YAAY,eAAe,IAAIA,YAAY,kBAAkB,CAAC;oBACjF,UAAUH,iBACJA,cAAc,CAACG,YAAY,kBAAkB,IAAIA,YAAY,eAAe,CAAC,GAC7E;oBACNjB;gBACJ;gBAEA,IAAII,AAAUE,WAAVF,OACAW,MAAM,CAACE,YAAY,eAAe,IAAIA,YAAY,kBAAkB,CAAC,GAAGb;gBAG5E,OAAOW;YACX,GAAG,CAAC;QACR;;AACJ;AAEO,MAAMI,mBAAmBC,6BAA6B,oBAAoB,CAAC;IAC9E,gBAAgBzB;IAChB,cAAc,EAAE;AACpB"}
@@ -25,7 +25,7 @@ class TextCompressedFieldIndexImpl {
25
25
  isSearchable(field) {
26
26
  const fieldType = this.fieldRegistry.get(field.type);
27
27
  if (!fieldType?.isSearchable) return false;
28
- if (field.settings?.disableFullTextSearch === true) return false;
28
+ else if (field.settings?.disableFullTextSearch === true) return false;
29
29
  return true;
30
30
  }
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { TextFieldTypes } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\n\nclass TextCompressedFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = TextFieldTypes.COMPRESSED;\n\n public constructor(private readonly fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface) {}\n\n public toIndex(\n params: CmsEntryOpenSearchFieldIndex.ToIndex\n ): CmsEntryOpenSearchFieldIndex.ToValue {\n const { field, value } = params;\n const isSearchable = this.isSearchable(field);\n\n if (isSearchable) {\n return { value };\n }\n\n return {\n rawValue: value\n };\n }\n\n public fromIndex(params: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n const { field, value, rawValue } = params;\n const isSearchable = this.isSearchable(field);\n\n if (isSearchable) {\n return value === undefined ? rawValue : value;\n }\n return rawValue === undefined ? value : rawValue;\n }\n\n private isSearchable(field: CmsModelField): boolean {\n const fieldType = this.fieldRegistry.get(field.type);\n if (!fieldType?.isSearchable) {\n return false;\n } else if (field.settings?.disableFullTextSearch === true) {\n return false;\n }\n return true;\n }\n}\n\nexport const TextCompressedFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: TextCompressedFieldIndexImpl,\n dependencies: [CmsModelFieldToGraphQLRegistry]\n});\n"],"names":["TextCompressedFieldIndexImpl","fieldRegistry","TextFieldTypes","params","field","value","isSearchable","rawValue","undefined","fieldType","TextCompressedFieldIndex","CmsEntryOpenSearchFieldIndex","CmsModelFieldToGraphQLRegistry"],"mappings":";;;AAKA,MAAMA;IAGF,YAAoCC,aAAuD,CAAE;aAAzDA,aAAa,GAAbA;aAFpB,SAAS,GAAGC,eAAe,UAAU;IAEyC;IAEvF,QACHC,MAA4C,EACR;QACpC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF;QACzB,MAAMG,eAAe,IAAI,CAAC,YAAY,CAACF;QAEvC,IAAIE,cACA,OAAO;YAAED;QAAM;QAGnB,OAAO;YACH,UAAUA;QACd;IACJ;IAEO,UAAUF,MAA8C,EAAO;QAClE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEE,QAAQ,EAAE,GAAGJ;QACnC,MAAMG,eAAe,IAAI,CAAC,YAAY,CAACF;QAEvC,IAAIE,cACA,OAAOD,AAAUG,WAAVH,QAAsBE,WAAWF;QAE5C,OAAOE,AAAaC,WAAbD,WAAyBF,QAAQE;IAC5C;IAEQ,aAAaH,KAAoB,EAAW;QAChD,MAAMK,YAAY,IAAI,CAAC,aAAa,CAAC,GAAG,CAACL,MAAM,IAAI;QACnD,IAAI,CAACK,WAAW,cACZ,OAAO;QACJ,IAAIL,MAAM,QAAQ,EAAE,0BAA0B,MACjD,OAAO;QAEX,OAAO;IACX;AACJ;AAEO,MAAMM,2BAA2BC,6BAA6B,oBAAoB,CAAC;IACtF,gBAAgBX;IAChB,cAAc;QAACY;KAA+B;AAClD"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/fields/TextCompressedFieldIndex.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { TextFieldTypes } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\n\nclass TextCompressedFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = TextFieldTypes.COMPRESSED;\n\n public constructor(private readonly fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface) {}\n\n public toIndex(\n params: CmsEntryOpenSearchFieldIndex.ToIndex\n ): CmsEntryOpenSearchFieldIndex.ToValue {\n const { field, value } = params;\n const isSearchable = this.isSearchable(field);\n\n if (isSearchable) {\n return { value };\n }\n\n return {\n rawValue: value\n };\n }\n\n public fromIndex(params: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n const { field, value, rawValue } = params;\n const isSearchable = this.isSearchable(field);\n\n if (isSearchable) {\n return value === undefined ? rawValue : value;\n }\n return rawValue === undefined ? value : rawValue;\n }\n\n private isSearchable(field: CmsModelField): boolean {\n const fieldType = this.fieldRegistry.get(field.type);\n if (!fieldType?.isSearchable) {\n return false;\n } else if (field.settings?.disableFullTextSearch === true) {\n return false;\n }\n return true;\n }\n}\n\nexport const TextCompressedFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: TextCompressedFieldIndexImpl,\n dependencies: [CmsModelFieldToGraphQLRegistry]\n});\n"],"names":["TextCompressedFieldIndexImpl","fieldRegistry","TextFieldTypes","params","field","value","isSearchable","rawValue","undefined","fieldType","TextCompressedFieldIndex","CmsEntryOpenSearchFieldIndex","CmsModelFieldToGraphQLRegistry"],"mappings":";;;AAKA,MAAMA;IAGF,YAAoCC,aAAuD,CAAE;aAAzDA,aAAa,GAAbA;aAFpB,SAAS,GAAGC,eAAe,UAAU;IAEyC;IAEvF,QACHC,MAA4C,EACR;QACpC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF;QACzB,MAAMG,eAAe,IAAI,CAAC,YAAY,CAACF;QAEvC,IAAIE,cACA,OAAO;YAAED;QAAM;QAGnB,OAAO;YACH,UAAUA;QACd;IACJ;IAEO,UAAUF,MAA8C,EAAO;QAClE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEE,QAAQ,EAAE,GAAGJ;QACnC,MAAMG,eAAe,IAAI,CAAC,YAAY,CAACF;QAEvC,IAAIE,cACA,OAAOD,AAAUG,WAAVH,QAAsBE,WAAWF;QAE5C,OAAOE,AAAaC,WAAbD,WAAyBF,QAAQE;IAC5C;IAEQ,aAAaH,KAAoB,EAAW;QAChD,MAAMK,YAAY,IAAI,CAAC,aAAa,CAAC,GAAG,CAACL,MAAM,IAAI;QACnD,IAAI,CAACK,WAAW,cACZ,OAAO;aACJ,IAAIL,MAAM,QAAQ,EAAE,0BAA0B,MACjD,OAAO;QAEX,OAAO;IACX;AACJ;AAEO,MAAMM,2BAA2BC,6BAA6B,oBAAoB,CAAC;IACtF,gBAAgBX;IAChB,cAAc;QAACY;KAA+B;AAClD"}
@@ -25,7 +25,7 @@ class TextEncryptedFieldIndexImpl {
25
25
  isSearchable(field) {
26
26
  const fieldType = this.fieldRegistry.get(field.type);
27
27
  if (!fieldType?.isSearchable) return false;
28
- if (field.settings?.disableFullTextSearch === true) return false;
28
+ else if (field.settings?.disableFullTextSearch === true) return false;
29
29
  return true;
30
30
  }
31
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { TextFieldTypes } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\n\nclass TextEncryptedFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = TextFieldTypes.ENCRYPTED;\n\n public constructor(private readonly fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface) {}\n\n public toIndex(\n params: CmsEntryOpenSearchFieldIndex.ToIndex\n ): CmsEntryOpenSearchFieldIndex.ToValue {\n const { field, value } = params;\n const isSearchable = this.isSearchable(field);\n\n if (isSearchable) {\n return { value };\n }\n\n return {\n rawValue: value\n };\n }\n\n public fromIndex(params: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n const { field, value, rawValue } = params;\n const isSearchable = this.isSearchable(field);\n\n if (isSearchable) {\n return value === undefined ? rawValue : value;\n }\n return rawValue === undefined ? value : rawValue;\n }\n\n private isSearchable(field: CmsModelField): boolean {\n const fieldType = this.fieldRegistry.get(field.type);\n if (!fieldType?.isSearchable) {\n return false;\n } else if (field.settings?.disableFullTextSearch === true) {\n return false;\n }\n return true;\n }\n}\n\nexport const TextEncryptedFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: TextEncryptedFieldIndexImpl,\n dependencies: [CmsModelFieldToGraphQLRegistry]\n});\n"],"names":["TextEncryptedFieldIndexImpl","fieldRegistry","TextFieldTypes","params","field","value","isSearchable","rawValue","undefined","fieldType","TextEncryptedFieldIndex","CmsEntryOpenSearchFieldIndex","CmsModelFieldToGraphQLRegistry"],"mappings":";;;AAKA,MAAMA;IAGF,YAAoCC,aAAuD,CAAE;aAAzDA,aAAa,GAAbA;aAFpB,SAAS,GAAGC,eAAe,SAAS;IAE0C;IAEvF,QACHC,MAA4C,EACR;QACpC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF;QACzB,MAAMG,eAAe,IAAI,CAAC,YAAY,CAACF;QAEvC,IAAIE,cACA,OAAO;YAAED;QAAM;QAGnB,OAAO;YACH,UAAUA;QACd;IACJ;IAEO,UAAUF,MAA8C,EAAO;QAClE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEE,QAAQ,EAAE,GAAGJ;QACnC,MAAMG,eAAe,IAAI,CAAC,YAAY,CAACF;QAEvC,IAAIE,cACA,OAAOD,AAAUG,WAAVH,QAAsBE,WAAWF;QAE5C,OAAOE,AAAaC,WAAbD,WAAyBF,QAAQE;IAC5C;IAEQ,aAAaH,KAAoB,EAAW;QAChD,MAAMK,YAAY,IAAI,CAAC,aAAa,CAAC,GAAG,CAACL,MAAM,IAAI;QACnD,IAAI,CAACK,WAAW,cACZ,OAAO;QACJ,IAAIL,MAAM,QAAQ,EAAE,0BAA0B,MACjD,OAAO;QAEX,OAAO;IACX;AACJ;AAEO,MAAMM,0BAA0BC,6BAA6B,oBAAoB,CAAC;IACrF,gBAAgBX;IAChB,cAAc;QAACY;KAA+B;AAClD"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/fields/TextEncryptedFieldIndex.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndex } from \"../abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { TextFieldTypes } from \"@webiny/api-headless-cms/features/modelBuilder/index.js\";\n\nclass TextEncryptedFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {\n public readonly fieldType = TextFieldTypes.ENCRYPTED;\n\n public constructor(private readonly fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface) {}\n\n public toIndex(\n params: CmsEntryOpenSearchFieldIndex.ToIndex\n ): CmsEntryOpenSearchFieldIndex.ToValue {\n const { field, value } = params;\n const isSearchable = this.isSearchable(field);\n\n if (isSearchable) {\n return { value };\n }\n\n return {\n rawValue: value\n };\n }\n\n public fromIndex(params: CmsEntryOpenSearchFieldIndex.FromIndex): any {\n const { field, value, rawValue } = params;\n const isSearchable = this.isSearchable(field);\n\n if (isSearchable) {\n return value === undefined ? rawValue : value;\n }\n return rawValue === undefined ? value : rawValue;\n }\n\n private isSearchable(field: CmsModelField): boolean {\n const fieldType = this.fieldRegistry.get(field.type);\n if (!fieldType?.isSearchable) {\n return false;\n } else if (field.settings?.disableFullTextSearch === true) {\n return false;\n }\n return true;\n }\n}\n\nexport const TextEncryptedFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({\n implementation: TextEncryptedFieldIndexImpl,\n dependencies: [CmsModelFieldToGraphQLRegistry]\n});\n"],"names":["TextEncryptedFieldIndexImpl","fieldRegistry","TextFieldTypes","params","field","value","isSearchable","rawValue","undefined","fieldType","TextEncryptedFieldIndex","CmsEntryOpenSearchFieldIndex","CmsModelFieldToGraphQLRegistry"],"mappings":";;;AAKA,MAAMA;IAGF,YAAoCC,aAAuD,CAAE;aAAzDA,aAAa,GAAbA;aAFpB,SAAS,GAAGC,eAAe,SAAS;IAE0C;IAEvF,QACHC,MAA4C,EACR;QACpC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF;QACzB,MAAMG,eAAe,IAAI,CAAC,YAAY,CAACF;QAEvC,IAAIE,cACA,OAAO;YAAED;QAAM;QAGnB,OAAO;YACH,UAAUA;QACd;IACJ;IAEO,UAAUF,MAA8C,EAAO;QAClE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEE,QAAQ,EAAE,GAAGJ;QACnC,MAAMG,eAAe,IAAI,CAAC,YAAY,CAACF;QAEvC,IAAIE,cACA,OAAOD,AAAUG,WAAVH,QAAsBE,WAAWF;QAE5C,OAAOE,AAAaC,WAAbD,WAAyBF,QAAQE;IAC5C;IAEQ,aAAaH,KAAoB,EAAW;QAChD,MAAMK,YAAY,IAAI,CAAC,aAAa,CAAC,GAAG,CAACL,MAAM,IAAI;QACnD,IAAI,CAACK,WAAW,cACZ,OAAO;aACJ,IAAIL,MAAM,QAAQ,EAAE,0BAA0B,MACjD,OAAO;QAEX,OAAO;IACX;AACJ;AAEO,MAAMM,0BAA0BC,6BAA6B,oBAAoB,CAAC;IACrF,gBAAgBX;IAChB,cAAc;QAACY;KAA+B;AAClD"}
@@ -3,7 +3,7 @@ import type { OpenSearchIndexRequestBody } from "@webiny/api-opensearch/types.js
3
3
  declare class BaseOpenSearchIndexImpl implements CmsEntryOpenSearchIndex.Interface {
4
4
  readonly body: OpenSearchIndexRequestBody;
5
5
  constructor();
6
- canUse(_: CmsEntryOpenSearchIndex.CanUseParams): boolean;
6
+ canUse(): boolean;
7
7
  }
8
8
  export declare const BaseOpenSearchIndex: typeof BaseOpenSearchIndexImpl & {
9
9
  __abstraction: import("@webiny/di").Abstraction<import("./abstractions.js").ICmsEntryOpenSearchIndex>;
@@ -4,7 +4,7 @@ class BaseOpenSearchIndexImpl {
4
4
  constructor(){
5
5
  this.body = getBaseConfiguration();
6
6
  }
7
- canUse(_) {
7
+ canUse() {
8
8
  return true;
9
9
  }
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js","sources":["../../../src/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-opensearch\";\nimport { CmsEntryOpenSearchIndex } from \"./abstractions.js\";\nimport type { OpenSearchIndexRequestBody } from \"@webiny/api-opensearch/types.js\";\n\nclass BaseOpenSearchIndexImpl implements CmsEntryOpenSearchIndex.Interface {\n public readonly body: OpenSearchIndexRequestBody;\n\n public constructor() {\n this.body = getBaseConfiguration();\n }\n public canUse(_: CmsEntryOpenSearchIndex.CanUseParams): boolean {\n return true;\n }\n}\n\nexport const BaseOpenSearchIndex = CmsEntryOpenSearchIndex.createImplementation({\n implementation: BaseOpenSearchIndexImpl,\n dependencies: []\n});\n"],"names":["BaseOpenSearchIndexImpl","getBaseConfiguration","_","BaseOpenSearchIndex","CmsEntryOpenSearchIndex"],"mappings":";;AAIA,MAAMA;IAGF,aAAqB;QACjB,IAAI,CAAC,IAAI,GAAGC;IAChB;IACO,OAAOC,CAAuC,EAAW;QAC5D,OAAO;IACX;AACJ;AAEO,MAAMC,sBAAsBC,wBAAwB,oBAAoB,CAAC;IAC5E,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js","sources":["../../../src/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.ts"],"sourcesContent":["import { getBaseConfiguration } from \"@webiny/api-opensearch\";\nimport { CmsEntryOpenSearchIndex } from \"./abstractions.js\";\nimport type { OpenSearchIndexRequestBody } from \"@webiny/api-opensearch/types.js\";\n\nclass BaseOpenSearchIndexImpl implements CmsEntryOpenSearchIndex.Interface {\n public readonly body: OpenSearchIndexRequestBody;\n\n public constructor() {\n this.body = getBaseConfiguration();\n }\n public canUse(): boolean {\n return true;\n }\n}\n\nexport const BaseOpenSearchIndex = CmsEntryOpenSearchIndex.createImplementation({\n implementation: BaseOpenSearchIndexImpl,\n dependencies: []\n});\n"],"names":["BaseOpenSearchIndexImpl","getBaseConfiguration","BaseOpenSearchIndex","CmsEntryOpenSearchIndex"],"mappings":";;AAIA,MAAMA;IAGF,aAAqB;QACjB,IAAI,CAAC,IAAI,GAAGC;IAChB;IACO,SAAkB;QACrB,OAAO;IACX;AACJ;AAEO,MAAMC,sBAAsBC,wBAAwB,oBAAoB,CAAC;IAC5E,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}