@webiny/api-headless-cms-ddb 0.0.0-unstable.e622468070 → 0.0.0-unstable.e9333b3f0b

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 (275) hide show
  1. package/abstractions/CmsDdbDataLoaders.d.ts +5 -0
  2. package/abstractions/CmsDdbDataLoaders.js +5 -0
  3. package/abstractions/CmsDdbDataLoaders.js.map +1 -0
  4. package/abstractions/CmsDdbEntryEntity.d.ts +5 -0
  5. package/abstractions/CmsDdbEntryEntity.js +5 -0
  6. package/abstractions/CmsDdbEntryEntity.js.map +1 -0
  7. package/abstractions/CmsDdbGroupEntity.d.ts +5 -0
  8. package/abstractions/CmsDdbGroupEntity.js +5 -0
  9. package/abstractions/CmsDdbGroupEntity.js.map +1 -0
  10. package/abstractions/CmsDdbModelEntity.d.ts +5 -0
  11. package/abstractions/CmsDdbModelEntity.js +5 -0
  12. package/abstractions/CmsDdbModelEntity.js.map +1 -0
  13. package/abstractions/CmsDdbTable.d.ts +5 -0
  14. package/abstractions/CmsDdbTable.js +5 -0
  15. package/abstractions/CmsDdbTable.js.map +1 -0
  16. package/definitions/entry.js +7 -9
  17. package/definitions/entry.js.map +1 -1
  18. package/definitions/group.js +7 -9
  19. package/definitions/group.js.map +1 -1
  20. package/definitions/model.js +7 -9
  21. package/definitions/model.js.map +1 -1
  22. package/definitions/table.js +6 -7
  23. package/definitions/table.js.map +1 -1
  24. package/definitions/types.d.ts +11 -5
  25. package/definitions/types.js +0 -3
  26. package/index.d.ts +17 -3
  27. package/index.js +33 -85
  28. package/index.js.map +1 -1
  29. package/operations/entry/DdbCreateEntry.d.ts +16 -0
  30. package/operations/entry/DdbCreateEntry.js +77 -0
  31. package/operations/entry/DdbCreateEntry.js.map +1 -0
  32. package/operations/entry/DdbCreateEntryRevisionFrom.d.ts +16 -0
  33. package/operations/entry/DdbCreateEntryRevisionFrom.js +85 -0
  34. package/operations/entry/DdbCreateEntryRevisionFrom.js.map +1 -0
  35. package/operations/entry/DdbDeleteEntry.d.ts +16 -0
  36. package/operations/entry/DdbDeleteEntry.js +65 -0
  37. package/operations/entry/DdbDeleteEntry.js.map +1 -0
  38. package/operations/entry/DdbDeleteEntryRevision.d.ts +17 -0
  39. package/operations/entry/DdbDeleteEntryRevision.js +91 -0
  40. package/operations/entry/DdbDeleteEntryRevision.js.map +1 -0
  41. package/operations/entry/DdbDeleteMultipleEntries.d.ts +16 -0
  42. package/operations/entry/DdbDeleteMultipleEntries.js +59 -0
  43. package/operations/entry/DdbDeleteMultipleEntries.js.map +1 -0
  44. package/operations/entry/DdbGetEntriesByIds.d.ts +14 -0
  45. package/operations/entry/DdbGetEntriesByIds.js +31 -0
  46. package/operations/entry/DdbGetEntriesByIds.js.map +1 -0
  47. package/operations/entry/DdbGetEntry.d.ts +14 -0
  48. package/operations/entry/DdbGetEntry.js +27 -0
  49. package/operations/entry/DdbGetEntry.js.map +1 -0
  50. package/operations/entry/DdbGetLatestEntriesByIds.d.ts +14 -0
  51. package/operations/entry/DdbGetLatestEntriesByIds.js +31 -0
  52. package/operations/entry/DdbGetLatestEntriesByIds.js.map +1 -0
  53. package/operations/entry/DdbGetLatestRevisionByEntryId.d.ts +14 -0
  54. package/operations/entry/DdbGetLatestRevisionByEntryId.js +35 -0
  55. package/operations/entry/DdbGetLatestRevisionByEntryId.js.map +1 -0
  56. package/operations/entry/DdbGetPreviousRevision.d.ts +14 -0
  57. package/operations/entry/DdbGetPreviousRevision.js +53 -0
  58. package/operations/entry/DdbGetPreviousRevision.js.map +1 -0
  59. package/operations/entry/DdbGetPublishedEntriesByIds.d.ts +14 -0
  60. package/operations/entry/DdbGetPublishedEntriesByIds.js +31 -0
  61. package/operations/entry/DdbGetPublishedEntriesByIds.js.map +1 -0
  62. package/operations/entry/DdbGetPublishedRevisionByEntryId.d.ts +14 -0
  63. package/operations/entry/DdbGetPublishedRevisionByEntryId.js +35 -0
  64. package/operations/entry/DdbGetPublishedRevisionByEntryId.js.map +1 -0
  65. package/operations/entry/DdbGetRevisionById.d.ts +14 -0
  66. package/operations/entry/DdbGetRevisionById.js +34 -0
  67. package/operations/entry/DdbGetRevisionById.js.map +1 -0
  68. package/operations/entry/DdbGetRevisions.d.ts +14 -0
  69. package/operations/entry/DdbGetRevisions.js +33 -0
  70. package/operations/entry/DdbGetRevisions.js.map +1 -0
  71. package/operations/entry/DdbGetUniqueFieldValues.d.ts +12 -0
  72. package/operations/entry/DdbGetUniqueFieldValues.js +31 -0
  73. package/operations/entry/DdbGetUniqueFieldValues.js.map +1 -0
  74. package/operations/entry/DdbListEntries.d.ts +28 -0
  75. package/operations/entry/DdbListEntries.js +124 -0
  76. package/operations/entry/DdbListEntries.js.map +1 -0
  77. package/operations/entry/DdbMoveEntry.d.ts +14 -0
  78. package/operations/entry/DdbMoveEntry.js +57 -0
  79. package/operations/entry/DdbMoveEntry.js.map +1 -0
  80. package/operations/entry/DdbMoveToBin.d.ts +16 -0
  81. package/operations/entry/DdbMoveToBin.js +77 -0
  82. package/operations/entry/DdbMoveToBin.js.map +1 -0
  83. package/operations/entry/DdbPublishEntry.d.ts +18 -0
  84. package/operations/entry/DdbPublishEntry.js +162 -0
  85. package/operations/entry/DdbPublishEntry.js.map +1 -0
  86. package/operations/entry/DdbRestoreFromBin.d.ts +16 -0
  87. package/operations/entry/DdbRestoreFromBin.js +78 -0
  88. package/operations/entry/DdbRestoreFromBin.js.map +1 -0
  89. package/operations/entry/DdbUnpublishEntry.d.ts +17 -0
  90. package/operations/entry/DdbUnpublishEntry.js +112 -0
  91. package/operations/entry/DdbUnpublishEntry.js.map +1 -0
  92. package/operations/entry/DdbUpdateEntry.d.ts +17 -0
  93. package/operations/entry/DdbUpdateEntry.js +105 -0
  94. package/operations/entry/DdbUpdateEntry.js.map +1 -0
  95. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -0
  96. package/operations/entry/dataLoader/DataLoaderCache.js +22 -29
  97. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  98. package/operations/entry/dataLoader/constants.js +2 -1
  99. package/operations/entry/dataLoader/constants.js.map +1 -1
  100. package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
  101. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  102. package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -26
  103. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  104. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +32 -38
  105. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  106. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +32 -38
  107. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  108. package/operations/entry/dataLoader/getRevisionById.js +34 -44
  109. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  110. package/operations/entry/dataLoader/index.js +8 -9
  111. package/operations/entry/dataLoader/index.js.map +1 -1
  112. package/operations/entry/dataLoader/types.d.ts +1 -0
  113. package/operations/entry/dataLoader/types.js +0 -3
  114. package/operations/entry/dataLoaders.d.ts +7 -6
  115. package/operations/entry/dataLoaders.js +89 -97
  116. package/operations/entry/dataLoaders.js.map +1 -1
  117. package/operations/entry/feature.d.ts +4 -0
  118. package/operations/entry/feature.js +53 -0
  119. package/operations/entry/feature.js.map +1 -0
  120. package/operations/entry/keys.d.ts +6 -0
  121. package/operations/entry/keys.js +57 -77
  122. package/operations/entry/keys.js.map +1 -1
  123. package/operations/entry/storageEntryUtils.d.ts +8 -0
  124. package/operations/entry/storageEntryUtils.js +25 -0
  125. package/operations/entry/storageEntryUtils.js.map +1 -0
  126. package/operations/group/DdbCreateGroup.d.ts +12 -0
  127. package/operations/group/DdbCreateGroup.js +35 -0
  128. package/operations/group/DdbCreateGroup.js.map +1 -0
  129. package/operations/group/DdbDeleteGroup.d.ts +12 -0
  130. package/operations/group/DdbDeleteGroup.js +31 -0
  131. package/operations/group/DdbDeleteGroup.js.map +1 -0
  132. package/operations/group/DdbGetGroup.d.ts +12 -0
  133. package/operations/group/DdbGetGroup.js +31 -0
  134. package/operations/group/DdbGetGroup.js.map +1 -0
  135. package/operations/group/DdbListGroups.d.ts +14 -0
  136. package/operations/group/DdbListGroups.js +52 -0
  137. package/operations/group/DdbListGroups.js.map +1 -0
  138. package/operations/group/DdbUpdateGroup.d.ts +12 -0
  139. package/operations/group/DdbUpdateGroup.js +35 -0
  140. package/operations/group/DdbUpdateGroup.js.map +1 -0
  141. package/operations/group/feature.d.ts +4 -0
  142. package/operations/group/feature.js +19 -0
  143. package/operations/group/feature.js.map +1 -0
  144. package/operations/group/keys.d.ts +15 -0
  145. package/operations/group/keys.js +17 -0
  146. package/operations/group/keys.js.map +1 -0
  147. package/operations/model/DdbCreateModel.d.ts +12 -0
  148. package/operations/model/DdbCreateModel.js +37 -0
  149. package/operations/model/DdbCreateModel.js.map +1 -0
  150. package/operations/model/DdbDeleteModel.d.ts +12 -0
  151. package/operations/model/DdbDeleteModel.js +31 -0
  152. package/operations/model/DdbDeleteModel.js.map +1 -0
  153. package/operations/model/DdbGetModel.d.ts +12 -0
  154. package/operations/model/DdbGetModel.js +30 -0
  155. package/operations/model/DdbGetModel.js.map +1 -0
  156. package/operations/model/DdbListModels.d.ts +12 -0
  157. package/operations/model/DdbListModels.js +36 -0
  158. package/operations/model/DdbListModels.js.map +1 -0
  159. package/operations/model/DdbUpdateModel.d.ts +12 -0
  160. package/operations/model/DdbUpdateModel.js +36 -0
  161. package/operations/model/DdbUpdateModel.js.map +1 -0
  162. package/operations/model/feature.d.ts +4 -0
  163. package/operations/model/feature.js +19 -0
  164. package/operations/model/feature.js.map +1 -0
  165. package/operations/model/keys.d.ts +15 -0
  166. package/operations/model/keys.js +16 -0
  167. package/operations/model/keys.js.map +1 -0
  168. package/package.json +26 -22
  169. package/requestFeature.d.ts +17 -0
  170. package/requestFeature.js +19 -0
  171. package/requestFeature.js.map +1 -0
  172. package/types.d.ts +10 -48
  173. package/types.js +6 -5
  174. package/types.js.map +1 -1
  175. package/definitions/types.js.map +0 -1
  176. package/dynamoDb/index.d.ts +0 -2
  177. package/dynamoDb/index.js +0 -8
  178. package/dynamoDb/index.js.map +0 -1
  179. package/dynamoDb/path/locationFolderId.d.ts +0 -2
  180. package/dynamoDb/path/locationFolderId.js +0 -34
  181. package/dynamoDb/path/locationFolderId.js.map +0 -1
  182. package/dynamoDb/path/plainObject.d.ts +0 -2
  183. package/dynamoDb/path/plainObject.js +0 -26
  184. package/dynamoDb/path/plainObject.js.map +0 -1
  185. package/dynamoDb/storage/longText.d.ts +0 -10
  186. package/dynamoDb/storage/longText.js +0 -86
  187. package/dynamoDb/storage/longText.js.map +0 -1
  188. package/dynamoDb/storage/richText.d.ts +0 -2
  189. package/dynamoDb/storage/richText.js +0 -52
  190. package/dynamoDb/storage/richText.js.map +0 -1
  191. package/dynamoDb/transformValue/datetime.d.ts +0 -5
  192. package/dynamoDb/transformValue/datetime.js +0 -40
  193. package/dynamoDb/transformValue/datetime.js.map +0 -1
  194. package/operations/entry/dataLoader/types.js.map +0 -1
  195. package/operations/entry/filtering/createExpressions.d.ts +0 -26
  196. package/operations/entry/filtering/createExpressions.js +0 -175
  197. package/operations/entry/filtering/createExpressions.js.map +0 -1
  198. package/operations/entry/filtering/createFields.d.ts +0 -16
  199. package/operations/entry/filtering/createFields.js +0 -106
  200. package/operations/entry/filtering/createFields.js.map +0 -1
  201. package/operations/entry/filtering/extractSort.d.ts +0 -17
  202. package/operations/entry/filtering/extractSort.js +0 -84
  203. package/operations/entry/filtering/extractSort.js.map +0 -1
  204. package/operations/entry/filtering/filter.d.ts +0 -15
  205. package/operations/entry/filtering/filter.js +0 -150
  206. package/operations/entry/filtering/filter.js.map +0 -1
  207. package/operations/entry/filtering/fullTextSearch.d.ts +0 -14
  208. package/operations/entry/filtering/fullTextSearch.js +0 -42
  209. package/operations/entry/filtering/fullTextSearch.js.map +0 -1
  210. package/operations/entry/filtering/getValue.d.ts +0 -5
  211. package/operations/entry/filtering/getValue.js +0 -59
  212. package/operations/entry/filtering/getValue.js.map +0 -1
  213. package/operations/entry/filtering/index.d.ts +0 -2
  214. package/operations/entry/filtering/index.js +0 -4
  215. package/operations/entry/filtering/index.js.map +0 -1
  216. package/operations/entry/filtering/mapPlugins.d.ts +0 -8
  217. package/operations/entry/filtering/mapPlugins.js +0 -25
  218. package/operations/entry/filtering/mapPlugins.js.map +0 -1
  219. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +0 -2
  220. package/operations/entry/filtering/plugins/defaultFilterCreate.js +0 -37
  221. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +0 -1
  222. package/operations/entry/filtering/plugins/index.d.ts +0 -1
  223. package/operations/entry/filtering/plugins/index.js +0 -9
  224. package/operations/entry/filtering/plugins/index.js.map +0 -1
  225. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +0 -2
  226. package/operations/entry/filtering/plugins/objectFilterCreate.js +0 -84
  227. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +0 -1
  228. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +0 -3
  229. package/operations/entry/filtering/plugins/refFilterCreate.js +0 -74
  230. package/operations/entry/filtering/plugins/refFilterCreate.js.map +0 -1
  231. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +0 -2
  232. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +0 -57
  233. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +0 -1
  234. package/operations/entry/filtering/sort.d.ts +0 -12
  235. package/operations/entry/filtering/sort.js +0 -67
  236. package/operations/entry/filtering/sort.js.map +0 -1
  237. package/operations/entry/filtering/systemFields.d.ts +0 -2
  238. package/operations/entry/filtering/systemFields.js +0 -116
  239. package/operations/entry/filtering/systemFields.js.map +0 -1
  240. package/operations/entry/filtering/transform.d.ts +0 -6
  241. package/operations/entry/filtering/transform.js +0 -11
  242. package/operations/entry/filtering/transform.js.map +0 -1
  243. package/operations/entry/filtering/types.d.ts +0 -40
  244. package/operations/entry/filtering/types.js +0 -3
  245. package/operations/entry/filtering/types.js.map +0 -1
  246. package/operations/entry/filtering/values.d.ts +0 -2
  247. package/operations/entry/filtering/values.js +0 -16
  248. package/operations/entry/filtering/values.js.map +0 -1
  249. package/operations/entry/filtering/where.d.ts +0 -5
  250. package/operations/entry/filtering/where.js +0 -28
  251. package/operations/entry/filtering/where.js.map +0 -1
  252. package/operations/entry/index.d.ts +0 -7
  253. package/operations/entry/index.js +0 -1196
  254. package/operations/entry/index.js.map +0 -1
  255. package/operations/group/index.d.ts +0 -9
  256. package/operations/group/index.js +0 -145
  257. package/operations/group/index.js.map +0 -1
  258. package/operations/model/index.d.ts +0 -7
  259. package/operations/model/index.js +0 -128
  260. package/operations/model/index.js.map +0 -1
  261. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +0 -23
  262. package/plugins/CmsEntryFieldFilterPathPlugin.js +0 -40
  263. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +0 -1
  264. package/plugins/CmsEntryFieldFilterPlugin.d.ts +0 -43
  265. package/plugins/CmsEntryFieldFilterPlugin.js +0 -21
  266. package/plugins/CmsEntryFieldFilterPlugin.js.map +0 -1
  267. package/plugins/CmsEntryFieldSortingPlugin.d.ts +0 -42
  268. package/plugins/CmsEntryFieldSortingPlugin.js +0 -19
  269. package/plugins/CmsEntryFieldSortingPlugin.js.map +0 -1
  270. package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +0 -11
  271. package/plugins/CmsFieldFilterValueTransformPlugin.js +0 -16
  272. package/plugins/CmsFieldFilterValueTransformPlugin.js.map +0 -1
  273. package/plugins/index.d.ts +0 -4
  274. package/plugins/index.js +0 -6
  275. package/plugins/index.js.map +0 -1
