@webiny/api-headless-cms-ddb 0.0.0-mt-2 → 0.0.0-unstable.0156a4c312

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 (215) hide show
  1. package/README.md +6 -20
  2. package/abstractions/CmsDdbDataLoaders.d.ts +5 -0
  3. package/abstractions/CmsDdbDataLoaders.js +5 -0
  4. package/abstractions/CmsDdbDataLoaders.js.map +1 -0
  5. package/abstractions/CmsDdbEntryEntity.d.ts +5 -0
  6. package/abstractions/CmsDdbEntryEntity.js +5 -0
  7. package/abstractions/CmsDdbEntryEntity.js.map +1 -0
  8. package/abstractions/CmsDdbGroupEntity.d.ts +5 -0
  9. package/abstractions/CmsDdbGroupEntity.js +5 -0
  10. package/abstractions/CmsDdbGroupEntity.js.map +1 -0
  11. package/abstractions/CmsDdbModelEntity.d.ts +5 -0
  12. package/abstractions/CmsDdbModelEntity.js +5 -0
  13. package/abstractions/CmsDdbModelEntity.js.map +1 -0
  14. package/abstractions/CmsDdbTable.d.ts +5 -0
  15. package/abstractions/CmsDdbTable.js +5 -0
  16. package/abstractions/CmsDdbTable.js.map +1 -0
  17. package/definitions/entry.d.ts +6 -6
  18. package/definitions/entry.js +9 -95
  19. package/definitions/entry.js.map +1 -0
  20. package/definitions/group.d.ts +6 -6
  21. package/definitions/group.js +9 -72
  22. package/definitions/group.js.map +1 -0
  23. package/definitions/model.d.ts +6 -6
  24. package/definitions/model.js +9 -94
  25. package/definitions/model.js.map +1 -0
  26. package/definitions/table.d.ts +6 -7
  27. package/definitions/table.js +8 -30
  28. package/definitions/table.js.map +1 -0
  29. package/definitions/types.d.ts +65 -0
  30. package/definitions/types.js +0 -0
  31. package/index.d.ts +10 -2
  32. package/index.js +45 -123
  33. package/index.js.map +1 -0
  34. package/operations/entry/DdbCreateEntry.d.ts +16 -0
  35. package/operations/entry/DdbCreateEntry.js +77 -0
  36. package/operations/entry/DdbCreateEntry.js.map +1 -0
  37. package/operations/entry/DdbCreateEntryRevisionFrom.d.ts +16 -0
  38. package/operations/entry/DdbCreateEntryRevisionFrom.js +85 -0
  39. package/operations/entry/DdbCreateEntryRevisionFrom.js.map +1 -0
  40. package/operations/entry/DdbDeleteEntry.d.ts +16 -0
  41. package/operations/entry/DdbDeleteEntry.js +65 -0
  42. package/operations/entry/DdbDeleteEntry.js.map +1 -0
  43. package/operations/entry/DdbDeleteEntryRevision.d.ts +17 -0
  44. package/operations/entry/DdbDeleteEntryRevision.js +91 -0
  45. package/operations/entry/DdbDeleteEntryRevision.js.map +1 -0
  46. package/operations/entry/DdbDeleteMultipleEntries.d.ts +16 -0
  47. package/operations/entry/DdbDeleteMultipleEntries.js +59 -0
  48. package/operations/entry/DdbDeleteMultipleEntries.js.map +1 -0
  49. package/operations/entry/DdbGetEntriesByIds.d.ts +14 -0
  50. package/operations/entry/DdbGetEntriesByIds.js +31 -0
  51. package/operations/entry/DdbGetEntriesByIds.js.map +1 -0
  52. package/operations/entry/DdbGetEntry.d.ts +14 -0
  53. package/operations/entry/DdbGetEntry.js +27 -0
  54. package/operations/entry/DdbGetEntry.js.map +1 -0
  55. package/operations/entry/DdbGetLatestEntriesByIds.d.ts +14 -0
  56. package/operations/entry/DdbGetLatestEntriesByIds.js +31 -0
  57. package/operations/entry/DdbGetLatestEntriesByIds.js.map +1 -0
  58. package/operations/entry/DdbGetLatestRevisionByEntryId.d.ts +14 -0
  59. package/operations/entry/DdbGetLatestRevisionByEntryId.js +35 -0
  60. package/operations/entry/DdbGetLatestRevisionByEntryId.js.map +1 -0
  61. package/operations/entry/DdbGetPreviousRevision.d.ts +14 -0
  62. package/operations/entry/DdbGetPreviousRevision.js +53 -0
  63. package/operations/entry/DdbGetPreviousRevision.js.map +1 -0
  64. package/operations/entry/DdbGetPublishedEntriesByIds.d.ts +14 -0
  65. package/operations/entry/DdbGetPublishedEntriesByIds.js +31 -0
  66. package/operations/entry/DdbGetPublishedEntriesByIds.js.map +1 -0
  67. package/operations/entry/DdbGetPublishedRevisionByEntryId.d.ts +14 -0
  68. package/operations/entry/DdbGetPublishedRevisionByEntryId.js +35 -0
  69. package/operations/entry/DdbGetPublishedRevisionByEntryId.js.map +1 -0
  70. package/operations/entry/DdbGetRevisionById.d.ts +14 -0
  71. package/operations/entry/DdbGetRevisionById.js +34 -0
  72. package/operations/entry/DdbGetRevisionById.js.map +1 -0
  73. package/operations/entry/DdbGetRevisions.d.ts +14 -0
  74. package/operations/entry/DdbGetRevisions.js +33 -0
  75. package/operations/entry/DdbGetRevisions.js.map +1 -0
  76. package/operations/entry/DdbGetUniqueFieldValues.d.ts +12 -0
  77. package/operations/entry/DdbGetUniqueFieldValues.js +31 -0
  78. package/operations/entry/DdbGetUniqueFieldValues.js.map +1 -0
  79. package/operations/entry/DdbListEntries.d.ts +30 -0
  80. package/operations/entry/DdbListEntries.js +133 -0
  81. package/operations/entry/DdbListEntries.js.map +1 -0
  82. package/operations/entry/DdbMoveEntry.d.ts +16 -0
  83. package/operations/entry/DdbMoveEntry.js +63 -0
  84. package/operations/entry/DdbMoveEntry.js.map +1 -0
  85. package/operations/entry/DdbMoveToBin.d.ts +16 -0
  86. package/operations/entry/DdbMoveToBin.js +77 -0
  87. package/operations/entry/DdbMoveToBin.js.map +1 -0
  88. package/operations/entry/DdbPublishEntry.d.ts +18 -0
  89. package/operations/entry/DdbPublishEntry.js +162 -0
  90. package/operations/entry/DdbPublishEntry.js.map +1 -0
  91. package/operations/entry/DdbRestoreFromBin.d.ts +16 -0
  92. package/operations/entry/DdbRestoreFromBin.js +78 -0
  93. package/operations/entry/DdbRestoreFromBin.js.map +1 -0
  94. package/operations/entry/DdbUnpublishEntry.d.ts +17 -0
  95. package/operations/entry/DdbUnpublishEntry.js +112 -0
  96. package/operations/entry/DdbUnpublishEntry.js.map +1 -0
  97. package/operations/entry/DdbUpdateEntry.d.ts +17 -0
  98. package/operations/entry/DdbUpdateEntry.js +105 -0
  99. package/operations/entry/DdbUpdateEntry.js.map +1 -0
  100. package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
  101. package/operations/entry/dataLoader/DataLoaderCache.js +27 -0
  102. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
  103. package/operations/entry/dataLoader/constants.d.ts +1 -0
  104. package/operations/entry/dataLoader/constants.js +5 -0
  105. package/operations/entry/dataLoader/constants.js.map +1 -0
  106. package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
  107. package/operations/entry/dataLoader/createBatchScheduleFn.js +10 -0
  108. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
  109. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
  110. package/operations/entry/dataLoader/getAllEntryRevisions.js +24 -0
  111. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
  112. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
  113. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +40 -0
  114. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
  115. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
  116. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +40 -0
  117. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
  118. package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
  119. package/operations/entry/dataLoader/getRevisionById.js +42 -0
  120. package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
  121. package/operations/entry/dataLoader/index.d.ts +8 -0
  122. package/operations/entry/dataLoader/index.js +18 -0
  123. package/operations/entry/dataLoader/index.js.map +1 -0
  124. package/operations/entry/dataLoader/types.d.ts +6 -0
  125. package/operations/entry/dataLoader/types.js +0 -0
  126. package/operations/entry/dataLoaders.d.ts +20 -31
  127. package/operations/entry/dataLoaders.js +91 -296
  128. package/operations/entry/dataLoaders.js.map +1 -0
  129. package/operations/entry/feature.d.ts +4 -0
  130. package/operations/entry/feature.js +55 -0
  131. package/operations/entry/feature.js.map +1 -0
  132. package/operations/entry/keys.d.ts +46 -2
  133. package/operations/entry/keys.js +53 -55
  134. package/operations/entry/keys.js.map +1 -0
  135. package/operations/entry/storageEntryUtils.d.ts +8 -0
  136. package/operations/entry/storageEntryUtils.js +25 -0
  137. package/operations/entry/storageEntryUtils.js.map +1 -0
  138. package/operations/group/DdbCreateGroup.d.ts +12 -0
  139. package/operations/group/DdbCreateGroup.js +35 -0
  140. package/operations/group/DdbCreateGroup.js.map +1 -0
  141. package/operations/group/DdbDeleteGroup.d.ts +12 -0
  142. package/operations/group/DdbDeleteGroup.js +31 -0
  143. package/operations/group/DdbDeleteGroup.js.map +1 -0
  144. package/operations/group/DdbGetGroup.d.ts +12 -0
  145. package/operations/group/DdbGetGroup.js +31 -0
  146. package/operations/group/DdbGetGroup.js.map +1 -0
  147. package/operations/group/DdbListGroups.d.ts +14 -0
  148. package/operations/group/DdbListGroups.js +52 -0
  149. package/operations/group/DdbListGroups.js.map +1 -0
  150. package/operations/group/DdbUpdateGroup.d.ts +12 -0
  151. package/operations/group/DdbUpdateGroup.js +35 -0
  152. package/operations/group/DdbUpdateGroup.js.map +1 -0
  153. package/operations/group/feature.d.ts +4 -0
  154. package/operations/group/feature.js +19 -0
  155. package/operations/group/feature.js.map +1 -0
  156. package/operations/group/keys.d.ts +15 -0
  157. package/operations/group/keys.js +17 -0
  158. package/operations/group/keys.js.map +1 -0
  159. package/operations/model/DdbCreateModel.d.ts +12 -0
  160. package/operations/model/DdbCreateModel.js +37 -0
  161. package/operations/model/DdbCreateModel.js.map +1 -0
  162. package/operations/model/DdbDeleteModel.d.ts +12 -0
  163. package/operations/model/DdbDeleteModel.js +31 -0
  164. package/operations/model/DdbDeleteModel.js.map +1 -0
  165. package/operations/model/DdbGetModel.d.ts +12 -0
  166. package/operations/model/DdbGetModel.js +30 -0
  167. package/operations/model/DdbGetModel.js.map +1 -0
  168. package/operations/model/DdbListModels.d.ts +12 -0
  169. package/operations/model/DdbListModels.js +36 -0
  170. package/operations/model/DdbListModels.js.map +1 -0
  171. package/operations/model/DdbUpdateModel.d.ts +12 -0
  172. package/operations/model/DdbUpdateModel.js +36 -0
  173. package/operations/model/DdbUpdateModel.js.map +1 -0
  174. package/operations/model/feature.d.ts +4 -0
  175. package/operations/model/feature.js +19 -0
  176. package/operations/model/feature.js.map +1 -0
  177. package/operations/model/keys.d.ts +15 -0
  178. package/operations/model/keys.js +16 -0
  179. package/operations/model/keys.js.map +1 -0
  180. package/package.json +30 -34
  181. package/types.d.ts +12 -76
  182. package/types.js +8 -15
  183. package/types.js.map +1 -0
  184. package/definitions/settings.d.ts +0 -8
  185. package/definitions/settings.js +0 -62
  186. package/definitions/system.d.ts +0 -8
  187. package/definitions/system.js +0 -50
  188. package/dynamoDb/index.d.ts +0 -2
  189. package/dynamoDb/index.js +0 -24
  190. package/dynamoDb/path/plainObject.d.ts +0 -3
  191. package/dynamoDb/path/plainObject.js +0 -33
  192. package/dynamoDb/path/ref.d.ts +0 -3
  193. package/dynamoDb/path/ref.js +0 -27
  194. package/dynamoDb/storage/date.d.ts +0 -3
  195. package/dynamoDb/storage/date.js +0 -65
  196. package/dynamoDb/storage/longText.d.ts +0 -7
  197. package/dynamoDb/storage/longText.js +0 -83
  198. package/dynamoDb/storage/richText.d.ts +0 -8
  199. package/dynamoDb/storage/richText.js +0 -110
  200. package/dynamoDb/transformValue/datetime.d.ts +0 -3
  201. package/dynamoDb/transformValue/datetime.js +0 -47
  202. package/operations/entry/index.d.ts +0 -8
  203. package/operations/entry/index.js +0 -823
  204. package/operations/entry/systemFields.d.ts +0 -2
  205. package/operations/entry/systemFields.js +0 -50
  206. package/operations/entry/utils.d.ts +0 -31
  207. package/operations/entry/utils.js +0 -406
  208. package/operations/group/index.d.ts +0 -8
  209. package/operations/group/index.js +0 -198
  210. package/operations/model/index.d.ts +0 -6
  211. package/operations/model/index.js +0 -161
  212. package/operations/settings/index.d.ts +0 -6
  213. package/operations/settings/index.js +0 -141
  214. package/operations/system/index.d.ts +0 -6
  215. package/operations/system/index.js +0 -105
