@webiny/api-headless-cms-ddb-es 0.0.0-unstable.06b2ede40f → 0.0.0-unstable.0d717d18dd

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 (440) hide show
  1. package/README.md +6 -30
  2. package/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
  3. package/abstractions/CmsDdbEsDataLoaders.js +5 -0
  4. package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
  5. package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
  6. package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
  7. package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
  8. package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
  9. package/abstractions/CmsDdbEsEntryEntity.js +5 -0
  10. package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
  11. package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
  12. package/abstractions/CmsDdbEsGroupEntity.js +5 -0
  13. package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
  14. package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
  15. package/abstractions/CmsDdbEsModelEntity.js +5 -0
  16. package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
  17. package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
  18. package/abstractions/CmsDdbEsOsTable.js +5 -0
  19. package/abstractions/CmsDdbEsOsTable.js.map +1 -0
  20. package/abstractions/CmsDdbEsTable.d.ts +5 -0
  21. package/abstractions/CmsDdbEsTable.js +5 -0
  22. package/abstractions/CmsDdbEsTable.js.map +1 -0
  23. package/configurations.d.ts +5 -15
  24. package/configurations.js +14 -46
  25. package/configurations.js.map +1 -1
  26. package/definitions/entry.d.ts +4 -6
  27. package/definitions/entry.js +8 -179
  28. package/definitions/entry.js.map +1 -1
  29. package/definitions/group.d.ts +6 -7
  30. package/definitions/group.js +8 -63
  31. package/definitions/group.js.map +1 -1
  32. package/definitions/model.d.ts +6 -7
  33. package/definitions/model.js +8 -107
  34. package/definitions/model.js.map +1 -1
  35. package/definitions/types.d.ts +65 -0
  36. package/definitions/types.js +0 -0
  37. package/feature.d.ts +4 -0
  38. package/feature.js +89 -0
  39. package/feature.js.map +1 -0
  40. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.d.ts +13 -0
  41. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js +35 -0
  42. package/features/CmsModelOpenSearchIndex/CmsModelOpenSearchIndexProvider.js.map +1 -0
  43. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.d.ts +8 -0
  44. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js +17 -0
  45. package/features/CmsModelOpenSearchIndex/DefaultCmsModelOpenSearchIndex.js.map +1 -0
  46. package/features/CmsModelOpenSearchIndex/abstractions.d.ts +1 -0
  47. package/features/CmsModelOpenSearchIndex/abstractions.js +1 -0
  48. package/features/CmsModelOpenSearchIndex/feature.d.ts +4 -0
  49. package/features/CmsModelOpenSearchIndex/feature.js +13 -0
  50. package/features/CmsModelOpenSearchIndex/feature.js.map +1 -0
  51. package/features/CmsModelOpenSearchIndex/index.d.ts +3 -0
  52. package/features/CmsModelOpenSearchIndex/index.js +3 -0
  53. package/index.d.ts +1 -3
  54. package/index.js +1 -225
  55. package/operations/entry/DdbEsCreateEntry.d.ts +23 -0
  56. package/operations/entry/DdbEsCreateEntry.js +131 -0
  57. package/operations/entry/DdbEsCreateEntry.js.map +1 -0
  58. package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +23 -0
  59. package/operations/entry/DdbEsCreateEntryRevisionFrom.js +136 -0
  60. package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
  61. package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
  62. package/operations/entry/DdbEsDeleteEntry.js +79 -0
  63. package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
  64. package/operations/entry/DdbEsDeleteEntryRevision.d.ts +23 -0
  65. package/operations/entry/DdbEsDeleteEntryRevision.js +133 -0
  66. package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
  67. package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
  68. package/operations/entry/DdbEsDeleteMultipleEntries.js +77 -0
  69. package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
  70. package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
  71. package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
  72. package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
  73. package/operations/entry/DdbEsGetEntry.d.ts +14 -0
  74. package/operations/entry/DdbEsGetEntry.js +27 -0
  75. package/operations/entry/DdbEsGetEntry.js.map +1 -0
  76. package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
  77. package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
  78. package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
  79. package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
  80. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
  81. package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
  82. package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
  83. package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
  84. package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
  85. package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
  86. package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
  87. package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
  88. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
  89. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
  90. package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
  91. package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
  92. package/operations/entry/DdbEsGetRevisionById.js +34 -0
  93. package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
  94. package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
  95. package/operations/entry/DdbEsGetRevisions.js +33 -0
  96. package/operations/entry/DdbEsGetRevisions.js.map +1 -0
  97. package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +17 -0
  98. package/operations/entry/DdbEsGetUniqueFieldValues.js +73 -0
  99. package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
  100. package/operations/entry/DdbEsListEntries.d.ts +24 -0
  101. package/operations/entry/DdbEsListEntries.js +88 -0
  102. package/operations/entry/DdbEsListEntries.js.map +1 -0
  103. package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
  104. package/operations/entry/DdbEsMoveEntry.js +113 -0
  105. package/operations/entry/DdbEsMoveEntry.js.map +1 -0
  106. package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
  107. package/operations/entry/DdbEsMoveToBin.js +137 -0
  108. package/operations/entry/DdbEsMoveToBin.js.map +1 -0
  109. package/operations/entry/DdbEsPublishEntry.d.ts +23 -0
  110. package/operations/entry/DdbEsPublishEntry.js +228 -0
  111. package/operations/entry/DdbEsPublishEntry.js.map +1 -0
  112. package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
  113. package/operations/entry/DdbEsRestoreFromBin.js +137 -0
  114. package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
  115. package/operations/entry/DdbEsUnpublishEntry.d.ts +23 -0
  116. package/operations/entry/DdbEsUnpublishEntry.js +124 -0
  117. package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
  118. package/operations/entry/DdbEsUpdateEntry.d.ts +23 -0
  119. package/operations/entry/DdbEsUpdateEntry.js +172 -0
  120. package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
  121. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -2
  122. package/operations/entry/dataLoader/DataLoaderCache.js +21 -35
  123. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  124. package/operations/entry/dataLoader/constants.js +2 -7
  125. package/operations/entry/dataLoader/constants.js.map +1 -1
  126. package/operations/entry/dataLoader/createBatchScheduleFn.js +7 -22
  127. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  128. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
  129. package/operations/entry/dataLoader/getAllEntryRevisions.js +20 -41
  130. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  131. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
  132. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +30 -48
  133. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  134. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
  135. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +30 -48
  136. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  137. package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
  138. package/operations/entry/dataLoader/getRevisionById.js +36 -58
  139. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  140. package/operations/entry/dataLoader/index.d.ts +3 -3
  141. package/operations/entry/dataLoader/index.js +13 -35
  142. package/operations/entry/dataLoader/index.js.map +1 -1
  143. package/operations/entry/dataLoader/types.d.ts +4 -4
  144. package/operations/entry/dataLoader/types.js +0 -7
  145. package/operations/entry/dataLoaders.d.ts +14 -14
  146. package/operations/entry/dataLoaders.js +92 -110
  147. package/operations/entry/dataLoaders.js.map +1 -1
  148. package/operations/entry/feature.d.ts +4 -0
  149. package/operations/entry/feature.js +55 -0
  150. package/operations/entry/feature.js.map +1 -0
  151. package/operations/entry/keys.d.ts +31 -1
  152. package/operations/entry/keys.js +44 -27
  153. package/operations/entry/keys.js.map +1 -1
  154. package/operations/entry/recordType.js +4 -18
  155. package/operations/entry/recordType.js.map +1 -1
  156. package/operations/entry/storageEntryUtils.d.ts +7 -0
  157. package/operations/entry/storageEntryUtils.js +14 -0
  158. package/operations/entry/storageEntryUtils.js.map +1 -0
  159. package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
  160. package/operations/entry/transformations/convertEntryKeys.js +21 -34
  161. package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
  162. package/operations/entry/transformations/index.d.ts +21 -18
  163. package/operations/entry/transformations/index.js +87 -123
  164. package/operations/entry/transformations/index.js.map +1 -1
  165. package/operations/entry/transformations/modifyEntryValues.d.ts +30 -35
  166. package/operations/entry/transformations/modifyEntryValues.js +12 -24
  167. package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
  168. package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
  169. package/operations/entry/transformations/transformEntryKeys.js +14 -24
  170. package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
  171. package/operations/group/DdbEsCreateGroup.d.ts +12 -0
  172. package/operations/group/DdbEsCreateGroup.js +35 -0
  173. package/operations/group/DdbEsCreateGroup.js.map +1 -0
  174. package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
  175. package/operations/group/DdbEsDeleteGroup.js +31 -0
  176. package/operations/group/DdbEsDeleteGroup.js.map +1 -0
  177. package/operations/group/DdbEsGetGroup.d.ts +12 -0
  178. package/operations/group/DdbEsGetGroup.js +31 -0
  179. package/operations/group/DdbEsGetGroup.js.map +1 -0
  180. package/operations/group/DdbEsListGroups.d.ts +14 -0
  181. package/operations/group/DdbEsListGroups.js +52 -0
  182. package/operations/group/DdbEsListGroups.js.map +1 -0
  183. package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
  184. package/operations/group/DdbEsUpdateGroup.js +35 -0
  185. package/operations/group/DdbEsUpdateGroup.js.map +1 -0
  186. package/operations/group/feature.d.ts +4 -0
  187. package/operations/group/feature.js +19 -0
  188. package/operations/group/feature.js.map +1 -0
  189. package/operations/group/keys.d.ts +15 -0
  190. package/operations/group/keys.js +17 -0
  191. package/operations/group/keys.js.map +1 -0
  192. package/operations/model/DdbEsCreateModel.d.ts +14 -0
  193. package/operations/model/DdbEsCreateModel.js +52 -0
  194. package/operations/model/DdbEsCreateModel.js.map +1 -0
  195. package/operations/model/DdbEsDeleteModel.d.ts +12 -0
  196. package/operations/model/DdbEsDeleteModel.js +31 -0
  197. package/operations/model/DdbEsDeleteModel.js.map +1 -0
  198. package/operations/model/DdbEsGetModel.d.ts +12 -0
  199. package/operations/model/DdbEsGetModel.js +30 -0
  200. package/operations/model/DdbEsGetModel.js.map +1 -0
  201. package/operations/model/DdbEsListModels.d.ts +12 -0
  202. package/operations/model/DdbEsListModels.js +36 -0
  203. package/operations/model/DdbEsListModels.js.map +1 -0
  204. package/operations/model/DdbEsUpdateModel.d.ts +12 -0
  205. package/operations/model/DdbEsUpdateModel.js +36 -0
  206. package/operations/model/DdbEsUpdateModel.js.map +1 -0
  207. package/operations/model/feature.d.ts +4 -0
  208. package/operations/model/feature.js +19 -0
  209. package/operations/model/feature.js.map +1 -0
  210. package/operations/model/keys.d.ts +15 -0
  211. package/operations/model/keys.js +17 -0
  212. package/operations/model/keys.js.map +1 -0
  213. package/package.json +40 -36
  214. package/tasks/CreateElasticsearchIndexTask.d.ts +13 -0
  215. package/tasks/CreateElasticsearchIndexTask.js +40 -0
  216. package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
  217. package/types.d.ts +12 -159
  218. package/types.js +7 -39
  219. package/types.js.map +1 -1
  220. package/definitions/entryElasticsearch.d.ts +0 -9
  221. package/definitions/entryElasticsearch.js +0 -41
  222. package/definitions/entryElasticsearch.js.map +0 -1
  223. package/definitions/system.d.ts +0 -9
  224. package/definitions/system.js +0 -42
  225. package/definitions/system.js.map +0 -1
  226. package/definitions/table.d.ts +0 -8
  227. package/definitions/table.js +0 -25
  228. package/definitions/table.js.map +0 -1
  229. package/definitions/tableElasticsearch.d.ts +0 -8
  230. package/definitions/tableElasticsearch.js +0 -25
  231. package/definitions/tableElasticsearch.js.map +0 -1
  232. package/dynamoDb/index.d.ts +0 -3
  233. package/dynamoDb/index.js +0 -16
  234. package/dynamoDb/index.js.map +0 -1
  235. package/dynamoDb/storage/longText.d.ts +0 -10
  236. package/dynamoDb/storage/longText.js +0 -96
  237. package/dynamoDb/storage/longText.js.map +0 -1
  238. package/dynamoDb/storage/richText.d.ts +0 -2
  239. package/dynamoDb/storage/richText.js +0 -59
  240. package/dynamoDb/storage/richText.js.map +0 -1
  241. package/elasticsearch/createElasticsearchIndex.d.ts +0 -9
  242. package/elasticsearch/createElasticsearchIndex.js +0 -40
  243. package/elasticsearch/createElasticsearchIndex.js.map +0 -1
  244. package/elasticsearch/deleteElasticsearchIndex.d.ts +0 -8
  245. package/elasticsearch/deleteElasticsearchIndex.js +0 -38
  246. package/elasticsearch/deleteElasticsearchIndex.js.map +0 -1
  247. package/elasticsearch/index.d.ts +0 -2
  248. package/elasticsearch/index.js +0 -13
  249. package/elasticsearch/index.js.map +0 -1
  250. package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
  251. package/elasticsearch/indexing/dateTimeIndexing.js +0 -88
  252. package/elasticsearch/indexing/dateTimeIndexing.js.map +0 -1
  253. package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
  254. package/elasticsearch/indexing/defaultFieldIndexing.js +0 -54
  255. package/elasticsearch/indexing/defaultFieldIndexing.js.map +0 -1
  256. package/elasticsearch/indexing/index.d.ts +0 -2
  257. package/elasticsearch/indexing/index.js +0 -18
  258. package/elasticsearch/indexing/index.js.map +0 -1
  259. package/elasticsearch/indexing/jsonIndexing.d.ts +0 -2
  260. package/elasticsearch/indexing/jsonIndexing.js +0 -28
  261. package/elasticsearch/indexing/jsonIndexing.js.map +0 -1
  262. package/elasticsearch/indexing/longTextIndexing.d.ts +0 -7
  263. package/elasticsearch/indexing/longTextIndexing.js +0 -42
  264. package/elasticsearch/indexing/longTextIndexing.js.map +0 -1
  265. package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
  266. package/elasticsearch/indexing/numberIndexing.js +0 -41
  267. package/elasticsearch/indexing/numberIndexing.js.map +0 -1
  268. package/elasticsearch/indexing/objectIndexing.d.ts +0 -12
  269. package/elasticsearch/indexing/objectIndexing.js +0 -201
  270. package/elasticsearch/indexing/objectIndexing.js.map +0 -1
  271. package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
  272. package/elasticsearch/indexing/richTextIndexing.js +0 -31
  273. package/elasticsearch/indexing/richTextIndexing.js.map +0 -1
  274. package/elasticsearch/indices/base.d.ts +0 -2
  275. package/elasticsearch/indices/base.js +0 -13
  276. package/elasticsearch/indices/base.js.map +0 -1
  277. package/elasticsearch/indices/index.d.ts +0 -1
  278. package/elasticsearch/indices/index.js +0 -14
  279. package/elasticsearch/indices/index.js.map +0 -1
  280. package/elasticsearch/indices/japanese.d.ts +0 -2
  281. package/elasticsearch/indices/japanese.js +0 -14
  282. package/elasticsearch/indices/japanese.js.map +0 -1
  283. package/elasticsearch/search/index.d.ts +0 -3
  284. package/elasticsearch/search/index.js +0 -13
  285. package/elasticsearch/search/index.js.map +0 -1
  286. package/elasticsearch/search/refSearch.d.ts +0 -2
  287. package/elasticsearch/search/refSearch.js +0 -31
  288. package/elasticsearch/search/refSearch.js.map +0 -1
  289. package/elasticsearch/search/searchableJson.d.ts +0 -2
  290. package/elasticsearch/search/searchableJson.js +0 -60
  291. package/elasticsearch/search/searchableJson.js.map +0 -1
  292. package/elasticsearch/search/timeSearch.d.ts +0 -2
  293. package/elasticsearch/search/timeSearch.js +0 -27
  294. package/elasticsearch/search/timeSearch.js.map +0 -1
  295. package/helpers/entryIndexHelpers.d.ts +0 -18
  296. package/helpers/entryIndexHelpers.js +0 -190
  297. package/helpers/entryIndexHelpers.js.map +0 -1
  298. package/helpers/fieldIdentifier.d.ts +0 -6
  299. package/helpers/fieldIdentifier.js +0 -43
  300. package/helpers/fieldIdentifier.js.map +0 -1
  301. package/helpers/index.d.ts +0 -2
  302. package/helpers/index.js +0 -29
  303. package/helpers/index.js.map +0 -1
  304. package/index.js.map +0 -1
  305. package/operations/entry/dataLoader/types.js.map +0 -1
  306. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +0 -18
  307. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +0 -34
  308. package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +0 -1
  309. package/operations/entry/elasticsearch/body.d.ts +0 -13
  310. package/operations/entry/elasticsearch/body.js +0 -142
  311. package/operations/entry/elasticsearch/body.js.map +0 -1
  312. package/operations/entry/elasticsearch/fields.d.ts +0 -10
  313. package/operations/entry/elasticsearch/fields.js +0 -315
  314. package/operations/entry/elasticsearch/fields.js.map +0 -1
  315. package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +0 -8
  316. package/operations/entry/elasticsearch/filtering/applyFiltering.js +0 -60
  317. package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +0 -1
  318. package/operations/entry/elasticsearch/filtering/exec.d.ts +0 -17
  319. package/operations/entry/elasticsearch/filtering/exec.js +0 -175
  320. package/operations/entry/elasticsearch/filtering/exec.js.map +0 -1
  321. package/operations/entry/elasticsearch/filtering/index.d.ts +0 -1
  322. package/operations/entry/elasticsearch/filtering/index.js +0 -18
  323. package/operations/entry/elasticsearch/filtering/index.js.map +0 -1
  324. package/operations/entry/elasticsearch/filtering/path.d.ts +0 -16
  325. package/operations/entry/elasticsearch/filtering/path.js +0 -48
  326. package/operations/entry/elasticsearch/filtering/path.js.map +0 -1
  327. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +0 -2
  328. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +0 -30
  329. package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +0 -1
  330. package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +0 -1
  331. package/operations/entry/elasticsearch/filtering/plugins/index.js +0 -15
  332. package/operations/entry/elasticsearch/filtering/plugins/index.js.map +0 -1
  333. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +0 -2
  334. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +0 -69
  335. package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +0 -1
  336. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +0 -2
  337. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +0 -57
  338. package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +0 -1
  339. package/operations/entry/elasticsearch/filtering/populated.d.ts +0 -2
  340. package/operations/entry/elasticsearch/filtering/populated.js +0 -25
  341. package/operations/entry/elasticsearch/filtering/populated.js.map +0 -1
  342. package/operations/entry/elasticsearch/filtering/values.d.ts +0 -2
  343. package/operations/entry/elasticsearch/filtering/values.js +0 -24
  344. package/operations/entry/elasticsearch/filtering/values.js.map +0 -1
  345. package/operations/entry/elasticsearch/fullTextSearch.d.ts +0 -12
  346. package/operations/entry/elasticsearch/fullTextSearch.js +0 -91
  347. package/operations/entry/elasticsearch/fullTextSearch.js.map +0 -1
  348. package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +0 -8
  349. package/operations/entry/elasticsearch/fullTextSearchFields.js +0 -27
  350. package/operations/entry/elasticsearch/fullTextSearchFields.js.map +0 -1
  351. package/operations/entry/elasticsearch/initialQuery.d.ts +0 -17
  352. package/operations/entry/elasticsearch/initialQuery.js +0 -106
  353. package/operations/entry/elasticsearch/initialQuery.js.map +0 -1
  354. package/operations/entry/elasticsearch/keyword.d.ts +0 -2
  355. package/operations/entry/elasticsearch/keyword.js +0 -36
  356. package/operations/entry/elasticsearch/keyword.js.map +0 -1
  357. package/operations/entry/elasticsearch/logIgnoredEsResponseError.d.ts +0 -9
  358. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js +0 -26
  359. package/operations/entry/elasticsearch/logIgnoredEsResponseError.js.map +0 -1
  360. package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +0 -9
  361. package/operations/entry/elasticsearch/plugins/bodyModifier.js +0 -18
  362. package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +0 -1
  363. package/operations/entry/elasticsearch/plugins/operator.d.ts +0 -8
  364. package/operations/entry/elasticsearch/plugins/operator.js +0 -39
  365. package/operations/entry/elasticsearch/plugins/operator.js.map +0 -1
  366. package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +0 -9
  367. package/operations/entry/elasticsearch/plugins/queryModifier.js +0 -18
  368. package/operations/entry/elasticsearch/plugins/queryModifier.js.map +0 -1
  369. package/operations/entry/elasticsearch/plugins/search.d.ts +0 -7
  370. package/operations/entry/elasticsearch/plugins/search.js +0 -26
  371. package/operations/entry/elasticsearch/plugins/search.js.map +0 -1
  372. package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +0 -9
  373. package/operations/entry/elasticsearch/plugins/sortModifier.js +0 -18
  374. package/operations/entry/elasticsearch/plugins/sortModifier.js.map +0 -1
  375. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +0 -2
  376. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +0 -13
  377. package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +0 -1
  378. package/operations/entry/elasticsearch/sort.d.ts +0 -12
  379. package/operations/entry/elasticsearch/sort.js +0 -89
  380. package/operations/entry/elasticsearch/sort.js.map +0 -1
  381. package/operations/entry/elasticsearch/transformValueForSearch.d.ts +0 -16
  382. package/operations/entry/elasticsearch/transformValueForSearch.js +0 -32
  383. package/operations/entry/elasticsearch/transformValueForSearch.js.map +0 -1
  384. package/operations/entry/elasticsearch/types.d.ts +0 -41
  385. package/operations/entry/elasticsearch/types.js +0 -7
  386. package/operations/entry/elasticsearch/types.js.map +0 -1
  387. package/operations/entry/index.d.ts +0 -11
  388. package/operations/entry/index.js +0 -1881
  389. package/operations/entry/index.js.map +0 -1
  390. package/operations/entry/transformations/transformEntryToIndex.d.ts +0 -10
  391. package/operations/entry/transformations/transformEntryToIndex.js +0 -31
  392. package/operations/entry/transformations/transformEntryToIndex.js.map +0 -1
  393. package/operations/group/index.d.ts +0 -8
  394. package/operations/group/index.js +0 -179
  395. package/operations/group/index.js.map +0 -1
  396. package/operations/model/index.d.ts +0 -8
  397. package/operations/model/index.js +0 -183
  398. package/operations/model/index.js.map +0 -1
  399. package/operations/system/index.d.ts +0 -6
  400. package/operations/system/index.js +0 -94
  401. package/operations/system/index.js.map +0 -1
  402. package/operations/system/indexes.d.ts +0 -10
  403. package/operations/system/indexes.js +0 -41
  404. package/operations/system/indexes.js.map +0 -1
  405. package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +0 -69
  406. package/plugins/CmsElasticsearchModelFieldPlugin.js +0 -52
  407. package/plugins/CmsElasticsearchModelFieldPlugin.js.map +0 -1
  408. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -22
  409. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -21
  410. package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +0 -1
  411. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +0 -23
  412. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +0 -27
  413. package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +0 -1
  414. package/plugins/CmsEntryElasticsearchIndexPlugin.d.ts +0 -4
  415. package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -13
  416. package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +0 -1
  417. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +0 -32
  418. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +0 -40
  419. package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +0 -1
  420. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -19
  421. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -21
  422. package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +0 -1
  423. package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -19
  424. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -21
  425. package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +0 -1
  426. package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +0 -33
  427. package/plugins/CmsEntryElasticsearchValuesModifier.js +0 -50
  428. package/plugins/CmsEntryElasticsearchValuesModifier.js.map +0 -1
  429. package/plugins/CmsEntryFilterPlugin.d.ts +0 -49
  430. package/plugins/CmsEntryFilterPlugin.js +0 -22
  431. package/plugins/CmsEntryFilterPlugin.js.map +0 -1
  432. package/plugins/index.d.ts +0 -8
  433. package/plugins/index.js +0 -95
  434. package/plugins/index.js.map +0 -1
  435. package/tasks/createIndexTaskPlugin.d.ts +0 -2
  436. package/tasks/createIndexTaskPlugin.js +0 -67
  437. package/tasks/createIndexTaskPlugin.js.map +0 -1
  438. package/values/NoValueContainer.d.ts +0 -5
  439. package/values/NoValueContainer.js +0 -20
  440. package/values/NoValueContainer.js.map +0 -1
