@webiny/api-headless-cms-ddb-es 6.3.0-beta.4 → 6.4.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (207) hide show
  1. package/configurations.js +27 -35
  2. package/configurations.js.map +1 -1
  3. package/definitions/entry.js +7 -9
  4. package/definitions/entry.js.map +1 -1
  5. package/definitions/group.js +7 -9
  6. package/definitions/group.js.map +1 -1
  7. package/definitions/model.js +7 -9
  8. package/definitions/model.js.map +1 -1
  9. package/definitions/types.d.ts +1 -0
  10. package/definitions/types.js +0 -3
  11. package/elasticsearch/createElasticsearchIndex.js +50 -67
  12. package/elasticsearch/createElasticsearchIndex.js.map +1 -1
  13. package/elasticsearch/deleteElasticsearchIndex.js +18 -26
  14. package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
  15. package/exports/api/cms/opensearch.js +2 -4
  16. package/feature.js +144 -153
  17. package/feature.js.map +1 -1
  18. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +2 -1
  19. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +1 -1
  20. package/features/CmsEntryOpenSearchBodyModifier/index.js +0 -2
  21. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +28 -27
  22. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -1
  23. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +2 -1
  24. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +1 -1
  25. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +2 -1
  26. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +1 -1
  27. package/features/CmsEntryOpenSearchFieldIndex/constants.js +2 -1
  28. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +1 -1
  29. package/features/CmsEntryOpenSearchFieldIndex/feature.js +13 -12
  30. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +1 -1
  31. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +48 -65
  32. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +1 -1
  33. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +20 -30
  34. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +1 -1
  35. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +15 -16
  36. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +1 -1
  37. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +15 -18
  38. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +1 -1
  39. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +24 -29
  40. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +1 -1
  41. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +99 -144
  42. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +1 -1
  43. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +15 -16
  44. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +1 -1
  45. package/features/CmsEntryOpenSearchFieldIndex/index.js +0 -2
  46. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +26 -28
  47. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +1 -1
  48. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +2 -1
  49. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +1 -1
  50. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +2 -1
  51. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +1 -1
  52. package/features/CmsEntryOpenSearchFilter/constants.js +2 -1
  53. package/features/CmsEntryOpenSearchFilter/constants.js.map +1 -1
  54. package/features/CmsEntryOpenSearchFilter/feature.js +9 -8
  55. package/features/CmsEntryOpenSearchFilter/feature.js.map +1 -1
  56. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +18 -15
  57. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +1 -1
  58. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +35 -53
  59. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +1 -1
  60. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +27 -40
  61. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +1 -1
  62. package/features/CmsEntryOpenSearchFilter/index.js +0 -2
  63. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +2 -1
  64. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +1 -1
  65. package/features/CmsEntryOpenSearchFullTextSearch/index.js +0 -2
  66. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +10 -9
  67. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +1 -1
  68. package/features/CmsEntryOpenSearchIndex/abstractions.js +2 -1
  69. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +1 -1
  70. package/features/CmsEntryOpenSearchIndex/feature.js +6 -5
  71. package/features/CmsEntryOpenSearchIndex/feature.js.map +1 -1
  72. package/features/CmsEntryOpenSearchIndex/index.js +0 -2
  73. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +2 -1
  74. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +1 -1
  75. package/features/CmsEntryOpenSearchQueryModifier/index.js +0 -2
  76. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +2 -1
  77. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +1 -1
  78. package/features/CmsEntryOpenSearchSortModifier/index.js +0 -2
  79. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +24 -20
  80. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -1
  81. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +2 -1
  82. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +1 -1
  83. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +2 -1
  84. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +1 -1
  85. package/features/CmsEntryOpenSearchValueSearch/feature.js +9 -8
  86. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +1 -1
  87. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +14 -16
  88. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +1 -1
  89. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +31 -42
  90. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +1 -1
  91. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +15 -17
  92. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +1 -1
  93. package/features/CmsEntryOpenSearchValueSearch/index.js +0 -2
  94. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +2 -1
  95. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +1 -1
  96. package/features/CmsEntryOpenSearchValuesModifier/index.js +0 -2
  97. package/helpers/entryIndexHelpers.js +71 -123
  98. package/helpers/entryIndexHelpers.js.map +1 -1
  99. package/helpers/fieldIdentifier.js +18 -30
  100. package/helpers/fieldIdentifier.js.map +1 -1
  101. package/helpers/index.js +0 -2
  102. package/index.js +0 -2
  103. package/operations/entry/dataLoader/DataLoaderCache.js +22 -26
  104. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  105. package/operations/entry/dataLoader/constants.js +2 -1
  106. package/operations/entry/dataLoader/constants.js.map +1 -1
  107. package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
  108. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  109. package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -29
  110. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  111. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +27 -37
  112. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  113. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +27 -37
  114. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  115. package/operations/entry/dataLoader/getRevisionById.js +32 -46
  116. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  117. package/operations/entry/dataLoader/index.js +8 -9
  118. package/operations/entry/dataLoader/index.js.map +1 -1
  119. package/operations/entry/dataLoader/types.js +0 -3
  120. package/operations/entry/dataLoaders.js +81 -99
  121. package/operations/entry/dataLoaders.js.map +1 -1
  122. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +6 -24
  123. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
  124. package/operations/entry/elasticsearch/body.js +74 -125
  125. package/operations/entry/elasticsearch/body.js.map +1 -1
  126. package/operations/entry/elasticsearch/fields/createSystemField.js +6 -7
  127. package/operations/entry/elasticsearch/fields/createSystemField.js.map +1 -1
  128. package/operations/entry/elasticsearch/fields/live.js +45 -40
  129. package/operations/entry/elasticsearch/fields/live.js.map +1 -1
  130. package/operations/entry/elasticsearch/fields/location.js +45 -40
  131. package/operations/entry/elasticsearch/fields/location.js.map +1 -1
  132. package/operations/entry/elasticsearch/fields/state.js +99 -88
  133. package/operations/entry/elasticsearch/fields/state.js.map +1 -1
  134. package/operations/entry/elasticsearch/fields.js +193 -217
  135. package/operations/entry/elasticsearch/fields.js.map +1 -1
  136. package/operations/entry/elasticsearch/filtering/applyFiltering.js +32 -45
  137. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
  138. package/operations/entry/elasticsearch/filtering/exec.js +85 -114
  139. package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
  140. package/operations/entry/elasticsearch/filtering/index.js +0 -2
  141. package/operations/entry/elasticsearch/filtering/path.js +24 -33
  142. package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
  143. package/operations/entry/elasticsearch/filtering/populated.js +8 -14
  144. package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
  145. package/operations/entry/elasticsearch/filtering/values.js +11 -12
  146. package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
  147. package/operations/entry/elasticsearch/fullTextSearch.js +43 -80
  148. package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
  149. package/operations/entry/elasticsearch/fullTextSearchFields.js +7 -17
  150. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
  151. package/operations/entry/elasticsearch/initialQuery.js +37 -80
  152. package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
  153. package/operations/entry/elasticsearch/keyword.js +13 -27
  154. package/operations/entry/elasticsearch/keyword.js.map +1 -1
  155. package/operations/entry/elasticsearch/plugins/operator.js +9 -20
  156. package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
  157. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -4
  158. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -1
  159. package/operations/entry/elasticsearch/sort.js +69 -92
  160. package/operations/entry/elasticsearch/sort.js.map +1 -1
  161. package/operations/entry/elasticsearch/transformValueForSearch.js +9 -14
  162. package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
  163. package/operations/entry/elasticsearch/types.js +0 -3
  164. package/operations/entry/index.js +1322 -1709
  165. package/operations/entry/index.js.map +1 -1
  166. package/operations/entry/keys.js +43 -63
  167. package/operations/entry/keys.js.map +1 -1
  168. package/operations/entry/recordType.js +4 -9
  169. package/operations/entry/recordType.js.map +1 -1
  170. package/operations/entry/transformations/convertEntryKeys.js +21 -26
  171. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  172. package/operations/entry/transformations/index.js +85 -114
  173. package/operations/entry/transformations/index.js.map +1 -1
  174. package/operations/entry/transformations/modifyEntryValues.d.ts +1 -1
  175. package/operations/entry/transformations/modifyEntryValues.js +12 -17
  176. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  177. package/operations/entry/transformations/transformEntryKeys.js +13 -16
  178. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  179. package/operations/entry/transformations/transformEntryToIndex.js +17 -22
  180. package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
  181. package/operations/group/index.js +113 -134
  182. package/operations/group/index.js.map +1 -1
  183. package/operations/model/index.js +128 -156
  184. package/operations/model/index.js.map +1 -1
  185. package/package.json +23 -23
  186. package/tasks/createIndexTaskPlugin.js +35 -38
  187. package/tasks/createIndexTaskPlugin.js.map +1 -1
  188. package/types.js +7 -13
  189. package/types.js.map +1 -1
  190. package/values/NoValueContainer.js +8 -10
  191. package/values/NoValueContainer.js.map +1 -1
  192. package/definitions/types.js.map +0 -1
  193. package/exports/api/cms/opensearch.js.map +0 -1
  194. package/features/CmsEntryOpenSearchBodyModifier/index.js.map +0 -1
  195. package/features/CmsEntryOpenSearchFieldIndex/index.js.map +0 -1
  196. package/features/CmsEntryOpenSearchFilter/index.js.map +0 -1
  197. package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +0 -1
  198. package/features/CmsEntryOpenSearchIndex/index.js.map +0 -1
  199. package/features/CmsEntryOpenSearchQueryModifier/index.js.map +0 -1
  200. package/features/CmsEntryOpenSearchSortModifier/index.js.map +0 -1
  201. package/features/CmsEntryOpenSearchValueSearch/index.js.map +0 -1
  202. package/features/CmsEntryOpenSearchValuesModifier/index.js.map +0 -1
  203. package/helpers/index.js.map +0 -1
  204. package/index.js.map +0 -1
  205. package/operations/entry/dataLoader/types.js.map +0 -1
  206. package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
  207. package/operations/entry/elasticsearch/types.js.map +0 -1
