@webiny/api-headless-cms-ddb-es 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. package/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
  2. package/abstractions/CmsDdbEsDataLoaders.js +5 -0
  3. package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
  4. package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
  5. package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
  6. package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
  7. package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
  8. package/abstractions/CmsDdbEsEntryEntity.js +5 -0
  9. package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
  10. package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
  11. package/abstractions/CmsDdbEsGroupEntity.js +5 -0
  12. package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
  13. package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
  14. package/abstractions/CmsDdbEsModelEntity.js +5 -0
  15. package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
  16. package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
  17. package/abstractions/CmsDdbEsOsTable.js +5 -0
  18. package/abstractions/CmsDdbEsOsTable.js.map +1 -0
  19. package/abstractions/CmsDdbEsTable.d.ts +5 -0
  20. package/abstractions/CmsDdbEsTable.js +5 -0
  21. package/abstractions/CmsDdbEsTable.js.map +1 -0
  22. package/definitions/entry.js +7 -9
  23. package/definitions/entry.js.map +1 -1
  24. package/definitions/group.js +7 -9
  25. package/definitions/group.js.map +1 -1
  26. package/definitions/model.js +7 -9
  27. package/definitions/model.js.map +1 -1
  28. package/definitions/types.d.ts +4 -0
  29. package/definitions/types.js +0 -3
  30. package/feature.d.ts +9 -1
  31. package/feature.js +46 -179
  32. package/feature.js.map +1 -1
  33. package/index.d.ts +2 -1
  34. package/index.js +2 -3
  35. package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
  36. package/operations/entry/DdbEsCreateEntry.js +134 -0
  37. package/operations/entry/DdbEsCreateEntry.js.map +1 -0
  38. package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
  39. package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
  40. package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
  41. package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
  42. package/operations/entry/DdbEsDeleteEntry.js +79 -0
  43. package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
  44. package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
  45. package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
  46. package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
  47. package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
  48. package/operations/entry/DdbEsDeleteMultipleEntries.js +80 -0
  49. package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
  50. package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
  51. package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
  52. package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
  53. package/operations/entry/DdbEsGetEntry.d.ts +14 -0
  54. package/operations/entry/DdbEsGetEntry.js +27 -0
  55. package/operations/entry/DdbEsGetEntry.js.map +1 -0
  56. package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
  57. package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
  58. package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
  59. package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
  60. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
  61. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
  62. package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
  63. package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
  64. package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
  65. package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
  66. package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
  67. package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
  68. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
  69. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
  70. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
  71. package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
  72. package/operations/entry/DdbEsGetRevisionById.js +34 -0
  73. package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
  74. package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
  75. package/operations/entry/DdbEsGetRevisions.js +33 -0
  76. package/operations/entry/DdbEsGetRevisions.js.map +1 -0
  77. package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
  78. package/operations/entry/DdbEsGetUniqueFieldValues.js +76 -0
  79. package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
  80. package/operations/entry/DdbEsListEntries.d.ts +25 -0
  81. package/operations/entry/DdbEsListEntries.js +91 -0
  82. package/operations/entry/DdbEsListEntries.js.map +1 -0
  83. package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
  84. package/operations/entry/DdbEsMoveEntry.js +113 -0
  85. package/operations/entry/DdbEsMoveEntry.js.map +1 -0
  86. package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
  87. package/operations/entry/DdbEsMoveToBin.js +137 -0
  88. package/operations/entry/DdbEsMoveToBin.js.map +1 -0
  89. package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
  90. package/operations/entry/DdbEsPublishEntry.js +231 -0
  91. package/operations/entry/DdbEsPublishEntry.js.map +1 -0
  92. package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
  93. package/operations/entry/DdbEsRestoreFromBin.js +137 -0
  94. package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
  95. package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
  96. package/operations/entry/DdbEsUnpublishEntry.js +127 -0
  97. package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
  98. package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
  99. package/operations/entry/DdbEsUpdateEntry.js +175 -0
  100. package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
  101. package/operations/entry/dataLoader/DataLoaderCache.js +22 -26
  102. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  103. package/operations/entry/dataLoader/constants.js +2 -1
  104. package/operations/entry/dataLoader/constants.js.map +1 -1
  105. package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
  106. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  107. package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -29
  108. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  109. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +27 -37
  110. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  111. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +27 -37
  112. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  113. package/operations/entry/dataLoader/getRevisionById.js +32 -46
  114. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  115. package/operations/entry/dataLoader/index.js +8 -9
  116. package/operations/entry/dataLoader/index.js.map +1 -1
  117. package/operations/entry/dataLoader/types.js +0 -3
  118. package/operations/entry/dataLoaders.d.ts +5 -5
  119. package/operations/entry/dataLoaders.js +89 -99
  120. package/operations/entry/dataLoaders.js.map +1 -1
  121. package/{features/CmsEntryOpenSearchIndex → operations/entry}/feature.d.ts +1 -1
  122. package/operations/entry/feature.js +53 -0
  123. package/operations/entry/feature.js.map +1 -0
  124. package/operations/entry/keys.js +43 -63
  125. package/operations/entry/keys.js.map +1 -1
  126. package/operations/entry/recordType.js +4 -9
  127. package/operations/entry/recordType.js.map +1 -1
  128. package/operations/entry/storageEntryUtils.d.ts +7 -0
  129. package/operations/entry/storageEntryUtils.js +14 -0
  130. package/operations/entry/storageEntryUtils.js.map +1 -0
  131. package/operations/entry/transformations/convertEntryKeys.js +21 -26
  132. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  133. package/operations/entry/transformations/index.d.ts +2 -5
  134. package/operations/entry/transformations/index.js +85 -115
  135. package/operations/entry/transformations/index.js.map +1 -1
  136. package/operations/entry/transformations/modifyEntryValues.d.ts +3 -3
  137. package/operations/entry/transformations/modifyEntryValues.js +12 -17
  138. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  139. package/operations/entry/transformations/transformEntryKeys.js +13 -16
  140. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  141. package/operations/group/DdbEsCreateGroup.d.ts +12 -0
  142. package/operations/group/DdbEsCreateGroup.js +35 -0
  143. package/operations/group/DdbEsCreateGroup.js.map +1 -0
  144. package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
  145. package/operations/group/DdbEsDeleteGroup.js +31 -0
  146. package/operations/group/DdbEsDeleteGroup.js.map +1 -0
  147. package/operations/group/DdbEsGetGroup.d.ts +12 -0
  148. package/operations/group/DdbEsGetGroup.js +31 -0
  149. package/operations/group/DdbEsGetGroup.js.map +1 -0
  150. package/operations/group/DdbEsListGroups.d.ts +14 -0
  151. package/operations/group/DdbEsListGroups.js +52 -0
  152. package/operations/group/DdbEsListGroups.js.map +1 -0
  153. package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
  154. package/operations/group/DdbEsUpdateGroup.js +35 -0
  155. package/operations/group/DdbEsUpdateGroup.js.map +1 -0
  156. package/{features/CmsEntryOpenSearchFilter → operations/group}/feature.d.ts +1 -1
  157. package/operations/group/feature.js +19 -0
  158. package/operations/group/feature.js.map +1 -0
  159. package/operations/group/keys.d.ts +15 -0
  160. package/operations/group/keys.js +17 -0
  161. package/operations/group/keys.js.map +1 -0
  162. package/operations/model/DdbEsCreateModel.d.ts +16 -0
  163. package/operations/model/DdbEsCreateModel.js +56 -0
  164. package/operations/model/DdbEsCreateModel.js.map +1 -0
  165. package/operations/model/DdbEsDeleteModel.d.ts +12 -0
  166. package/operations/model/DdbEsDeleteModel.js +31 -0
  167. package/operations/model/DdbEsDeleteModel.js.map +1 -0
  168. package/operations/model/DdbEsGetModel.d.ts +12 -0
  169. package/operations/model/DdbEsGetModel.js +30 -0
  170. package/operations/model/DdbEsGetModel.js.map +1 -0
  171. package/operations/model/DdbEsListModels.d.ts +12 -0
  172. package/operations/model/DdbEsListModels.js +36 -0
  173. package/operations/model/DdbEsListModels.js.map +1 -0
  174. package/operations/model/DdbEsUpdateModel.d.ts +12 -0
  175. package/operations/model/DdbEsUpdateModel.js +36 -0
  176. package/operations/model/DdbEsUpdateModel.js.map +1 -0
  177. package/{features/CmsEntryOpenSearchFieldIndex → operations/model}/feature.d.ts +1 -1
  178. package/operations/model/feature.js +19 -0
  179. package/operations/model/feature.js.map +1 -0
  180. package/operations/model/keys.d.ts +15 -0
  181. package/operations/model/keys.js +17 -0
  182. package/operations/model/keys.js.map +1 -0
  183. package/package.json +33 -27
  184. package/requestFeature.d.ts +20 -0
  185. package/requestFeature.js +54 -0
  186. package/requestFeature.js.map +1 -0
  187. package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
  188. package/tasks/CreateElasticsearchIndexTask.js +40 -0
  189. package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
  190. package/types.d.ts +11 -50
  191. package/types.js +7 -13
  192. package/types.js.map +1 -1
  193. package/configurations.d.ts +0 -19
  194. package/configurations.js +0 -39
  195. package/configurations.js.map +0 -1
  196. package/definitions/types.js.map +0 -1
  197. package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
  198. package/elasticsearch/createElasticsearchIndex.js +0 -74
  199. package/elasticsearch/createElasticsearchIndex.js.map +0 -1
  200. package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
  201. package/elasticsearch/deleteElasticsearchIndex.js +0 -31
  202. package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
  203. package/exports/api/cms/opensearch.d.ts +0 -9
  204. package/exports/api/cms/opensearch.js +0 -11
  205. package/exports/api/cms/opensearch.js.map +0 -1
  206. package/features/CmsEntryOpenSearchBodyModifier/abstractions.d.ts +0 -16
  207. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js +0 -4
  208. package/features/CmsEntryOpenSearchBodyModifier/abstractions.js.map +0 -1
  209. package/features/CmsEntryOpenSearchBodyModifier/index.d.ts +0 -1
  210. package/features/CmsEntryOpenSearchBodyModifier/index.js +0 -3
  211. package/features/CmsEntryOpenSearchBodyModifier/index.js.map +0 -1
  212. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -13
  213. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js +0 -36
  214. package/features/CmsEntryOpenSearchFieldIndex/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
  215. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.d.ts +0 -35
  216. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js +0 -4
  217. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndex.js.map +0 -1
  218. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.d.ts +0 -11
  219. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js +0 -4
  220. package/features/CmsEntryOpenSearchFieldIndex/abstractions/CmsEntryOpenSearchFieldIndexRegistry.js.map +0 -1
  221. package/features/CmsEntryOpenSearchFieldIndex/constants.d.ts +0 -1
  222. package/features/CmsEntryOpenSearchFieldIndex/constants.js +0 -3
  223. package/features/CmsEntryOpenSearchFieldIndex/constants.js.map +0 -1
  224. package/features/CmsEntryOpenSearchFieldIndex/feature.js +0 -24
  225. package/features/CmsEntryOpenSearchFieldIndex/feature.js.map +0 -1
  226. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.d.ts +0 -11
  227. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js +0 -77
  228. package/features/CmsEntryOpenSearchFieldIndex/fields/DateTimeFieldIndex.js.map +0 -1
  229. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.d.ts +0 -10
  230. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js +0 -39
  231. package/features/CmsEntryOpenSearchFieldIndex/fields/DefaultFieldIndex.js.map +0 -1
  232. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.d.ts +0 -10
  233. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js +0 -22
  234. package/features/CmsEntryOpenSearchFieldIndex/fields/JsonFieldIndex.js.map +0 -1
  235. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.d.ts +0 -10
  236. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js +0 -25
  237. package/features/CmsEntryOpenSearchFieldIndex/fields/LongTextFieldIndex.js.map +0 -1
  238. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.d.ts +0 -11
  239. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js +0 -37
  240. package/features/CmsEntryOpenSearchFieldIndex/fields/NumberFieldIndex.js.map +0 -1
  241. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.d.ts +0 -10
  242. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js +0 -158
  243. package/features/CmsEntryOpenSearchFieldIndex/fields/ObjectFieldIndex.js.map +0 -1
  244. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.d.ts +0 -10
  245. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js +0 -22
  246. package/features/CmsEntryOpenSearchFieldIndex/fields/RichTextFieldIndex.js.map +0 -1
  247. package/features/CmsEntryOpenSearchFieldIndex/index.d.ts +0 -3
  248. package/features/CmsEntryOpenSearchFieldIndex/index.js +0 -5
  249. package/features/CmsEntryOpenSearchFieldIndex/index.js.map +0 -1
  250. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.d.ts +0 -11
  251. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js +0 -38
  252. package/features/CmsEntryOpenSearchFilter/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
  253. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.d.ts +0 -37
  254. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js +0 -4
  255. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilter.js.map +0 -1
  256. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.d.ts +0 -9
  257. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js +0 -4
  258. package/features/CmsEntryOpenSearchFilter/abstractions/CmsEntryOpenSearchFilterRegistry.js.map +0 -1
  259. package/features/CmsEntryOpenSearchFilter/constants.d.ts +0 -1
  260. package/features/CmsEntryOpenSearchFilter/constants.js +0 -3
  261. package/features/CmsEntryOpenSearchFilter/constants.js.map +0 -1
  262. package/features/CmsEntryOpenSearchFilter/feature.js +0 -16
  263. package/features/CmsEntryOpenSearchFilter/feature.js.map +0 -1
  264. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.d.ts +0 -9
  265. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js +0 -23
  266. package/features/CmsEntryOpenSearchFilter/fields/DefaultFilter.js.map +0 -1
  267. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.d.ts +0 -9
  268. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js +0 -61
  269. package/features/CmsEntryOpenSearchFilter/fields/ObjectFilter.js.map +0 -1
  270. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.d.ts +0 -9
  271. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js +0 -49
  272. package/features/CmsEntryOpenSearchFilter/fields/RefFilter.js.map +0 -1
  273. package/features/CmsEntryOpenSearchFilter/index.d.ts +0 -3
  274. package/features/CmsEntryOpenSearchFilter/index.js +0 -5
  275. package/features/CmsEntryOpenSearchFilter/index.js.map +0 -1
  276. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.d.ts +0 -20
  277. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js +0 -4
  278. package/features/CmsEntryOpenSearchFullTextSearch/abstractions.js.map +0 -1
  279. package/features/CmsEntryOpenSearchFullTextSearch/index.d.ts +0 -1
  280. package/features/CmsEntryOpenSearchFullTextSearch/index.js +0 -3
  281. package/features/CmsEntryOpenSearchFullTextSearch/index.js.map +0 -1
  282. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.d.ts +0 -11
  283. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js +0 -16
  284. package/features/CmsEntryOpenSearchIndex/BaseOpenSearchIndex.js.map +0 -1
  285. package/features/CmsEntryOpenSearchIndex/abstractions.d.ts +0 -14
  286. package/features/CmsEntryOpenSearchIndex/abstractions.js +0 -4
  287. package/features/CmsEntryOpenSearchIndex/abstractions.js.map +0 -1
  288. package/features/CmsEntryOpenSearchIndex/feature.js +0 -10
  289. package/features/CmsEntryOpenSearchIndex/feature.js.map +0 -1
  290. package/features/CmsEntryOpenSearchIndex/index.d.ts +0 -3
  291. package/features/CmsEntryOpenSearchIndex/index.js +0 -5
  292. package/features/CmsEntryOpenSearchIndex/index.js.map +0 -1
  293. package/features/CmsEntryOpenSearchQueryModifier/abstractions.d.ts +0 -16
  294. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js +0 -4
  295. package/features/CmsEntryOpenSearchQueryModifier/abstractions.js.map +0 -1
  296. package/features/CmsEntryOpenSearchQueryModifier/index.d.ts +0 -1
  297. package/features/CmsEntryOpenSearchQueryModifier/index.js +0 -3
  298. package/features/CmsEntryOpenSearchQueryModifier/index.js.map +0 -1
  299. package/features/CmsEntryOpenSearchSortModifier/abstractions.d.ts +0 -15
  300. package/features/CmsEntryOpenSearchSortModifier/abstractions.js +0 -4
  301. package/features/CmsEntryOpenSearchSortModifier/abstractions.js.map +0 -1
  302. package/features/CmsEntryOpenSearchSortModifier/index.d.ts +0 -1
  303. package/features/CmsEntryOpenSearchSortModifier/index.js +0 -3
  304. package/features/CmsEntryOpenSearchSortModifier/index.js.map +0 -1
  305. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -12
  306. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js +0 -27
  307. package/features/CmsEntryOpenSearchValueSearch/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
  308. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.d.ts +0 -22
  309. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js +0 -4
  310. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearch.js.map +0 -1
  311. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.d.ts +0 -10
  312. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js +0 -4
  313. package/features/CmsEntryOpenSearchValueSearch/abstractions/CmsEntryOpenSearchValueSearchRegistry.js.map +0 -1
  314. package/features/CmsEntryOpenSearchValueSearch/feature.d.ts +0 -4
  315. package/features/CmsEntryOpenSearchValueSearch/feature.js +0 -16
  316. package/features/CmsEntryOpenSearchValueSearch/feature.js.map +0 -1
  317. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.d.ts +0 -10
  318. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js +0 -23
  319. package/features/CmsEntryOpenSearchValueSearch/fields/RefSearch.js.map +0 -1
  320. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.d.ts +0 -10
  321. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js +0 -55
  322. package/features/CmsEntryOpenSearchValueSearch/fields/SearchableJsonSearch.js.map +0 -1
  323. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.d.ts +0 -10
  324. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js +0 -24
  325. package/features/CmsEntryOpenSearchValueSearch/fields/TimeSearch.js.map +0 -1
  326. package/features/CmsEntryOpenSearchValueSearch/index.d.ts +0 -3
  327. package/features/CmsEntryOpenSearchValueSearch/index.js +0 -5
  328. package/features/CmsEntryOpenSearchValueSearch/index.js.map +0 -1
  329. package/features/CmsEntryOpenSearchValuesModifier/abstractions.d.ts +0 -23
  330. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js +0 -4
  331. package/features/CmsEntryOpenSearchValuesModifier/abstractions.js.map +0 -1
  332. package/features/CmsEntryOpenSearchValuesModifier/index.d.ts +0 -1
  333. package/features/CmsEntryOpenSearchValuesModifier/index.js +0 -3
  334. package/features/CmsEntryOpenSearchValuesModifier/index.js.map +0 -1
  335. package/helpers/entryIndexHelpers.d.ts +0 -20
  336. package/helpers/entryIndexHelpers.js +0 -134
  337. package/helpers/entryIndexHelpers.js.map +0 -1
  338. package/helpers/fieldIdentifier.d.ts +0 -6
  339. package/helpers/fieldIdentifier.js +0 -35
  340. package/helpers/fieldIdentifier.js.map +0 -1
  341. package/helpers/index.d.ts +0 -2
  342. package/helpers/index.js +0 -4
  343. package/helpers/index.js.map +0 -1
  344. package/index.js.map +0 -1
  345. package/operations/entry/dataLoader/types.js.map +0 -1
  346. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
  347. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -27
  348. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
  349. package/operations/entry/elasticsearch/body.d.ts +0 -29
  350. package/operations/entry/elasticsearch/body.js +0 -138
  351. package/operations/entry/elasticsearch/body.js.map +0 -1
  352. package/operations/entry/elasticsearch/fields/createSystemField.d.ts +0 -4
  353. package/operations/entry/elasticsearch/fields/createSystemField.js +0 -10
  354. package/operations/entry/elasticsearch/fields/createSystemField.js.map +0 -1
  355. package/operations/entry/elasticsearch/fields/live.d.ts +0 -2
  356. package/operations/entry/elasticsearch/fields/live.js +0 -45
  357. package/operations/entry/elasticsearch/fields/live.js.map +0 -1
  358. package/operations/entry/elasticsearch/fields/location.d.ts +0 -2
  359. package/operations/entry/elasticsearch/fields/location.js +0 -45
  360. package/operations/entry/elasticsearch/fields/location.js.map +0 -1
  361. package/operations/entry/elasticsearch/fields/state.d.ts +0 -2
  362. package/operations/entry/elasticsearch/fields/state.js +0 -93
  363. package/operations/entry/elasticsearch/fields/state.js.map +0 -1
  364. package/operations/entry/elasticsearch/fields.d.ts +0 -12
  365. package/operations/entry/elasticsearch/fields.js +0 -231
  366. package/operations/entry/elasticsearch/fields.js.map +0 -1
  367. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -9
  368. package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -52
  369. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
  370. package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -22
  371. package/operations/entry/elasticsearch/filtering/exec.js +0 -125
  372. package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
  373. package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
  374. package/operations/entry/elasticsearch/filtering/index.js +0 -3
  375. package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
  376. package/operations/entry/elasticsearch/filtering/path.d.ts +0 -17
  377. package/operations/entry/elasticsearch/filtering/path.js +0 -36
  378. package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
  379. package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
  380. package/operations/entry/elasticsearch/filtering/populated.js +0 -18
  381. package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
  382. package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
  383. package/operations/entry/elasticsearch/filtering/values.js +0 -16
  384. package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
  385. package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -13
  386. package/operations/entry/elasticsearch/fullTextSearch.js +0 -88
  387. package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
  388. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
  389. package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -20
  390. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
  391. package/operations/entry/elasticsearch/initialQuery.d.ts +0 -17
  392. package/operations/entry/elasticsearch/initialQuery.js +0 -88
  393. package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
  394. package/operations/entry/elasticsearch/keyword.d.ts +0 -2
  395. package/operations/entry/elasticsearch/keyword.js +0 -31
  396. package/operations/entry/elasticsearch/keyword.js.map +0 -1
  397. package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -7
  398. package/operations/entry/elasticsearch/plugins/operator.js +0 -24
  399. package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
  400. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
  401. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -6
  402. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
  403. package/operations/entry/elasticsearch/sort.d.ts +0 -12
  404. package/operations/entry/elasticsearch/sort.js +0 -103
  405. package/operations/entry/elasticsearch/sort.js.map +0 -1
  406. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -9
  407. package/operations/entry/elasticsearch/transformValueForSearch.js +0 -17
  408. package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
  409. package/operations/entry/elasticsearch/types.d.ts +0 -34
  410. package/operations/entry/elasticsearch/types.js +0 -3
  411. package/operations/entry/elasticsearch/types.js.map +0 -1
  412. package/operations/entry/index.d.ts +0 -32
  413. package/operations/entry/index.js +0 -1761
  414. package/operations/entry/index.js.map +0 -1
  415. package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -12
  416. package/operations/entry/transformations/transformEntryToIndex.js +0 -26
  417. package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
  418. package/operations/group/index.d.ts +0 -9
  419. package/operations/group/index.js +0 -142
  420. package/operations/group/index.js.map +0 -1
  421. package/operations/model/index.d.ts +0 -8
  422. package/operations/model/index.js +0 -163
  423. package/operations/model/index.js.map +0 -1
  424. package/tasks/createIndexTaskPlugin.d.ts +0 -2
  425. package/tasks/createIndexTaskPlugin.js +0 -48
  426. package/tasks/createIndexTaskPlugin.js.map +0 -1
  427. package/values/NoValueContainer.d.ts +0 -5
  428. package/values/NoValueContainer.js +0 -13
  429. package/values/NoValueContainer.js.map +0 -1