@@ -0,0 +1,5 @@
1
+ import type { IDataLoadersHandler } from "../types.js";
2
+ export declare const CmsDdbDataLoaders: import("@webiny/di").Abstraction<IDataLoadersHandler>;
3
+ export declare namespace CmsDdbDataLoaders {
4
+ type Interface = IDataLoadersHandler;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbDataLoaders = createAbstraction("Cms/Ddb/DataLoaders");
3
+ export { CmsDdbDataLoaders };
4
+
5
+ //# sourceMappingURL=CmsDdbDataLoaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbDataLoaders.js","sources":["../../src/abstractions/CmsDdbDataLoaders.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IDataLoadersHandler } from \"~/types.js\";\n\nexport const CmsDdbDataLoaders = createAbstraction<IDataLoadersHandler>(\"Cms/Ddb/DataLoaders\");\n\nexport namespace CmsDdbDataLoaders {\n export type Interface = IDataLoadersHandler;\n}\n"],"names":["CmsDdbDataLoaders","createAbstraction"],"mappings":";AAGO,MAAMA,oBAAoBC,kBAAuC"}
@@ -0,0 +1,5 @@
1
+ import type { IEntryEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbEntryEntity: import("@webiny/di").Abstraction<IEntryEntity>;
3
+ export declare namespace CmsDdbEntryEntity {
4
+ type Interface = IEntryEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbEntryEntity = createAbstraction("Cms/Ddb/EntryEntity");
3
+ export { CmsDdbEntryEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbEntryEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbEntryEntity.js","sources":["../../src/abstractions/CmsDdbEntryEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IEntryEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbEntryEntity = createAbstraction<IEntryEntity>(\"Cms/Ddb/EntryEntity\");\n\nexport namespace CmsDdbEntryEntity {\n export type Interface = IEntryEntity;\n}\n"],"names":["CmsDdbEntryEntity","createAbstraction"],"mappings":";AAGO,MAAMA,oBAAoBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { IGroupEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbGroupEntity: import("@webiny/di").Abstraction<IGroupEntity>;
3
+ export declare namespace CmsDdbGroupEntity {
4
+ type Interface = IGroupEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbGroupEntity = createAbstraction("Cms/Ddb/GroupEntity");
3
+ export { CmsDdbGroupEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbGroupEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbGroupEntity.js","sources":["../../src/abstractions/CmsDdbGroupEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IGroupEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbGroupEntity = createAbstraction<IGroupEntity>(\"Cms/Ddb/GroupEntity\");\n\nexport namespace CmsDdbGroupEntity {\n export type Interface = IGroupEntity;\n}\n"],"names":["CmsDdbGroupEntity","createAbstraction"],"mappings":";AAGO,MAAMA,oBAAoBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { IModelEntity } from "../definitions/types.js";
2
+ export declare const CmsDdbModelEntity: import("@webiny/di").Abstraction<IModelEntity>;
3
+ export declare namespace CmsDdbModelEntity {
4
+ type Interface = IModelEntity;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbModelEntity = createAbstraction("Cms/Ddb/ModelEntity");
3
+ export { CmsDdbModelEntity };
4
+
5
+ //# sourceMappingURL=CmsDdbModelEntity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbModelEntity.js","sources":["../../src/abstractions/CmsDdbModelEntity.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\n\nexport const CmsDdbModelEntity = createAbstraction<IModelEntity>(\"Cms/Ddb/ModelEntity\");\n\nexport namespace CmsDdbModelEntity {\n export type Interface = IModelEntity;\n}\n"],"names":["CmsDdbModelEntity","createAbstraction"],"mappings":";AAGO,MAAMA,oBAAoBC,kBAAgC"}
@@ -0,0 +1,5 @@
1
+ import type { ITable } from "@webiny/db-dynamodb";
2
+ export declare const CmsDdbTable: import("@webiny/di").Abstraction<ITable<string, string, string>>;
3
+ export declare namespace CmsDdbTable {
4
+ type Interface = ITable;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/api";
2
+ const CmsDdbTable = createAbstraction("Cms/Ddb/Table");
3
+ export { CmsDdbTable };
4
+
5
+ //# sourceMappingURL=CmsDdbTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractions/CmsDdbTable.js","sources":["../../src/abstractions/CmsDdbTable.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport const CmsDdbTable = createAbstraction<ITable>(\"Cms/Ddb/Table\");\n\nexport namespace CmsDdbTable {\n export type Interface = ITable;\n}\n"],"names":["CmsDdbTable","createAbstraction"],"mappings":";AAGO,MAAMA,cAAcC,kBAA0B"}
@@ -1,13 +1,11 @@
1
1
  import { createStandardEntity } from "@webiny/db-dynamodb";
2
- export const createEntryEntity = params => {
3
- const {
4
- table,
5
- entityName
6
- } = params;
7
- return createStandardEntity({
8
- name: entityName,
9
- table: table.table
10
- });
2
+ const createEntryEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ name: entityName,
6
+ table: table.table
7
+ });
11
8
  };
9
+ export { createEntryEntity };
12
10
 
13
11
  //# sourceMappingURL=entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createStandardEntity","createEntryEntity","params","table","entityName","name"],"sources":["entry.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IEntryEntity, IEntryEntityAttirbutesData } from \"./types.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createEntryEntity = (params: Params): IEntryEntity => {\n const { table, entityName } = params;\n return createStandardEntity<IEntryEntityAttirbutesData>({\n name: entityName,\n table: table.table\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AAQvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAA6B;IACpDK,IAAI,EAAED,UAAU;IAChBD,KAAK,EAAEA,KAAK,CAACA;EACjB,CAAC,CAAC;AACN,CAAC","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 \"./types.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createEntryEntity = (params: Params): 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":";AAQO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAiD;QACpD,MAAMD;QACN,OAAOD,MAAM,KAAK;IACtB;AACJ"}
@@ -1,13 +1,11 @@
1
1
  import { createStandardEntity } from "@webiny/db-dynamodb";
2
- export const createGroupEntity = params => {
3
- const {
4
- table,
5
- entityName
6
- } = params;
7
- return createStandardEntity({
8
- table: table.table,
9
- name: entityName
10
- });
2
+ const createGroupEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ table: table.table,
6
+ name: entityName
7
+ });
11
8
  };
9
+ export { createGroupEntity };
12
10
 
13
11
  //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createStandardEntity","createGroupEntity","params","table","entityName","name"],"sources":["group.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IGroupEntity } from \"./types.js\";\nimport type { CmsGroup } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\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"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AASvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","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 \"./types.js\";\nimport type { CmsGroup } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\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":";AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAA+B;QAClC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
@@ -1,13 +1,11 @@
1
1
  import { createStandardEntity } from "@webiny/db-dynamodb";
2
- export const createModelEntity = params => {
3
- const {
4
- table,
5
- entityName
6
- } = params;
7
- return createStandardEntity({
8
- table: table.table,
9
- name: entityName
10
- });
2
+ const createModelEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ table: table.table,
6
+ name: entityName
7
+ });
11
8
  };
9
+ export { createModelEntity };
12
10
 
13
11
  //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createStandardEntity","createModelEntity","params","table","entityName","name"],"sources":["model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"./types.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AASvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"definitions/model.js","sources":["../../src/definitions/model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"./types.js\";\nimport type { StorageCmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<StorageCmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"names":["createModelEntity","params","table","entityName","createStandardEntity"],"mappings":";AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAsC;QACzC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
@@ -1,9 +1,8 @@
1
- import { createTable as baseCreateTable } from "@webiny/db-dynamodb";
2
- export const createTable = params => {
3
- return baseCreateTable({
4
- name: params.name || process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
5
- documentClient: params.documentClient
6
- });
7
- };
1
+ import { createTable } from "@webiny/db-dynamodb";
2
+ const table_createTable = (params)=>createTable({
3
+ name: params.name || process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
4
+ documentClient: params.documentClient
5
+ });
6
+ export { table_createTable as createTable };
8
7
 
9
8
  //# sourceMappingURL=table.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createTable","baseCreateTable","params","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","documentClient"],"sources":["table.ts"],"sourcesContent":["import { createTable as baseCreateTable } from \"@webiny/db-dynamodb\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\n\ninterface Params {\n name?: string;\n documentClient: DynamoDBDocument;\n}\n\nexport const createTable = (params: Params) => {\n return baseCreateTable({\n name: params.name || process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n documentClient: params.documentClient\n });\n};\n"],"mappings":"AAAA,SAASA,WAAW,IAAIC,eAAe,QAAQ,qBAAqB;AAQpE,OAAO,MAAMD,WAAW,GAAIE,MAAc,IAAK;EAC3C,OAAOD,eAAe,CAAC;IACnBE,IAAI,EAAED,MAAM,CAACC,IAAI,IAAIC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IAC1FC,cAAc,EAAEN,MAAM,CAACM;EAC3B,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"definitions/table.js","sources":["../../src/definitions/table.ts"],"sourcesContent":["import { createTable as baseCreateTable } from \"@webiny/db-dynamodb\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\n\ninterface Params {\n name?: string;\n documentClient: DynamoDBDocument;\n}\n\nexport const createTable = (params: Params) => {\n return baseCreateTable({\n name: params.name || process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n documentClient: params.documentClient\n });\n};\n"],"names":["createTable","params","baseCreateTable","process"],"mappings":";AAQO,MAAMA,oBAAc,CAACC,SACjBC,YAAgB;QACnB,MAAMD,OAAO,IAAI,IAAIE,QAAQ,GAAG,CAAC,qBAAqB,IAAKA,QAAQ,GAAG,CAAC,QAAQ;QAC/E,gBAAgBF,OAAO,cAAc;IACzC"}
@@ -1,7 +1,7 @@
1
1
  import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
2
2
  import type { GenericRecord } from "@webiny/api/types.js";
3
- import type { CmsEntryStatus, CmsGroup, CmsIdentity, CmsModel, ICmsEntryLocation, IEntryState } from "@webiny/api-headless-cms/types/index.js";
4
- export interface IEntryEntityAttirbutesData {
3
+ import type { CmsEntryStatus, CmsGroup, CmsIdentity, ICmsEntryLive, ICmsEntryLocation, ICmsEntrySystem, StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
4
+ export interface IEntryEntityAttributesData {
5
5
  id: string;
6
6
  entryId: string;
7
7
  modelId: string;
@@ -51,9 +51,15 @@ export interface IEntryEntityAttirbutesData {
51
51
  binOriginalFolderId?: string;
52
52
  values: GenericRecord;
53
53
  meta?: GenericRecord;
54
- state?: IEntryState;
54
+ system?: ICmsEntrySystem;
55
+ live: ICmsEntryLive | null;
56
+ revisionDescription: string | undefined;
57
+ /**
58
+ * A timestamp of when the entry should be automatically deleted from the database.
59
+ */
60
+ expiresAt: number | null;
55
61
  }
56
- export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttirbutesData>;
57
- export type IModelEntity = IEntity<IStandardEntityAttributes<CmsModel>>;
62
+ export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
63
+ export type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;
58
64
  export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
59
65
  export type IEntryEntity = IEntity<IEntryEntityAttributes>;
@@ -1,3 +0,0 @@
1
- export {};
2
-
3
- //# sourceMappingURL=types.js.map
package/index.d.ts CHANGED
@@ -1,3 +1,17 @@
1
- import type { StorageOperationsFactory } from "./types.js";
2
- export * from "./plugins/index.js";
3
- export declare const createStorageOperations: StorageOperationsFactory;
1
+ export { HeadlessCmsDdbRequestFeature } from "./requestFeature.js";
2
+ /**
3
+ * Root half of the DynamoDB CMS storage: the table and entity definitions, built once per process.
4
+ * The storage operations are per request, in `HeadlessCmsDdbRequestFeature`.
5
+ * Requires DynamoDBClient to be registered in the container first (via DbFeature).
6
+ *
7
+ * Usage:
8
+ * DbFeature.register(container, { documentClient, table });
9
+ * HeadlessCmsDdbFeature.register(container);
10
+ * // then in request:
11
+ * HeadlessCmsDdbRequestFeature.register(requestContainer);
12
+ * HeadlessCmsFeature.register(requestContainer, { type: "manage" });
13
+ */
14
+ export declare const HeadlessCmsDdbFeature: {
15
+ name: string;
16
+ register(container: import("@webiny/di").Container): void;
17
+ };
package/index.js CHANGED
@@ -1,92 +1,40 @@
1
- import dynamoDbValueFilters from "@webiny/db-dynamodb/plugins/filters/index.js";
2
- import dynamoDbPlugins from "./dynamoDb/index.js";
3
1
  import { ENTITIES } from "./types.js";
4
2
  import { createGroupEntity } from "./definitions/group.js";
5
3
  import { createModelEntity } from "./definitions/model.js";
6
4
  import { createEntryEntity } from "./definitions/entry.js";
7
- import { PluginsContainer } from "@webiny/plugins";
8
- import { createGroupsStorageOperations } from "./operations/group/index.js";
9
- import { createModelsStorageOperations } from "./operations/model/index.js";
10
- import { createEntriesStorageOperations } from "./operations/entry/index.js";
11
- import { createFilterCreatePlugins } from "./operations/entry/filtering/plugins/index.js";
12
- import { CmsEntryFieldFilterPathPlugin, CmsEntryFieldFilterPlugin, CmsEntryFieldSortingPlugin, CmsFieldFilterValueTransformPlugin } from "./plugins/index.js";
13
- import { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin.js";
14
- import { StorageOperationsCmsModelPlugin, StorageTransformPlugin } from "@webiny/api-headless-cms";
15
- import { CompressorPlugin } from "@webiny/api";
16
5
  import { createTable } from "./definitions/table.js";
17
- export * from "./plugins/index.js";
18
- export const createStorageOperations = params => {
19
- const {
20
- table,
21
- documentClient,
22
- plugins: userPlugins
23
- } = params;
24
- const tableInstance = createTable({
25
- name: table,
26
- documentClient
27
- });
28
- const entities = {
29
- groups: createGroupEntity({
30
- entityName: ENTITIES.GROUPS,
31
- table: tableInstance
32
- }),
33
- models: createModelEntity({
34
- entityName: ENTITIES.MODELS,
35
- table: tableInstance
36
- }),
37
- entries: createEntryEntity({
38
- entityName: ENTITIES.ENTRIES,
39
- table: tableInstance
40
- })
41
- };
42
- const plugins = new PluginsContainer([
43
- /**
44
- * DynamoDB filter plugins for the where conditions.
45
- */
46
- dynamoDbValueFilters(),
47
- /**
48
- * Field plugins for DynamoDB.
49
- */
50
- dynamoDbPlugins(),
51
- /**
52
- * Filter create plugins.
53
- */
54
- createFilterCreatePlugins(),
55
- /**
56
- * User defined custom plugins.
57
- */
58
- ...(userPlugins || [])]);
59
- const entries = createEntriesStorageOperations({
60
- entity: entities.entries,
61
- plugins
62
- });
63
- return {
64
- name: "dynamodb",
65
- beforeInit: async context => {
66
- const types = ["cms-model-field-to-graphql", CmsEntryFieldFilterPathPlugin.type, CmsFieldFilterValueTransformPlugin.type, CmsEntryFieldFilterPlugin.type, CmsEntryFieldSortingPlugin.type, ValueFilterPlugin.type, StorageOperationsCmsModelPlugin.type, StorageTransformPlugin.type, CompressorPlugin.type];
67
- /**
68
- * Collect all required plugins from parent context.
69
- */
70
- for (const type of types) {
71
- plugins.mergeByType(context.plugins, type);
72
- }
73
- /**
74
- * Pass the plugins to the parent context.
75
- */
76
- context.plugins.register([dynamoDbPlugins()]);
77
- entries.dataLoaders.clearAll();
78
- },
79
- getEntities: () => entities,
80
- getTable: () => tableInstance,
81
- groups: createGroupsStorageOperations({
82
- entity: entities.groups,
83
- plugins
84
- }),
85
- models: createModelsStorageOperations({
86
- entity: entities.models
87
- }),
88
- entries
89
- };
90
- };
6
+ import { createFeature } from "@webiny/feature/api/index.js";
7
+ import { DynamoDBClient } from "@webiny/db-dynamodb";
8
+ import { FilterUtilFeature } from "@webiny/db-dynamodb/feature/FilterUtil/feature.js";
9
+ import { CmsDdbTable } from "./abstractions/CmsDdbTable.js";
10
+ import { CmsDdbGroupEntity } from "./abstractions/CmsDdbGroupEntity.js";
11
+ import { CmsDdbModelEntity } from "./abstractions/CmsDdbModelEntity.js";
12
+ import { CmsDdbEntryEntity } from "./abstractions/CmsDdbEntryEntity.js";
13
+ const HeadlessCmsDdbFeature = createFeature({
14
+ name: "cms.storageOperations.ddb",
15
+ register: (container)=>{
16
+ FilterUtilFeature.register(container);
17
+ const db = container.resolve(DynamoDBClient);
18
+ const documentClient = db.client;
19
+ const tableInstance = createTable({
20
+ documentClient
21
+ });
22
+ container.registerInstance(CmsDdbTable, tableInstance);
23
+ container.registerInstance(CmsDdbGroupEntity, createGroupEntity({
24
+ entityName: ENTITIES.GROUPS,
25
+ table: tableInstance
26
+ }));
27
+ container.registerInstance(CmsDdbModelEntity, createModelEntity({
28
+ entityName: ENTITIES.MODELS,
29
+ table: tableInstance
30
+ }));
31
+ container.registerInstance(CmsDdbEntryEntity, createEntryEntity({
32
+ entityName: ENTITIES.ENTRIES,
33
+ table: tableInstance
34
+ }));
35
+ }
36
+ });
37
+ export { HeadlessCmsDdbRequestFeature } from "./requestFeature.js";
38
+ export { HeadlessCmsDdbFeature };
91
39
 
92
40
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["dynamoDbValueFilters","dynamoDbPlugins","ENTITIES","createGroupEntity","createModelEntity","createEntryEntity","PluginsContainer","createGroupsStorageOperations","createModelsStorageOperations","createEntriesStorageOperations","createFilterCreatePlugins","CmsEntryFieldFilterPathPlugin","CmsEntryFieldFilterPlugin","CmsEntryFieldSortingPlugin","CmsFieldFilterValueTransformPlugin","ValueFilterPlugin","StorageOperationsCmsModelPlugin","StorageTransformPlugin","CompressorPlugin","createTable","createStorageOperations","params","table","documentClient","plugins","userPlugins","tableInstance","name","entities","groups","entityName","GROUPS","models","MODELS","entries","ENTRIES","entity","beforeInit","context","types","type","mergeByType","register","dataLoaders","clearAll","getEntities","getTable"],"sources":["index.ts"],"sourcesContent":["import dynamoDbValueFilters from \"@webiny/db-dynamodb/plugins/filters/index.js\";\nimport dynamoDbPlugins from \"./dynamoDb/index.js\";\nimport type { StorageOperationsFactory } from \"~/types.js\";\nimport { ENTITIES } from \"~/types.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { createGroupsStorageOperations } from \"~/operations/group/index.js\";\nimport { createModelsStorageOperations } from \"~/operations/model/index.js\";\nimport { createEntriesStorageOperations } from \"./operations/entry/index.js\";\n\nimport { createFilterCreatePlugins } from \"~/operations/entry/filtering/plugins/index.js\";\nimport {\n CmsEntryFieldFilterPathPlugin,\n CmsEntryFieldFilterPlugin,\n CmsEntryFieldSortingPlugin,\n CmsFieldFilterValueTransformPlugin\n} from \"~/plugins/index.js\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin.js\";\nimport { StorageOperationsCmsModelPlugin, StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CompressorPlugin } from \"@webiny/api\";\nimport { createTable } from \"~/definitions/table.js\";\n\nexport * from \"./plugins/index.js\";\n\nexport const createStorageOperations: StorageOperationsFactory = params => {\n const { table, documentClient, plugins: userPlugins } = params;\n\n const tableInstance = createTable({\n name: table,\n documentClient\n });\n\n const entities = {\n groups: createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n }),\n models: createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n }),\n entries: createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n })\n };\n\n const plugins = new PluginsContainer([\n /**\n * DynamoDB filter plugins for the where conditions.\n */\n dynamoDbValueFilters(),\n /**\n * Field plugins for DynamoDB.\n */\n dynamoDbPlugins(),\n /**\n * Filter create plugins.\n */\n createFilterCreatePlugins(),\n /**\n * User defined custom plugins.\n */\n ...(userPlugins || [])\n ]);\n\n const entries = createEntriesStorageOperations({\n entity: entities.entries,\n plugins\n });\n\n return {\n name: \"dynamodb\",\n beforeInit: async context => {\n const types: string[] = [\n \"cms-model-field-to-graphql\",\n CmsEntryFieldFilterPathPlugin.type,\n CmsFieldFilterValueTransformPlugin.type,\n CmsEntryFieldFilterPlugin.type,\n CmsEntryFieldSortingPlugin.type,\n ValueFilterPlugin.type,\n StorageOperationsCmsModelPlugin.type,\n StorageTransformPlugin.type,\n CompressorPlugin.type\n ];\n /**\n * Collect all required plugins from parent context.\n */\n for (const type of types) {\n plugins.mergeByType(context.plugins, type);\n }\n /**\n * Pass the plugins to the parent context.\n */\n context.plugins.register([dynamoDbPlugins()]);\n\n entries.dataLoaders.clearAll();\n },\n getEntities: () => entities,\n getTable: () => tableInstance,\n groups: createGroupsStorageOperations({\n entity: entities.groups,\n plugins\n }),\n models: createModelsStorageOperations({\n entity: entities.models\n }),\n entries\n };\n};\n"],"mappings":"AAAA,OAAOA,oBAAoB,MAAM,8CAA8C;AAC/E,OAAOC,eAAe;AAEtB,SAASC,QAAQ;AACjB,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,gBAAgB,QAAQ,iBAAiB;AAClD,SAASC,6BAA6B;AACtC,SAASC,6BAA6B;AACtC,SAASC,8BAA8B;AAEvC,SAASC,yBAAyB;AAClC,SACIC,6BAA6B,EAC7BC,yBAAyB,EACzBC,0BAA0B,EAC1BC,kCAAkC;AAEtC,SAASC,iBAAiB,QAAQ,8DAA8D;AAChG,SAASC,+BAA+B,EAAEC,sBAAsB,QAAQ,0BAA0B;AAClG,SAASC,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,WAAW;AAEpB;AAEA,OAAO,MAAMC,uBAAiD,GAAGC,MAAM,IAAI;EACvE,MAAM;IAAEC,KAAK;IAAEC,cAAc;IAAEC,OAAO,EAAEC;EAAY,CAAC,GAAGJ,MAAM;EAE9D,MAAMK,aAAa,GAAGP,WAAW,CAAC;IAC9BQ,IAAI,EAAEL,KAAK;IACXC;EACJ,CAAC,CAAC;EAEF,MAAMK,QAAQ,GAAG;IACbC,MAAM,EAAE1B,iBAAiB,CAAC;MACtB2B,UAAU,EAAE5B,QAAQ,CAAC6B,MAAM;MAC3BT,KAAK,EAAEI;IACX,CAAC,CAAC;IACFM,MAAM,EAAE5B,iBAAiB,CAAC;MACtB0B,UAAU,EAAE5B,QAAQ,CAAC+B,MAAM;MAC3BX,KAAK,EAAEI;IACX,CAAC,CAAC;IACFQ,OAAO,EAAE7B,iBAAiB,CAAC;MACvByB,UAAU,EAAE5B,QAAQ,CAACiC,OAAO;MAC5Bb,KAAK,EAAEI;IACX,CAAC;EACL,CAAC;EAED,MAAMF,OAAO,GAAG,IAAIlB,gBAAgB,CAAC;EACjC;AACR;AACA;EACQN,oBAAoB,CAAC,CAAC;EACtB;AACR;AACA;EACQC,eAAe,CAAC,CAAC;EACjB;AACR;AACA;EACQS,yBAAyB,CAAC,CAAC;EAC3B;AACR;AACA;EACQ,IAAIe,WAAW,IAAI,EAAE,CAAC,CACzB,CAAC;EAEF,MAAMS,OAAO,GAAGzB,8BAA8B,CAAC;IAC3C2B,MAAM,EAAER,QAAQ,CAACM,OAAO;IACxBV;EACJ,CAAC,CAAC;EAEF,OAAO;IACHG,IAAI,EAAE,UAAU;IAChBU,UAAU,EAAE,MAAMC,OAAO,IAAI;MACzB,MAAMC,KAAe,GAAG,CACpB,4BAA4B,EAC5B5B,6BAA6B,CAAC6B,IAAI,EAClC1B,kCAAkC,CAAC0B,IAAI,EACvC5B,yBAAyB,CAAC4B,IAAI,EAC9B3B,0BAA0B,CAAC2B,IAAI,EAC/BzB,iBAAiB,CAACyB,IAAI,EACtBxB,+BAA+B,CAACwB,IAAI,EACpCvB,sBAAsB,CAACuB,IAAI,EAC3BtB,gBAAgB,CAACsB,IAAI,CACxB;MACD;AACZ;AACA;MACY,KAAK,MAAMA,IAAI,IAAID,KAAK,EAAE;QACtBf,OAAO,CAACiB,WAAW,CAACH,OAAO,CAACd,OAAO,EAAEgB,IAAI,CAAC;MAC9C;MACA;AACZ;AACA;MACYF,OAAO,CAACd,OAAO,CAACkB,QAAQ,CAAC,CAACzC,eAAe,CAAC,CAAC,CAAC,CAAC;MAE7CiC,OAAO,CAACS,WAAW,CAACC,QAAQ,CAAC,CAAC;IAClC,CAAC;IACDC,WAAW,EAAEA,CAAA,KAAMjB,QAAQ;IAC3BkB,QAAQ,EAAEA,CAAA,KAAMpB,aAAa;IAC7BG,MAAM,EAAEtB,6BAA6B,CAAC;MAClC6B,MAAM,EAAER,QAAQ,CAACC,MAAM;MACvBL;IACJ,CAAC,CAAC;IACFQ,MAAM,EAAExB,6BAA6B,CAAC;MAClC4B,MAAM,EAAER,QAAQ,CAACI;IACrB,CAAC,CAAC;IACFE;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { ENTITIES } from \"~/types.js\";\nimport { createGroupEntity } from \"~/definitions/group.js\";\nimport { createModelEntity } from \"~/definitions/model.js\";\nimport { createEntryEntity } from \"~/definitions/entry.js\";\nimport { createTable } from \"~/definitions/table.js\";\nimport { createFeature } from \"@webiny/feature/api/index.js\";\nimport { DynamoDBClient } from \"@webiny/db-dynamodb\";\nimport { FilterUtilFeature } from \"@webiny/db-dynamodb/feature/FilterUtil/feature.js\";\nimport { CmsDdbTable } from \"~/abstractions/CmsDdbTable.js\";\nimport { CmsDdbGroupEntity } from \"~/abstractions/CmsDdbGroupEntity.js\";\nimport { CmsDdbModelEntity } from \"~/abstractions/CmsDdbModelEntity.js\";\nimport { CmsDdbEntryEntity } from \"~/abstractions/CmsDdbEntryEntity.js\";\n\nexport { HeadlessCmsDdbRequestFeature } from \"~/requestFeature.js\";\n\n/**\n * Root half of the DynamoDB CMS storage: the table and entity definitions, built once per process.\n * The storage operations are per request, in `HeadlessCmsDdbRequestFeature`.\n * Requires DynamoDBClient to be registered in the container first (via DbFeature).\n *\n * Usage:\n * DbFeature.register(container, { documentClient, table });\n * HeadlessCmsDdbFeature.register(container);\n * // then in request:\n * HeadlessCmsDdbRequestFeature.register(requestContainer);\n * HeadlessCmsFeature.register(requestContainer, { type: \"manage\" });\n */\nexport const HeadlessCmsDdbFeature = createFeature({\n name: \"cms.storageOperations.ddb\",\n register: container => {\n FilterUtilFeature.register(container);\n\n const db = container.resolve(DynamoDBClient);\n const documentClient = db.client;\n\n const tableInstance = createTable({ documentClient });\n\n // Register infrastructure instances (app-scoped)\n container.registerInstance(CmsDdbTable, tableInstance);\n container.registerInstance(\n CmsDdbGroupEntity,\n createGroupEntity({\n entityName: ENTITIES.GROUPS,\n table: tableInstance\n })\n );\n container.registerInstance(\n CmsDdbModelEntity,\n createModelEntity({\n entityName: ENTITIES.MODELS,\n table: tableInstance\n })\n );\n container.registerInstance(\n CmsDdbEntryEntity,\n createEntryEntity({\n entityName: ENTITIES.ENTRIES,\n table: tableInstance\n })\n );\n }\n});\n"],"names":["HeadlessCmsDdbFeature","createFeature","container","FilterUtilFeature","db","DynamoDBClient","documentClient","tableInstance","createTable","CmsDdbTable","CmsDdbGroupEntity","createGroupEntity","ENTITIES","CmsDdbModelEntity","createModelEntity","CmsDdbEntryEntity","createEntryEntity"],"mappings":";;;;;;;;;;;;AA2BO,MAAMA,wBAAwBC,cAAc;IAC/C,MAAM;IACN,UAAUC,CAAAA;QACNC,kBAAkB,QAAQ,CAACD;QAE3B,MAAME,KAAKF,UAAU,OAAO,CAACG;QAC7B,MAAMC,iBAAiBF,GAAG,MAAM;QAEhC,MAAMG,gBAAgBC,YAAY;YAAEF;QAAe;QAGnDJ,UAAU,gBAAgB,CAACO,aAAaF;QACxCL,UAAU,gBAAgB,CACtBQ,mBACAC,kBAAkB;YACd,YAAYC,SAAS,MAAM;YAC3B,OAAOL;QACX;QAEJL,UAAU,gBAAgB,CACtBW,mBACAC,kBAAkB;YACd,YAAYF,SAAS,MAAM;YAC3B,OAAOL;QACX;QAEJL,UAAU,gBAAgB,CACtBa,mBACAC,kBAAkB;YACd,YAAYJ,SAAS,OAAO;YAC5B,OAAOL;QACX;IAER;AACJ"}
@@ -0,0 +1,16 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
3
+ import { CmsDdbEntryEntity } from "../../abstractions/CmsDdbEntryEntity.js";
4
+ import { CmsDdbDataLoaders } from "../../abstractions/CmsDdbDataLoaders.js";
5
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
6
+ declare class DdbCreateEntryImpl implements CreateEntryStorageOperation.Interface {
7
+ private entity;
8
+ private dataLoaders;
9
+ private storageModelProvider;
10
+ constructor(entity: CmsDdbEntryEntity.Interface, dataLoaders: CmsDdbDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
11
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsCreateParams<T>): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>>;
12
+ }
13
+ export declare const DdbCreateEntry: typeof DdbCreateEntryImpl & {
14
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js").ICreateEntryStorageOperation>;
15
+ };
16
+ export {};
@@ -0,0 +1,77 @@
1
+ import error from "@webiny/error";
2
+ import { CreateEntryStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js";
3
+ import { CmsDdbEntryEntity } from "../../abstractions/CmsDdbEntryEntity.js";
4
+ import { CmsDdbDataLoaders } from "../../abstractions/CmsDdbDataLoaders.js";
5
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
6
+ import { createEntryLatestKeys, createEntryPublishedKeys, createEntryRevisionKeys } from "./keys.js";
7
+ import { convertToStorageEntry } from "./storageEntryUtils.js";
8
+ class DdbCreateEntryImpl {
9
+ constructor(entity, dataLoaders, storageModelProvider){
10
+ this.entity = entity;
11
+ this.dataLoaders = dataLoaders;
12
+ this.storageModelProvider = storageModelProvider;
13
+ }
14
+ async execute(initialModel, params) {
15
+ const { entry, storageEntry: initialStorageEntry } = params;
16
+ const model = this.storageModelProvider.getModel(initialModel);
17
+ const isPublished = "published" === entry.status;
18
+ const locked = isPublished ? true : entry.locked;
19
+ const storageEntry = convertToStorageEntry({
20
+ model,
21
+ storageEntry: initialStorageEntry
22
+ });
23
+ const storageEntryRevisionKeys = createEntryRevisionKeys(entry);
24
+ const storageEntryLatestKeys = createEntryLatestKeys(entry);
25
+ const entityBatch = this.entity.createEntityWriter({
26
+ put: [
27
+ {
28
+ ...storageEntryRevisionKeys,
29
+ data: {
30
+ ...storageEntry,
31
+ locked
32
+ }
33
+ },
34
+ {
35
+ ...storageEntryLatestKeys,
36
+ data: {
37
+ ...storageEntry,
38
+ locked
39
+ }
40
+ }
41
+ ]
42
+ });
43
+ if (isPublished) {
44
+ const storageEntryPublishedKeys = createEntryPublishedKeys(storageEntry);
45
+ entityBatch.put({
46
+ ...storageEntryPublishedKeys,
47
+ data: {
48
+ ...storageEntry,
49
+ locked
50
+ }
51
+ });
52
+ }
53
+ try {
54
+ await entityBatch.execute();
55
+ this.dataLoaders.clearAll({
56
+ tenant: entry.tenant
57
+ });
58
+ } catch (ex) {
59
+ throw new error(ex.message || "Could not insert data into the DynamoDB.", ex.code || "CREATE_ENTRY_ERROR", {
60
+ error: ex,
61
+ entry
62
+ });
63
+ }
64
+ return initialStorageEntry;
65
+ }
66
+ }
67
+ const DdbCreateEntry = CreateEntryStorageOperation.createImplementation({
68
+ implementation: DdbCreateEntryImpl,
69
+ dependencies: [
70
+ CmsDdbEntryEntity,
71
+ CmsDdbDataLoaders,
72
+ CmsStorageModelProvider
73
+ ]
74
+ });
75
+ export { DdbCreateEntry };
76
+
77
+ //# sourceMappingURL=DdbCreateEntry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations/entry/DdbCreateEntry.js","sources":["../../../src/operations/entry/DdbCreateEntry.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsEntryValues,\n CmsEntryStorageOperationsCreateParams\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { CreateEntryStorageOperation } from \"@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryStorageOperation.js\";\nimport { CmsDdbEntryEntity } from \"~/abstractions/CmsDdbEntryEntity.js\";\nimport { CmsDdbDataLoaders } from \"~/abstractions/CmsDdbDataLoaders.js\";\nimport { CmsStorageModelProvider } from \"@webiny/api-headless-cms/features/shared/abstractions.js\";\nimport {\n createEntryLatestKeys,\n createEntryPublishedKeys,\n createEntryRevisionKeys\n} from \"~/operations/entry/keys.js\";\nimport { convertToStorageEntry } from \"./storageEntryUtils.js\";\n\nclass DdbCreateEntryImpl implements CreateEntryStorageOperation.Interface {\n constructor(\n private entity: CmsDdbEntryEntity.Interface,\n private dataLoaders: CmsDdbDataLoaders.Interface,\n private storageModelProvider: CmsStorageModelProvider.Interface\n ) {}\n\n async execute<T extends CmsEntryValues = CmsEntryValues>(\n initialModel: CmsModel,\n params: CmsEntryStorageOperationsCreateParams<T>\n ) {\n const { entry, storageEntry: initialStorageEntry } = params;\n const model = this.storageModelProvider.getModel(initialModel);\n\n const isPublished = entry.status === \"published\";\n\n const locked = isPublished ? true : entry.locked;\n\n const storageEntry = convertToStorageEntry({\n model,\n storageEntry: initialStorageEntry\n });\n\n const storageEntryRevisionKeys = createEntryRevisionKeys(entry);\n const storageEntryLatestKeys = createEntryLatestKeys(entry);\n /**\n * We need to:\n * - create new main entry item\n * - create new or update the latest entry item\n */\n const entityBatch = this.entity.createEntityWriter({\n put: [\n {\n ...storageEntryRevisionKeys,\n data: {\n ...storageEntry,\n locked\n }\n },\n {\n ...storageEntryLatestKeys,\n data: {\n ...storageEntry,\n locked\n }\n }\n ]\n });\n\n /**\n * We need to create published entry if\n */\n if (isPublished) {\n const storageEntryPublishedKeys = createEntryPublishedKeys(storageEntry);\n entityBatch.put({\n ...storageEntryPublishedKeys,\n data: {\n ...storageEntry,\n locked\n }\n });\n }\n\n try {\n await entityBatch.execute();\n this.dataLoaders.clearAll({\n tenant: entry.tenant\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not insert data into the DynamoDB.\",\n ex.code || \"CREATE_ENTRY_ERROR\",\n {\n error: ex,\n entry\n }\n );\n }\n\n return initialStorageEntry;\n }\n}\n\nexport const DdbCreateEntry = CreateEntryStorageOperation.createImplementation({\n implementation: DdbCreateEntryImpl,\n dependencies: [CmsDdbEntryEntity, CmsDdbDataLoaders, CmsStorageModelProvider]\n});\n"],"names":["DdbCreateEntryImpl","entity","dataLoaders","storageModelProvider","initialModel","params","entry","initialStorageEntry","model","isPublished","locked","storageEntry","convertToStorageEntry","storageEntryRevisionKeys","createEntryRevisionKeys","storageEntryLatestKeys","createEntryLatestKeys","entityBatch","storageEntryPublishedKeys","createEntryPublishedKeys","ex","WebinyError","DdbCreateEntry","CreateEntryStorageOperation","CmsDdbEntryEntity","CmsDdbDataLoaders","CmsStorageModelProvider"],"mappings":";;;;;;;AAiBA,MAAMA;IACF,YACYC,MAAmC,EACnCC,WAAwC,EACxCC,oBAAuD,CACjE;aAHUF,MAAM,GAANA;aACAC,WAAW,GAAXA;aACAC,oBAAoB,GAApBA;IACT;IAEH,MAAM,QACFC,YAAsB,EACtBC,MAAgD,EAClD;QACE,MAAM,EAAEC,KAAK,EAAE,cAAcC,mBAAmB,EAAE,GAAGF;QACrD,MAAMG,QAAQ,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAACJ;QAEjD,MAAMK,cAAcH,AAAiB,gBAAjBA,MAAM,MAAM;QAEhC,MAAMI,SAASD,cAAc,OAAOH,MAAM,MAAM;QAEhD,MAAMK,eAAeC,sBAAsB;YACvCJ;YACA,cAAcD;QAClB;QAEA,MAAMM,2BAA2BC,wBAAwBR;QACzD,MAAMS,yBAAyBC,sBAAsBV;QAMrD,MAAMW,cAAc,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;YAC/C,KAAK;gBACD;oBACI,GAAGJ,wBAAwB;oBAC3B,MAAM;wBACF,GAAGF,YAAY;wBACfD;oBACJ;gBACJ;gBACA;oBACI,GAAGK,sBAAsB;oBACzB,MAAM;wBACF,GAAGJ,YAAY;wBACfD;oBACJ;gBACJ;aACH;QACL;QAKA,IAAID,aAAa;YACb,MAAMS,4BAA4BC,yBAAyBR;YAC3DM,YAAY,GAAG,CAAC;gBACZ,GAAGC,yBAAyB;gBAC5B,MAAM;oBACF,GAAGP,YAAY;oBACfD;gBACJ;YACJ;QACJ;QAEA,IAAI;YACA,MAAMO,YAAY,OAAO;YACzB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC;gBACtB,QAAQX,MAAM,MAAM;YACxB;QACJ,EAAE,OAAOc,IAAI;YACT,MAAM,IAAIC,MACND,GAAG,OAAO,IAAI,4CACdA,GAAG,IAAI,IAAI,sBACX;gBACI,OAAOA;gBACPd;YACJ;QAER;QAEA,OAAOC;IACX;AACJ;AAEO,MAAMe,iBAAiBC,4BAA4B,oBAAoB,CAAC;IAC3E,gBAAgBvB;IAChB,cAAc;QAACwB;QAAmBC;QAAmBC;KAAwB;AACjF"}
@@ -0,0 +1,16 @@
1
+ import type { CmsModel, CmsEntryValues, CmsEntryStorageOperationsCreateRevisionFromParams } from "@webiny/api-headless-cms/types/index.js";
2
+ import { CreateEntryRevisionFromStorageOperation } from "@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js";
3
+ import { CmsDdbEntryEntity } from "../../abstractions/CmsDdbEntryEntity.js";
4
+ import { CmsDdbDataLoaders } from "../../abstractions/CmsDdbDataLoaders.js";
5
+ import { CmsStorageModelProvider } from "@webiny/api-headless-cms/features/shared/abstractions.js";
6
+ declare class DdbCreateEntryRevisionFromImpl implements CreateEntryRevisionFromStorageOperation.Interface {
7
+ private entity;
8
+ private dataLoaders;
9
+ private storageModelProvider;
10
+ constructor(entity: CmsDdbEntryEntity.Interface, dataLoaders: CmsDdbDataLoaders.Interface, storageModelProvider: CmsStorageModelProvider.Interface);
11
+ execute<T extends CmsEntryValues = CmsEntryValues>(initialModel: CmsModel, params: CmsEntryStorageOperationsCreateRevisionFromParams<T>): Promise<import("@webiny/api-headless-cms/types/types.js").CmsStorageEntry<T>>;
12
+ }
13
+ export declare const DdbCreateEntryRevisionFrom: typeof DdbCreateEntryRevisionFromImpl & {
14
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms/features/shared/storageOperations/entry/CreateEntryRevisionFromStorageOperation.js").ICreateEntryRevisionFromStorageOperation>;
15
+ };
16
+ export {};