package/feature.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createTable, registerExtension as registerDynamoDbExtension } from "@webiny/db-dynamodb";
2
- import { StorageOperationsFactory as StorageOperationsFactoryAbstraction } from "@webiny/api-headless-cms/exports/api/cms/storage.js";
1
+ import { createTable, registerExtension } from "@webiny/db-dynamodb";
2
+ import { StorageOperationsFactory } from "@webiny/api-headless-cms/exports/api/cms/storage.js";
3
3
  import { ENTITIES } from "./types.js";
4
4
  import { createRegisterExtensionPlugin } from "@webiny/handler";
5
5
  import { createFeature } from "@webiny/feature/api/index.js";
@@ -27,162 +27,153 @@ import { CmsEntryOpenSearchFullTextSearch } from "./features/CmsEntryOpenSearchF
27
27
  import { CmsEntryOpenSearchValuesModifier } from "./features/CmsEntryOpenSearchValuesModifier/index.js";
28
28
  import { CmsEntryOpenSearchFieldIndexFeature, CmsEntryOpenSearchFieldIndexRegistry } from "./features/CmsEntryOpenSearchFieldIndex/index.js";
29
29
  import { CmsEntryOpenSearchFilterFeature, CmsEntryOpenSearchFilterRegistry } from "./features/CmsEntryOpenSearchFilter/index.js";
30
- const createOpenSearchStorageOperations = params => {
31
- const {
32
- table,
33
- esTable,
34
- documentClient,
35
- elasticsearch,
36
- plugins,
37
- container
38
- } = params;
39
- const tableInstance = createTable({
40
- name: table || process.env.DB_TABLE,
41
- documentClient
42
- });
43
- const tableElasticsearchInstance = createOpenSearchTable({
44
- name: esTable,
45
- documentClient
46
- });
47
- const entities = {
48
- groups: createGroupEntity({
49
- entityName: ENTITIES.GROUPS,
50
- table: tableInstance
51
- }),
52
- models: createModelEntity({
53
- entityName: ENTITIES.MODELS,
54
- table: tableInstance
55
- }),
56
- entries: createEntryEntity({
57
- entityName: ENTITIES.ENTRIES,
58
- table: tableInstance
59
- }),
60
- entriesEs: createOpenSearchEntity({
61
- entityName: ENTITIES.ENTRIES_ES,
62
- table: tableElasticsearchInstance
63
- })
64
- };
65
- const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);
66
- const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);
67
- const compressionHandler = container.resolve(CompressionHandler);
68
- const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);
69
- const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);
70
- const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);
71
- const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);
72
- const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);
73
- const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);
74
- const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);
75
- container.registerFactory(ModelAfterCreateEventHandler, () => ({
76
- async handle(event) {
77
- const {
78
- model
79
- } = event.payload;
80
- await createElasticsearchIndex({
81
- client: elasticsearch,
82
- model,
83
- indexConfigs: container.resolveAll(CmsEntryOpenSearchIndex)
84
- });
85
- }
86
- }));
87
- container.registerFactory(ModelAfterCreateFromEventHandler, () => ({
88
- async handle(event) {
89
- const {
90
- model
91
- } = event.payload;
92
- await createElasticsearchIndex({
93
- client: elasticsearch,
94
- model,
95
- indexConfigs: container.resolveAll(CmsEntryOpenSearchIndex)
96
- });
97
- }
98
- }));
99
- container.registerFactory(ModelAfterDeleteEventHandler, () => ({
100
- async handle(event) {
101
- const {
102
- model
103
- } = event.payload;
104
- await deleteElasticsearchIndex({
105
- client: elasticsearch,
106
- model
107
- });
108
- }
109
- }));
110
- const entries = createEntriesStorageOperations({
111
- entity: entities.entries,
112
- esEntity: entities.entriesEs,
113
- plugins,
114
- elasticsearch,
115
- fieldRegistry,
116
- fieldIndexRegistry,
117
- compressionHandler,
118
- bodyModifiers,
119
- sortModifiers,
120
- queryModifiers,
121
- valueSearchRegistry,
122
- fullTextSearches,
123
- valuesModifiers,
124
- filterRegistry
125
- });
126
- return {
127
- name: "dynamodb:opensearch",
128
- beforeInit: async context => {
129
- context.db.registry.register({
130
- item: entities.entries,
131
- app: "cms",
132
- tags: ["regular", entities.entries.name]
133
- });
134
- context.db.registry.register({
135
- item: entities.entriesEs,
136
- app: "cms",
137
- tags: ["es", entities.entriesEs.name]
138
- });
139
- // TODO we know that context is ok, but types are missing elasticsearch/opensearch
140
- // @ts-expect-error
141
- createCreateIndexTask(context);
142
- entries.dataLoaders.clearAll();
143
- },
144
- getEntities: () => entities,
145
- getTable: () => tableInstance,
146
- getEsTable: () => tableElasticsearchInstance,
147
- groups: createGroupsStorageOperations({
148
- entity: entities.groups,
149
- container
150
- }),
151
- models: createModelsStorageOperations({
152
- entity: entities.models,
153
- elasticsearch
154
- }),
155
- entries
156
- };
30
+ const createOpenSearchStorageOperations = (params)=>{
31
+ const { table, esTable, documentClient, elasticsearch, plugins, container } = params;
32
+ const tableInstance = createTable({
33
+ name: table || process.env.DB_TABLE,
34
+ documentClient
35
+ });
36
+ const tableElasticsearchInstance = createOpenSearchTable({
37
+ name: esTable,
38
+ documentClient
39
+ });
40
+ const entities = {
41
+ groups: createGroupEntity({
42
+ entityName: ENTITIES.GROUPS,
43
+ table: tableInstance
44
+ }),
45
+ models: createModelEntity({
46
+ entityName: ENTITIES.MODELS,
47
+ table: tableInstance
48
+ }),
49
+ entries: createEntryEntity({
50
+ entityName: ENTITIES.ENTRIES,
51
+ table: tableInstance
52
+ }),
53
+ entriesEs: createOpenSearchEntity({
54
+ entityName: ENTITIES.ENTRIES_ES,
55
+ table: tableElasticsearchInstance
56
+ })
57
+ };
58
+ const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);
59
+ const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);
60
+ const compressionHandler = container.resolve(CompressionHandler);
61
+ const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);
62
+ const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);
63
+ const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);
64
+ const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);
65
+ const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);
66
+ const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);
67
+ const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);
68
+ container.registerFactory(ModelAfterCreateEventHandler, ()=>({
69
+ async handle (event) {
70
+ const { model } = event.payload;
71
+ await createElasticsearchIndex({
72
+ client: elasticsearch,
73
+ model,
74
+ indexConfigs: container.resolveAll(CmsEntryOpenSearchIndex)
75
+ });
76
+ }
77
+ }));
78
+ container.registerFactory(ModelAfterCreateFromEventHandler, ()=>({
79
+ async handle (event) {
80
+ const { model } = event.payload;
81
+ await createElasticsearchIndex({
82
+ client: elasticsearch,
83
+ model,
84
+ indexConfigs: container.resolveAll(CmsEntryOpenSearchIndex)
85
+ });
86
+ }
87
+ }));
88
+ container.registerFactory(ModelAfterDeleteEventHandler, ()=>({
89
+ async handle (event) {
90
+ const { model } = event.payload;
91
+ await deleteElasticsearchIndex({
92
+ client: elasticsearch,
93
+ model
94
+ });
95
+ }
96
+ }));
97
+ const entries = createEntriesStorageOperations({
98
+ entity: entities.entries,
99
+ esEntity: entities.entriesEs,
100
+ plugins,
101
+ elasticsearch,
102
+ fieldRegistry,
103
+ fieldIndexRegistry,
104
+ compressionHandler,
105
+ bodyModifiers,
106
+ sortModifiers,
107
+ queryModifiers,
108
+ valueSearchRegistry,
109
+ fullTextSearches,
110
+ valuesModifiers,
111
+ filterRegistry
112
+ });
113
+ return {
114
+ name: "dynamodb:opensearch",
115
+ beforeInit: async (context)=>{
116
+ context.db.registry.register({
117
+ item: entities.entries,
118
+ app: "cms",
119
+ tags: [
120
+ "regular",
121
+ entities.entries.name
122
+ ]
123
+ });
124
+ context.db.registry.register({
125
+ item: entities.entriesEs,
126
+ app: "cms",
127
+ tags: [
128
+ "es",
129
+ entities.entriesEs.name
130
+ ]
131
+ });
132
+ createCreateIndexTask(context);
133
+ entries.dataLoaders.clearAll();
134
+ },
135
+ getEntities: ()=>entities,
136
+ getTable: ()=>tableInstance,
137
+ getEsTable: ()=>tableElasticsearchInstance,
138
+ groups: createGroupsStorageOperations({
139
+ entity: entities.groups,
140
+ container
141
+ }),
142
+ models: createModelsStorageOperations({
143
+ entity: entities.models,
144
+ elasticsearch
145
+ }),
146
+ entries
147
+ };
157
148
  };
