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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (290) 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 +4 -6
  18. package/definitions/entry.js +8 -185
  19. package/definitions/entry.js.map +1 -1
  20. package/definitions/group.d.ts +4 -6
  21. package/definitions/group.js +8 -63
  22. package/definitions/group.js.map +1 -1
  23. package/definitions/model.d.ts +4 -6
  24. package/definitions/model.js +8 -107
  25. package/definitions/model.js.map +1 -1
  26. package/definitions/table.d.ts +3 -5
  27. package/definitions/table.js +6 -29
  28. package/definitions/table.js.map +1 -1
  29. package/definitions/types.d.ts +65 -0
  30. package/definitions/types.js +0 -0
  31. package/index.d.ts +17 -3
  32. package/index.js +36 -123
  33. package/index.js.map +1 -1
  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 +28 -0
  80. package/operations/entry/DdbListEntries.js +124 -0
  81. package/operations/entry/DdbListEntries.js.map +1 -0
  82. package/operations/entry/DdbMoveEntry.d.ts +14 -0
  83. package/operations/entry/DdbMoveEntry.js +57 -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 +1 -2
  101. package/operations/entry/dataLoader/DataLoaderCache.js +21 -35
  102. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  103. package/operations/entry/dataLoader/constants.js +2 -7
  104. package/operations/entry/dataLoader/constants.js.map +1 -1
  105. package/operations/entry/dataLoader/createBatchScheduleFn.js +7 -22
  106. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  107. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
  108. package/operations/entry/dataLoader/getAllEntryRevisions.js +20 -41
  109. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  110. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
  111. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +36 -52
  112. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  113. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
  114. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +36 -52
  115. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  116. package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
  117. package/operations/entry/dataLoader/getRevisionById.js +38 -58
  118. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  119. package/operations/entry/dataLoader/index.d.ts +3 -3
  120. package/operations/entry/dataLoader/index.js +13 -35
  121. package/operations/entry/dataLoader/index.js.map +1 -1
  122. package/operations/entry/dataLoader/types.d.ts +4 -4
  123. package/operations/entry/dataLoader/types.js +0 -7
  124. package/operations/entry/dataLoaders.d.ts +13 -13
  125. package/operations/entry/dataLoaders.js +92 -110
  126. package/operations/entry/dataLoaders.js.map +1 -1
  127. package/operations/entry/feature.d.ts +4 -0
  128. package/operations/entry/feature.js +53 -0
  129. package/operations/entry/feature.js.map +1 -0
  130. package/operations/entry/keys.d.ts +46 -2
  131. package/operations/entry/keys.js +52 -49
  132. package/operations/entry/keys.js.map +1 -1
  133. package/operations/entry/storageEntryUtils.d.ts +8 -0
  134. package/operations/entry/storageEntryUtils.js +25 -0
  135. package/operations/entry/storageEntryUtils.js.map +1 -0
  136. package/operations/group/DdbCreateGroup.d.ts +12 -0
  137. package/operations/group/DdbCreateGroup.js +35 -0
  138. package/operations/group/DdbCreateGroup.js.map +1 -0
  139. package/operations/group/DdbDeleteGroup.d.ts +12 -0
  140. package/operations/group/DdbDeleteGroup.js +31 -0
  141. package/operations/group/DdbDeleteGroup.js.map +1 -0
  142. package/operations/group/DdbGetGroup.d.ts +12 -0
  143. package/operations/group/DdbGetGroup.js +31 -0
  144. package/operations/group/DdbGetGroup.js.map +1 -0
  145. package/operations/group/DdbListGroups.d.ts +14 -0
  146. package/operations/group/DdbListGroups.js +52 -0
  147. package/operations/group/DdbListGroups.js.map +1 -0
  148. package/operations/group/DdbUpdateGroup.d.ts +12 -0
  149. package/operations/group/DdbUpdateGroup.js +35 -0
  150. package/operations/group/DdbUpdateGroup.js.map +1 -0
  151. package/operations/group/feature.d.ts +4 -0
  152. package/operations/group/feature.js +19 -0
  153. package/operations/group/feature.js.map +1 -0
  154. package/operations/group/keys.d.ts +15 -0
  155. package/operations/group/keys.js +17 -0
  156. package/operations/group/keys.js.map +1 -0
  157. package/operations/model/DdbCreateModel.d.ts +12 -0
  158. package/operations/model/DdbCreateModel.js +37 -0
  159. package/operations/model/DdbCreateModel.js.map +1 -0
  160. package/operations/model/DdbDeleteModel.d.ts +12 -0
  161. package/operations/model/DdbDeleteModel.js +31 -0
  162. package/operations/model/DdbDeleteModel.js.map +1 -0
  163. package/operations/model/DdbGetModel.d.ts +12 -0
  164. package/operations/model/DdbGetModel.js +30 -0
  165. package/operations/model/DdbGetModel.js.map +1 -0
  166. package/operations/model/DdbListModels.d.ts +12 -0
  167. package/operations/model/DdbListModels.js +36 -0
  168. package/operations/model/DdbListModels.js.map +1 -0
  169. package/operations/model/DdbUpdateModel.d.ts +12 -0
  170. package/operations/model/DdbUpdateModel.js +36 -0
  171. package/operations/model/DdbUpdateModel.js.map +1 -0
  172. package/operations/model/feature.d.ts +4 -0
  173. package/operations/model/feature.js +19 -0
  174. package/operations/model/feature.js.map +1 -0
  175. package/operations/model/keys.d.ts +15 -0
  176. package/operations/model/keys.js +16 -0
  177. package/operations/model/keys.js.map +1 -0
  178. package/package.json +27 -25
  179. package/requestFeature.d.ts +17 -0
  180. package/requestFeature.js +19 -0
  181. package/requestFeature.js.map +1 -0
  182. package/types.d.ts +11 -51
  183. package/types.js +6 -12
  184. package/types.js.map +1 -1
  185. package/definitions/system.d.ts +0 -10
  186. package/definitions/system.js +0 -42
  187. package/definitions/system.js.map +0 -1
  188. package/dynamoDb/index.d.ts +0 -2
  189. package/dynamoDb/index.js +0 -15
  190. package/dynamoDb/index.js.map +0 -1
  191. package/dynamoDb/path/locationFolderId.d.ts +0 -2
  192. package/dynamoDb/path/locationFolderId.js +0 -43
  193. package/dynamoDb/path/locationFolderId.js.map +0 -1
  194. package/dynamoDb/path/plainObject.d.ts +0 -2
  195. package/dynamoDb/path/plainObject.js +0 -35
  196. package/dynamoDb/path/plainObject.js.map +0 -1
  197. package/dynamoDb/storage/longText.d.ts +0 -10
  198. package/dynamoDb/storage/longText.js +0 -94
  199. package/dynamoDb/storage/longText.js.map +0 -1
  200. package/dynamoDb/storage/richText.d.ts +0 -2
  201. package/dynamoDb/storage/richText.js +0 -61
  202. package/dynamoDb/storage/richText.js.map +0 -1
  203. package/dynamoDb/transformValue/datetime.d.ts +0 -5
  204. package/dynamoDb/transformValue/datetime.js +0 -47
  205. package/dynamoDb/transformValue/datetime.js.map +0 -1
  206. package/operations/entry/dataLoader/types.js.map +0 -1
  207. package/operations/entry/filtering/createExpressions.d.ts +0 -26
  208. package/operations/entry/filtering/createExpressions.js +0 -178
  209. package/operations/entry/filtering/createExpressions.js.map +0 -1
  210. package/operations/entry/filtering/createFields.d.ts +0 -16
  211. package/operations/entry/filtering/createFields.js +0 -108
  212. package/operations/entry/filtering/createFields.js.map +0 -1
  213. package/operations/entry/filtering/extractSort.d.ts +0 -17
  214. package/operations/entry/filtering/extractSort.js +0 -69
  215. package/operations/entry/filtering/extractSort.js.map +0 -1
  216. package/operations/entry/filtering/filter.d.ts +0 -15
  217. package/operations/entry/filtering/filter.js +0 -158
  218. package/operations/entry/filtering/filter.js.map +0 -1
  219. package/operations/entry/filtering/fullTextSearch.d.ts +0 -14
  220. package/operations/entry/filtering/fullTextSearch.js +0 -50
  221. package/operations/entry/filtering/fullTextSearch.js.map +0 -1
  222. package/operations/entry/filtering/getValue.d.ts +0 -5
  223. package/operations/entry/filtering/getValue.js +0 -66
  224. package/operations/entry/filtering/getValue.js.map +0 -1
  225. package/operations/entry/filtering/index.d.ts +0 -2
  226. package/operations/entry/filtering/index.js +0 -21
  227. package/operations/entry/filtering/index.js.map +0 -1
  228. package/operations/entry/filtering/mapPlugins.d.ts +0 -8
  229. package/operations/entry/filtering/mapPlugins.js +0 -33
  230. package/operations/entry/filtering/mapPlugins.js.map +0 -1
  231. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +0 -2
  232. package/operations/entry/filtering/plugins/defaultFilterCreate.js +0 -45
  233. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +0 -1
  234. package/operations/entry/filtering/plugins/index.d.ts +0 -1
  235. package/operations/entry/filtering/plugins/index.js +0 -16
  236. package/operations/entry/filtering/plugins/index.js.map +0 -1
  237. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +0 -2
  238. package/operations/entry/filtering/plugins/objectFilterCreate.js +0 -90
  239. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +0 -1
  240. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +0 -3
  241. package/operations/entry/filtering/plugins/refFilterCreate.js +0 -80
  242. package/operations/entry/filtering/plugins/refFilterCreate.js.map +0 -1
  243. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +0 -2
  244. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +0 -65
  245. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +0 -1
  246. package/operations/entry/filtering/sort.d.ts +0 -12
  247. package/operations/entry/filtering/sort.js +0 -71
  248. package/operations/entry/filtering/sort.js.map +0 -1
  249. package/operations/entry/filtering/systemFields.d.ts +0 -4
  250. package/operations/entry/filtering/systemFields.js +0 -90
  251. package/operations/entry/filtering/systemFields.js.map +0 -1
  252. package/operations/entry/filtering/transform.d.ts +0 -6
  253. package/operations/entry/filtering/transform.js +0 -18
  254. package/operations/entry/filtering/transform.js.map +0 -1
  255. package/operations/entry/filtering/types.d.ts +0 -40
  256. package/operations/entry/filtering/types.js +0 -7
  257. package/operations/entry/filtering/types.js.map +0 -1
  258. package/operations/entry/filtering/values.d.ts +0 -2
  259. package/operations/entry/filtering/values.js +0 -24
  260. package/operations/entry/filtering/values.js.map +0 -1
  261. package/operations/entry/filtering/where.d.ts +0 -5
  262. package/operations/entry/filtering/where.js +0 -35
  263. package/operations/entry/filtering/where.js.map +0 -1
  264. package/operations/entry/index.d.ts +0 -8
  265. package/operations/entry/index.js +0 -1306
  266. package/operations/entry/index.js.map +0 -1
  267. package/operations/group/index.d.ts +0 -9
  268. package/operations/group/index.js +0 -174
  269. package/operations/group/index.js.map +0 -1
  270. package/operations/model/index.d.ts +0 -7
  271. package/operations/model/index.js +0 -150
  272. package/operations/model/index.js.map +0 -1
  273. package/operations/system/index.d.ts +0 -7
  274. package/operations/system/index.js +0 -94
  275. package/operations/system/index.js.map +0 -1
  276. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +0 -23
  277. package/plugins/CmsEntryFieldFilterPathPlugin.js +0 -48
  278. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +0 -1
  279. package/plugins/CmsEntryFieldFilterPlugin.d.ts +0 -43
  280. package/plugins/CmsEntryFieldFilterPlugin.js +0 -27
  281. package/plugins/CmsEntryFieldFilterPlugin.js.map +0 -1
  282. package/plugins/CmsEntryFieldSortingPlugin.d.ts +0 -42
  283. package/plugins/CmsEntryFieldSortingPlugin.js +0 -27
  284. package/plugins/CmsEntryFieldSortingPlugin.js.map +0 -1
  285. package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +0 -11
  286. package/plugins/CmsFieldFilterValueTransformPlugin.js +0 -23
  287. package/plugins/CmsFieldFilterValueTransformPlugin.js.map +0 -1
  288. package/plugins/index.d.ts +0 -4
  289. package/plugins/index.js +0 -51
  290. package/plugins/index.js.map +0 -1