package/README.md CHANGED
@@ -1,25 +1,11 @@
1
1
  # @webiny/api-headless-cms-ddb
2
2
 
3
- [![](https://img.shields.io/npm/dw/@webiny/api-headless-cms-ddb.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb)
4
- [![](https://img.shields.io/npm/v/@webiny/api-headless-cms-ddb.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb)
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
12
- ```
9
+ ---
13
10
 
14
- Or if you prefer yarn:
15
-
16
- ```
17
- yarn add @webiny/api-headless-cms-ddb
18
- ```
19
-
20
- ## Testing
21
- To run the tests only for this package you must filter it with keywords.
22
- ### Command
23
- ````
24
- yarn test packages/api-headless-cms --keyword=cms:ddb --keyword=cms:base
25
- ````
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 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,8 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
3
- export interface Params {
4
- table: Table;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IEntryEntity } from "./types.js";
3
+ interface Params {
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createEntryEntity: (params: Params) => Entity<any>;
7
+ export declare const createEntryEntity: (params: Params) => IEntryEntity;
8
+ export {};
@@ -1,97 +1,11 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createEntryEntity = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
-
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
-
18
- const createEntryEntity = params => {
19
- const {
20
- table,
21
- entityName,
22
- attributes
23
- } = params;
24
- return new _dynamodbToolbox.Entity({
25
- name: entityName,
26
- table,
27
- attributes: _objectSpread({
28
- PK: {
29
- type: "string",
30
- partitionKey: true
31
- },
32
- SK: {
33
- type: "string",
34
- sortKey: true
35
- },
36
- GSI1_PK: {
37
- type: "string"
38
- },
39
- GSI1_SK: {
40
- type: "string"
41
- },
42
- TYPE: {
43
- type: "string"
44
- },
45
- __type: {
46
- type: "string"
47
- },
48
- webinyVersion: {
49
- type: "string"
50
- },
51
- tenant: {
52
- type: "string"
53
- },
54
- entryId: {
55
- type: "string"
56
- },
57
- id: {
58
- type: "string"
59
- },
60
- createdBy: {
61
- type: "map"
62
- },
63
- ownedBy: {
64
- type: "map"
65
- },
66
- createdOn: {
67
- type: "string"
68
- },
69
- savedOn: {
70
- type: "string"
71
- },
72
- modelId: {
73
- type: "string"
74
- },
75
- locale: {
76
- type: "string"
77
- },
78
- publishedOn: {
79
- type: "string"
80
- },
81
- version: {
82
- type: "number"
83
- },
84
- locked: {
85
- type: "boolean"
86
- },
87
- status: {
88
- type: "string"
89
- },
90
- values: {
91
- type: "map"
92
- }
93
- }, attributes || {})
94
- });
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
+ });
95
8
  };
9
+ export { createEntryEntity };
96
10
 
97
- exports.createEntryEntity = createEntryEntity;
11
+ //# sourceMappingURL=entry.js.map
@@ -0,0 +1 @@
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,8 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
3
- export interface Params {
4
- table: Table;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IGroupEntity } from "./types.js";
3
+ interface Params {
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createGroupEntity: (params: Params) => Entity<any>;
7
+ export declare const createGroupEntity: (params: Params) => IGroupEntity;
8
+ export {};
@@ -1,74 +1,11 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createGroupEntity = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
-
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
-
18
- const createGroupEntity = params => {
19
- const {
20
- table,
21
- attributes,
22
- entityName
23
- } = params;
24
- return new _dynamodbToolbox.Entity({
25
- name: entityName,
26
- table,
27
- attributes: _objectSpread({
28
- PK: {
29
- partitionKey: true
30
- },
31
- SK: {
32
- sortKey: true
33
- },
34
- TYPE: {
35
- type: "string"
36
- },
37
- webinyVersion: {
38
- type: "string"
39
- },
40
- id: {
41
- type: "string"
42
- },
43
- name: {
44
- type: "string"
45
- },
46
- slug: {
47
- type: "string"
48
- },
49
- locale: {
50
- type: "string"
51
- },
52
- description: {
53
- type: "string"
54
- },
55
- icon: {
56
- type: "string"
57
- },
58
- createdBy: {
59
- type: "map"
60
- },
61
- createdOn: {
62
- type: "string"
63
- },
64
- savedOn: {
65
- type: "string"
66
- },
67
- tenant: {
68
- type: "string"
69
- }
70
- }, attributes || {})
71
- });
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
+ });
72
8
  };
9
+ export { createGroupEntity };
73
10
 
74
- exports.createGroupEntity = createGroupEntity;
11
+ //# sourceMappingURL=group.js.map
@@ -0,0 +1 @@
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,8 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
3
- export interface Params {
4
- table: Table;
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IModelEntity } from "./types.js";
3
+ interface Params {
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createModelEntity: (params: Params) => Entity<any>;
7
+ export declare const createModelEntity: (params: Params) => IModelEntity;
8
+ export {};
@@ -1,96 +1,11 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createModelEntity = void 0;
9
-
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
15
-
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
-
18
- const createModelEntity = params => {
19
- const {
20
- table,
21
- attributes,
22
- entityName
23
- } = params;
24
- return new _dynamodbToolbox.Entity({
25
- name: entityName,
26
- table,
27
- attributes: _objectSpread({
28
- PK: {
29
- partitionKey: true
30
- },
31
- SK: {
32
- sortKey: true
33
- },
34
- TYPE: {
35
- type: "string",
36
- required: true
37
- },
38
- webinyVersion: {
39
- type: "string",
40
- required: true
41
- },
42
- name: {
43
- type: "string",
44
- required: true
45
- },
46
- modelId: {
47
- type: "string",
48
- required: true
49
- },
50
- locale: {
51
- type: "string",
52
- required: true
53
- },
54
- group: {
55
- type: "map",
56
- required: true
57
- },
58
- description: {
59
- type: "string"
60
- },
61
- createdOn: {
62
- type: "string",
63
- required: true
64
- },
65
- savedOn: {
66
- type: "string",
67
- required: true
68
- },
69
- createdBy: {
70
- type: "map",
71
- required: true
72
- },
73
- fields: {
74
- type: "list",
75
- required: true
76
- },
77
- layout: {
78
- type: "list",
79
- required: true
80
- },
81
- lockedFields: {
82
- type: "list",
83
- required: true
84
- },
85
- titleFieldId: {
86
- type: "string"
87
- },
88
- tenant: {
89
- type: "string",
90
- required: true
91
- }
92
- }, attributes || {})
93
- });
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ const createModelEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ table: table.table,
6
+ name: entityName
7
+ });
94
8
  };
9
+ export { createModelEntity };
95
10
 
96
- exports.createModelEntity = createModelEntity;
11
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
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,8 +1,7 @@
1
- import { TableModifier } from "../types";
2
- import { DocumentClient } from "aws-sdk/clients/dynamodb";
3
- import { Table } from "dynamodb-toolbox";
4
- export interface Params {
5
- table?: TableModifier;
6
- documentClient: DocumentClient;
1
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
2
+ interface Params {
3
+ name?: string;
4
+ documentClient: DynamoDBDocument;
7
5
  }
8
- export declare const createTable: ({ table, documentClient }: Params) => Table;
6
+ export declare const createTable: (params: Params) => import("@webiny/db-dynamodb").ITable<string, "PK", "SK">;
7
+ export {};
@@ -1,30 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createTable = void 0;
7
-
8
- var _dynamodbToolbox = require("dynamodb-toolbox");
9
-
10
- const createTable = ({
11
- table,
12
- documentClient
13
- }) => {
14
- const tableConfig = {
15
- name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
16
- partitionKey: "PK",
17
- sortKey: "SK",
18
- DocumentClient: documentClient,
19
- indexes: {
20
- GSI1: {
21
- partitionKey: "GSI1_PK",
22
- sortKey: "GSI1_SK"
23
- }
24
- }
25
- };
26
- const config = typeof table === "function" ? table(tableConfig) : tableConfig;
27
- return new _dynamodbToolbox.Table(config);
28
- };
29
-
30
- exports.createTable = createTable;
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 };
7
+
8
+ //# sourceMappingURL=table.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,65 @@
1
+ import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
2
+ import type { GenericRecord } from "@webiny/api/types.js";
3
+ import type { CmsEntryStatus, CmsGroup, CmsIdentity, ICmsEntryLive, ICmsEntryLocation, ICmsEntrySystem, StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
4
+ export interface IEntryEntityAttributesData {
5
+ id: string;
6
+ entryId: string;
7
+ modelId: string;
8
+ tenant: string;
9
+ /**
10
+ * Revision-level meta fields. 👇
11
+ */
12
+ revisionCreatedOn: string;
13
+ revisionModifiedOn: string | null;
14
+ revisionSavedOn: string;
15
+ revisionDeletedOn: string | null;
16
+ revisionRestoredOn: string | null;
17
+ revisionFirstPublishedOn: string | null;
18
+ revisionLastPublishedOn: string | null;
19
+ revisionCreatedBy: CmsIdentity;
20
+ revisionModifiedBy: CmsIdentity | null;
21
+ revisionSavedBy: CmsIdentity;
22
+ revisionDeletedBy: CmsIdentity | null;
23
+ revisionRestoredBy: CmsIdentity | null;
24
+ revisionFirstPublishedBy: CmsIdentity | null;
25
+ revisionLastPublishedBy: CmsIdentity | null;
26
+ /**
27
+ * Entry-level meta fields. 👇
28
+ */
29
+ createdOn: string;
30
+ modifiedOn: string | null;
31
+ savedOn: string;
32
+ deletedOn: string | null;
33
+ restoredOn: string | null;
34
+ firstPublishedOn: string | null;
35
+ lastPublishedOn: string | null;
36
+ createdBy: CmsIdentity;
37
+ modifiedBy: CmsIdentity | null;
38
+ savedBy: CmsIdentity;
39
+ deletedBy: CmsIdentity | null;
40
+ restoredBy: CmsIdentity | null;
41
+ firstPublishedBy: CmsIdentity | null;
42
+ lastPublishedBy: CmsIdentity | null;
43
+ /**
44
+ * The rest. 👇
45
+ */
46
+ version: number;
47
+ locked: boolean;
48
+ status: CmsEntryStatus;
49
+ location?: ICmsEntryLocation;
50
+ wbyDeleted?: boolean | null;
51
+ binOriginalFolderId?: string;
52
+ values: GenericRecord;
53
+ meta?: GenericRecord;
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;
61
+ }
62
+ export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
63
+ export type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;
64
+ export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
65
+ export type IEntryEntity = IEntity<IEntryEntityAttributes>;
File without changes
package/index.d.ts CHANGED
@@ -1,2 +1,10 @@
1
- import { StorageOperationsFactory } from "./types";
2
- export declare const createStorageOperations: StorageOperationsFactory;
1
+ /**
2
+ * DynamoDB CMS storage. Register it once, in the root container. Tables and entities are built once
3
+ * per process; the storage operations are transient, and per-request state (the entry DataLoaders,
4
+ * the filter registries) is container scoped, so each request (child) container gets its own.
5
+ * Requires DynamoDBClient to be registered in the container first (via DbFeature).
6
+ */
7
+ export declare const HeadlessCmsDdbFeature: {
8
+ name: string;
9
+ register(container: import("@webiny/di").Container): void;
10
+ };