158
149
  class OpenSearchStorageOperationsFactoryImpl {
159
- async create(context) {
160
- return createOpenSearchStorageOperations({
161
- documentClient: context.db.driver.getClient(),
162
- elasticsearch: context.opensearch,
163
- plugins: context.plugins,
164
- container: context.container
165
- });
166
- }
150
+ async create(context) {
151
+ return createOpenSearchStorageOperations({
152
+ documentClient: context.db.driver.getClient(),
153
+ elasticsearch: context.opensearch,
154
+ plugins: context.plugins,
155
+ container: context.container
156
+ });
157
+ }
167
158
  }
168
- const OpenSearchStorageOperationsFactory = StorageOperationsFactoryAbstraction.createImplementation({
169
- implementation: OpenSearchStorageOperationsFactoryImpl,
170
- dependencies: []
159
+ const OpenSearchStorageOperationsFactory = StorageOperationsFactory.createImplementation({
160
+ implementation: OpenSearchStorageOperationsFactoryImpl,
161
+ dependencies: []
171
162
  });
172
163
  const storageOperationsFeature = createFeature({
173
- name: "cms.storageOperations.openSearch",
174
- register: container => {
175
- CmsEntryOpenSearchFieldIndexFeature.register(container);
176
- CmsEntryOpenSearchFilterFeature.register(container);
177
- CmsEntryOpenSearchIndexFeature.register(container);
178
- CmsEntryOpenSearchValueSearchFeature.register(container);
179
- container.register(OpenSearchStorageOperationsFactory).inSingletonScope();
180
- }
164
+ name: "cms.storageOperations.openSearch",
165
+ register: (container)=>{
166
+ CmsEntryOpenSearchFieldIndexFeature.register(container);
167
+ CmsEntryOpenSearchFilterFeature.register(container);
168
+ CmsEntryOpenSearchIndexFeature.register(container);
169
+ CmsEntryOpenSearchValueSearchFeature.register(container);
170
+ container.register(OpenSearchStorageOperationsFactory).inSingletonScope();
171
+ }
181
172
  });
182
- export const registerCmsOpenSearchStorageOperations = () => {
183
- return [registerDynamoDbExtension(), createRegisterExtensionPlugin(context => {
184
- return storageOperationsFeature.register(context.container);
185
- })];
186
- };
173
+ const registerCmsOpenSearchStorageOperations = ()=>[
174
+ registerExtension(),
175
+ createRegisterExtensionPlugin((context)=>storageOperationsFeature.register(context.container))
176
+ ];
177
+ export { registerCmsOpenSearchStorageOperations };
187
178
 
188
179
  //# sourceMappingURL=feature.js.map
package/feature.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["createTable","registerExtension","registerDynamoDbExtension","StorageOperationsFactory","StorageOperationsFactoryAbstraction","ENTITIES","createRegisterExtensionPlugin","createFeature","CmsEntryOpenSearchValueSearchFeature","CmsEntryOpenSearchValueSearchRegistry","CmsEntryOpenSearchIndex","CmsEntryOpenSearchIndexFeature","createModelsStorageOperations","createEntriesStorageOperations","createGroupEntity","createModelEntity","createEntryEntity","createElasticsearchIndex","createGroupsStorageOperations","createOpenSearchEntity","createOpenSearchTable","deleteElasticsearchIndex","createCreateIndexTask","ModelAfterCreateEventHandler","ModelAfterCreateFromEventHandler","ModelAfterDeleteEventHandler","CmsModelFieldToGraphQLRegistry","CompressionHandler","CmsEntryOpenSearchBodyModifier","CmsEntryOpenSearchSortModifier","CmsEntryOpenSearchQueryModifier","CmsEntryOpenSearchFullTextSearch","CmsEntryOpenSearchValuesModifier","CmsEntryOpenSearchFieldIndexFeature","CmsEntryOpenSearchFieldIndexRegistry","CmsEntryOpenSearchFilterFeature","CmsEntryOpenSearchFilterRegistry","createOpenSearchStorageOperations","params","table","esTable","documentClient","elasticsearch","plugins","container","tableInstance","name","process","env","DB_TABLE","tableElasticsearchInstance","entities","groups","entityName","GROUPS","models","MODELS","entries","ENTRIES","entriesEs","ENTRIES_ES","fieldRegistry","resolve","fieldIndexRegistry","compressionHandler","bodyModifiers","resolveAll","sortModifiers","queryModifiers","valueSearchRegistry","fullTextSearches","valuesModifiers","filterRegistry","registerFactory","handle","event","model","payload","client","indexConfigs","entity","esEntity","beforeInit","context","db","registry","register","item","app","tags","dataLoaders","clearAll","getEntities","getTable","getEsTable","OpenSearchStorageOperationsFactoryImpl","create","driver","getClient","opensearch","OpenSearchStorageOperationsFactory","createImplementation","implementation","dependencies","storageOperationsFeature","inSingletonScope","registerCmsOpenSearchStorageOperations"],"sources":["feature.ts"],"sourcesContent":["import { createTable, registerExtension as registerDynamoDbExtension } from \"@webiny/db-dynamodb\";\nimport { StorageOperationsFactory as StorageOperationsFactoryAbstraction } from \"@webiny/api-headless-cms/exports/api/cms/storage.js\";\nimport type { CmsContext, StorageOperationsFactory as IStorageOperationsFactory } from \"~/types.js\";\nimport { ENTITIES } from \"~/types.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\nimport { createFeature } from \"@webiny/feature/api/index.js\";\nimport {\n CmsEntryOpenSearchValueSearchFeature,\n CmsEntryOpenSearchValueSearchRegistry\n} from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\nimport {\n CmsEntryOpenSearchIndex,\n CmsEntryOpenSearchIndexFeature\n} from \"~/features/CmsEntryOpenSearchIndex/index.js\";\nimport { createModelsStorageOperations } from \"./operations/model/index.js\";\nimport { createEntriesStorageOperations } from \"./operations/entry/index.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { createElasticsearchIndex } from \"~/elasticsearch/createElasticsearchIndex.js\";\nimport { createGroupsStorageOperations } from \"~/operations/group/index.js\";\nimport { createOpenSearchEntity, createOpenSearchTable } from \"@webiny/api-opensearch\";\nimport { deleteElasticsearchIndex } from \"./elasticsearch/deleteElasticsearchIndex.js\";\nimport { createCreateIndexTask } from \"~/tasks/createIndexTaskPlugin.js\";\nimport { ModelAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModel/index.js\";\nimport { ModelAfterCreateFromEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModelFrom/events.js\";\nimport { ModelAfterDeleteEventHandler } from \"@webiny/api-headless-cms/features/contentModel/DeleteModel/events.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { CompressionHandler } from \"@webiny/utils/exports/api.js\";\nimport { CmsEntryOpenSearchBodyModifier } from \"~/features/CmsEntryOpenSearchBodyModifier/index.js\";\nimport { CmsEntryOpenSearchSortModifier } from \"~/features/CmsEntryOpenSearchSortModifier/index.js\";\nimport { CmsEntryOpenSearchQueryModifier } from \"~/features/CmsEntryOpenSearchQueryModifier/index.js\";\nimport { CmsEntryOpenSearchFullTextSearch } from \"~/features/CmsEntryOpenSearchFullTextSearch/index.js\";\nimport { CmsEntryOpenSearchValuesModifier } from \"~/features/CmsEntryOpenSearchValuesModifier/index.js\";\nimport {\n CmsEntryOpenSearchFieldIndexFeature,\n CmsEntryOpenSearchFieldIndexRegistry\n} from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\nimport {\n CmsEntryOpenSearchFilterFeature,\n CmsEntryOpenSearchFilterRegistry\n} from \"~/features/CmsEntryOpenSearchFilter/index.js\";\n\nconst createOpenSearchStorageOperations: IStorageOperationsFactory = params => {\n const { table, esTable, documentClient, elasticsearch, plugins, container } = params;\n\n const tableInstance = createTable({\n name: table || (process.env.DB_TABLE as string),\n documentClient\n });\n const tableElasticsearchInstance = createOpenSearchTable({\n name: esTable,\n documentClient\n });\n\n const entities = {\n groups: createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n }),\n models: createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n }),\n entries: createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n }),\n entriesEs: createOpenSearchEntity({\n entityName: ENTITIES.ENTRIES_ES,\n table: tableElasticsearchInstance\n })\n };\n\n const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);\n const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);\n const compressionHandler = container.resolve(CompressionHandler);\n const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);\n const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);\n const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);\n const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);\n const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);\n const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);\n const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);\n\n container.registerFactory(ModelAfterCreateEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await createElasticsearchIndex({\n client: elasticsearch,\n model,\n indexConfigs: container.resolveAll(CmsEntryOpenSearchIndex)\n });\n }\n }));\n\n container.registerFactory(ModelAfterCreateFromEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await createElasticsearchIndex({\n client: elasticsearch,\n model,\n indexConfigs: container.resolveAll(CmsEntryOpenSearchIndex)\n });\n }\n }));\n\n container.registerFactory(ModelAfterDeleteEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await deleteElasticsearchIndex({\n client: elasticsearch,\n model\n });\n }\n }));\n\n const entries = createEntriesStorageOperations({\n entity: entities.entries,\n esEntity: entities.entriesEs,\n plugins,\n elasticsearch,\n fieldRegistry,\n fieldIndexRegistry,\n compressionHandler,\n bodyModifiers,\n sortModifiers,\n queryModifiers,\n valueSearchRegistry,\n fullTextSearches,\n valuesModifiers,\n filterRegistry\n });\n\n return {\n name: \"dynamodb:opensearch\",\n beforeInit: async context => {\n context.db.registry.register({\n item: entities.entries,\n app: \"cms\",\n tags: [\"regular\", entities.entries.name]\n });\n context.db.registry.register({\n item: entities.entriesEs,\n app: \"cms\",\n tags: [\"es\", entities.entriesEs.name]\n });\n // TODO we know that context is ok, but types are missing elasticsearch/opensearch\n // @ts-expect-error\n createCreateIndexTask(context);\n\n entries.dataLoaders.clearAll();\n },\n getEntities: () => entities,\n getTable: () => tableInstance,\n getEsTable: () => tableElasticsearchInstance,\n groups: createGroupsStorageOperations({\n entity: entities.groups,\n container\n }),\n models: createModelsStorageOperations({\n entity: entities.models,\n elasticsearch\n }),\n entries\n };\n};\n\nclass OpenSearchStorageOperationsFactoryImpl\n implements StorageOperationsFactoryAbstraction.Interface\n{\n public async create(context: CmsContext) {\n return createOpenSearchStorageOperations({\n documentClient: context.db.driver.getClient() as DynamoDBDocument,\n elasticsearch: context.opensearch,\n plugins: context.plugins,\n container: context.container\n });\n }\n}\n\nconst OpenSearchStorageOperationsFactory = StorageOperationsFactoryAbstraction.createImplementation(\n {\n implementation: OpenSearchStorageOperationsFactoryImpl,\n dependencies: []\n }\n);\n\nconst storageOperationsFeature = createFeature({\n name: \"cms.storageOperations.openSearch\",\n register: container => {\n CmsEntryOpenSearchFieldIndexFeature.register(container);\n CmsEntryOpenSearchFilterFeature.register(container);\n CmsEntryOpenSearchIndexFeature.register(container);\n CmsEntryOpenSearchValueSearchFeature.register(container);\n container.register(OpenSearchStorageOperationsFactory).inSingletonScope();\n }\n});\n\nexport const registerCmsOpenSearchStorageOperations = () => {\n return [\n registerDynamoDbExtension(),\n createRegisterExtensionPlugin(context => {\n return storageOperationsFeature.register(context.container);\n })\n ];\n};\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,iBAAiB,IAAIC,yBAAyB,QAAQ,qBAAqB;AACjG,SAASC,wBAAwB,IAAIC,mCAAmC,QAAQ,qDAAqD;AAErI,SAASC,QAAQ;AAEjB,SAASC,6BAA6B,QAAQ,iBAAiB;AAC/D,SAASC,aAAa,QAAQ,8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YAAY,EAAE;AAClB,CACJ,CAAC;AAED,MAAMC,wBAAwB,GAAGjG,aAAa,CAAC;EAC3CuC,IAAI,EAAE,kCAAkC;EACxCwC,QAAQ,EAAE1C,SAAS,IAAI;IACnBX,mCAAmC,CAACqD,QAAQ,CAAC1C,SAAS,CAAC;IACvDT,+BAA+B,CAACmD,QAAQ,CAAC1C,SAAS,CAAC;IACnDjC,8BAA8B,CAAC2E,QAAQ,CAAC1C,SAAS,CAAC;IAClDpC,oCAAoC,CAAC8E,QAAQ,CAAC1C,SAAS,CAAC;IACxDA,SAAS,CAAC0C,QAAQ,CAACc,kCAAkC,CAAC,CAACK,gBAAgB,CAAC,CAAC;EAC7E;AACJ,CAAC,CAAC;AAEF,OAAO,MAAMC,sCAAsC,GAAGA,CAAA,KAAM;EACxD,OAAO,CACHxG,yBAAyB,CAAC,CAAC,EAC3BI,6BAA6B,CAAC6E,OAAO,IAAI;IACrC,OAAOqB,wBAAwB,CAAClB,QAAQ,CAACH,OAAO,CAACvC,SAAS,CAAC;EAC/D,CAAC,CAAC,CACL;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"feature.js","sources":["../src/feature.ts"],"sourcesContent":["import { createTable, registerExtension as registerDynamoDbExtension } from \"@webiny/db-dynamodb\";\nimport { StorageOperationsFactory as StorageOperationsFactoryAbstraction } from \"@webiny/api-headless-cms/exports/api/cms/storage.js\";\nimport type { CmsContext, StorageOperationsFactory as IStorageOperationsFactory } from \"~/types.js\";\nimport { ENTITIES } from \"~/types.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler\";\nimport { createFeature } from \"@webiny/feature/api/index.js\";\nimport {\n CmsEntryOpenSearchValueSearchFeature,\n CmsEntryOpenSearchValueSearchRegistry\n} from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\nimport {\n CmsEntryOpenSearchIndex,\n CmsEntryOpenSearchIndexFeature\n} from \"~/features/CmsEntryOpenSearchIndex/index.js\";\nimport { createModelsStorageOperations } from \"./operations/model/index.js\";\nimport { createEntriesStorageOperations } from \"./operations/entry/index.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { createElasticsearchIndex } from \"~/elasticsearch/createElasticsearchIndex.js\";\nimport { createGroupsStorageOperations } from \"~/operations/group/index.js\";\nimport { createOpenSearchEntity, createOpenSearchTable } from \"@webiny/api-opensearch\";\nimport { deleteElasticsearchIndex } from \"./elasticsearch/deleteElasticsearchIndex.js\";\nimport { createCreateIndexTask } from \"~/tasks/createIndexTaskPlugin.js\";\nimport { ModelAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModel/index.js\";\nimport { ModelAfterCreateFromEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModelFrom/events.js\";\nimport { ModelAfterDeleteEventHandler } from \"@webiny/api-headless-cms/features/contentModel/DeleteModel/events.js\";\nimport { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\nimport { CompressionHandler } from \"@webiny/utils/exports/api.js\";\nimport { CmsEntryOpenSearchBodyModifier } from \"~/features/CmsEntryOpenSearchBodyModifier/index.js\";\nimport { CmsEntryOpenSearchSortModifier } from \"~/features/CmsEntryOpenSearchSortModifier/index.js\";\nimport { CmsEntryOpenSearchQueryModifier } from \"~/features/CmsEntryOpenSearchQueryModifier/index.js\";\nimport { CmsEntryOpenSearchFullTextSearch } from \"~/features/CmsEntryOpenSearchFullTextSearch/index.js\";\nimport { CmsEntryOpenSearchValuesModifier } from \"~/features/CmsEntryOpenSearchValuesModifier/index.js\";\nimport {\n CmsEntryOpenSearchFieldIndexFeature,\n CmsEntryOpenSearchFieldIndexRegistry\n} from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\nimport {\n CmsEntryOpenSearchFilterFeature,\n CmsEntryOpenSearchFilterRegistry\n} from \"~/features/CmsEntryOpenSearchFilter/index.js\";\n\nconst createOpenSearchStorageOperations: IStorageOperationsFactory = params => {\n const { table, esTable, documentClient, elasticsearch, plugins, container } = params;\n\n const tableInstance = createTable({\n name: table || (process.env.DB_TABLE as string),\n documentClient\n });\n const tableElasticsearchInstance = createOpenSearchTable({\n name: esTable,\n documentClient\n });\n\n const entities = {\n groups: createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n }),\n models: createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n }),\n entries: createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n }),\n entriesEs: createOpenSearchEntity({\n entityName: ENTITIES.ENTRIES_ES,\n table: tableElasticsearchInstance\n })\n };\n\n const fieldRegistry = container.resolve(CmsModelFieldToGraphQLRegistry);\n const fieldIndexRegistry = container.resolve(CmsEntryOpenSearchFieldIndexRegistry);\n const compressionHandler = container.resolve(CompressionHandler);\n const bodyModifiers = container.resolveAll(CmsEntryOpenSearchBodyModifier);\n const sortModifiers = container.resolveAll(CmsEntryOpenSearchSortModifier);\n const queryModifiers = container.resolveAll(CmsEntryOpenSearchQueryModifier);\n const valueSearchRegistry = container.resolve(CmsEntryOpenSearchValueSearchRegistry);\n const fullTextSearches = container.resolveAll(CmsEntryOpenSearchFullTextSearch);\n const valuesModifiers = container.resolveAll(CmsEntryOpenSearchValuesModifier);\n const filterRegistry = container.resolve(CmsEntryOpenSearchFilterRegistry);\n\n container.registerFactory(ModelAfterCreateEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await createElasticsearchIndex({\n client: elasticsearch,\n model,\n indexConfigs: container.resolveAll(CmsEntryOpenSearchIndex)\n });\n }\n }));\n\n container.registerFactory(ModelAfterCreateFromEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await createElasticsearchIndex({\n client: elasticsearch,\n model,\n indexConfigs: container.resolveAll(CmsEntryOpenSearchIndex)\n });\n }\n }));\n\n container.registerFactory(ModelAfterDeleteEventHandler, () => ({\n async handle(event) {\n const { model } = event.payload;\n await deleteElasticsearchIndex({\n client: elasticsearch,\n model\n });\n }\n }));\n\n const entries = createEntriesStorageOperations({\n entity: entities.entries,\n esEntity: entities.entriesEs,\n plugins,\n elasticsearch,\n fieldRegistry,\n fieldIndexRegistry,\n compressionHandler,\n bodyModifiers,\n sortModifiers,\n queryModifiers,\n valueSearchRegistry,\n fullTextSearches,\n valuesModifiers,\n filterRegistry\n });\n\n return {\n name: \"dynamodb:opensearch\",\n beforeInit: async context => {\n context.db.registry.register({\n item: entities.entries,\n app: \"cms\",\n tags: [\"regular\", entities.entries.name]\n });\n context.db.registry.register({\n item: entities.entriesEs,\n app: \"cms\",\n tags: [\"es\", entities.entriesEs.name]\n });\n // TODO we know that context is ok, but types are missing elasticsearch/opensearch\n // @ts-expect-error\n createCreateIndexTask(context);\n\n entries.dataLoaders.clearAll();\n },\n getEntities: () => entities,\n getTable: () => tableInstance,\n getEsTable: () => tableElasticsearchInstance,\n groups: createGroupsStorageOperations({\n entity: entities.groups,\n container\n }),\n models: createModelsStorageOperations({\n entity: entities.models,\n elasticsearch\n }),\n entries\n };\n};\n\nclass OpenSearchStorageOperationsFactoryImpl\n implements StorageOperationsFactoryAbstraction.Interface\n{\n public async create(context: CmsContext) {\n return createOpenSearchStorageOperations({\n documentClient: context.db.driver.getClient() as DynamoDBDocument,\n elasticsearch: context.opensearch,\n plugins: context.plugins,\n container: context.container\n });\n }\n}\n\nconst OpenSearchStorageOperationsFactory = StorageOperationsFactoryAbstraction.createImplementation(\n {\n implementation: OpenSearchStorageOperationsFactoryImpl,\n dependencies: []\n }\n);\n\nconst storageOperationsFeature = createFeature({\n name: \"cms.storageOperations.openSearch\",\n register: container => {\n CmsEntryOpenSearchFieldIndexFeature.register(container);\n CmsEntryOpenSearchFilterFeature.register(container);\n CmsEntryOpenSearchIndexFeature.register(container);\n CmsEntryOpenSearchValueSearchFeature.register(container);\n container.register(OpenSearchStorageOperationsFactory).inSingletonScope();\n }\n});\n\nexport const registerCmsOpenSearchStorageOperations = () => {\n return [\n registerDynamoDbExtension(),\n createRegisterExtensionPlugin(context => {\n return storageOperationsFeature.register(context.container);\n })\n ];\n};\n"],"names":["createOpenSearchStorageOperations","params","table","esTable","documentClient","elasticsearch","plugins","container","tableInstance","createTable","process","tableElasticsearchInstance","createOpenSearchTable","entities","createGroupEntity","ENTITIES","createModelEntity","createEntryEntity","createOpenSearchEntity","fieldRegistry","CmsModelFieldToGraphQLRegistry","fieldIndexRegistry","CmsEntryOpenSearchFieldIndexRegistry","compressionHandler","CompressionHandler","bodyModifiers","CmsEntryOpenSearchBodyModifier","sortModifiers","CmsEntryOpenSearchSortModifier","queryModifiers","CmsEntryOpenSearchQueryModifier","valueSearchRegistry","CmsEntryOpenSearchValueSearchRegistry","fullTextSearches","CmsEntryOpenSearchFullTextSearch","valuesModifiers","CmsEntryOpenSearchValuesModifier","filterRegistry","CmsEntryOpenSearchFilterRegistry","ModelAfterCreateEventHandler","event","model","createElasticsearchIndex","CmsEntryOpenSearchIndex","ModelAfterCreateFromEventHandler","ModelAfterDeleteEventHandler","deleteElasticsearchIndex","entries","createEntriesStorageOperations","context","createCreateIndexTask","createGroupsStorageOperations","createModelsStorageOperations","OpenSearchStorageOperationsFactoryImpl","OpenSearchStorageOperationsFactory","StorageOperationsFactoryAbstraction","storageOperationsFeature","createFeature","CmsEntryOpenSearchFieldIndexFeature","CmsEntryOpenSearchFilterFeature","CmsEntryOpenSearchIndexFeature","CmsEntryOpenSearchValueSearchFeature","registerCmsOpenSearchStorageOperations","registerDynamoDbExtension","createRegisterExtensionPlugin"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAMA,oCAA+DC,CAAAA;IACjE,MAAM,EAAEC,KAAK,EAAEC,OAAO,EAAEC,cAAc,EAAEC,aAAa,EAAEC,OAAO,EAAEC,SAAS,EAAE,GAAGN;IAE9E,MAAMO,gBAAgBC,YAAY;QAC9B,MA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J;AAEA,MAAMK,qCAAqCC,yBAAAA,oBAAwD,CAC/F;IACI,gBAAgBF;IAChB,cAAc,EAAE;AACpB;AAGJ,MAAMG,2BAA2BC,cAAc;IAC3C,MAAM;IACN,UAAUlD,CAAAA;QACNmD,oCAAoC,QAAQ,CAACnD;QAC7CoD,gCAAgC,QAAQ,CAACpD;QACzCqD,+BAA+B,QAAQ,CAACrD;QACxCsD,qCAAqC,QAAQ,CAACtD;QAC9CA,UAAU,QAAQ,CAAC+C,oCAAoC,gBAAgB;IAC3E;AACJ;AAEO,MAAMQ,yCAAyC,IAC3C;QACHC;QACAC,8BAA8Bf,CAAAA,UACnBO,yBAAyB,QAAQ,CAACP,QAAQ,SAAS;KAEjE"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "@webiny/feature/api";
2
- export const CmsEntryOpenSearchBodyModifier = createAbstraction("Cms/Entry/OpenSearch/BodyModifier");
2
+ const CmsEntryOpenSearchBodyModifier = createAbstraction("Cms/Entry/OpenSearch/BodyModifier");
3
+ export { CmsEntryOpenSearchBodyModifier };
3
4
 
4
5
  //# sourceMappingURL=abstractions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","CmsEntryOpenSearchBodyModifier"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { SearchBody } from \"@webiny/api-opensearch\";\n\nexport interface ModifyBodyParams {\n body: SearchBody;\n model: CmsModel;\n where: Record<string, any>;\n}\n\nexport interface ICmsEntryOpenSearchBodyModifier {\n readonly modelId?: string;\n modifyBody(params: ModifyBodyParams): void;\n}\n\nexport const CmsEntryOpenSearchBodyModifier = createAbstraction<ICmsEntryOpenSearchBodyModifier>(\n \"Cms/Entry/OpenSearch/BodyModifier\"\n);\n\nexport namespace CmsEntryOpenSearchBodyModifier {\n export type Interface = ICmsEntryOpenSearchBodyModifier;\n export type Params = ModifyBodyParams;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAevD,OAAO,MAAMC,8BAA8B,GAAGD,iBAAiB,CAC3D,mCACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchBodyModifier/abstractions.js","sources":["../../../src/features/CmsEntryOpenSearchBodyModifier/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { SearchBody } from \"@webiny/api-opensearch\";\n\nexport interface ModifyBodyParams {\n body: SearchBody;\n model: CmsModel;\n where: Record<string, any>;\n}\n\nexport interface ICmsEntryOpenSearchBodyModifier {\n readonly modelId?: string;\n modifyBody(params: ModifyBodyParams): void;\n}\n\nexport const CmsEntryOpenSearchBodyModifier = createAbstraction<ICmsEntryOpenSearchBodyModifier>(\n \"Cms/Entry/OpenSearch/BodyModifier\"\n);\n\nexport namespace CmsEntryOpenSearchBodyModifier {\n export type Interface = ICmsEntryOpenSearchBodyModifier;\n export type Params = ModifyBodyParams;\n}\n"],"names":["CmsEntryOpenSearchBodyModifier","createAbstraction"],"mappings":";AAeO,MAAMA,iCAAiCC,kBAC1C"}
@@ -1,3 +1 @@
1
1
  export { CmsEntryOpenSearchBodyModifier } from "./abstractions.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,36 +1,37 @@
1
- import { CmsEntryOpenSearchFieldIndexRegistry as Abstraction } from "./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js";
1
+ import { CmsEntryOpenSearchFieldIndexRegistry } from "./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js";
2
2
  import { CmsEntryOpenSearchFieldIndex } from "./abstractions/CmsEntryOpenSearchFieldIndex.js";
3
3
  import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
4
4
  import { FIELD_INDEXING_DEFAULT } from "./constants.js";
5
5
  class CmsEntryOpenSearchFieldIndexRegistryImpl {
6
- constructor(fieldIndexing) {
7
- this.fieldIndexing = fieldIndexing;
8
- }
9
- get(type) {
10
- const fieldType = getBaseFieldType({
11
- type
12
- });
13
- return this.fieldIndexing.find(field => field.fieldType === fieldType);
14
- }
15
- getDefault() {
16
- const fieldIndex = this.fieldIndexing.find(field => field.fieldType === FIELD_INDEXING_DEFAULT);
17
- if (fieldIndex) {
18
- return fieldIndex;
6
+ constructor(fieldIndexing){
7
+ this.fieldIndexing = fieldIndexing;
8
+ }
9
+ get(type) {
10
+ const fieldType = getBaseFieldType({
11
+ type
12
+ });
13
+ return this.fieldIndexing.find((field)=>field.fieldType === fieldType);
14
+ }
15
+ getDefault() {
16
+ const fieldIndex = this.fieldIndexing.find((field)=>field.fieldType === FIELD_INDEXING_DEFAULT);
17
+ if (fieldIndex) return fieldIndex;
18
+ throw new Error(`Missing default field index plugin. Please make sure to register a plugin with "${FIELD_INDEXING_DEFAULT}" field type.`);
19
+ }
20
+ getAll() {
21
+ return this.fieldIndexing;
19
22
  }
20
- /**
21
- * This should never happen, as the default field index plugin exists in our code. This can fail during testing.
22
- */
23
- throw new Error(`Missing default field index plugin. Please make sure to register a plugin with "${FIELD_INDEXING_DEFAULT}" field type.`);
24
- }
25
- getAll() {
26
- return this.fieldIndexing;
27
- }
28
23
  }
29
- export const CmsEntryOpenSearchFieldIndexRegistry = Abstraction.createImplementation({
30
- implementation: CmsEntryOpenSearchFieldIndexRegistryImpl,
31
- dependencies: [[CmsEntryOpenSearchFieldIndex, {
32
- multiple: true
33
- }]]
24
+ const CmsEntryOpenSearchFieldIndexRegistry_CmsEntryOpenSearchFieldIndexRegistry = CmsEntryOpenSearchFieldIndexRegistry.createImplementation({
25
+ implementation: CmsEntryOpenSearchFieldIndexRegistryImpl,
26
+ dependencies: [
27
+ [
28
+ CmsEntryOpenSearchFieldIndex,
29
+ {
30
+ multiple: true
31
+ }
32
+ ]
33
+ ]
34
34
  });
35
+ export { CmsEntryOpenSearchFieldIndexRegistry_CmsEntryOpenSearchFieldIndexRegistry as CmsEntryOpenSearchFieldIndexRegistry };
35
36
 
36
37
  //# sourceMappingURL=CmsEntryOpenSearchFieldIndexRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CmsEntryOpenSearchFieldIndexRegistry","Abstraction","CmsEntryOpenSearchFieldIndex","getBaseFieldType","FIELD_INDEXING_DEFAULT","CmsEntryOpenSearchFieldIndexRegistryImpl","constructor","fieldIndexing","get","type","fieldType","find","field","getDefault","fieldIndex","Error","getAll","createImplementation","implementation","dependencies","multiple"],"sources":["CmsEntryOpenSearchFieldIndexRegistry.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndexRegistry as Abstraction } from \"./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"./abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\nimport { FIELD_INDEXING_DEFAULT } from \"./constants.js\";\n\nclass CmsEntryOpenSearchFieldIndexRegistryImpl implements Abstraction.Interface {\n public constructor(private readonly fieldIndexing: CmsEntryOpenSearchFieldIndex.Interface[]) {}\n\n public get(type: string): CmsEntryOpenSearchFieldIndex.Interface | undefined {\n const fieldType = getBaseFieldType({\n type\n });\n return this.fieldIndexing.find(field => field.fieldType === fieldType);\n }\n\n public getDefault(): CmsEntryOpenSearchFieldIndex.Interface {\n const fieldIndex = this.fieldIndexing.find(\n field => field.fieldType === FIELD_INDEXING_DEFAULT\n );\n if (fieldIndex) {\n return fieldIndex;\n }\n /**\n * This should never happen, as the default field index plugin exists in our code. This can fail during testing.\n */\n throw new Error(\n `Missing default field index plugin. Please make sure to register a plugin with \"${FIELD_INDEXING_DEFAULT}\" field type.`\n );\n }\n\n public getAll(): CmsEntryOpenSearchFieldIndex.Interface[] {\n return this.fieldIndexing;\n }\n}\n\nexport const CmsEntryOpenSearchFieldIndexRegistry = Abstraction.createImplementation({\n implementation: CmsEntryOpenSearchFieldIndexRegistryImpl,\n dependencies: [[CmsEntryOpenSearchFieldIndex, { multiple: true }]]\n});\n"],"mappings":"AAAA,SAASA,oCAAoC,IAAIC,WAAW;AAC5D,SAASC,4BAA4B;AACrC,SAASC,gBAAgB,QAAQ,oDAAoD;AACrF,SAASC,sBAAsB;AAE/B,MAAMC,wCAAwC,CAAkC;EACrEC,WAAWA,CAAkBC,aAAuD,EAAE;IAAA,KAAzDA,aAAuD,GAAvDA,aAAuD;EAAG;EAEvFC,GAAGA,CAACC,IAAY,EAAsD;IACzE,MAAMC,SAAS,GAAGP,gBAAgB,CAAC;MAC/BM;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACF,aAAa,CAACI,IAAI,CAACC,KAAK,IAAIA,KAAK,CAACF,SAAS,KAAKA,SAAS,CAAC;EAC1E;EAEOG,UAAUA,CAAA,EAA2C;IACxD,MAAMC,UAAU,GAAG,IAAI,CAACP,aAAa,CAACI,IAAI,CACtCC,KAAK,IAAIA,KAAK,CAACF,SAAS,KAAKN,sBACjC,CAAC;IACD,IAAIU,UAAU,EAAE;MACZ,OAAOA,UAAU;IACrB;IACA;AACR;AACA;IACQ,MAAM,IAAIC,KAAK,CACX,mFAAmFX,sBAAsB,eAC7G,CAAC;EACL;EAEOY,MAAMA,CAAA,EAA6C;IACtD,OAAO,IAAI,CAACT,aAAa;EAC7B;AACJ;AAEA,OAAO,MAAMP,oCAAoC,GAAGC,WAAW,CAACgB,oBAAoB,CAAC;EACjFC,cAAc,EAAEb,wCAAwC;EACxDc,YAAY,EAAE,CAAC,CAACjB,4BAA4B,EAAE;IAAEkB,QAAQ,EAAE;EAAK,CAAC,CAAC;AACrE,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js","sources":["../../../src/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.ts"],"sourcesContent":["import { CmsEntryOpenSearchFieldIndexRegistry as Abstraction } from \"./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js\";\nimport { CmsEntryOpenSearchFieldIndex } from \"./abstractions/CmsEntryOpenSearchFieldIndex.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\nimport { FIELD_INDEXING_DEFAULT } from \"./constants.js\";\n\nclass CmsEntryOpenSearchFieldIndexRegistryImpl implements Abstraction.Interface {\n public constructor(private readonly fieldIndexing: CmsEntryOpenSearchFieldIndex.Interface[]) {}\n\n public get(type: string): CmsEntryOpenSearchFieldIndex.Interface | undefined {\n const fieldType = getBaseFieldType({\n type\n });\n return this.fieldIndexing.find(field => field.fieldType === fieldType);\n }\n\n public getDefault(): CmsEntryOpenSearchFieldIndex.Interface {\n const fieldIndex = this.fieldIndexing.find(\n field => field.fieldType === FIELD_INDEXING_DEFAULT\n );\n if (fieldIndex) {\n return fieldIndex;\n }\n /**\n * This should never happen, as the default field index plugin exists in our code. This can fail during testing.\n */\n throw new Error(\n `Missing default field index plugin. Please make sure to register a plugin with \"${FIELD_INDEXING_DEFAULT}\" field type.`\n );\n }\n\n public getAll(): CmsEntryOpenSearchFieldIndex.Interface[] {\n return this.fieldIndexing;\n }\n}\n\nexport const CmsEntryOpenSearchFieldIndexRegistry = Abstraction.createImplementation({\n implementation: CmsEntryOpenSearchFieldIndexRegistryImpl,\n dependencies: [[CmsEntryOpenSearchFieldIndex, { multiple: true }]]\n});\n"],"names":["CmsEntryOpenSearchFieldIndexRegistryImpl","fieldIndexing","type","fieldType","getBaseFieldType","field","fieldIndex","FIELD_INDEXING_DEFAULT","Error","CmsEntryOpenSearchFieldIndexRegistry","Abstraction","CmsEntryOpenSearchFieldIndex"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoCC,aAAuD,CAAE;aAAzDA,aAAa,GAAbA;IAA0D;IAEvF,IAAIC,IAAY,EAAsD;QACzE,MAAMC,YAAYC,iBAAiB;YAC/BF;QACJ;QACA,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAACG,CAAAA,QAASA,MAAM,SAAS,KAAKF;IAChE;IAEO,aAAqD;QACxD,MAAMG,aAAa,IAAI,CAAC,aAAa,CAAC,IAAI,CACtCD,CAAAA,QAASA,MAAM,SAAS,KAAKE;QAEjC,IAAID,YACA,OAAOA;QAKX,MAAM,IAAIE,MACN,CAAC,gFAAgF,EAAED,uBAAuB,aAAa,CAAC;IAEhI;IAEO,SAAmD;QACtD,OAAO,IAAI,CAAC,aAAa;IAC7B;AACJ;AAEO,MAAME,4EAAuCC,qCAAAA,oBAAgC,CAAC;IACjF,gBAAgBV;IAChB,cAAc;QAAC;YAACW;YAA8B;gBAAE,UAAU;YAAK;SAAE;KAAC;AACtE"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "@webiny/feature/api";
2
- export const CmsEntryOpenSearchFieldIndex = createAbstraction("Cms/Entry/OpenSearch/FieldIndex");
2
+ const CmsEntryOpenSearchFieldIndex = createAbstraction("Cms/Entry/OpenSearch/FieldIndex");
3
+ export { CmsEntryOpenSearchFieldIndex };
3
4
 
4
5
  //# sourceMappingURL=CmsEntryOpenSearchFieldIndex.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","CmsEntryOpenSearchFieldIndex"],"sources":["CmsEntryOpenSearchFieldIndex.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\n\nexport interface ToIndexParams {\n model: CmsModel;\n field: CmsModelField;\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n value: any;\n rawValue: any;\n getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;\n}\n\nexport interface ToIndexValue {\n value?: any;\n rawValue?: any;\n}\n\nexport interface FromIndexParams {\n model: CmsModel;\n field: CmsModelField;\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n value: any;\n rawValue: any;\n getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;\n}\n\nexport interface ICmsEntryOpenSearchFieldIndex {\n readonly fieldType: string;\n unmappedType?(field: Pick<CmsModelField, \"fieldId\" | \"type\">): string;\n toIndex(params: ToIndexParams): ToIndexValue;\n fromIndex(params: FromIndexParams): any;\n}\n\nexport const CmsEntryOpenSearchFieldIndex = createAbstraction<ICmsEntryOpenSearchFieldIndex>(\n \"Cms/Entry/OpenSearch/FieldIndex\"\n);\n\nexport namespace CmsEntryOpenSearchFieldIndex {\n export type Interface = ICmsEntryOpenSearchFieldIndex;\n export type ToIndex = ToIndexParams;\n export type ToValue = ToIndexValue;\n export type FromIndex = FromIndexParams;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAkCvD,OAAO,MAAMC,4BAA4B,GAAGD,iBAAiB,CACzD,iCACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsModelFieldToGraphQLRegistry } from \"@webiny/api-headless-cms/exports/api/cms/graphql.js\";\n\nexport interface ToIndexParams {\n model: CmsModel;\n field: CmsModelField;\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n value: any;\n rawValue: any;\n getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;\n}\n\nexport interface ToIndexValue {\n value?: any;\n rawValue?: any;\n}\n\nexport interface FromIndexParams {\n model: CmsModel;\n field: CmsModelField;\n fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;\n value: any;\n rawValue: any;\n getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;\n}\n\nexport interface ICmsEntryOpenSearchFieldIndex {\n readonly fieldType: string;\n unmappedType?(field: Pick<CmsModelField, \"fieldId\" | \"type\">): string;\n toIndex(params: ToIndexParams): ToIndexValue;\n fromIndex(params: FromIndexParams): any;\n}\n\nexport const CmsEntryOpenSearchFieldIndex = createAbstraction<ICmsEntryOpenSearchFieldIndex>(\n \"Cms/Entry/OpenSearch/FieldIndex\"\n);\n\nexport namespace CmsEntryOpenSearchFieldIndex {\n export type Interface = ICmsEntryOpenSearchFieldIndex;\n export type ToIndex = ToIndexParams;\n export type ToValue = ToIndexValue;\n export type FromIndex = FromIndexParams;\n}\n"],"names":["CmsEntryOpenSearchFieldIndex","createAbstraction"],"mappings":";AAkCO,MAAMA,+BAA+BC,kBACxC"}
@@ -1,4 +1,5 @@
1
1
  import { createAbstraction } from "@webiny/feature/api";
2
- export const CmsEntryOpenSearchFieldIndexRegistry = createAbstraction("Cms/Entry/OpenSearch/FieldIndexRegistry");
2
+ const CmsEntryOpenSearchFieldIndexRegistry = createAbstraction("Cms/Entry/OpenSearch/FieldIndexRegistry");
3
+ export { CmsEntryOpenSearchFieldIndexRegistry };
3
4
 
4
5
  //# sourceMappingURL=CmsEntryOpenSearchFieldIndexRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createAbstraction","CmsEntryOpenSearchFieldIndexRegistry"],"sources":["CmsEntryOpenSearchFieldIndexRegistry.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsEntryOpenSearchFieldIndex } from \"./CmsEntryOpenSearchFieldIndex.js\";\n\nexport interface ICmsEntryOpenSearchFieldIndexRegistry {\n get(fieldType: string): CmsEntryOpenSearchFieldIndex.Interface | undefined;\n getDefault(): CmsEntryOpenSearchFieldIndex.Interface;\n getAll(): CmsEntryOpenSearchFieldIndex.Interface[];\n}\n\nexport const CmsEntryOpenSearchFieldIndexRegistry =\n createAbstraction<ICmsEntryOpenSearchFieldIndexRegistry>(\n \"Cms/Entry/OpenSearch/FieldIndexRegistry\"\n );\n\nexport namespace CmsEntryOpenSearchFieldIndexRegistry {\n export type Interface = ICmsEntryOpenSearchFieldIndexRegistry;\n export type FieldIndex = CmsEntryOpenSearchFieldIndex.Interface;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AASvD,OAAO,MAAMC,oCAAoC,GAC7CD,iBAAiB,CACb,yCACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js","sources":["../../../../src/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { CmsEntryOpenSearchFieldIndex } from \"./CmsEntryOpenSearchFieldIndex.js\";\n\nexport interface ICmsEntryOpenSearchFieldIndexRegistry {\n get(fieldType: string): CmsEntryOpenSearchFieldIndex.Interface | undefined;\n getDefault(): CmsEntryOpenSearchFieldIndex.Interface;\n getAll(): CmsEntryOpenSearchFieldIndex.Interface[];\n}\n\nexport const CmsEntryOpenSearchFieldIndexRegistry =\n createAbstraction<ICmsEntryOpenSearchFieldIndexRegistry>(\n \"Cms/Entry/OpenSearch/FieldIndexRegistry\"\n );\n\nexport namespace CmsEntryOpenSearchFieldIndexRegistry {\n export type Interface = ICmsEntryOpenSearchFieldIndexRegistry;\n export type FieldIndex = CmsEntryOpenSearchFieldIndex.Interface;\n}\n"],"names":["CmsEntryOpenSearchFieldIndexRegistry","createAbstraction"],"mappings":";AASO,MAAMA,uCACTC,kBACI"}
@@ -1,3 +1,4 @@
1
- export const FIELD_INDEXING_DEFAULT = "*";
1
+ const FIELD_INDEXING_DEFAULT = "*";
2
+ export { FIELD_INDEXING_DEFAULT };
2
3
 
3
4
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["FIELD_INDEXING_DEFAULT"],"sources":["constants.ts"],"sourcesContent":["export const FIELD_INDEXING_DEFAULT = \"*\" as const;\n"],"mappings":"AAAA,OAAO,MAAMA,sBAAsB,GAAG,GAAY","ignoreList":[]}
1
+ {"version":3,"file":"features/CmsEntryOpenSearchFieldIndex/constants.js","sources":["../../../src/features/CmsEntryOpenSearchFieldIndex/constants.ts"],"sourcesContent":["export const FIELD_INDEXING_DEFAULT = \"*\" as const;\n"],"names":["FIELD_INDEXING_DEFAULT"],"mappings":"AAAO,MAAMA,yBAAyB"}
@@ -7,18 +7,19 @@ import { NumberFieldIndex } from "./fields/NumberFieldIndex.js";
7
7
  import { DefaultFieldIndex } from "./fields/DefaultFieldIndex.js";
8
8
  import { DateTimeFieldIndex } from "./fields/DateTimeFieldIndex.js";
9
9
  import { ObjectFieldIndex } from "./fields/ObjectFieldIndex.js";
10
- export const CmsEntryOpenSearchFieldIndexFeature = createFeature({
11
- name: "Cms/Entry/OpenSearch/FieldIndexFeature",
12
- register: container => {
13
- container.register(RichTextFieldIndex);
14
- container.register(JsonFieldIndex);
15
- container.register(LongTextFieldIndex);
16
- container.register(NumberFieldIndex);
17
- container.register(DefaultFieldIndex);
18
- container.register(DateTimeFieldIndex);
19
- container.register(ObjectFieldIndex);
20
- container.register(CmsEntryOpenSearchFieldIndexRegistry);
21
- }
10
+ const CmsEntryOpenSearchFieldIndexFeature = createFeature({
11
+ name: "Cms/Entry/OpenSearch/FieldIndexFeature",
12
+ register: (container)=>{
13
+ container.register(RichTextFieldIndex);
14
+ container.register(JsonFieldIndex);
15
+ container.register(LongTextFieldIndex);
16
+ container.register(NumberFieldIndex);
17
+ container.register(DefaultFieldIndex);
18
+ container.register(DateTimeFieldIndex);
19
+ container.register(ObjectFieldIndex);
20
+ container.register(CmsEntryOpenSearchFieldIndexRegistry);
21
+ }
22
22
  });
23
+ export { CmsEntryOpenSearchFieldIndexFeature };
23
24
 
24
25
  //# sourceMappingURL=feature.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createFeature","CmsEntryOpenSearchFieldIndexRegistry","RichTextFieldIndex","JsonFieldIndex","LongTextFieldIndex","NumberFieldIndex","DefaultFieldIndex","DateTimeFieldIndex","ObjectFieldIndex","CmsEntryOpenSearchFieldIndexFeature","name","register","container"],"sources":["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\";\n\nexport const CmsEntryOpenSearchFieldIndexFeature = createFeature({\n name: \"Cms/Entry/OpenSearch/FieldIndexFeature\",\n register: container => {\n container.register(RichTextFieldIndex);\n container.register(JsonFieldIndex);\n container.register(LongTextFieldIndex);\n container.register(NumberFieldIndex);\n container.register(DefaultFieldIndex);\n container.register(DateTimeFieldIndex);\n container.register(ObjectFieldIndex);\n container.register(CmsEntryOpenSearchFieldIndexRegistry);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,oCAAoC;AAC7C,SAASC,kBAAkB;AAC3B,SAASC,cAAc;AACvB,SAASC,kBAAkB;AAC3B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;AAC3B,SAASC,gBAAgB;AAEzB,OAAO,MAAMC,mCAAmC,GAAGT,aAAa,CAAC;EAC7DU,IAAI,EAAE,wCAAwC;EAC9CC,QAAQ,EAAEC,SAAS,IAAI;IACnBA,SAAS,CAACD,QAAQ,CAACT,kBAAkB,CAAC;IACtCU,SAAS,CAACD,QAAQ,CAACR,cAAc,CAAC;IAClCS,SAAS,CAACD,QAAQ,CAACP,kBAAkB,CAAC;IACtCQ,SAAS,CAACD,QAAQ,CAACN,gBAAgB,CAAC;IACpCO,SAAS,CAACD,QAAQ,CAACL,iBAAiB,CAAC;IACrCM,SAAS,CAACD,QAAQ,CAACJ,kBAAkB,CAAC;IACtCK,SAAS,CAACD,QAAQ,CAACH,gBAAgB,CAAC;IACpCI,SAAS,CAACD,QAAQ,CAACV,oCAAoC,CAAC;EAC5D;AACJ,CAAC,CAAC","ignoreList":[]}
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\";\n\nexport const CmsEntryOpenSearchFieldIndexFeature = createFeature({\n name: \"Cms/Entry/OpenSearch/FieldIndexFeature\",\n register: container => {\n container.register(RichTextFieldIndex);\n container.register(JsonFieldIndex);\n container.register(LongTextFieldIndex);\n container.register(NumberFieldIndex);\n container.register(DefaultFieldIndex);\n container.register(DateTimeFieldIndex);\n container.register(ObjectFieldIndex);\n container.register(CmsEntryOpenSearchFieldIndexRegistry);\n }\n});\n"],"names":["CmsEntryOpenSearchFieldIndexFeature","createFeature","container","RichTextFieldIndex","JsonFieldIndex","LongTextFieldIndex","NumberFieldIndex","DefaultFieldIndex","DateTimeFieldIndex","ObjectFieldIndex","CmsEntryOpenSearchFieldIndexRegistry"],"mappings":";;;;;;;;;AAUO,MAAMA,sCAAsCC,cAAc;IAC7D,MAAM;IACN,UAAUC,CAAAA;QACNA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QACnBN,UAAU,QAAQ,CAACO;QACnBP,UAAU,QAAQ,CAACQ;IACvB;AACJ"}