@@ -1,94 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createSystemStorageOperations = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _get = require("@webiny/db-dynamodb/utils/get");
10
- var _dbDynamodb = require("@webiny/db-dynamodb");
11
- const createPartitionKey = ({
12
- tenant
13
- }) => {
14
- return `T#${tenant.toLowerCase()}#SYSTEM`;
15
- };
16
- const createSortKey = () => {
17
- return "CMS";
18
- };
19
- const createKeys = params => {
20
- return {
21
- PK: createPartitionKey(params),
22
- SK: createSortKey()
23
- };
24
- };
25
- const createSystemStorageOperations = params => {
26
- const {
27
- entity
28
- } = params;
29
- const create = async ({
30
- system
31
- }) => {
32
- const keys = createKeys(system);
33
- try {
34
- await (0, _dbDynamodb.put)({
35
- entity,
36
- item: {
37
- ...system,
38
- ...keys
39
- }
40
- });
41
- return system;
42
- } catch (ex) {
43
- throw new _error.default(ex.message || "Could not create system.", ex.code || "CREATE_SYSTEM_ERROR", {
44
- error: ex,
45
- system,
46
- keys
47
- });
48
- }
49
- };
50
- const update = async params => {
51
- const {
52
- system
53
- } = params;
54
- const keys = createKeys(system);
55
- try {
56
- await (0, _dbDynamodb.put)({
57
- entity,
58
- item: {
59
- ...system,
60
- ...keys
61
- }
62
- });
63
- return system;
64
- } catch (ex) {
65
- throw new _error.default(ex.message || "Could not update system.", ex.code || "UPDATE_SYSTEM_ERROR", {
66
- error: ex,
67
- system,
68
- keys
69
- });
70
- }
71
- };
72
- const get = async params => {
73
- const keys = createKeys(params);
74
- try {
75
- return await (0, _get.getClean)({
76
- entity,
77
- keys
78
- });
79
- } catch (ex) {
80
- throw new _error.default(ex.message || "Could not get system.", ex.code || "GET_SYSTEM_ERROR", {
81
- error: ex,
82
- keys
83
- });
84
- }
85
- };
86
- return {
87
- create,
88
- update,
89
- get
90
- };
91
- };
92
- exports.createSystemStorageOperations = createSystemStorageOperations;
93
-
94
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_get","_dbDynamodb","createPartitionKey","tenant","toLowerCase","createSortKey","createKeys","params","PK","SK","createSystemStorageOperations","entity","create","system","keys","put","item","ex","WebinyError","message","code","error","update","get","getClean","exports"],"sources":["index.ts"],"sourcesContent":["import type {\n CmsSystem,\n CmsSystemStorageOperations,\n CmsSystemStorageOperationsCreateParams,\n CmsSystemStorageOperationsGetParams,\n CmsSystemStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport type { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport { getClean } from \"@webiny/db-dynamodb/utils/get\";\nimport { put } from \"@webiny/db-dynamodb\";\n\ninterface CreateSystemStorageOperationsParams {\n entity: Entity<any>;\n}\n\ninterface PartitionKeyParams {\n tenant: string;\n}\nconst createPartitionKey = ({ tenant }: PartitionKeyParams): string => {\n return `T#${tenant.toLowerCase()}#SYSTEM`;\n};\nconst createSortKey = (): string => {\n return \"CMS\";\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey()\n };\n};\n\nexport const createSystemStorageOperations = (\n params: CreateSystemStorageOperationsParams\n): CmsSystemStorageOperations => {\n const { entity } = params;\n\n const create = async ({ system }: CmsSystemStorageOperationsCreateParams) => {\n const keys = createKeys(system);\n try {\n await put({\n entity,\n item: {\n ...system,\n ...keys\n }\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create system.\",\n ex.code || \"CREATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const update = async (params: CmsSystemStorageOperationsUpdateParams) => {\n const { system } = params;\n\n const keys = createKeys(system);\n\n try {\n await put({\n entity,\n item: {\n ...system,\n ...keys\n }\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update system.\",\n ex.code || \"UPDATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsSystemStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n return await getClean<CmsSystem>({\n entity,\n keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get system.\",\n ex.code || \"GET_SYSTEM_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n return {\n create,\n update,\n get\n };\n};\n"],"mappings":";;;;;;;AAQA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,MAAMG,kBAAkB,GAAGA,CAAC;EAAEC;AAA2B,CAAC,KAAa;EACnE,OAAO,KAAKA,MAAM,CAACC,WAAW,CAAC,CAAC,SAAS;AAC7C,CAAC;AACD,MAAMC,aAAa,GAAGA,CAAA,KAAc;EAChC,OAAO,KAAK;AAChB,CAAC;AAMD,MAAMC,UAAU,GAAIC,MAA0B,IAAW;EACrD,OAAO;IACHC,EAAE,EAAEN,kBAAkB,CAACK,MAAM,CAAC;IAC9BE,EAAE,EAAEJ,aAAa,CAAC;EACtB,CAAC;AACL,CAAC;AAEM,MAAMK,6BAA6B,GACtCH,MAA2C,IACd;EAC7B,MAAM;IAAEI;EAAO,CAAC,GAAGJ,MAAM;EAEzB,MAAMK,MAAM,GAAG,MAAAA,CAAO;IAAEC;EAA+C,CAAC,KAAK;IACzE,MAAMC,IAAI,GAAGR,UAAU,CAACO,MAAM,CAAC;IAC/B,IAAI;MACA,MAAM,IAAAE,eAAG,EAAC;QACNJ,MAAM;QACNK,IAAI,EAAE;UACF,GAAGH,MAAM;UACT,GAAGC;QACP;MACJ,CAAC,CAAC;MACF,OAAOD,MAAM;IACjB,CAAC,CAAC,OAAOI,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,0BAA0B,EACxCF,EAAE,CAACG,IAAI,IAAI,qBAAqB,EAChC;QACIC,KAAK,EAAEJ,EAAE;QACTJ,MAAM;QACNC;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMQ,MAAM,GAAG,MAAOf,MAA8C,IAAK;IACrE,MAAM;MAAEM;IAAO,CAAC,GAAGN,MAAM;IAEzB,MAAMO,IAAI,GAAGR,UAAU,CAACO,MAAM,CAAC;IAE/B,IAAI;MACA,MAAM,IAAAE,eAAG,EAAC;QACNJ,MAAM;QACNK,IAAI,EAAE;UACF,GAAGH,MAAM;UACT,GAAGC;QACP;MACJ,CAAC,CAAC;MACF,OAAOD,MAAM;IACjB,CAAC,CAAC,OAAOI,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,0BAA0B,EACxCF,EAAE,CAACG,IAAI,IAAI,qBAAqB,EAChC;QACIC,KAAK,EAAEJ,EAAE;QACTJ,MAAM;QACNC;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMS,GAAG,GAAG,MAAOhB,MAA2C,IAAK;IAC/D,MAAMO,IAAI,GAAGR,UAAU,CAACC,MAAM,CAAC;IAE/B,IAAI;MACA,OAAO,MAAM,IAAAiB,aAAQ,EAAY;QAC7Bb,MAAM;QACNG;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,uBAAuB,EACrCF,EAAE,CAACG,IAAI,IAAI,kBAAkB,EAC7B;QACIC,KAAK,EAAEJ,EAAE;QACTH;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHF,MAAM;IACNU,MAAM;IACNC;EACJ,CAAC;AACL,CAAC;AAACE,OAAA,CAAAf,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -1,23 +0,0 @@
1
- import { Plugin } from "@webiny/plugins/Plugin";
2
- import type { CmsModelField } from "@webiny/api-headless-cms/types";
3
- export interface CreatePathCallableParams {
4
- field: Partial<CmsModelField> & Pick<CmsModelField, "fieldId" | "storageId" | "id">;
5
- index?: number;
6
- }
7
- export interface CreatePathCallable {
8
- (params: CreatePathCallableParams): string;
9
- }
10
- export interface CmsEntryFieldFilterPathPluginParams {
11
- fieldType: string;
12
- fieldId?: string[];
13
- path: string | CreatePathCallable;
14
- canUse?: (field: Pick<CmsModelField, "fieldId" | "type">, parents?: string[]) => boolean;
15
- }
16
- export declare class CmsEntryFieldFilterPathPlugin extends Plugin {
17
- static readonly type: string;
18
- private readonly config;
19
- get fieldType(): string;
20
- constructor(config: CmsEntryFieldFilterPathPluginParams);
21
- canUse(field: Pick<CmsModelField, "fieldId" | "type">, parents: string[]): boolean;
22
- createPath(params: CreatePathCallableParams): string;
23
- }
@@ -1,48 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.CmsEntryFieldFilterPathPlugin = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- var _Plugin = require("@webiny/plugins/Plugin");
10
- class CmsEntryFieldFilterPathPlugin extends _Plugin.Plugin {
11
- static type = "cms-field-filter-path";
12
- get fieldType() {
13
- return this.config.fieldType;
14
- }
15
- constructor(config) {
16
- super();
17
- this.config = config;
18
-
19
- /**
20
- * We expect error here because we know that `this.constructor.type` is defined, but TS does not.
21
- */
22
- // @ts-expect-error
23
- this.name = `${this.constructor.type}-${this.config.fieldType}`;
24
- }
25
- canUse(field, parents) {
26
- if (field.type !== this.config.fieldType) {
27
- return false;
28
- } else if (this.config.canUse) {
29
- return this.config.canUse(field, parents);
30
- }
31
- const fieldId = this.config.fieldId;
32
- if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {
33
- return true;
34
- }
35
- return fieldId.includes(field.fieldId);
36
- }
37
- createPath(params) {
38
- if (typeof this.config.path === "function") {
39
- return this.config.path(params);
40
- } else if (typeof this.config.path === "string") {
41
- return this.config.path;
42
- }
43
- throw new _error.default(`Missing path in "${this.name}" plugin.`);
44
- }
45
- }
46
- exports.CmsEntryFieldFilterPathPlugin = CmsEntryFieldFilterPathPlugin;
47
-
48
- //# sourceMappingURL=CmsEntryFieldFilterPathPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_Plugin","CmsEntryFieldFilterPathPlugin","Plugin","type","fieldType","config","constructor","name","canUse","field","parents","fieldId","Array","isArray","length","includes","createPath","params","path","WebinyError","exports"],"sources":["CmsEntryFieldFilterPathPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins/Plugin\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams {\n field: Partial<CmsModelField> & Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"id\">;\n index?: number;\n}\nexport interface CreatePathCallable {\n (params: CreatePathCallableParams): string;\n}\nexport interface CmsEntryFieldFilterPathPluginParams {\n fieldType: string;\n fieldId?: string[];\n path: string | CreatePathCallable;\n canUse?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents?: string[]) => boolean;\n}\nexport class CmsEntryFieldFilterPathPlugin extends Plugin {\n public static override readonly type: string = \"cms-field-filter-path\";\n\n private readonly config: CmsEntryFieldFilterPathPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(config: CmsEntryFieldFilterPathPluginParams) {\n super();\n\n this.config = config;\n\n /**\n * We expect error here because we know that `this.constructor.type` is defined, but TS does not.\n */\n // @ts-expect-error\n this.name = `${this.constructor.type}-${this.config.fieldType}`;\n }\n\n public canUse(field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents: string[]): boolean {\n if (field.type !== this.config.fieldType) {\n return false;\n } else if (this.config.canUse) {\n return this.config.canUse(field, parents);\n }\n const fieldId = this.config.fieldId;\n if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {\n return true;\n }\n return fieldId.includes(field.fieldId);\n }\n\n public createPath(params: CreatePathCallableParams): string {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n throw new WebinyError(`Missing path in \"${this.name}\" plugin.`);\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAgBO,MAAME,6BAA6B,SAASC,cAAM,CAAC;EACtD,OAAgCC,IAAI,GAAW,uBAAuB;EAItE,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEOE,WAAWA,CAACD,MAA2C,EAAE;IAC5D,KAAK,CAAC,CAAC;IAEP,IAAI,CAACA,MAAM,GAAGA,MAAM;;IAEpB;AACR;AACA;IACQ;IACA,IAAI,CAACE,IAAI,GAAG,GAAG,IAAI,CAACD,WAAW,CAACH,IAAI,IAAI,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;EACnE;EAEOI,MAAMA,CAACC,KAA8C,EAAEC,OAAiB,EAAW;IACtF,IAAID,KAAK,CAACN,IAAI,KAAK,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;MACtC,OAAO,KAAK;IAChB,CAAC,MAAM,IAAI,IAAI,CAACC,MAAM,CAACG,MAAM,EAAE;MAC3B,OAAO,IAAI,CAACH,MAAM,CAACG,MAAM,CAACC,KAAK,EAAEC,OAAO,CAAC;IAC7C;IACA,MAAMC,OAAO,GAAG,IAAI,CAACN,MAAM,CAACM,OAAO;IACnC,IAAI,CAACA,OAAO,IAAIC,KAAK,CAACC,OAAO,CAACF,OAAO,CAAC,KAAK,KAAK,IAAIA,OAAO,CAACG,MAAM,KAAK,CAAC,EAAE;MACtE,OAAO,IAAI;IACf;IACA,OAAOH,OAAO,CAACI,QAAQ,CAACN,KAAK,CAACE,OAAO,CAAC;EAC1C;EAEOK,UAAUA,CAACC,MAAgC,EAAU;IACxD,IAAI,OAAO,IAAI,CAACZ,MAAM,CAACa,IAAI,KAAK,UAAU,EAAE;MACxC,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI,CAACD,MAAM,CAAC;IACnC,CAAC,MAAM,IAAI,OAAO,IAAI,CAACZ,MAAM,CAACa,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI;IAC3B;IACA,MAAM,IAAIC,cAAW,CAAC,oBAAoB,IAAI,CAACZ,IAAI,WAAW,CAAC;EACnE;AACJ;AAACa,OAAA,CAAAnB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -1,43 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import type { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin";
3
- import type { Field } from "../operations/entry/filtering/types";
4
- import type { CmsFieldFilterValueTransformPlugin } from "../types";
5
- /**
6
- * This plugin is used to create the filter.
7
- * Internally we have default one + the one for the reference field - because it is actually an object when filtering.
8
- */
9
- interface CmsEntryFieldFilterPluginParams<T = any> {
10
- fieldType: string;
11
- create: (params: CmsEntryFieldFilterPluginCreateParams<T>) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];
12
- }
13
- interface CmsEntryFieldFilterPluginCreateParams<T = any> {
14
- key: string;
15
- value: T;
16
- field: Field;
17
- fields: Record<string, Field>;
18
- operation: string;
19
- valueFilterPlugins: Record<string, ValueFilterPlugin>;
20
- transformValuePlugins: Record<string, CmsFieldFilterValueTransformPlugin>;
21
- getFilterCreatePlugin: (type: string) => CmsEntryFieldFilterPlugin;
22
- negate: boolean;
23
- compareValue: any;
24
- transformValue: <I = any, O = any>(value: I) => O;
25
- }
26
- export interface CmsEntryFieldFilterPluginCreateResponse {
27
- field: Field;
28
- path: string;
29
- fieldPathId: string;
30
- plugin: ValueFilterPlugin;
31
- negate: boolean;
32
- compareValue: any;
33
- transformValue: <I = any, O = any>(value: I) => O;
34
- }
35
- export declare class CmsEntryFieldFilterPlugin<T = any> extends Plugin {
36
- static readonly type: string;
37
- static readonly ALL: string;
38
- private readonly config;
39
- readonly fieldType: string;
40
- constructor(config: CmsEntryFieldFilterPluginParams<T>);
41
- create(params: CmsEntryFieldFilterPluginCreateParams<T>): CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[] | null;
42
- }
43
- export {};
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CmsEntryFieldFilterPlugin = void 0;
7
- var _plugins = require("@webiny/plugins");
8
- /**
9
- * This plugin is used to create the filter.
10
- * Internally we have default one + the one for the reference field - because it is actually an object when filtering.
11
- */
12
-
13
- class CmsEntryFieldFilterPlugin extends _plugins.Plugin {
14
- static type = "cms.dynamodb.entry.field.filter";
15
- static ALL = "*";
16
- constructor(config) {
17
- super();
18
- this.config = config;
19
- this.fieldType = this.config.fieldType;
20
- }
21
- create(params) {
22
- return this.config.create(params);
23
- }
24
- }
25
- exports.CmsEntryFieldFilterPlugin = CmsEntryFieldFilterPlugin;
26
-
27
- //# sourceMappingURL=CmsEntryFieldFilterPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_plugins","require","CmsEntryFieldFilterPlugin","Plugin","type","ALL","constructor","config","fieldType","create","params","exports"],"sources":["CmsEntryFieldFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport type { Field } from \"~/operations/entry/filtering/types\";\nimport type { CmsFieldFilterValueTransformPlugin } from \"~/types\";\n\n/**\n * This plugin is used to create the filter.\n * Internally we have default one + the one for the reference field - because it is actually an object when filtering.\n */\n\ninterface CmsEntryFieldFilterPluginParams<T = any> {\n fieldType: string;\n create: (\n params: CmsEntryFieldFilterPluginCreateParams<T>\n ) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];\n}\n\ninterface CmsEntryFieldFilterPluginCreateParams<T = any> {\n key: string;\n value: T;\n field: Field;\n fields: Record<string, Field>;\n operation: string;\n valueFilterPlugins: Record<string, ValueFilterPlugin>;\n transformValuePlugins: Record<string, CmsFieldFilterValueTransformPlugin>;\n getFilterCreatePlugin: (type: string) => CmsEntryFieldFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport interface CmsEntryFieldFilterPluginCreateResponse {\n field: Field;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport class CmsEntryFieldFilterPlugin<T = any> extends Plugin {\n public static override readonly type: string = \"cms.dynamodb.entry.field.filter\";\n public static readonly ALL: string = \"*\";\n\n private readonly config: CmsEntryFieldFilterPluginParams<T>;\n\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFieldFilterPluginParams<T>) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public create(params: CmsEntryFieldFilterPluginCreateParams<T>) {\n return this.config.create(params);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;;AAiCO,MAAMC,yBAAyB,SAAkBC,eAAM,CAAC;EAC3D,OAAgCC,IAAI,GAAW,iCAAiC;EAChF,OAAuBC,GAAG,GAAW,GAAG;EAMjCC,WAAWA,CAACC,MAA0C,EAAE;IAC3D,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACD,MAAM,CAACC,SAAS;EAC1C;EAEOC,MAAMA,CAACC,MAAgD,EAAE;IAC5D,OAAO,IAAI,CAACH,MAAM,CAACE,MAAM,CAACC,MAAM,CAAC;EACrC;AACJ;AAACC,OAAA,CAAAT,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1,42 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import type { Field } from "../operations/entry/filtering/types";
3
- import type { CmsModel } from "@webiny/api-headless-cms/types";
4
- interface CmsEntryFieldSortingPluginCanUseParams {
5
- model: CmsModel;
6
- field?: Field;
7
- fieldId: string;
8
- order: "ASC" | "DESC";
9
- /**
10
- * Combination of fieldId and sortBy
11
- *
12
- * example: id_ASC or createdBy_DESC
13
- */
14
- sortBy: string;
15
- }
16
- interface CmsEntryFieldSortingPluginCreateSortParams {
17
- model: CmsModel;
18
- fieldId: string;
19
- order: "ASC" | "DESC";
20
- sortBy: string;
21
- fields: Record<string, Field>;
22
- field?: Field;
23
- }
24
- interface CmsEntryFieldSortingPluginCreateSortResult {
25
- valuePath: string;
26
- reverse: boolean;
27
- fieldId: string;
28
- field: Field;
29
- }
30
- interface CmsEntryFieldSortingPluginConfig {
31
- createSort: (params: CmsEntryFieldSortingPluginCreateSortParams) => CmsEntryFieldSortingPluginCreateSortResult;
32
- canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean;
33
- }
34
- export declare class CmsEntryFieldSortingPlugin extends Plugin {
35
- static readonly type: string;
36
- private readonly config;
37
- constructor(config: CmsEntryFieldSortingPluginConfig);
38
- canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean;
39
- createSort(params: CmsEntryFieldSortingPluginCreateSortParams): CmsEntryFieldSortingPluginCreateSortResult;
40
- }
41
- export declare const createCmsEntryFieldSortingPlugin: (config: CmsEntryFieldSortingPluginConfig) => CmsEntryFieldSortingPlugin;
42
- export {};
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createCmsEntryFieldSortingPlugin = exports.CmsEntryFieldSortingPlugin = void 0;
7
- var _plugins = require("@webiny/plugins");
8
- class CmsEntryFieldSortingPlugin extends _plugins.Plugin {
9
- static type = "cms.entry.field.sorting";
10
- constructor(config) {
11
- super();
12
- this.config = config;
13
- }
14
- canUse(params) {
15
- return this.config.canUse(params);
16
- }
17
- createSort(params) {
18
- return this.config.createSort(params);
19
- }
20
- }
21
- exports.CmsEntryFieldSortingPlugin = CmsEntryFieldSortingPlugin;
22
- const createCmsEntryFieldSortingPlugin = config => {
23
- return new CmsEntryFieldSortingPlugin(config);
24
- };
25
- exports.createCmsEntryFieldSortingPlugin = createCmsEntryFieldSortingPlugin;
26
-
27
- //# sourceMappingURL=CmsEntryFieldSortingPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_plugins","require","CmsEntryFieldSortingPlugin","Plugin","type","constructor","config","canUse","params","createSort","exports","createCmsEntryFieldSortingPlugin"],"sources":["CmsEntryFieldSortingPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Field } from \"~/operations/entry/filtering/types\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface CmsEntryFieldSortingPluginCanUseParams {\n model: CmsModel;\n field?: Field;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n /**\n * Combination of fieldId and sortBy\n *\n * example: id_ASC or createdBy_DESC\n */\n sortBy: string;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortParams {\n model: CmsModel;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n sortBy: string;\n fields: Record<string, Field>;\n field?: Field;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortResult {\n valuePath: string;\n reverse: boolean;\n fieldId: string;\n field: Field;\n}\n\ninterface CmsEntryFieldSortingPluginConfig {\n createSort: (\n params: CmsEntryFieldSortingPluginCreateSortParams\n ) => CmsEntryFieldSortingPluginCreateSortResult;\n canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean;\n}\n\nexport class CmsEntryFieldSortingPlugin extends Plugin {\n public static override readonly type: string = \"cms.entry.field.sorting\";\n private readonly config: CmsEntryFieldSortingPluginConfig;\n\n public constructor(config: CmsEntryFieldSortingPluginConfig) {\n super();\n this.config = config;\n }\n\n public canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean {\n return this.config.canUse(params);\n }\n\n public createSort(\n params: CmsEntryFieldSortingPluginCreateSortParams\n ): CmsEntryFieldSortingPluginCreateSortResult {\n return this.config.createSort(params);\n }\n}\n\nexport const createCmsEntryFieldSortingPlugin = (config: CmsEntryFieldSortingPluginConfig) => {\n return new CmsEntryFieldSortingPlugin(config);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAwCO,MAAMC,0BAA0B,SAASC,eAAM,CAAC;EACnD,OAAgCC,IAAI,GAAW,yBAAyB;EAGjEC,WAAWA,CAACC,MAAwC,EAAE;IACzD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOC,MAAMA,CAACC,MAA8C,EAAW;IACnE,OAAO,IAAI,CAACF,MAAM,CAACC,MAAM,CAACC,MAAM,CAAC;EACrC;EAEOC,UAAUA,CACbD,MAAkD,EACR;IAC1C,OAAO,IAAI,CAACF,MAAM,CAACG,UAAU,CAACD,MAAM,CAAC;EACzC;AACJ;AAACE,OAAA,CAAAR,0BAAA,GAAAA,0BAAA;AAEM,MAAMS,gCAAgC,GAAIL,MAAwC,IAAK;EAC1F,OAAO,IAAIJ,0BAA0B,CAACI,MAAM,CAAC;AACjD,CAAC;AAACI,OAAA,CAAAC,gCAAA,GAAAA,gCAAA","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import type { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from "../types";
3
- type CmsFieldFilterValueTransformPluginParams = Omit<CmsFieldFilterValueTransformPluginInterface, "type">;
4
- export declare class CmsFieldFilterValueTransformPlugin extends Plugin implements Omit<CmsFieldFilterValueTransformPluginInterface, "type"> {
5
- static type: string;
6
- private config;
7
- get fieldType(): string;
8
- get transform(): CmsFieldFilterValueTransformPluginParams["transform"];
9
- constructor(config: CmsFieldFilterValueTransformPluginParams);
10
- }
11
- export {};
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.CmsFieldFilterValueTransformPlugin = void 0;
7
- var _plugins = require("@webiny/plugins");
8
- class CmsFieldFilterValueTransformPlugin extends _plugins.Plugin {
9
- static type = "cms-field-filter-value-transform";
10
- get fieldType() {
11
- return this.config.fieldType;
12
- }
13
- get transform() {
14
- return this.config.transform;
15
- }
16
- constructor(config) {
17
- super();
18
- this.config = config;
19
- }
20
- }
21
- exports.CmsFieldFilterValueTransformPlugin = CmsFieldFilterValueTransformPlugin;
22
-
23
- //# sourceMappingURL=CmsFieldFilterValueTransformPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_plugins","require","CmsFieldFilterValueTransformPlugin","Plugin","type","fieldType","config","transform","constructor","exports"],"sources":["CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from \"~/types\";\n\ntype CmsFieldFilterValueTransformPluginParams = Omit<\n CmsFieldFilterValueTransformPluginInterface,\n \"type\"\n>;\nexport class CmsFieldFilterValueTransformPlugin\n extends Plugin\n implements Omit<CmsFieldFilterValueTransformPluginInterface, \"type\">\n{\n public static override type = \"cms-field-filter-value-transform\";\n\n private config: CmsFieldFilterValueTransformPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public get transform(): CmsFieldFilterValueTransformPluginParams[\"transform\"] {\n return this.config.transform;\n }\n\n public constructor(config: CmsFieldFilterValueTransformPluginParams) {\n super();\n this.config = config;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,kCAAkC,SACnCC,eAAM,CAElB;EACI,OAAuBC,IAAI,GAAG,kCAAkC;EAIhE,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEA,IAAWE,SAASA,CAAA,EAA0D;IAC1E,OAAO,IAAI,CAACD,MAAM,CAACC,SAAS;EAChC;EAEOC,WAAWA,CAACF,MAAgD,EAAE;IACjE,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;AACJ;AAACG,OAAA,CAAAP,kCAAA,GAAAA,kCAAA","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- export * from "./CmsEntryFieldFilterPathPlugin";
2
- export * from "./CmsEntryFieldSortingPlugin";
3
- export * from "./CmsEntryFieldFilterPlugin";
4
- export * from "./CmsFieldFilterValueTransformPlugin";
package/plugins/index.js DELETED
@@ -1,51 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _CmsEntryFieldFilterPathPlugin = require("./CmsEntryFieldFilterPathPlugin");
7
- Object.keys(_CmsEntryFieldFilterPathPlugin).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _CmsEntryFieldFilterPathPlugin[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _CmsEntryFieldFilterPathPlugin[key];
14
- }
15
- });
16
- });
17
- var _CmsEntryFieldSortingPlugin = require("./CmsEntryFieldSortingPlugin");
18
- Object.keys(_CmsEntryFieldSortingPlugin).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _CmsEntryFieldSortingPlugin[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _CmsEntryFieldSortingPlugin[key];
25
- }
26
- });
27
- });
28
- var _CmsEntryFieldFilterPlugin = require("./CmsEntryFieldFilterPlugin");
29
- Object.keys(_CmsEntryFieldFilterPlugin).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _CmsEntryFieldFilterPlugin[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _CmsEntryFieldFilterPlugin[key];
36
- }
37
- });
38
- });
39
- var _CmsFieldFilterValueTransformPlugin = require("./CmsFieldFilterValueTransformPlugin");
40
- Object.keys(_CmsFieldFilterValueTransformPlugin).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _CmsFieldFilterValueTransformPlugin[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _CmsFieldFilterValueTransformPlugin[key];
47
- }
48
- });
49
- });
50
-
51
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_CmsEntryFieldFilterPathPlugin","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CmsEntryFieldSortingPlugin","_CmsEntryFieldFilterPlugin","_CmsFieldFilterValueTransformPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin\";\nexport * from \"./CmsEntryFieldSortingPlugin\";\nexport * from \"./CmsEntryFieldFilterPlugin\";\nexport * from \"./CmsFieldFilterValueTransformPlugin\";\n"],"mappings":";;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,8BAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,8BAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,8BAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,2BAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,2BAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,2BAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,2BAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,0BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,0BAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,0BAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,0BAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,mCAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,mCAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,mCAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,mCAAA,CAAAP,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}