package/types.js CHANGED
@@ -1,16 +1,10 @@
1
- /**
2
- * A definition of the entry that is being prepared for the Elasticsearch.
3
- *
4
- * @category Elasticsearch
5
- * @category CmsEntry
6
- */
7
-
8
- export let ENTITIES = /*#__PURE__*/function (ENTITIES) {
9
- ENTITIES["GROUPS"] = "CmsGroups";
10
- ENTITIES["MODELS"] = "CmsModels";
11
- ENTITIES["ENTRIES"] = "CmsEntries";
12
- ENTITIES["ENTRIES_ES"] = "CmsEntriesElasticsearch";
13
- return ENTITIES;
1
+ var types_ENTITIES = /*#__PURE__*/ function(ENTITIES) {
2
+ ENTITIES["GROUPS"] = "CmsGroups";
3
+ ENTITIES["MODELS"] = "CmsModels";
4
+ ENTITIES["ENTRIES"] = "CmsEntries";
5
+ ENTITIES["ENTRIES_ES"] = "CmsEntriesElasticsearch";
6
+ return ENTITIES;
14
7
  }({});
8
+ export { types_ENTITIES as ENTITIES };
15
9
 
16
10
  //# sourceMappingURL=types.js.map
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import type {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsEntryValues,\n CmsModel,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type {\n Client,\n IOpenSearchEntity as IElasticsearchEntity,\n OpenSearchContext\n} from \"@webiny/api-opensearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { IEntryEntity, IGroupEntity, IModelEntity } from \"~/definitions/types.js\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport interface CmsContext extends BaseCmsContext, OpenSearchContext {}\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry<T extends CmsEntryValues = CmsEntryValues> extends CmsEntry<T> {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Partial<T>;\n /**\n * Dev can add whatever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n elasticsearch: Client;\n table?: string;\n esTable?: string;\n plugins: PluginsContainer;\n container: CmsContext[\"container\"];\n}\n\nexport interface IGetEntitiesResponse {\n groups: IGroupEntity;\n models: IModelEntity;\n entries: IEntryEntity;\n entriesEs: IElasticsearchEntity;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => ITable;\n getEsTable: () => ITable;\n getEntities: () => IGetEntitiesResponse;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: IDataLoadersHandler;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\">;\n}\nexport interface IDataLoadersHandler {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":"AAmBA;AACA;AACA;AACA;AACA;AACA;;AAYA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type {\n CmsContext,\n CmsEntryValues,\n CmsModel,\n CmsStorageEntry\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport { CmsContext };\n\nexport enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n tenant: string;\n}\n\nexport interface DataLoadersHandlerDataLoaderParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n ids: readonly string[];\n}\n\nexport interface IDataLoadersHandler {\n getAllEntryRevisions<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getRevisionById<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getPublishedRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n getLatestRevisionByEntryId<T extends CmsEntryValues = CmsEntryValues>(\n params: DataLoadersHandlerDataLoaderParams\n ): Promise<CmsStorageEntry<T>[]>;\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"names":["ENTITIES"],"mappings":"AASO,IAAKA,iBAAQA,WAAAA,GAAAA,SAARA,QAAQ;;;;;WAARA"}
@@ -1,19 +0,0 @@
1
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
2
- import type { OpenSearchIndexRequestBody } from "@webiny/api-opensearch/types.js";
3
- import type { CmsEntryOpenSearchIndex } from "./features/CmsEntryOpenSearchIndex/index.js";
4
- interface ConfigurationsElasticsearch {
5
- index: string;
6
- }
7
- export interface CmsElasticsearchParams {
8
- model: Pick<CmsModel, "tenant" | "modelId">;
9
- }
10
- export interface ConfigurationsIndexSettingsParams {
11
- indexConfigs: CmsEntryOpenSearchIndex.Interface[];
12
- model: Pick<CmsModel, "tenant" | "modelId" | "group">;
13
- }
14
- export interface Configurations {
15
- es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;
16
- indexSettings: (params: ConfigurationsIndexSettingsParams) => Partial<OpenSearchIndexRequestBody>;
17
- }
18
- export declare const configurations: Configurations;
19
- export {};
package/configurations.js DELETED
@@ -1,39 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { getOpenSearchIndexPrefix, isSharedOpenSearchIndex as isSharedElasticsearchIndex } from "@webiny/api-opensearch";
3
- export const configurations = {
4
- es({
5
- model
6
- }) {
7
- const {
8
- tenant
9
- } = model;
10
- if (!tenant) {
11
- throw new WebinyError(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
12
- }
13
- const sharedIndex = isSharedElasticsearchIndex();
14
- const index = [sharedIndex ? "root" : tenant, "headless-cms", model.modelId].join("-").toLowerCase();
15
- const prefix = getOpenSearchIndexPrefix();
16
- if (!prefix) {
17
- return {
18
- index
19
- };
20
- }
21
- return {
22
- index: prefix + index
23
- };
24
- },
25
- indexSettings: ({
26
- indexConfigs,
27
- model
28
- }) => {
29
- const usable = indexConfigs.filter(c => c.canUse({
30
- model
31
- }));
32
- if (usable.length === 0) {
33
- return {};
34
- }
35
- return usable[usable.length - 1].body;
36
- }
37
- };
38
-
39
- //# sourceMappingURL=configurations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","getOpenSearchIndexPrefix","isSharedOpenSearchIndex","isSharedElasticsearchIndex","configurations","es","model","tenant","sharedIndex","index","modelId","join","toLowerCase","prefix","indexSettings","indexConfigs","usable","filter","c","canUse","length","body"],"sources":["configurations.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport {\n getOpenSearchIndexPrefix,\n isSharedOpenSearchIndex as isSharedElasticsearchIndex\n} from \"@webiny/api-opensearch\";\nimport type { OpenSearchIndexRequestBody } from \"@webiny/api-opensearch/types.js\";\nimport type { CmsEntryOpenSearchIndex } from \"~/features/CmsEntryOpenSearchIndex/index.js\";\n\ninterface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n indexConfigs: CmsEntryOpenSearchIndex.Interface[];\n model: Pick<CmsModel, \"tenant\" | \"modelId\" | \"group\">;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;\n indexSettings: (\n params: ConfigurationsIndexSettingsParams\n ) => Partial<OpenSearchIndexRequestBody>;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\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 sharedIndex = isSharedElasticsearchIndex();\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getOpenSearchIndexPrefix();\n\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n },\n indexSettings: ({ indexConfigs, model }) => {\n const usable = indexConfigs.filter(c => c.canUse({ model }));\n if (usable.length === 0) {\n return {};\n }\n return usable[usable.length - 1].body;\n }\n};\n"],"mappings":"AACA,OAAOA,WAAW,MAAM,eAAe;AACvC,SACIC,wBAAwB,EACxBC,uBAAuB,IAAIC,0BAA0B,QAClD,wBAAwB;AAwB/B,OAAO,MAAMC,cAA8B,GAAG;EAC1CC,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC;IAAO,CAAC,GAAGD,KAAK;IAExB,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIP,WAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMQ,WAAW,GAAGL,0BAA0B,CAAC,CAAC;IAChD,MAAMM,KAAK,GAAG,CAACD,WAAW,GAAG,MAAM,GAAGD,MAAM,EAAE,cAAc,EAAED,KAAK,CAACI,OAAO,CAAC,CACvEC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAGZ,wBAAwB,CAAC,CAAC;IAEzC,IAAI,CAACY,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL,CAAC;EACDK,aAAa,EAAEA,CAAC;IAAEC,YAAY;IAAET;EAAM,CAAC,KAAK;IACxC,MAAMU,MAAM,GAAGD,YAAY,CAACE,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACC,MAAM,CAAC;MAAEb;IAAM,CAAC,CAAC,CAAC;IAC5D,IAAIU,MAAM,CAACI,MAAM,KAAK,CAAC,EAAE;MACrB,OAAO,CAAC,CAAC;IACb;IACA,OAAOJ,MAAM,CAACA,MAAM,CAACI,MAAM,GAAG,CAAC,CAAC,CAACC,IAAI;EACzC;AACJ,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntity, IStandardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type {\n CmsEntryStatus,\n CmsGroup,\n CmsIdentity,\n ICmsEntryLive,\n ICmsEntryLocation,\n ICmsEntrySystem,\n StorageCmsModel\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface IEntryEntityAttributesData {\n tenant: string;\n entryId: string;\n id: string;\n modelId: string;\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: string;\n revisionModifiedOn: string | null;\n revisionSavedOn: string;\n revisionDeletedOn: string | null;\n revisionRestoredOn: string | null;\n revisionFirstPublishedOn: string | null;\n revisionLastPublishedOn: string | null;\n revisionCreatedBy: CmsIdentity;\n revisionModifiedBy: CmsIdentity | null;\n revisionSavedBy: CmsIdentity;\n revisionDeletedBy: CmsIdentity | null;\n revisionRestoredBy: CmsIdentity | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: string;\n modifiedOn: string | null;\n savedOn: string;\n deletedOn: string | null;\n restoredOn: string | null;\n firstPublishedOn: string | null;\n lastPublishedOn: string | null;\n createdBy: CmsIdentity;\n modifiedBy: CmsIdentity | null;\n savedBy: CmsIdentity;\n deletedBy: CmsIdentity | null;\n restoredBy: CmsIdentity | null;\n firstPublishedBy: CmsIdentity | null;\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * The rest. 👇\n */\n version: number;\n locked: boolean;\n status: CmsEntryStatus;\n location?: ICmsEntryLocation;\n wbyDeleted?: boolean | null;\n binOriginalFolderId?: string;\n values: GenericRecord;\n meta?: GenericRecord;\n system?: ICmsEntrySystem;\n live: ICmsEntryLive | null;\n revisionDescription: string | undefined;\n}\n\nexport type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;\n\nexport type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;\nexport type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;\nexport type IEntryEntity = IEntity<IEntryEntityAttributes>;\n"],"mappings":"","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- import type { Client } from "@webiny/api-opensearch";
2
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
3
- import type { CmsEntryOpenSearchIndex } from "../features/CmsEntryOpenSearchIndex/index.js";
4
- export interface CreateElasticsearchIndexParams {
5
- client: Client;
6
- indexConfigs: CmsEntryOpenSearchIndex.Interface[];
7
- model: CmsModel;
8
- }
9
- export declare const createElasticsearchIndex: (params: CreateElasticsearchIndexParams) => Promise<void>;
@@ -1,74 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { configurations } from "../configurations.js";
3
- const getLastUsable = params => {
4
- const {
5
- configs
6
- } = params;
7
- const usable = configs.filter(c => c.canUse(params));
8
- if (usable.length === 0) {
9
- throw new WebinyError("Could not find a single usable CmsEntryOpenSearchIndex.", "OPENSEARCH_INDEX_TEMPLATE_ERROR");
10
- }
11
- return usable[usable.length - 1];
12
- };
13
- export const createElasticsearchIndex = async params => {
14
- const {
15
- client,
16
- indexConfigs,
17
- model
18
- } = params;
19
- const {
20
- index
21
- } = configurations.es({
22
- model
23
- });
24
- const config = getLastUsable({
25
- configs: indexConfigs,
26
- model
27
- });
28
- if (!config) {
29
- /**
30
- * This can happen only while development as we have a base index setting that is always usable.
31
- */
32
- throw new Error(`Could not find a usable CmsEntryOpenSearchIndex for the CMS model "${model.name}".`);
33
- }
34
- try {
35
- const response = await client.indices.exists({
36
- index,
37
- ignore_unavailable: false,
38
- allow_no_indices: true,
39
- include_defaults: true,
40
- flat_settings: false,
41
- local: false
42
- });
43
- if (response.body) {
44
- console.log(`Elasticsearch index "${index}" for the CMS model "${model.name}" already exists.`);
45
- return;
46
- }
47
- } catch {
48
- console.error(`Could not determine if the index "${index}" exists.`);
49
- }
50
- try {
51
- await client.indices.create({
52
- index,
53
- body: {
54
- ...config.body
55
- }
56
- });
57
- } catch (ex) {
58
- console.error(`Could not create Elasticsearch index "${index}" for the CMS model "${model.name}".`);
59
- console.error(ex);
60
- throw new WebinyError(ex.message || "Could not create OpenSearch index for the CMS entry.", ex.code || "CREATE_OPENSEARCH_INDEX_ERROR", {
61
- error: {
62
- ...ex,
63
- message: ex.message,
64
- code: ex.code,
65
- data: ex.data
66
- },
67
- tenant: model.tenant,
68
- index,
69
- body: config.body
70
- });
71
- }
72
- };
73
-
74
- //# sourceMappingURL=createElasticsearchIndex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","configurations","getLastUsable","params","configs","usable","filter","c","canUse","length","createElasticsearchIndex","client","indexConfigs","model","index","es","config","Error","name","response","indices","exists","ignore_unavailable","allow_no_indices","include_defaults","flat_settings","local","body","console","log","error","create","ex","message","code","data","tenant"],"sources":["createElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@webiny/api-opensearch\";\nimport WebinyError from \"@webiny/error\";\nimport { configurations } from \"~/configurations.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsEntryOpenSearchIndex } from \"~/features/CmsEntryOpenSearchIndex/index.js\";\n\nexport interface CreateElasticsearchIndexParams {\n client: Client;\n indexConfigs: CmsEntryOpenSearchIndex.Interface[];\n model: CmsModel;\n}\n\ninterface IGetLastUsableParams {\n configs: CmsEntryOpenSearchIndex.Interface[];\n model: CmsModel;\n}\n\nconst getLastUsable = (params: IGetLastUsableParams): CmsEntryOpenSearchIndex.Interface => {\n const { configs } = params;\n const usable = configs.filter(c => c.canUse(params));\n if (usable.length === 0) {\n throw new WebinyError(\n \"Could not find a single usable CmsEntryOpenSearchIndex.\",\n \"OPENSEARCH_INDEX_TEMPLATE_ERROR\"\n );\n }\n return usable[usable.length - 1];\n};\n\nexport const createElasticsearchIndex = async (params: CreateElasticsearchIndexParams) => {\n const { client, indexConfigs, model } = params;\n\n const { index } = configurations.es({\n model\n });\n\n const config = getLastUsable({\n configs: indexConfigs,\n model\n });\n if (!config) {\n /**\n * This can happen only while development as we have a base index setting that is always usable.\n */\n throw new Error(\n `Could not find a usable CmsEntryOpenSearchIndex for the CMS model \"${model.name}\".`\n );\n }\n\n try {\n const response = await client.indices.exists({\n index,\n ignore_unavailable: false,\n allow_no_indices: true,\n include_defaults: true,\n flat_settings: false,\n local: false\n });\n if (response.body) {\n console.log(\n `Elasticsearch index \"${index}\" for the CMS model \"${model.name}\" already exists.`\n );\n return;\n }\n } catch {\n console.error(`Could not determine if the index \"${index}\" exists.`);\n }\n\n try {\n await client.indices.create({\n index,\n body: {\n ...config.body\n }\n });\n } catch (ex) {\n console.error(\n `Could not create Elasticsearch index \"${index}\" for the CMS model \"${model.name}\".`\n );\n console.error(ex);\n throw new WebinyError(\n ex.message || \"Could not create OpenSearch index for the CMS entry.\",\n ex.code || \"CREATE_OPENSEARCH_INDEX_ERROR\",\n {\n error: {\n ...ex,\n message: ex.message,\n code: ex.code,\n data: ex.data\n },\n tenant: model.tenant,\n index,\n body: config.body\n }\n );\n }\n};\n"],"mappings":"AACA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,cAAc;AAevB,MAAMC,aAAa,GAAIC,MAA4B,IAAwC;EACvF,MAAM;IAAEC;EAAQ,CAAC,GAAGD,MAAM;EAC1B,MAAME,MAAM,GAAGD,OAAO,CAACE,MAAM,CAACC,CAAC,IAAIA,CAAC,CAACC,MAAM,CAACL,MAAM,CAAC,CAAC;EACpD,IAAIE,MAAM,CAACI,MAAM,KAAK,CAAC,EAAE;IACrB,MAAM,IAAIT,WAAW,CACjB,yDAAyD,EACzD,iCACJ,CAAC;EACL;EACA,OAAOK,MAAM,CAACA,MAAM,CAACI,MAAM,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,OAAO,MAAMC,wBAAwB,GAAG,MAAOP,MAAsC,IAAK;EACtF,MAAM;IAAEQ,MAAM;IAAEC,YAAY;IAAEC;EAAM,CAAC,GAAGV,MAAM;EAE9C,MAAM;IAAEW;EAAM,CAAC,GAAGb,cAAc,CAACc,EAAE,CAAC;IAChCF;EACJ,CAAC,CAAC;EAEF,MAAMG,MAAM,GAAGd,aAAa,CAAC;IACzBE,OAAO,EAAEQ,YAAY;IACrBC;EACJ,CAAC,CAAC;EACF,IAAI,CAACG,MAAM,EAAE;IACT;AACR;AACA;IACQ,MAAM,IAAIC,KAAK,CACX,sEAAsEJ,KAAK,CAACK,IAAI,IACpF,CAAC;EACL;EAEA,IAAI;IACA,MAAMC,QAAQ,GAAG,MAAMR,MAAM,CAACS,OAAO,CAACC,MAAM,CAAC;MACzCP,KAAK;MACLQ,kBAAkB,EAAE,KAAK;MACzBC,gBAAgB,EAAE,IAAI;MACtBC,gBAAgB,EAAE,IAAI;MACtBC,aAAa,EAAE,KAAK;MACpBC,KAAK,EAAE;IACX,CAAC,CAAC;IACF,IAAIP,QAAQ,CAACQ,IAAI,EAAE;MACfC,OAAO,CAACC,GAAG,CACP,wBAAwBf,KAAK,wBAAwBD,KAAK,CAACK,IAAI,mBACnE,CAAC;MACD;IACJ;EACJ,CAAC,CAAC,MAAM;IACJU,OAAO,CAACE,KAAK,CAAC,qCAAqChB,KAAK,WAAW,CAAC;EACxE;EAEA,IAAI;IACA,MAAMH,MAAM,CAACS,OAAO,CAACW,MAAM,CAAC;MACxBjB,KAAK;MACLa,IAAI,EAAE;QACF,GAAGX,MAAM,CAACW;MACd;IACJ,CAAC,CAAC;EACN,CAAC,CAAC,OAAOK,EAAE,EAAE;IACTJ,OAAO,CAACE,KAAK,CACT,yCAAyChB,KAAK,wBAAwBD,KAAK,CAACK,IAAI,IACpF,CAAC;IACDU,OAAO,CAACE,KAAK,CAACE,EAAE,CAAC;IACjB,MAAM,IAAIhC,WAAW,CACjBgC,EAAE,CAACC,OAAO,IAAI,sDAAsD,EACpED,EAAE,CAACE,IAAI,IAAI,+BAA+B,EAC1C;MACIJ,KAAK,EAAE;QACH,GAAGE,EAAE;QACLC,OAAO,EAAED,EAAE,CAACC,OAAO;QACnBC,IAAI,EAAEF,EAAE,CAACE,IAAI;QACbC,IAAI,EAAEH,EAAE,CAACG;MACb,CAAC;MACDC,MAAM,EAAEvB,KAAK,CAACuB,MAAM;MACpBtB,KAAK;MACLa,IAAI,EAAEX,MAAM,CAACW;IACjB,CACJ,CAAC;EACL;AACJ,CAAC","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import type { Client } from "@webiny/api-opensearch";
2
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
3
- interface DeleteElasticsearchIndexParams {
4
- client: Client;
5
- model: CmsModel;
6
- }
7
- export declare const deleteElasticsearchIndex: (params: DeleteElasticsearchIndexParams) => Promise<void>;
8
- export {};
@@ -1,31 +0,0 @@
1
- import { configurations } from "../configurations.js";
2
- export const deleteElasticsearchIndex = async params => {
3
- const {
4
- client,
5
- model
6
- } = params;
7
- const {
8
- index
9
- } = configurations.es({
10
- model
11
- });
12
- const {
13
- body: exists
14
- } = await client.indices.exists({
15
- index
16
- });
17
- if (!exists) {
18
- return;
19
- }
20
- try {
21
- await client.indices.delete({
22
- index,
23
- ignore_unavailable: true
24
- });
25
- } catch (ex) {
26
- console.log(`Could not delete Elasticsearch index "${index}". Please do it manually.`);
27
- console.log(ex.message);
28
- }
29
- };
30
-
31
- //# sourceMappingURL=deleteElasticsearchIndex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["configurations","deleteElasticsearchIndex","params","client","model","index","es","body","exists","indices","delete","ignore_unavailable","ex","console","log","message"],"sources":["deleteElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@webiny/api-opensearch\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport { configurations } from \"~/configurations.js\";\n\ninterface DeleteElasticsearchIndexParams {\n client: Client;\n model: CmsModel;\n}\n\nexport const deleteElasticsearchIndex = async (\n params: DeleteElasticsearchIndexParams\n): Promise<void> => {\n const { client, model } = params;\n\n const { index } = configurations.es({\n model\n });\n const { body: exists } = await client.indices.exists({\n index\n });\n if (!exists) {\n return;\n }\n\n try {\n await client.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n console.log(`Could not delete Elasticsearch index \"${index}\". Please do it manually.`);\n console.log(ex.message);\n }\n};\n"],"mappings":"AAEA,SAASA,cAAc;AAOvB,OAAO,MAAMC,wBAAwB,GAAG,MACpCC,MAAsC,IACtB;EAChB,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAEhC,MAAM;IAAEG;EAAM,CAAC,GAAGL,cAAc,CAACM,EAAE,CAAC;IAChCF;EACJ,CAAC,CAAC;EACF,MAAM;IAAEG,IAAI,EAAEC;EAAO,CAAC,GAAG,MAAML,MAAM,CAACM,OAAO,CAACD,MAAM,CAAC;IACjDH;EACJ,CAAC,CAAC;EACF,IAAI,CAACG,MAAM,EAAE;IACT;EACJ;EAEA,IAAI;IACA,MAAML,MAAM,CAACM,OAAO,CAACC,MAAM,CAAC;MACxBL,KAAK;MACLM,kBAAkB,EAAE;IACxB,CAAC,CAAC;EACN,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAC,yCAAyCT,KAAK,2BAA2B,CAAC;IACtFQ,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;EAC3B;AACJ,CAAC","ignoreList":[]}
@@ -1,9 +0,0 @@
1
- export { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchFieldIndex } from "../../../features/CmsEntryOpenSearchFieldIndex/index.js";
2
- export { CmsEntryOpenSearchFilterRegistry, CmsEntryOpenSearchFilter } from "../../../features/CmsEntryOpenSearchFilter/index.js";
3
- export { CmsEntryOpenSearchBodyModifier } from "../../../features/CmsEntryOpenSearchBodyModifier/index.js";
4
- export { CmsEntryOpenSearchSortModifier } from "../../../features/CmsEntryOpenSearchSortModifier/index.js";
5
- export { CmsEntryOpenSearchQueryModifier } from "../../../features/CmsEntryOpenSearchQueryModifier/index.js";
6
- export { CmsEntryOpenSearchValueSearch, CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
7
- export { CmsEntryOpenSearchFullTextSearch } from "../../../features/CmsEntryOpenSearchFullTextSearch/index.js";
8
- export { CmsEntryOpenSearchIndex } from "../../../features/CmsEntryOpenSearchIndex/index.js";
9
- export { CmsEntryOpenSearchValuesModifier } from "../../../features/CmsEntryOpenSearchValuesModifier/index.js";
@@ -1,11 +0,0 @@
1
- export { CmsEntryOpenSearchFieldIndexRegistry, CmsEntryOpenSearchFieldIndex } from "../../../features/CmsEntryOpenSearchFieldIndex/index.js";
2
- export { CmsEntryOpenSearchFilterRegistry, CmsEntryOpenSearchFilter } from "../../../features/CmsEntryOpenSearchFilter/index.js";
3
- export { CmsEntryOpenSearchBodyModifier } from "../../../features/CmsEntryOpenSearchBodyModifier/index.js";
4
- export { CmsEntryOpenSearchSortModifier } from "../../../features/CmsEntryOpenSearchSortModifier/index.js";
5
- export { CmsEntryOpenSearchQueryModifier } from "../../../features/CmsEntryOpenSearchQueryModifier/index.js";
6
- export { CmsEntryOpenSearchValueSearch, CmsEntryOpenSearchValueSearchRegistry } from "../../../features/CmsEntryOpenSearchValueSearch/index.js";
7
- export { CmsEntryOpenSearchFullTextSearch } from "../../../features/CmsEntryOpenSearchFullTextSearch/index.js";
8
- export { CmsEntryOpenSearchIndex } from "../../../features/CmsEntryOpenSearchIndex/index.js";
9
- export { CmsEntryOpenSearchValuesModifier } from "../../../features/CmsEntryOpenSearchValuesModifier/index.js";
10
-
11
- //# sourceMappingURL=opensearch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryOpenSearchFieldIndexRegistry","CmsEntryOpenSearchFieldIndex","CmsEntryOpenSearchFilterRegistry","CmsEntryOpenSearchFilter","CmsEntryOpenSearchBodyModifier","CmsEntryOpenSearchSortModifier","CmsEntryOpenSearchQueryModifier","CmsEntryOpenSearchValueSearch","CmsEntryOpenSearchValueSearchRegistry","CmsEntryOpenSearchFullTextSearch","CmsEntryOpenSearchIndex","CmsEntryOpenSearchValuesModifier"],"sources":["opensearch.ts"],"sourcesContent":["export {\n CmsEntryOpenSearchFieldIndexRegistry,\n CmsEntryOpenSearchFieldIndex\n} from \"~/features/CmsEntryOpenSearchFieldIndex/index.js\";\nexport {\n CmsEntryOpenSearchFilterRegistry,\n CmsEntryOpenSearchFilter\n} from \"~/features/CmsEntryOpenSearchFilter/index.js\";\nexport { CmsEntryOpenSearchBodyModifier } from \"~/features/CmsEntryOpenSearchBodyModifier/index.js\";\nexport { CmsEntryOpenSearchSortModifier } from \"~/features/CmsEntryOpenSearchSortModifier/index.js\";\nexport { CmsEntryOpenSearchQueryModifier } from \"~/features/CmsEntryOpenSearchQueryModifier/index.js\";\nexport {\n CmsEntryOpenSearchValueSearch,\n CmsEntryOpenSearchValueSearchRegistry\n} from \"~/features/CmsEntryOpenSearchValueSearch/index.js\";\nexport { CmsEntryOpenSearchFullTextSearch } from \"~/features/CmsEntryOpenSearchFullTextSearch/index.js\";\nexport { CmsEntryOpenSearchIndex } from \"~/features/CmsEntryOpenSearchIndex/index.js\";\nexport { CmsEntryOpenSearchValuesModifier } from \"~/features/CmsEntryOpenSearchValuesModifier/index.js\";\n"],"mappings":"AAAA,SACIA,oCAAoC,EACpCC,4BAA4B;AAEhC,SACIC,gCAAgC,EAChCC,wBAAwB;AAE5B,SAASC,8BAA8B;AACvC,SAASC,8BAA8B;AACvC,SAASC,+BAA+B;AACxC,SACIC,6BAA6B,EAC7BC,qCAAqC;AAEzC,SAASC,gCAAgC;AACzC,SAASC,uBAAuB;AAChC,SAASC,gCAAgC","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
2
- import type { SearchBody } from "@webiny/api-opensearch";
3
- export interface ModifyBodyParams {
4
- body: SearchBody;
5
- model: CmsModel;
6
- where: Record<string, any>;
7
- }
8
- export interface ICmsEntryOpenSearchBodyModifier {
9
- readonly modelId?: string;
10
- modifyBody(params: ModifyBodyParams): void;
11
- }
12
- export declare const CmsEntryOpenSearchBodyModifier: import("@webiny/di").Abstraction<ICmsEntryOpenSearchBodyModifier>;
13
- export declare namespace CmsEntryOpenSearchBodyModifier {
14
- type Interface = ICmsEntryOpenSearchBodyModifier;
15
- type Params = ModifyBodyParams;
16
- }
@@ -1,4 +0,0 @@
1
- import { createAbstraction } from "@webiny/feature/api";
2
- export const CmsEntryOpenSearchBodyModifier = createAbstraction("Cms/Entry/OpenSearch/BodyModifier");
3
-
4
- //# sourceMappingURL=abstractions.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- export { CmsEntryOpenSearchBodyModifier } from "./abstractions.js";
@@ -1,3 +0,0 @@
1
- export { CmsEntryOpenSearchBodyModifier } from "./abstractions.js";
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["CmsEntryOpenSearchBodyModifier"],"sources":["index.ts"],"sourcesContent":["export { CmsEntryOpenSearchBodyModifier } from \"./abstractions.js\";\n"],"mappings":"AAAA,SAASA,8BAA8B","ignoreList":[]}
@@ -1,13 +0,0 @@
1
- import { CmsEntryOpenSearchFieldIndexRegistry as Abstraction } from "./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js";
2
- import { CmsEntryOpenSearchFieldIndex } from "./abstractions/CmsEntryOpenSearchFieldIndex.js";
3
- declare class CmsEntryOpenSearchFieldIndexRegistryImpl implements Abstraction.Interface {
4
- private readonly fieldIndexing;
5
- constructor(fieldIndexing: CmsEntryOpenSearchFieldIndex.Interface[]);
6
- get(type: string): CmsEntryOpenSearchFieldIndex.Interface | undefined;
7
- getDefault(): CmsEntryOpenSearchFieldIndex.Interface;
8
- getAll(): CmsEntryOpenSearchFieldIndex.Interface[];
9
- }
10
- export declare const CmsEntryOpenSearchFieldIndexRegistry: typeof CmsEntryOpenSearchFieldIndexRegistryImpl & {
11
- __abstraction: import("@webiny/di").Abstraction<import("./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js").ICmsEntryOpenSearchFieldIndexRegistry>;
12
- };
13
- export {};
@@ -1,36 +0,0 @@
1
- import { CmsEntryOpenSearchFieldIndexRegistry as Abstraction } from "./abstractions/CmsEntryOpenSearchFieldIndexRegistry.js";
2
- import { CmsEntryOpenSearchFieldIndex } from "./abstractions/CmsEntryOpenSearchFieldIndex.js";
3
- import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
4
- import { FIELD_INDEXING_DEFAULT } from "./constants.js";
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;
19
- }
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
- }
29
- export const CmsEntryOpenSearchFieldIndexRegistry = Abstraction.createImplementation({
30
- implementation: CmsEntryOpenSearchFieldIndexRegistryImpl,
31
- dependencies: [[CmsEntryOpenSearchFieldIndex, {
32
- multiple: true
33
- }]]
34
- });
35
-
36
- //# sourceMappingURL=CmsEntryOpenSearchFieldIndexRegistry.js.map
@@ -1 +0,0 @@
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,35 +0,0 @@
1
- import type { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types/index.js";
2
- import type { CmsModelFieldToGraphQLRegistry } from "@webiny/api-headless-cms/exports/api/cms/graphql.js";
3
- export interface ToIndexParams {
4
- model: CmsModel;
5
- field: CmsModelField;
6
- fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
7
- value: any;
8
- rawValue: any;
9
- getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;
10
- }
11
- export interface ToIndexValue {
12
- value?: any;
13
- rawValue?: any;
14
- }
15
- export interface FromIndexParams {
16
- model: CmsModel;
17
- field: CmsModelField;
18
- fieldRegistry: CmsModelFieldToGraphQLRegistry.Interface;
19
- value: any;
20
- rawValue: any;
21
- getFieldIndex(fieldType: string): ICmsEntryOpenSearchFieldIndex;
22
- }
23
- export interface ICmsEntryOpenSearchFieldIndex {
24
- readonly fieldType: string;
25
- unmappedType?(field: Pick<CmsModelField, "fieldId" | "type">): string;
26
- toIndex(params: ToIndexParams): ToIndexValue;
27
- fromIndex(params: FromIndexParams): any;
28
- }
29
- export declare const CmsEntryOpenSearchFieldIndex: import("@webiny/di").Abstraction<ICmsEntryOpenSearchFieldIndex>;
30
- export declare namespace CmsEntryOpenSearchFieldIndex {
31
- type Interface = ICmsEntryOpenSearchFieldIndex;
32
- type ToIndex = ToIndexParams;
33
- type ToValue = ToIndexValue;
34
- type FromIndex = FromIndexParams;
35
- }
@@ -1,4 +0,0 @@
1
- import { createAbstraction } from "@webiny/feature/api";
2
- export const CmsEntryOpenSearchFieldIndex = createAbstraction("Cms/Entry/OpenSearch/FieldIndex");
3
-
4
- //# sourceMappingURL=CmsEntryOpenSearchFieldIndex.js.map
@@ -1 +0,0 @@
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,11 +0,0 @@
1
- import type { CmsEntryOpenSearchFieldIndex } from "./CmsEntryOpenSearchFieldIndex.js";
2
- export interface ICmsEntryOpenSearchFieldIndexRegistry {
3
- get(fieldType: string): CmsEntryOpenSearchFieldIndex.Interface | undefined;
4
- getDefault(): CmsEntryOpenSearchFieldIndex.Interface;
5
- getAll(): CmsEntryOpenSearchFieldIndex.Interface[];
6
- }
7
- export declare const CmsEntryOpenSearchFieldIndexRegistry: import("@webiny/di").Abstraction<ICmsEntryOpenSearchFieldIndexRegistry>;
8
- export declare namespace CmsEntryOpenSearchFieldIndexRegistry {
9
- type Interface = ICmsEntryOpenSearchFieldIndexRegistry;
10
- type FieldIndex = CmsEntryOpenSearchFieldIndex.Interface;
11
- }
@@ -1,4 +0,0 @@
1
- import { createAbstraction } from "@webiny/feature/api";
2
- export const CmsEntryOpenSearchFieldIndexRegistry = createAbstraction("Cms/Entry/OpenSearch/FieldIndexRegistry");
3
-
4
- //# sourceMappingURL=CmsEntryOpenSearchFieldIndexRegistry.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- export declare const FIELD_INDEXING_DEFAULT: "*";
@@ -1,3 +0,0 @@
1
- export const FIELD_INDEXING_DEFAULT = "*";
2
-
3
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
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,24 +0,0 @@
1
- import { createFeature } from "@webiny/feature/api";
2
- import { CmsEntryOpenSearchFieldIndexRegistry } from "./CmsEntryOpenSearchFieldIndexRegistry.js";
3
- import { RichTextFieldIndex } from "./fields/RichTextFieldIndex.js";
4
- import { JsonFieldIndex } from "./fields/JsonFieldIndex.js";
5
- import { LongTextFieldIndex } from "./fields/LongTextFieldIndex.js";
6
- import { NumberFieldIndex } from "./fields/NumberFieldIndex.js";
7
- import { DefaultFieldIndex } from "./fields/DefaultFieldIndex.js";
8
- import { DateTimeFieldIndex } from "./fields/DateTimeFieldIndex.js";
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
- }
22
- });
23
-
24
- //# sourceMappingURL=feature.js.map
@@ -1 +0,0 @@
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,11 +0,0 @@
1
- import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
2
- declare class DateTimeFieldIndexImpl implements CmsEntryOpenSearchFieldIndex.Interface {
3
- readonly fieldType = "datetime";
4
- unmappedType(): string;
5
- toIndex({ field, value }: CmsEntryOpenSearchFieldIndex.ToIndex): CmsEntryOpenSearchFieldIndex.ToValue;
6
- fromIndex({ field, value }: CmsEntryOpenSearchFieldIndex.FromIndex): any;
7
- }
8
- export declare const DateTimeFieldIndex: typeof DateTimeFieldIndexImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("../abstractions/CmsEntryOpenSearchFieldIndex.js").ICmsEntryOpenSearchFieldIndex>;
10
- };
11
- export {};
@@ -1,77 +0,0 @@
1
- import { CmsEntryOpenSearchFieldIndex } from "../abstractions/CmsEntryOpenSearchFieldIndex.js";
2
- const convertTimeToNumber = time => {
3
- if (!time) {
4
- return null;
5
- }
6
- const [hours, minutes, seconds = 0] = time.split(":").map(Number);
7
- return hours * 60 * 60 + minutes * 60 + seconds;
8
- };
9
- const convertNumberToTime = value => {
10
- if (value === undefined || value === null) {
11
- return null;
12
- }
13
- const hours = Math.floor(value / 60 / 60);
14
- const minutes = Math.floor((value - hours * 60 * 60) / 60);
15
- const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);
16
- return [hours, minutes, seconds].map(v => String(v).padStart(2, "0")).join(":");
17
- };
18
- const convertValueToIndex = (value, field) => {
19
- if (!value) {
20
- return null;
21
- } else if (field.settings?.type === "time") {
22
- return convertTimeToNumber(value);
23
- }
24
- return value;
25
- };
26
- const convertValueFromIndex = (value, field) => {
27
- const type = field.settings?.type;
28
- if (type === "time") {
29
- return convertNumberToTime(value);
30
- } else if (!value) {
31
- return null;
32
- } else if (type === "dateTimeWithTimezone") {
33
- return value;
34
- } else if (type === "date") {
35
- const dateValue = new Date(value);
36
- return dateValue.toISOString().slice(0, 10);
37
- }
38
- return new Date(value).toISOString();
39
- };
40
- class DateTimeFieldIndexImpl {
41
- fieldType = "datetime";
42
- unmappedType() {
43
- return "date";
44
- }
45
- toIndex({
46
- field,
47
- value
48
- }) {
49
- if (Array.isArray(value) === true) {
50
- return {
51
- value: value.map(v => {
52
- return convertValueToIndex(v, field);
53
- })
54
- };
55
- }
56
- return {
57
- value: convertValueToIndex(value, field)
58
- };
59
- }
60
- fromIndex({
61
- field,
62
- value
63
- }) {
64
- if (Array.isArray(value) === true) {
65
- return value.map(v => {
66
- return convertValueFromIndex(v, field);
67
- });
68
- }
69
- return convertValueFromIndex(value, field);
70
- }
71
- }
72
- export const DateTimeFieldIndex = CmsEntryOpenSearchFieldIndex.createImplementation({
73
- implementation: DateTimeFieldIndexImpl,
74
- dependencies: []
75
- });
76
-
77
- //# sourceMappingURL=DateTimeFieldIndex.js.map