package/README.md CHANGED
@@ -1,35 +1,11 @@
1
1
  # @webiny/api-headless-cms-ddb-es
2
2
 
3
- [![](https://img.shields.io/npm/dw/@webiny/api-headless-cms-ddb-es.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb-es)
4
- [![](https://img.shields.io/npm/v/@webiny/api-headless-cms-ddb-es.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb-es)
5
- [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
7
6
 
8
- ## Install
7
+ 📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
9
8
 
10
- ```
11
- npm install --save @webiny/api-headless-cms-ddb-es
12
- ```
9
+ ---
13
10
 
14
- Or if you prefer yarn:
15
-
16
- ```
17
- yarn add @webiny/api-headless-cms-ddb-es
18
- ```
19
-
20
-
21
- ## Testing
22
- To run the tests only for this package you must filter it with keywords.
23
-
24
- ### Env variables
25
-
26
- ###### LOCAL_ELASTICSEARCH
27
- If set, does not run Elasticsearch when starting the tests, use local one. You must install it and run if, of course.
28
-
29
- ###### ELASTICSEARCH_PORT
30
- Custom port for local elasticsearch.
31
-
32
- ### Command
33
- ````
34
- ELASTICSEARCH_PORT=9200 LOCAL_ELASTICSEARCH=true yarn test packages/api-headless-cms --keyword=cms:ddb-es --keyword=cms:base
35
- ````
11
+ _This README file is automatically generated during the publish process._
@@ -0,0 +1,5 @@
1
+ import type { IDataLoadersHandler } from "../types.js";
2
+ export declare const CmsDdbEsDataLoaders: import("@webiny/di").Abstraction<IDataLoadersHandler>;
3
+ export declare namespace CmsDdbEsDataLoaders {
4
+ type Interface = IDataLoadersHandler;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsDataLoaders = createAbstraction("Cms/DdbEs/DataLoaders");
3
+ export { CmsDdbEsDataLoaders };
4
+
5
+ //# sourceMappingURL=CmsDdbEsDataLoaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsDataLoaders.js","sources":["../../src/abstractions/CmsDdbEsDataLoaders.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IDataLoadersHandler } from \"~/types.js\";\n\nexport const CmsDdbEsDataLoaders = createAbstraction<IDataLoadersHandler>(\"Cms/DdbEs/DataLoaders\");\n\nexport namespace CmsDdbEsDataLoaders {\n export type Interface = IDataLoadersHandler;\n}\n"],"names":["CmsDdbEsDataLoaders","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAuC"}
@@ -0,0 +1,5 @@
1
+ import type { IOpenSearchEntity } from "@webiny/api-opensearch";
2
+ export declare const CmsDdbEsEntriesEsEntity: import("@webiny/di").Abstraction<IOpenSearchEntity>;
3
+ export declare namespace CmsDdbEsEntriesEsEntity {
4
+ type Interface = IOpenSearchEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsEntriesEsEntity = createAbstraction("Cms/DdbEs/EntriesEsEntity");
3
+ export { CmsDdbEsEntriesEsEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEsEntriesEsEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsEntriesEsEntity.js","sources":["../../src/abstractions/CmsDdbEsEntriesEsEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IOpenSearchEntity } from \"@webiny/api-opensearch\";\n\nexport const CmsDdbEsEntriesEsEntity = createAbstraction<IOpenSearchEntity>(\n \"Cms/DdbEs/EntriesEsEntity\"\n);\n\nexport namespace CmsDdbEsEntriesEsEntity {\n export type Interface = IOpenSearchEntity;\n}\n"],"names":["CmsDdbEsEntriesEsEntity","createAbstraction"],"mappings":";AAGO,MAAMA,0BAA0BC,kBACnC"}
@@ -0,0 +1,5 @@
1
+ import type { IEntryEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbEsEntryEntity: import("@webiny/di").Abstraction<IEntryEntity>;
3
+ export declare namespace CmsDdbEsEntryEntity {
4
+ type Interface = IEntryEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsEntryEntity = createAbstraction("Cms/DdbEs/EntryEntity");
3
+ export { CmsDdbEsEntryEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEsEntryEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsEntryEntity.js","sources":["../../src/abstractions/CmsDdbEsEntryEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IEntryEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsEntryEntity = createAbstraction<IEntryEntity>(\"Cms/DdbEs/EntryEntity\");\n\nexport namespace CmsDdbEsEntryEntity {\n export type Interface = IEntryEntity;\n}\n"],"names":["CmsDdbEsEntryEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { IGroupEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbEsGroupEntity: import("@webiny/di").Abstraction<IGroupEntity>;
3
+ export declare namespace CmsDdbEsGroupEntity {
4
+ type Interface = IGroupEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsGroupEntity = createAbstraction("Cms/DdbEs/GroupEntity");
3
+ export { CmsDdbEsGroupEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEsGroupEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsGroupEntity.js","sources":["../../src/abstractions/CmsDdbEsGroupEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IGroupEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsGroupEntity = createAbstraction<IGroupEntity>(\"Cms/DdbEs/GroupEntity\");\n\nexport namespace CmsDdbEsGroupEntity {\n export type Interface = IGroupEntity;\n}\n"],"names":["CmsDdbEsGroupEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { IModelEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbEsModelEntity: import("@webiny/di").Abstraction<IModelEntity>;
3
+ export declare namespace CmsDdbEsModelEntity {
4
+ type Interface = IModelEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsModelEntity = createAbstraction("Cms/DdbEs/ModelEntity");
3
+ export { CmsDdbEsModelEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEsModelEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsModelEntity.js","sources":["../../src/abstractions/CmsDdbEsModelEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEsModelEntity = createAbstraction<IModelEntity>(\"Cms/DdbEs/ModelEntity\");\n\nexport namespace CmsDdbEsModelEntity {\n export type Interface = IModelEntity;\n}\n"],"names":["CmsDdbEsModelEntity","createAbstraction"],"mappings":";AAGO,MAAMA,sBAAsBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { ITable } from "@webiny/db-dynamodb";
2
+ export declare const CmsDdbEsOsTable: import("@webiny/di").Abstraction<ITable<string, string, string>>;
3
+ export declare namespace CmsDdbEsOsTable {
4
+ type Interface = ITable;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsOsTable = createAbstraction("Cms/DdbEs/OsTable");
3
+ export { CmsDdbEsOsTable };
4
+
5
+ //# sourceMappingURL=CmsDdbEsOsTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsOsTable.js","sources":["../../src/abstractions/CmsDdbEsOsTable.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport const CmsDdbEsOsTable = createAbstraction<ITable>(\"Cms/DdbEs/OsTable\");\n\nexport namespace CmsDdbEsOsTable {\n export type Interface = ITable;\n}\n"],"names":["CmsDdbEsOsTable","createAbstraction"],"mappings":";AAGO,MAAMA,kBAAkBC,kBAA0B"}
@@ -0,0 +1,5 @@
1
+ import type { ITable } from "@webiny/db-dynamodb";
2
+ export declare const CmsDdbEsTable: import("@webiny/di").Abstraction<ITable<string, string, string>>;
3
+ export declare namespace CmsDdbEsTable {
4
+ type Interface = ITable;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEsTable = createAbstraction("Cms/DdbEs/Table");
3
+ export { CmsDdbEsTable };
4
+
5
+ //# sourceMappingURL=CmsDdbEsTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEsTable.js","sources":["../../src/abstractions/CmsDdbEsTable.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport const CmsDdbEsTable = createAbstraction<ITable>(\"Cms/DdbEs/Table\");\n\nexport namespace CmsDdbEsTable {\n export type Interface = ITable;\n}\n"],"names":["CmsDdbEsTable","createAbstraction"],"mappings":";AAGO,MAAMA,gBAAgBC,kBAA0B"}
@@ -1,19 +1,9 @@
1
- import type { CmsModel } from "@webiny/api-headless-cms/types";
2
- import type { CmsContext } from "./types";
3
- import type { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types";
4
- interface ConfigurationsElasticsearch {
5
- index: string;
6
- }
1
+ import type { CmsModelOpenSearchIndexProvider, ICmsModelOpenSearchIndexProviderResult } from "./features/CmsModelOpenSearchIndex/index.js";
2
+ import type { StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
7
3
  export interface CmsElasticsearchParams {
8
- model: Pick<CmsModel, "tenant" | "locale" | "modelId">;
9
- }
10
- export interface ConfigurationsIndexSettingsParams {
11
- context: CmsContext;
12
- model: Pick<CmsModel, "locale">;
4
+ model: StorageCmsModel;
13
5
  }
14
6
  export interface Configurations {
15
- es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;
16
- indexSettings: (params: ConfigurationsIndexSettingsParams) => Partial<ElasticsearchIndexRequestBody>;
7
+ es: (params: CmsElasticsearchParams) => Promise<ICmsModelOpenSearchIndexProviderResult>;
17
8
  }
18
- export declare const configurations: Configurations;
19
- export {};
9
+ export declare const createConfigurations: (provider: CmsModelOpenSearchIndexProvider.Interface) => Configurations;
package/configurations.js CHANGED
@@ -1,49 +1,17 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.configurations = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _apiElasticsearch = require("@webiny/api-elasticsearch");
10
- var _plugins = require("./plugins");
11
- const configurations = exports.configurations = {
12
- es({
13
- model
14
- }) {
15
- const {
16
- tenant,
17
- locale
18
- } = model;
19
- if (!tenant) {
20
- throw new _error.default(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
21
- } else if (!locale) {
22
- throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
23
- }
24
- const sharedIndex = (0, _apiElasticsearch.isSharedElasticsearchIndex)();
25
- const index = [sharedIndex ? "root" : tenant, "headless-cms", locale, model.modelId].join("-").toLowerCase();
26
- const prefix = (0, _apiElasticsearch.getElasticsearchIndexPrefix)();
27
- if (!prefix) {
28
- return {
29
- index
30
- };
31
- }
32
- return {
33
- index: prefix + index
34
- };
35
- },
36
- indexSettings: ({
37
- context,
38
- model
39
- }) => {
40
- const plugin = (0, _apiElasticsearch.getLastAddedIndexPlugin)({
41
- container: context.plugins,
42
- type: _plugins.CmsEntryElasticsearchIndexPlugin.type,
43
- locale: model.locale
1
+ import { getOpenSearchIndexPrefix } from "@webiny/api-opensearch";
2
+ const createConfigurations = (provider)=>({
3
+ async es ({ model }) {
4
+ const result = await provider.execute({
5
+ model
6
+ });
7
+ const prefix = getOpenSearchIndexPrefix();
8
+ if (!prefix) return result;
9
+ return {
10
+ ...result,
11
+ index: prefix + result.index
12
+ };
13
+ }
44
14
  });
45
- return plugin ? plugin.body : {};
46
- }
47
- };
15
+ export { createConfigurations };
48
16
 
49
17
  //# sourceMappingURL=configurations.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_apiElasticsearch","_plugins","configurations","exports","es","model","tenant","locale","WebinyError","sharedIndex","isSharedElasticsearchIndex","index","modelId","join","toLowerCase","prefix","getElasticsearchIndexPrefix","indexSettings","context","plugin","getLastAddedIndexPlugin","container","plugins","type","CmsEntryElasticsearchIndexPlugin","body"],"sources":["configurations.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\nimport type { CmsContext } from \"~/types\";\nimport {\n getElasticsearchIndexPrefix,\n getLastAddedIndexPlugin,\n isSharedElasticsearchIndex\n} from \"@webiny/api-elasticsearch\";\nimport type { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins\";\n\ninterface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\" | \"modelId\">;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n context: CmsContext;\n model: Pick<CmsModel, \"locale\">;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;\n indexSettings: (\n params: ConfigurationsIndexSettingsParams\n ) => Partial<ElasticsearchIndexRequestBody>;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant, locale } = 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 } else if (!locale) {\n throw new WebinyError(\n `Missing \"locale\" parameter when trying to create Elasticsearch index name.`,\n \"LOCALE_ERROR\"\n );\n }\n\n const sharedIndex = isSharedElasticsearchIndex();\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", locale, model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getElasticsearchIndexPrefix();\n\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n },\n indexSettings: ({ context, model }) => {\n const plugin = getLastAddedIndexPlugin<CmsEntryElasticsearchIndexPlugin>({\n container: context.plugins,\n type: CmsEntryElasticsearchIndexPlugin.type,\n locale: model.locale\n });\n\n return plugin ? plugin.body : {};\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AAMA,IAAAE,QAAA,GAAAF,OAAA;AAsBO,MAAMG,cAA8B,GAAAC,OAAA,CAAAD,cAAA,GAAG;EAC1CE,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC,MAAM;MAAEC;IAAO,CAAC,GAAGF,KAAK;IAEhC,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIE,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMC,WAAW,GAAG,IAAAC,4CAA0B,EAAC,CAAC;IAChD,MAAMC,KAAK,GAAG,CAACF,WAAW,GAAG,MAAM,GAAGH,MAAM,EAAE,cAAc,EAAEC,MAAM,EAAEF,KAAK,CAACO,OAAO,CAAC,CAC/EC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAG,IAAAC,6CAA2B,EAAC,CAAC;IAE5C,IAAI,CAACD,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL,CAAC;EACDM,aAAa,EAAEA,CAAC;IAAEC,OAAO;IAAEb;EAAM,CAAC,KAAK;IACnC,MAAMc,MAAM,GAAG,IAAAC,yCAAuB,EAAmC;MACrEC,SAAS,EAAEH,OAAO,CAACI,OAAO;MAC1BC,IAAI,EAAEC,yCAAgC,CAACD,IAAI;MAC3ChB,MAAM,EAAEF,KAAK,CAACE;IAClB,CAAC,CAAC;IAEF,OAAOY,MAAM,GAAGA,MAAM,CAACM,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"configurations.js","sources":["../src/configurations.ts"],"sourcesContent":["import { getOpenSearchIndexPrefix } from \"@webiny/api-opensearch\";\nimport type {\n CmsModelOpenSearchIndexProvider,\n ICmsModelOpenSearchIndexProviderResult\n} from \"~/features/CmsModelOpenSearchIndex/index.js\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface CmsElasticsearchParams {\n model: StorageCmsModel;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => Promise<ICmsModelOpenSearchIndexProviderResult>;\n}\n\nexport const createConfigurations = (\n provider: CmsModelOpenSearchIndexProvider.Interface\n): Configurations => ({\n async es({ model }) {\n const result = await provider.execute({ model });\n\n const prefix = getOpenSearchIndexPrefix();\n\n if (!prefix) {\n return result;\n }\n return {\n ...result,\n index: prefix + result.index\n };\n }\n});\n"],"names":["createConfigurations","provider","model","result","prefix","getOpenSearchIndexPrefix"],"mappings":";AAeO,MAAMA,uBAAuB,CAChCC,WACkB;QAClB,MAAM,IAAG,EAAEC,KAAK,EAAE;YACd,MAAMC,SAAS,MAAMF,SAAS,OAAO,CAAC;gBAAEC;YAAM;YAE9C,MAAME,SAASC;YAEf,IAAI,CAACD,QACD,OAAOD;YAEX,OAAO;gBACH,GAAGA,MAAM;gBACT,OAAOC,SAASD,OAAO,KAAK;YAChC;QACJ;IACJ"}
@@ -1,9 +1,7 @@
1
- import type { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Entity } from "@webiny/db-dynamodb/toolbox";
3
- import type { Attributes } from "../types";
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IEntryEntity } from "../definitions/types.js";
4
3
  export interface CreateEntryEntityParams {
5
- table: Table<string, string, string>;
4
+ table: ITable;
6
5
  entityName: string;
7
- attributes: Attributes;
8
6
  }
9
- export declare const createEntryEntity: (params: CreateEntryEntityParams) => Entity<any>;
7
+ export declare const createEntryEntity: (params: CreateEntryEntityParams) => IEntryEntity;
@@ -1,182 +1,11 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createEntryEntity = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createEntryEntity = params => {
9
- const {
10
- table,
11
- entityName,
12
- attributes
13
- } = params;
14
- return new _toolbox.Entity({
15
- name: entityName,
16
- table,
17
- attributes: {
18
- PK: {
19
- type: "string",
20
- partitionKey: true
21
- },
22
- SK: {
23
- type: "string",
24
- sortKey: true
25
- },
26
- TYPE: {
27
- type: "string"
28
- },
29
- __type: {
30
- type: "string"
31
- },
32
- webinyVersion: {
33
- type: "string"
34
- },
35
- tenant: {
36
- type: "string"
37
- },
38
- entryId: {
39
- type: "string"
40
- },
41
- id: {
42
- type: "string"
43
- },
44
- /**
45
- * Revision-level meta fields. 👇
46
- */
47
- revisionCreatedOn: {
48
- type: "string"
49
- },
50
- revisionSavedOn: {
51
- type: "string"
52
- },
53
- revisionModifiedOn: {
54
- type: "string"
55
- },
56
- revisionDeletedOn: {
57
- type: "string"
58
- },
59
- revisionRestoredOn: {
60
- type: "string"
61
- },
62
- revisionFirstPublishedOn: {
63
- type: "string"
64
- },
65
- revisionLastPublishedOn: {
66
- type: "string"
67
- },
68
- revisionCreatedBy: {
69
- type: "map"
70
- },
71
- revisionSavedBy: {
72
- type: "map"
73
- },
74
- revisionModifiedBy: {
75
- type: "map"
76
- },
77
- revisionDeletedBy: {
78
- type: "map"
79
- },
80
- revisionRestoredBy: {
81
- type: "map"
82
- },
83
- revisionFirstPublishedBy: {
84
- type: "map"
85
- },
86
- revisionLastPublishedBy: {
87
- type: "map"
88
- },
89
- /**
90
- * Entry-level meta fields. 👇
91
- */
92
- createdOn: {
93
- type: "string"
94
- },
95
- savedOn: {
96
- type: "string"
97
- },
98
- modifiedOn: {
99
- type: "string"
100
- },
101
- deletedOn: {
102
- type: "string"
103
- },
104
- restoredOn: {
105
- type: "string"
106
- },
107
- firstPublishedOn: {
108
- type: "string"
109
- },
110
- lastPublishedOn: {
111
- type: "string"
112
- },
113
- createdBy: {
114
- type: "map"
115
- },
116
- savedBy: {
117
- type: "map"
118
- },
119
- modifiedBy: {
120
- type: "map"
121
- },
122
- deletedBy: {
123
- type: "map"
124
- },
125
- restoredBy: {
126
- type: "map"
127
- },
128
- firstPublishedBy: {
129
- type: "map"
130
- },
131
- lastPublishedBy: {
132
- type: "map"
133
- },
134
- /**
135
- * Deprecated fields. 👇
136
- */
137
- ownedBy: {
138
- type: "map"
139
- },
140
- publishedOn: {
141
- type: "string"
142
- },
143
- /**
144
- * The rest. 👇
145
- */
146
- modelId: {
147
- type: "string"
148
- },
149
- locale: {
150
- type: "string"
151
- },
152
- version: {
153
- type: "number"
154
- },
155
- locked: {
156
- type: "boolean"
157
- },
158
- status: {
159
- type: "string"
160
- },
161
- location: {
162
- type: "map"
163
- },
164
- wbyDeleted: {
165
- type: "boolean"
166
- },
167
- binOriginalFolderId: {
168
- type: "string"
169
- },
170
- values: {
171
- type: "map"
172
- },
173
- meta: {
174
- type: "map"
175
- },
176
- ...(attributes || {})
177
- }
178
- });
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ const createEntryEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ name: entityName,
6
+ table: table.table
7
+ });
179
8
  };
180
- exports.createEntryEntity = createEntryEntity;
9
+ export { createEntryEntity };
181
10
 
182
11
  //# sourceMappingURL=entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","TYPE","__type","webinyVersion","tenant","entryId","id","revisionCreatedOn","revisionSavedOn","revisionModifiedOn","revisionDeletedOn","revisionRestoredOn","revisionFirstPublishedOn","revisionLastPublishedOn","revisionCreatedBy","revisionSavedBy","revisionModifiedBy","revisionDeletedBy","revisionRestoredBy","revisionFirstPublishedBy","revisionLastPublishedBy","createdOn","savedOn","modifiedOn","deletedOn","restoredOn","firstPublishedOn","lastPublishedOn","createdBy","savedBy","modifiedBy","deletedBy","restoredBy","firstPublishedBy","lastPublishedBy","ownedBy","publishedOn","modelId","locale","version","locked","status","location","wbyDeleted","binOriginalFolderId","values","meta","exports"],"sources":["entry.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateEntryEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: { type: \"string\" },\n revisionSavedOn: { type: \"string\" },\n revisionModifiedOn: { type: \"string\" },\n revisionDeletedOn: { type: \"string\" },\n revisionRestoredOn: { type: \"string\" },\n revisionFirstPublishedOn: { type: \"string\" },\n revisionLastPublishedOn: { type: \"string\" },\n revisionCreatedBy: { type: \"map\" },\n revisionSavedBy: { type: \"map\" },\n revisionModifiedBy: { type: \"map\" },\n revisionDeletedBy: { type: \"map\" },\n revisionRestoredBy: { type: \"map\" },\n revisionFirstPublishedBy: { type: \"map\" },\n revisionLastPublishedBy: { type: \"map\" },\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: { type: \"string\" },\n savedOn: { type: \"string\" },\n modifiedOn: { type: \"string\" },\n deletedOn: { type: \"string\" },\n restoredOn: { type: \"string\" },\n firstPublishedOn: { type: \"string\" },\n lastPublishedOn: { type: \"string\" },\n createdBy: { type: \"map\" },\n savedBy: { type: \"map\" },\n modifiedBy: { type: \"map\" },\n deletedBy: { type: \"map\" },\n restoredBy: { type: \"map\" },\n firstPublishedBy: { type: \"map\" },\n lastPublishedBy: { type: \"map\" },\n\n /**\n * Deprecated fields. 👇\n */\n ownedBy: {\n type: \"map\"\n },\n publishedOn: {\n type: \"string\"\n },\n\n /**\n * The rest. 👇\n */\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n location: {\n type: \"map\"\n },\n wbyDeleted: {\n type: \"boolean\"\n },\n binOriginalFolderId: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":"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","ignoreList":[]}
1
+ {"version":3,"file":"definitions/entry.js","sources":["../../src/definitions/entry.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IEntryEntity, IEntryEntityAttributesData } from \"~/definitions/types.js\";\n\nexport interface CreateEntryEntityParams {\n table: ITable;\n entityName: string;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): IEntryEntity => {\n const { table, entityName } = params;\n return createStandardEntity<IEntryEntityAttributesData>({\n name: entityName,\n table: table.table\n });\n};\n"],"names":["createEntryEntity","params","table","entityName","createStandardEntity"],"mappings":";AAOO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAiD;QACpD,MAAMD;QACN,OAAOD,MAAM,KAAK;IACtB;AACJ"}
@@ -1,9 +1,8 @@
1
- import type { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Entity } from "@webiny/db-dynamodb/toolbox";
3
- import type { Attributes } from "../types";
4
- export interface CreateGroupEntityParams {
5
- table: Table<string, string, string>;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IGroupEntity } from "../definitions/types.js";
3
+ interface Params {
4
+ table: ITable;
6
5
  entityName: string;
7
- attributes: Attributes;
8
6
  }
9
- export declare const createGroupEntity: (params: CreateGroupEntityParams) => Entity<any>;
7
+ export declare const createGroupEntity: (params: Params) => IGroupEntity;
8
+ export {};
@@ -1,66 +1,11 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createGroupEntity = void 0;
7
- var _toolbox = require("@webiny/db-dynamodb/toolbox");
8
- const createGroupEntity = params => {
9
- const {
10
- table,
11
- attributes,
12
- entityName
13
- } = params;
14
- return new _toolbox.Entity({
15
- name: entityName,
16
- table,
17
- attributes: {
18
- PK: {
19
- partitionKey: true
20
- },
21
- SK: {
22
- sortKey: true
23
- },
24
- TYPE: {
25
- type: "string"
26
- },
27
- webinyVersion: {
28
- type: "string"
29
- },
30
- id: {
31
- type: "string"
32
- },
33
- name: {
34
- type: "string"
35
- },
36
- slug: {
37
- type: "string"
38
- },
39
- locale: {
40
- type: "string"
41
- },
42
- description: {
43
- type: "string"
44
- },
45
- icon: {
46
- type: "string"
47
- },
48
- createdBy: {
49
- type: "map"
50
- },
51
- createdOn: {
52
- type: "string"
53
- },
54
- savedOn: {
55
- type: "string"
56
- },
57
- tenant: {
58
- type: "string"
59
- },
60
- ...(attributes || {})
61
- }
62
- });
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ const createGroupEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ table: table.table,
6
+ name: entityName
7
+ });
63
8
  };
64
- exports.createGroupEntity = createGroupEntity;
9
+ export { createGroupEntity };
65
10
 
66
11
  //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_toolbox","require","createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant","exports"],"sources":["group.ts"],"sourcesContent":["import type { Table } from \"@webiny/db-dynamodb/toolbox\";\nimport { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport type { Attributes } from \"~/types\";\n\nexport interface CreateGroupEntityParams {\n table: Table<string, string, string>;\n entityName: string;\n attributes: Attributes;\n}\nexport const createGroupEntity = (params: CreateGroupEntityParams): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n icon: {\n type: \"string\"\n },\n\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAQO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAkB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,UAAU;IAAEC;EAAW,CAAC,GAAGH,MAAM;EAChD,OAAO,IAAII,eAAM,CAAC;IACdC,IAAI,EAAEF,UAAU;IAChBF,KAAK;IACLC,UAAU,EAAE;MACRI,EAAE,EAAE;QACAC,YAAY,EAAE;MAClB,CAAC;MACDC,EAAE,EAAE;QACAC,OAAO,EAAE;MACb,CAAC;MACDC,IAAI,EAAE;QACFC,IAAI,EAAE;MACV,CAAC;MACDC,aAAa,EAAE;QACXD,IAAI,EAAE;MACV,CAAC;MACDE,EAAE,EAAE;QACAF,IAAI,EAAE;MACV,CAAC;MACDN,IAAI,EAAE;QACFM,IAAI,EAAE;MACV,CAAC;MACDG,IAAI,EAAE;QACFH,IAAI,EAAE;MACV,CAAC;MACDI,MAAM,EAAE;QACJJ,IAAI,EAAE;MACV,CAAC;MACDK,WAAW,EAAE;QACTL,IAAI,EAAE;MACV,CAAC;MACDM,IAAI,EAAE;QACFN,IAAI,EAAE;MACV,CAAC;MAEDO,SAAS,EAAE;QACPP,IAAI,EAAE;MACV,CAAC;MACDQ,SAAS,EAAE;QACPR,IAAI,EAAE;MACV,CAAC;MACDS,OAAO,EAAE;QACLT,IAAI,EAAE;MACV,CAAC;MACDU,MAAM,EAAE;QACJV,IAAI,EAAE;MACV,CAAC;MACD,IAAIT,UAAU,IAAI,CAAC,CAAC;IACxB;EACJ,CAAC,CAAC;AACN,CAAC;AAACoB,OAAA,CAAAvB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"definitions/group.js","sources":["../../src/definitions/group.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IGroupEntity } from \"~/definitions/types.js\";\nimport type { CmsGroup } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\nexport const createGroupEntity = (params: Params): IGroupEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsGroup>({\n table: table.table,\n name: entityName\n });\n};\n"],"names":["createGroupEntity","params","table","entityName","createStandardEntity"],"mappings":";AAQO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAA+B;QAClC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
@@ -1,9 +1,8 @@
1
- import type { Table } from "@webiny/db-dynamodb/toolbox";
2
- import { Entity } from "@webiny/db-dynamodb/toolbox";
3
- import type { Attributes } from "../types";
4
- export interface CreateModelEntityParams {
5
- table: Table<string, string, string>;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IModelEntity } from "../definitions/types.js";
3
+ interface Params {
4
+ table: ITable;
6
5
  entityName: string;
7
- attributes: Attributes;
8
6
  }
9
- export declare const createModelEntity: (params: CreateModelEntityParams) => Entity<any>;
7
+ export declare const createModelEntity: (params: Params) => IModelEntity;
8
+ export {};