@webiny/api-headless-cms-ddb 0.0.0-unstable.e6f0dc8ca7 → 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 (267) 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 +4 -0
  25. package/definitions/types.js +0 -3
  26. package/index.d.ts +17 -2
  27. package/index.js +31 -88
  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.js +22 -26
  96. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  97. package/operations/entry/dataLoader/constants.js +2 -1
  98. package/operations/entry/dataLoader/constants.js.map +1 -1
  99. package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
  100. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  101. package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -29
  102. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  103. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +31 -41
  104. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  105. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +31 -41
  106. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  107. package/operations/entry/dataLoader/getRevisionById.js +33 -47
  108. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  109. package/operations/entry/dataLoader/index.js +8 -9
  110. package/operations/entry/dataLoader/index.js.map +1 -1
  111. package/operations/entry/dataLoader/types.js +0 -3
  112. package/operations/entry/dataLoaders.d.ts +7 -6
  113. package/operations/entry/dataLoaders.js +89 -99
  114. package/operations/entry/dataLoaders.js.map +1 -1
  115. package/operations/entry/feature.d.ts +4 -0
  116. package/operations/entry/feature.js +53 -0
  117. package/operations/entry/feature.js.map +1 -0
  118. package/operations/entry/keys.d.ts +6 -0
  119. package/operations/entry/keys.js +57 -77
  120. package/operations/entry/keys.js.map +1 -1
  121. package/operations/entry/storageEntryUtils.d.ts +8 -0
  122. package/operations/entry/storageEntryUtils.js +25 -0
  123. package/operations/entry/storageEntryUtils.js.map +1 -0
  124. package/operations/group/DdbCreateGroup.d.ts +12 -0
  125. package/operations/group/DdbCreateGroup.js +35 -0
  126. package/operations/group/DdbCreateGroup.js.map +1 -0
  127. package/operations/group/DdbDeleteGroup.d.ts +12 -0
  128. package/operations/group/DdbDeleteGroup.js +31 -0
  129. package/operations/group/DdbDeleteGroup.js.map +1 -0
  130. package/operations/group/DdbGetGroup.d.ts +12 -0
  131. package/operations/group/DdbGetGroup.js +31 -0
  132. package/operations/group/DdbGetGroup.js.map +1 -0
  133. package/operations/group/DdbListGroups.d.ts +14 -0
  134. package/operations/group/DdbListGroups.js +52 -0
  135. package/operations/group/DdbListGroups.js.map +1 -0
  136. package/operations/group/DdbUpdateGroup.d.ts +12 -0
  137. package/operations/group/DdbUpdateGroup.js +35 -0
  138. package/operations/group/DdbUpdateGroup.js.map +1 -0
  139. package/operations/group/feature.d.ts +4 -0
  140. package/operations/group/feature.js +19 -0
  141. package/operations/group/feature.js.map +1 -0
  142. package/operations/group/keys.d.ts +15 -0
  143. package/operations/group/keys.js +17 -0
  144. package/operations/group/keys.js.map +1 -0
  145. package/operations/model/DdbCreateModel.d.ts +12 -0
  146. package/operations/model/DdbCreateModel.js +37 -0
  147. package/operations/model/DdbCreateModel.js.map +1 -0
  148. package/operations/model/DdbDeleteModel.d.ts +12 -0
  149. package/operations/model/DdbDeleteModel.js +31 -0
  150. package/operations/model/DdbDeleteModel.js.map +1 -0
  151. package/operations/model/DdbGetModel.d.ts +12 -0
  152. package/operations/model/DdbGetModel.js +30 -0
  153. package/operations/model/DdbGetModel.js.map +1 -0
  154. package/operations/model/DdbListModels.d.ts +12 -0
  155. package/operations/model/DdbListModels.js +36 -0
  156. package/operations/model/DdbListModels.js.map +1 -0
  157. package/operations/model/DdbUpdateModel.d.ts +12 -0
  158. package/operations/model/DdbUpdateModel.js +36 -0
  159. package/operations/model/DdbUpdateModel.js.map +1 -0
  160. package/operations/model/feature.d.ts +4 -0
  161. package/operations/model/feature.js +19 -0
  162. package/operations/model/feature.js.map +1 -0
  163. package/operations/model/keys.d.ts +15 -0
  164. package/operations/model/keys.js +16 -0
  165. package/operations/model/keys.js.map +1 -0
  166. package/package.json +22 -24
  167. package/requestFeature.d.ts +17 -0
  168. package/requestFeature.js +19 -0
  169. package/requestFeature.js.map +1 -0
  170. package/types.d.ts +10 -50
  171. package/types.js +6 -5
  172. package/types.js.map +1 -1
  173. package/definitions/types.js.map +0 -1
  174. package/dynamoDb/index.d.ts +0 -2
  175. package/dynamoDb/index.js +0 -6
  176. package/dynamoDb/index.js.map +0 -1
  177. package/dynamoDb/path/locationFolderId.d.ts +0 -2
  178. package/dynamoDb/path/locationFolderId.js +0 -34
  179. package/dynamoDb/path/locationFolderId.js.map +0 -1
  180. package/dynamoDb/path/plainObject.d.ts +0 -2
  181. package/dynamoDb/path/plainObject.js +0 -26
  182. package/dynamoDb/path/plainObject.js.map +0 -1
  183. package/dynamoDb/transformValue/datetime.d.ts +0 -5
  184. package/dynamoDb/transformValue/datetime.js +0 -40
  185. package/dynamoDb/transformValue/datetime.js.map +0 -1
  186. package/operations/entry/dataLoader/types.js.map +0 -1
  187. package/operations/entry/filtering/createExpressions.d.ts +0 -27
  188. package/operations/entry/filtering/createExpressions.js +0 -172
  189. package/operations/entry/filtering/createExpressions.js.map +0 -1
  190. package/operations/entry/filtering/createFields.d.ts +0 -16
  191. package/operations/entry/filtering/createFields.js +0 -106
  192. package/operations/entry/filtering/createFields.js.map +0 -1
  193. package/operations/entry/filtering/extractSort.d.ts +0 -17
  194. package/operations/entry/filtering/extractSort.js +0 -84
  195. package/operations/entry/filtering/extractSort.js.map +0 -1
  196. package/operations/entry/filtering/filter.d.ts +0 -16
  197. package/operations/entry/filtering/filter.js +0 -153
  198. package/operations/entry/filtering/filter.js.map +0 -1
  199. package/operations/entry/filtering/fullTextSearch.d.ts +0 -14
  200. package/operations/entry/filtering/fullTextSearch.js +0 -42
  201. package/operations/entry/filtering/fullTextSearch.js.map +0 -1
  202. package/operations/entry/filtering/getValue.d.ts +0 -5
  203. package/operations/entry/filtering/getValue.js +0 -59
  204. package/operations/entry/filtering/getValue.js.map +0 -1
  205. package/operations/entry/filtering/index.d.ts +0 -2
  206. package/operations/entry/filtering/index.js +0 -4
  207. package/operations/entry/filtering/index.js.map +0 -1
  208. package/operations/entry/filtering/mapPlugins.d.ts +0 -8
  209. package/operations/entry/filtering/mapPlugins.js +0 -25
  210. package/operations/entry/filtering/mapPlugins.js.map +0 -1
  211. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +0 -2
  212. package/operations/entry/filtering/plugins/defaultFilterCreate.js +0 -37
  213. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +0 -1
  214. package/operations/entry/filtering/plugins/index.d.ts +0 -1
  215. package/operations/entry/filtering/plugins/index.js +0 -9
  216. package/operations/entry/filtering/plugins/index.js.map +0 -1
  217. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +0 -2
  218. package/operations/entry/filtering/plugins/objectFilterCreate.js +0 -84
  219. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +0 -1
  220. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +0 -3
  221. package/operations/entry/filtering/plugins/refFilterCreate.js +0 -74
  222. package/operations/entry/filtering/plugins/refFilterCreate.js.map +0 -1
  223. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +0 -2
  224. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +0 -62
  225. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +0 -1
  226. package/operations/entry/filtering/sort.d.ts +0 -12
  227. package/operations/entry/filtering/sort.js +0 -67
  228. package/operations/entry/filtering/sort.js.map +0 -1
  229. package/operations/entry/filtering/systemFields.d.ts +0 -2
  230. package/operations/entry/filtering/systemFields.js +0 -131
  231. package/operations/entry/filtering/systemFields.js.map +0 -1
  232. package/operations/entry/filtering/transform.d.ts +0 -6
  233. package/operations/entry/filtering/transform.js +0 -11
  234. package/operations/entry/filtering/transform.js.map +0 -1
  235. package/operations/entry/filtering/types.d.ts +0 -40
  236. package/operations/entry/filtering/types.js +0 -3
  237. package/operations/entry/filtering/types.js.map +0 -1
  238. package/operations/entry/filtering/values.d.ts +0 -2
  239. package/operations/entry/filtering/values.js +0 -16
  240. package/operations/entry/filtering/values.js.map +0 -1
  241. package/operations/entry/filtering/where.d.ts +0 -5
  242. package/operations/entry/filtering/where.js +0 -28
  243. package/operations/entry/filtering/where.js.map +0 -1
  244. package/operations/entry/index.d.ts +0 -9
  245. package/operations/entry/index.js +0 -1197
  246. package/operations/entry/index.js.map +0 -1
  247. package/operations/group/index.d.ts +0 -8
  248. package/operations/group/index.js +0 -142
  249. package/operations/group/index.js.map +0 -1
  250. package/operations/model/index.d.ts +0 -7
  251. package/operations/model/index.js +0 -127
  252. package/operations/model/index.js.map +0 -1
  253. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +0 -23
  254. package/plugins/CmsEntryFieldFilterPathPlugin.js +0 -40
  255. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +0 -1
  256. package/plugins/CmsEntryFieldFilterPlugin.d.ts +0 -43
  257. package/plugins/CmsEntryFieldFilterPlugin.js +0 -21
  258. package/plugins/CmsEntryFieldFilterPlugin.js.map +0 -1
  259. package/plugins/CmsEntryFieldSortingPlugin.d.ts +0 -42
  260. package/plugins/CmsEntryFieldSortingPlugin.js +0 -19
  261. package/plugins/CmsEntryFieldSortingPlugin.js.map +0 -1
  262. package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +0 -11
  263. package/plugins/CmsFieldFilterValueTransformPlugin.js +0 -16
  264. package/plugins/CmsFieldFilterValueTransformPlugin.js.map +0 -1
  265. package/plugins/index.d.ts +0 -4
  266. package/plugins/index.js +0 -6
  267. package/plugins/index.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","CmsEntryFieldFilterPathPlugin","createPath","field","path","settings","createLocationFolderIdPathPlugin","fieldType","canUse","parents","fieldId","length"],"sources":["locationFolderId.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport type { CreatePathCallable } from \"~/plugins/CmsEntryFieldFilterPathPlugin.js\";\nimport { CmsEntryFieldFilterPathPlugin } from \"~/plugins/CmsEntryFieldFilterPathPlugin.js\";\n\nconst createPath: CreatePathCallable = ({ field }) => {\n const { path } = field.settings || {};\n if (!path) {\n throw new WebinyError(\"Missing path settings value.\", \"FIELD_SETTINGS_ERROR\", {\n field\n });\n }\n return path;\n};\n\nexport const createLocationFolderIdPathPlugin = (): CmsEntryFieldFilterPathPlugin => {\n return new CmsEntryFieldFilterPathPlugin({\n fieldType: \"text\",\n path: createPath,\n canUse: (field, parents) => {\n if (field.fieldId !== \"folderId\") {\n return false;\n } else if (!parents?.length) {\n return false;\n }\n return parents[0] === \"wbyAco_location\";\n }\n });\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SAASC,6BAA6B;AAEtC,MAAMC,UAA8B,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EAClD,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK,CAACE,QAAQ,IAAI,CAAC,CAAC;EACrC,IAAI,CAACD,IAAI,EAAE;IACP,MAAM,IAAIJ,WAAW,CAAC,8BAA8B,EAAE,sBAAsB,EAAE;MAC1EG;IACJ,CAAC,CAAC;EACN;EACA,OAAOC,IAAI;AACf,CAAC;AAED,OAAO,MAAME,gCAAgC,GAAGA,CAAA,KAAqC;EACjF,OAAO,IAAIL,6BAA6B,CAAC;IACrCM,SAAS,EAAE,MAAM;IACjBH,IAAI,EAAEF,UAAU;IAChBM,MAAM,EAAEA,CAACL,KAAK,EAAEM,OAAO,KAAK;MACxB,IAAIN,KAAK,CAACO,OAAO,KAAK,UAAU,EAAE;QAC9B,OAAO,KAAK;MAChB,CAAC,MAAM,IAAI,CAACD,OAAO,EAAEE,MAAM,EAAE;QACzB,OAAO,KAAK;MAChB;MACA,OAAOF,OAAO,CAAC,CAAC,CAAC,KAAK,iBAAiB;IAC3C;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
2
- export declare const createPlainObjectPathPlugin: () => CmsEntryFieldFilterPathPlugin;
@@ -1,26 +0,0 @@
1
- /**
2
- * File is @internal
3
- */
4
- import WebinyError from "@webiny/error";
5
- import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
6
- const createPath = ({
7
- field
8
- }) => {
9
- const {
10
- path
11
- } = field.settings || {};
12
- if (!path) {
13
- throw new WebinyError("Missing path settings value.", "FIELD_SETTINGS_ERROR", {
14
- field
15
- });
16
- }
17
- return path;
18
- };
19
- export const createPlainObjectPathPlugin = () => {
20
- return new CmsEntryFieldFilterPathPlugin({
21
- fieldType: "plainObject",
22
- path: createPath
23
- });
24
- };
25
-
26
- //# sourceMappingURL=plainObject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","CmsEntryFieldFilterPathPlugin","createPath","field","path","settings","createPlainObjectPathPlugin","fieldType"],"sources":["plainObject.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport type { CreatePathCallable } from \"~/plugins/CmsEntryFieldFilterPathPlugin.js\";\nimport { CmsEntryFieldFilterPathPlugin } from \"~/plugins/CmsEntryFieldFilterPathPlugin.js\";\n\nconst createPath: CreatePathCallable = ({ field }) => {\n const { path } = field.settings || {};\n if (!path) {\n throw new WebinyError(\"Missing path settings value.\", \"FIELD_SETTINGS_ERROR\", {\n field\n });\n }\n return path;\n};\n\nexport const createPlainObjectPathPlugin = (): CmsEntryFieldFilterPathPlugin => {\n return new CmsEntryFieldFilterPathPlugin({\n fieldType: \"plainObject\",\n path: createPath\n });\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SAASC,6BAA6B;AAEtC,MAAMC,UAA8B,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EAClD,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK,CAACE,QAAQ,IAAI,CAAC,CAAC;EACrC,IAAI,CAACD,IAAI,EAAE;IACP,MAAM,IAAIJ,WAAW,CAAC,8BAA8B,EAAE,sBAAsB,EAAE;MAC1EG;IACJ,CAAC,CAAC;EACN;EACA,OAAOC,IAAI;AACf,CAAC;AAED,OAAO,MAAME,2BAA2B,GAAGA,CAAA,KAAqC;EAC5E,OAAO,IAAIL,6BAA6B,CAAC;IACrCM,SAAS,EAAE,aAAa;IACxBH,IAAI,EAAEF;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- /**
2
- * File is @internal
3
- */
4
- import type { CmsFieldFilterValueTransformPlugin } from "../../types.js";
5
- export declare const createDatetimeTransformValuePlugin: () => CmsFieldFilterValueTransformPlugin;
@@ -1,40 +0,0 @@
1
- /**
2
- * File is @internal
3
- */
4
-
5
- import { TimeTransformPlugin } from "@webiny/db-dynamodb/plugins/definitions/TimeTransformPlugin.js";
6
- import { DateTimeTransformPlugin } from "@webiny/db-dynamodb/plugins/definitions/DateTimeTransformPlugin.js";
7
- const timeTransformer = new TimeTransformPlugin({
8
- fields: ["*"]
9
- });
10
- const dateTimeTransformer = new DateTimeTransformPlugin({
11
- fields: ["*"]
12
- });
13
- export const createDatetimeTransformValuePlugin = () => {
14
- return {
15
- type: "cms-field-filter-value-transform",
16
- name: "cms-field-value-filter-transform-datetime",
17
- fieldType: "datetime",
18
- /**
19
- * Always transform into the milliseconds.
20
- */
21
- transform: ({
22
- field,
23
- value
24
- }) => {
25
- const {
26
- type
27
- } = field.settings || {};
28
- if (type === "time") {
29
- return timeTransformer.transform({
30
- value
31
- });
32
- }
33
- return dateTimeTransformer.transform({
34
- value
35
- });
36
- }
37
- };
38
- };
39
-
40
- //# sourceMappingURL=datetime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TimeTransformPlugin","DateTimeTransformPlugin","timeTransformer","fields","dateTimeTransformer","createDatetimeTransformValuePlugin","type","name","fieldType","transform","field","value","settings"],"sources":["datetime.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport type { CmsFieldFilterValueTransformPlugin } from \"~/types.js\";\nimport { TimeTransformPlugin } from \"@webiny/db-dynamodb/plugins/definitions/TimeTransformPlugin.js\";\nimport { DateTimeTransformPlugin } from \"@webiny/db-dynamodb/plugins/definitions/DateTimeTransformPlugin.js\";\n\nconst timeTransformer = new TimeTransformPlugin({\n fields: [\"*\"]\n});\nconst dateTimeTransformer = new DateTimeTransformPlugin({\n fields: [\"*\"]\n});\n\nexport const createDatetimeTransformValuePlugin = (): CmsFieldFilterValueTransformPlugin => {\n return {\n type: \"cms-field-filter-value-transform\",\n name: \"cms-field-value-filter-transform-datetime\",\n fieldType: \"datetime\",\n /**\n * Always transform into the milliseconds.\n */\n transform: ({ field, value }) => {\n const { type } = field.settings || {};\n if (type === \"time\") {\n return timeTransformer.transform({\n value\n });\n }\n return dateTimeTransformer.transform({\n value\n });\n }\n };\n};\n"],"mappings":"AAAA;AACA;AACA;;AAEA,SAASA,mBAAmB,QAAQ,gEAAgE;AACpG,SAASC,uBAAuB,QAAQ,oEAAoE;AAE5G,MAAMC,eAAe,GAAG,IAAIF,mBAAmB,CAAC;EAC5CG,MAAM,EAAE,CAAC,GAAG;AAChB,CAAC,CAAC;AACF,MAAMC,mBAAmB,GAAG,IAAIH,uBAAuB,CAAC;EACpDE,MAAM,EAAE,CAAC,GAAG;AAChB,CAAC,CAAC;AAEF,OAAO,MAAME,kCAAkC,GAAGA,CAAA,KAA0C;EACxF,OAAO;IACHC,IAAI,EAAE,kCAAkC;IACxCC,IAAI,EAAE,2CAA2C;IACjDC,SAAS,EAAE,UAAU;IACrB;AACR;AACA;IACQC,SAAS,EAAEA,CAAC;MAAEC,KAAK;MAAEC;IAAM,CAAC,KAAK;MAC7B,MAAM;QAAEL;MAAK,CAAC,GAAGI,KAAK,CAACE,QAAQ,IAAI,CAAC,CAAC;MACrC,IAAIN,IAAI,KAAK,MAAM,EAAE;QACjB,OAAOJ,eAAe,CAACO,SAAS,CAAC;UAC7BE;QACJ,CAAC,CAAC;MACN;MACA,OAAOP,mBAAmB,CAACK,SAAS,CAAC;QACjCE;MACJ,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntryEntity } from \"~/definitions/types.js\";\n\nexport interface IDataLoaderParams {\n entity: IEntryEntity;\n tenant: string;\n modelId: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,27 +0,0 @@
1
- import type { CmsContext, CmsEntryListWhere } from "@webiny/api-headless-cms/types/index.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
- import type { Field } from "./types.js";
4
- import { ValueFilter } from "@webiny/db-dynamodb/feature/ValueFilter/index.js";
5
- interface ICreateExpressionsParams {
6
- plugins: PluginsContainer;
7
- container: CmsContext["container"];
8
- where: Partial<CmsEntryListWhere>;
9
- fields: Record<string, Field>;
10
- }
11
- export type ExpressionCondition = "AND" | "OR";
12
- export interface Expression {
13
- expressions: Expression[];
14
- filters: Filter[];
15
- condition: ExpressionCondition;
16
- }
17
- export interface Filter {
18
- field: Field;
19
- path: string;
20
- fieldPathId: string;
21
- filter: ValueFilter.Interface;
22
- negate: boolean;
23
- compareValue: any;
24
- transformValue: <I = any, O = any>(value: I) => O;
25
- }
26
- export declare const createExpressions: (params: ICreateExpressionsParams) => Expression;
27
- export {};
@@ -1,172 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { getMappedPlugins } from "./mapPlugins.js";
3
- import { extractWhereParams } from "./where.js";
4
- import { transformValue } from "./transform.js";
5
- import { CmsEntryFieldFilterPlugin } from "../../../plugins/CmsEntryFieldFilterPlugin.js";
6
- import { getWhereValues } from "./values.js";
7
- import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
8
- import { ValueFilterRegistry } from "@webiny/db-dynamodb/exports/api/db.js";
9
- export const createExpressions = params => {
10
- const {
11
- where,
12
- plugins,
13
- fields,
14
- container
15
- } = params;
16
- const valueFilterRegistry = container.resolve(ValueFilterRegistry);
17
- const transformValuePlugins = getMappedPlugins({
18
- plugins,
19
- type: "cms-field-filter-value-transform",
20
- property: "fieldType"
21
- });
22
- const fieldFilterCreatePlugins = getMappedPlugins({
23
- plugins,
24
- type: CmsEntryFieldFilterPlugin.type,
25
- property: "fieldType"
26
- });
27
- const defaultFilterCreatePlugin = fieldFilterCreatePlugins["*"];
28
- const getFilterCreatePlugin = type => {
29
- const fieldType = getBaseFieldType({
30
- type
31
- });
32
- const filterCreatePlugin = fieldFilterCreatePlugins[fieldType] || defaultFilterCreatePlugin;
33
- if (filterCreatePlugin) {
34
- return filterCreatePlugin;
35
- }
36
- throw new WebinyError(`There is no filter create plugin for the field type "${fieldType}".`, "MISSING_FILTER_CREATE_PLUGIN", {
37
- fieldType
38
- });
39
- };
40
- const createExpression = ({
41
- where,
42
- condition
43
- }) => {
44
- const expression = {
45
- filters: [],
46
- expressions: [],
47
- condition
48
- };
49
- for (const key in where) {
50
- const value = where[key];
51
- if (value === undefined) {
52
- continue;
53
- }
54
-
55
- /**
56
- * If there are "AND" or "OR" keys, let's sort them out first.
57
- *
58
- *
59
- * AND conditional
60
- */
61
- if (key === "AND") {
62
- const childWhereList = getWhereValues(value, key);
63
- const childExpression = {
64
- condition: "AND",
65
- filters: [],
66
- expressions: []
67
- };
68
- for (const childWhere of childWhereList) {
69
- const result = createExpression({
70
- where: childWhere,
71
- condition: "AND"
72
- });
73
- childExpression.expressions.push(result);
74
- }
75
- expression.expressions.push(childExpression);
76
- continue;
77
- }
78
- /**
79
- * OR conditional
80
- */
81
- if (key === "OR") {
82
- const childWhereList = getWhereValues(value, key);
83
- const childExpression = {
84
- condition: "OR",
85
- filters: [],
86
- expressions: []
87
- };
88
- for (const childWhere of childWhereList) {
89
- const result = createExpression({
90
- where: childWhere,
91
- condition: "AND"
92
- });
93
- childExpression.expressions.push(result);
94
- }
95
- expression.expressions.push(childExpression);
96
- continue;
97
- }
98
- const whereParams = extractWhereParams(key);
99
- if (!whereParams) {
100
- continue;
101
- }
102
- const {
103
- fieldId,
104
- operation,
105
- negate
106
- } = whereParams;
107
- const field = fields[fieldId];
108
- if (!field) {
109
- throw new WebinyError(`There is no field with the fieldId "${fieldId}".`, "FIELD_ERROR", {
110
- fieldId
111
- });
112
- }
113
-
114
- /**
115
- * We need a filter create plugin for this type.
116
- */
117
- const filterCreatePlugin = getFilterCreatePlugin(field.type);
118
- const fieldType = getBaseFieldType(field);
119
- const transformValuePlugin = transformValuePlugins[fieldType];
120
- const transformValueCallable = value => {
121
- if (!transformValuePlugin) {
122
- return value;
123
- }
124
- return transformValuePlugin.transform({
125
- field,
126
- value
127
- });
128
- };
129
- const result = filterCreatePlugin.create({
130
- key,
131
- value,
132
- valueFilterRegistry,
133
- transformValuePlugins,
134
- getFilterCreatePlugin,
135
- operation,
136
- negate,
137
- field,
138
- fields,
139
- compareValue: transformValue({
140
- value,
141
- transform: transformValueCallable
142
- }),
143
- transformValue: transformValueCallable
144
- });
145
- /**
146
- * There is a possibility of
147
- * - no result
148
- * - result being an array
149
- * - result being an object
150
- */
151
- if (!result || Array.isArray(result) && result.length === 0) {
152
- continue;
153
- }
154
- expression.filters.push(...(Array.isArray(result) ? result : [result]));
155
- }
156
- return expression;
157
- };
158
- const expression = createExpression({
159
- where,
160
- condition: "AND"
161
- });
162
- /**
163
- * If the first expression has no filters and has only one expression, put that expression as main one.
164
- * This will mostly be used when having an OR condition as the single expression in the root level of the where
165
- */
166
- if (expression.filters.length > 0 || expression.expressions.length !== 1) {
167
- return expression;
168
- }
169
- return expression.expressions[0];
170
- };
171
-
172
- //# sourceMappingURL=createExpressions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","getMappedPlugins","extractWhereParams","transformValue","CmsEntryFieldFilterPlugin","getWhereValues","getBaseFieldType","ValueFilterRegistry","createExpressions","params","where","plugins","fields","container","valueFilterRegistry","resolve","transformValuePlugins","type","property","fieldFilterCreatePlugins","defaultFilterCreatePlugin","getFilterCreatePlugin","fieldType","filterCreatePlugin","createExpression","condition","expression","filters","expressions","key","value","undefined","childWhereList","childExpression","childWhere","result","push","whereParams","fieldId","operation","negate","field","transformValuePlugin","transformValueCallable","transform","create","compareValue","Array","isArray","length"],"sources":["createExpressions.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { CmsContext, CmsEntryListWhere } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsFieldFilterValueTransformPlugin } from \"~/types.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { Field } from \"./types.js\";\nimport { getMappedPlugins } from \"./mapPlugins.js\";\nimport { extractWhereParams } from \"./where.js\";\nimport { transformValue } from \"./transform.js\";\nimport { CmsEntryFieldFilterPlugin } from \"~/plugins/CmsEntryFieldFilterPlugin.js\";\nimport { getWhereValues } from \"~/operations/entry/filtering/values.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\nimport { ValueFilter } from \"@webiny/db-dynamodb/feature/ValueFilter/index.js\";\nimport { ValueFilterRegistry } from \"@webiny/db-dynamodb/exports/api/db.js\";\n\ninterface CreateExpressionParams {\n where: Partial<CmsEntryListWhere>;\n condition: ExpressionCondition;\n}\n\ninterface ICreateExpressionsParams {\n plugins: PluginsContainer;\n container: CmsContext[\"container\"];\n where: Partial<CmsEntryListWhere>;\n fields: Record<string, Field>;\n}\n\nexport type ExpressionCondition = \"AND\" | \"OR\";\n\nexport interface Expression {\n expressions: Expression[];\n filters: Filter[];\n condition: ExpressionCondition;\n}\n\nexport interface Filter {\n field: Field;\n path: string;\n fieldPathId: string;\n filter: ValueFilter.Interface;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport const createExpressions = (params: ICreateExpressionsParams): Expression => {\n const { where, plugins, fields, container } = params;\n const valueFilterRegistry = container.resolve(ValueFilterRegistry);\n\n const transformValuePlugins = getMappedPlugins<CmsFieldFilterValueTransformPlugin>({\n plugins,\n type: \"cms-field-filter-value-transform\",\n property: \"fieldType\"\n });\n const fieldFilterCreatePlugins = getMappedPlugins<CmsEntryFieldFilterPlugin>({\n plugins,\n type: CmsEntryFieldFilterPlugin.type,\n property: \"fieldType\"\n });\n\n const defaultFilterCreatePlugin = fieldFilterCreatePlugins[\"*\"] as CmsEntryFieldFilterPlugin;\n\n const getFilterCreatePlugin = (type: string) => {\n const fieldType = getBaseFieldType({\n type\n });\n const filterCreatePlugin = fieldFilterCreatePlugins[fieldType] || defaultFilterCreatePlugin;\n if (filterCreatePlugin) {\n return filterCreatePlugin;\n }\n throw new WebinyError(\n `There is no filter create plugin for the field type \"${fieldType}\".`,\n \"MISSING_FILTER_CREATE_PLUGIN\",\n {\n fieldType\n }\n );\n };\n\n const createExpression = ({ where, condition }: CreateExpressionParams): Expression => {\n const expression: Expression = {\n filters: [],\n expressions: [],\n condition\n };\n\n for (const key in where) {\n const value = where[key as keyof typeof where];\n if (value === undefined) {\n continue;\n }\n\n /**\n * If there are \"AND\" or \"OR\" keys, let's sort them out first.\n *\n *\n * AND conditional\n */\n if (key === \"AND\") {\n const childWhereList = getWhereValues(value, key);\n const childExpression: Expression = {\n condition: \"AND\",\n filters: [],\n expressions: []\n };\n for (const childWhere of childWhereList) {\n const result = createExpression({\n where: childWhere,\n condition: \"AND\"\n });\n childExpression.expressions.push(result);\n }\n expression.expressions.push(childExpression);\n continue;\n }\n /**\n * OR conditional\n */\n if (key === \"OR\") {\n const childWhereList = getWhereValues(value, key);\n\n const childExpression: Expression = {\n condition: \"OR\",\n filters: [],\n expressions: []\n };\n for (const childWhere of childWhereList) {\n const result = createExpression({\n where: childWhere,\n condition: \"AND\"\n });\n childExpression.expressions.push(result);\n }\n expression.expressions.push(childExpression);\n continue;\n }\n\n const whereParams = extractWhereParams(key);\n if (!whereParams) {\n continue;\n }\n\n const { fieldId, operation, negate } = whereParams;\n\n const field = fields[fieldId];\n if (!field) {\n throw new WebinyError(\n `There is no field with the fieldId \"${fieldId}\".`,\n \"FIELD_ERROR\",\n {\n fieldId\n }\n );\n }\n\n /**\n * We need a filter create plugin for this type.\n */\n const filterCreatePlugin = getFilterCreatePlugin(field.type);\n\n const fieldType = getBaseFieldType(field);\n\n const transformValuePlugin: CmsFieldFilterValueTransformPlugin =\n transformValuePlugins[fieldType];\n\n const transformValueCallable = (value: any) => {\n if (!transformValuePlugin) {\n return value;\n }\n return transformValuePlugin.transform({\n field,\n value\n });\n };\n\n const result = filterCreatePlugin.create({\n key,\n value,\n valueFilterRegistry,\n transformValuePlugins,\n getFilterCreatePlugin,\n operation,\n negate,\n field,\n fields,\n compareValue: transformValue({\n value,\n transform: transformValueCallable\n }),\n transformValue: transformValueCallable\n });\n /**\n * There is a possibility of\n * - no result\n * - result being an array\n * - result being an object\n */\n if (!result || (Array.isArray(result) && result.length === 0)) {\n continue;\n }\n\n expression.filters.push(...(Array.isArray(result) ? result : [result]));\n }\n\n return expression;\n };\n\n const expression = createExpression({\n where,\n condition: \"AND\"\n });\n /**\n * If the first expression has no filters and has only one expression, put that expression as main one.\n * This will mostly be used when having an OR condition as the single expression in the root level of the where\n */\n if (expression.filters.length > 0 || expression.expressions.length !== 1) {\n return expression;\n }\n return expression.expressions[0];\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AAKvC,SAASC,gBAAgB;AACzB,SAASC,kBAAkB;AAC3B,SAASC,cAAc;AACvB,SAASC,yBAAyB;AAClC,SAASC,cAAc;AACvB,SAASC,gBAAgB,QAAQ,oDAAoD;AAErF,SAASC,mBAAmB,QAAQ,uCAAuC;AAgC3E,OAAO,MAAMC,iBAAiB,GAAIC,MAAgC,IAAiB;EAC/E,MAAM;IAAEC,KAAK;IAAEC,OAAO;IAAEC,MAAM;IAAEC;EAAU,CAAC,GAAGJ,MAAM;EACpD,MAAMK,mBAAmB,GAAGD,SAAS,CAACE,OAAO,CAACR,mBAAmB,CAAC;EAElE,MAAMS,qBAAqB,GAAGf,gBAAgB,CAAqC;IAC/EU,OAAO;IACPM,IAAI,EAAE,kCAAkC;IACxCC,QAAQ,EAAE;EACd,CAAC,CAAC;EACF,MAAMC,wBAAwB,GAAGlB,gBAAgB,CAA4B;IACzEU,OAA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AAE;UACvB,OAAOZ,KAAK;QAChB;QACA,OAAOY,oBAAoB,CAACE,SAAS,CAAC;UAClCH,KAAK;UACLX;QACJ,CAAC,CAAC;MACN,CAAC;MAED,MAAMK,MAAM,GAAGZ,kBAAkB,CAACsB,MAAM,CAAC;QACrChB,GAAG;QACHC,KAAK;QACLhB,mBAAmB;QACnBE,qBAAqB;QACrBK,qBAAqB;QACrBkB,SAAS;QACTC,MAAM;QACNC,KAAK;QACL7B,MAAM;QACNkC,YAAY,EAAE3C,cAAc,CAAC;UACzB2B,KAAK;UACLc,SAAS,EAAED;QACf,CAAC,CAAC;QACFxC,cAAc,EAAEwC;MACpB,CAAC,CAAC;MACF;AACZ;AACA;AACA;AACA;AACA;MACY,IAAI,CAACR,MAAM,IAAKY,KAAK,CAACC,OAAO,CAACb,MAAM,CAAC,IAAIA,MAAM,CAACc,MAAM,KAAK,CAAE,EAAE;QAC3D;MACJ;MAEAvB,UAAU,CAACC,OAAO,CAACS,IAAI,CAAC,IAAIW,KAAK,CAACC,OAAO,CAACb,MAAM,CAAC,GAAGA,MAAM,GAAG,CAACA,MAAM,CAAC,CAAC,CAAC;IAC3E;IAEA,OAAOT,UAAU;EACrB,CAAC;EAED,MAAMA,UAAU,GAAGF,gBAAgB,CAAC;IAChCd,KAAK;IACLe,SAAS,EAAE;EACf,CAAC,CAAC;EACF;AACJ;AACA;AACA;EACI,IAAIC,UAAU,CAACC,OAAO,CAACsB,MAAM,GAAG,CAAC,IAAIvB,UAAU,CAACE,WAAW,CAACqB,MAAM,KAAK,CAAC,EAAE;IACtE,OAAOvB,UAAU;EACrB;EACA,OAAOA,UAAU,CAACE,WAAW,CAAC,CAAC,CAAC;AACpC,CAAC","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- import type { CmsModelField } from "@webiny/api-headless-cms/types/index.js";
2
- import type { Field } from "./types.js";
3
- import type { PluginsContainer } from "@webiny/plugins";
4
- interface Params {
5
- fields: CmsModelField[];
6
- plugins: PluginsContainer;
7
- }
8
- /**
9
- * This method will map the fieldId (fieldId -> field) to the actual field.
10
- *
11
- * In case of nested fields, fieldId is all the parent fieldIds + current one, joined by the dot (.).
12
- */
13
- export declare const createFields: (params: Params) => {
14
- [x: string]: Field;
15
- };
16
- export {};
@@ -1,106 +0,0 @@
1
- import { createSystemFields } from "./systemFields.js";
2
- import { CmsEntryFieldFilterPathPlugin } from "../../../plugins/index.js";
3
- import { getMappedPlugins } from "./mapPlugins.js";
4
- import { getBaseFieldType } from "@webiny/api-headless-cms/utils/getBaseFieldType.js";
5
- const createFieldCollection = params => {
6
- const {
7
- fields,
8
- parents,
9
- transformValuePlugins,
10
- valuePathPlugins,
11
- system
12
- } = params;
13
- return fields.reduce((collection, field) => {
14
- const fieldType = getBaseFieldType(field);
15
- const transformPlugin = transformValuePlugins[fieldType];
16
- const valuePathPlugin = valuePathPlugins[fieldType];
17
-
18
- /**
19
- * The required fieldId is a product of all of its parents and its own fieldId.
20
- */
21
- const fieldId = [...parents, {
22
- fieldId: field.fieldId,
23
- list: field.list
24
- }].map(f => f.fieldId).join(".");
25
- collection[fieldId] = {
26
- ...field,
27
- parents,
28
- system,
29
- createPath: params => {
30
- if (valuePathPlugin && valuePathPlugin.canUse(field, parents.map(p => p.fieldId))) {
31
- return valuePathPlugin.createPath(params);
32
- }
33
- return parents.map(parent => parent.fieldId).concat([params.field.fieldId]).join(".");
34
- },
35
- transform: value => {
36
- if (!transformPlugin) {
37
- return value;
38
- }
39
- return transformPlugin.transform({
40
- field,
41
- value
42
- });
43
- }
44
- };
45
- const childFields = field.settings?.fields;
46
- if (!childFields?.length) {
47
- return collection;
48
- }
49
- const result = createFieldCollection({
50
- fields: childFields,
51
- parents: [...parents, {
52
- fieldId: field.fieldId,
53
- list: field.list
54
- }],
55
- transformValuePlugins,
56
- valuePathPlugins,
57
- system
58
- });
59
- Object.assign(collection, result);
60
- return collection;
61
- }, {});
62
- };
63
- /**
64
- * This method will map the fieldId (fieldId -> field) to the actual field.
65
- *
66
- * In case of nested fields, fieldId is all the parent fieldIds + current one, joined by the dot (.).
67
- */
68
- export const createFields = params => {
69
- const {
70
- fields,
71
- plugins
72
- } = params;
73
- const transformValuePlugins = getMappedPlugins({
74
- plugins,
75
- type: "cms-field-filter-value-transform",
76
- property: "fieldType"
77
- });
78
- const valuePathPlugins = getMappedPlugins({
79
- plugins,
80
- type: CmsEntryFieldFilterPathPlugin.type,
81
- property: "fieldType"
82
- });
83
- const collection = createFieldCollection({
84
- fields: createSystemFields(),
85
- transformValuePlugins,
86
- valuePathPlugins,
87
- parents: [],
88
- system: true
89
- });
90
- const result = createFieldCollection({
91
- fields,
92
- transformValuePlugins,
93
- valuePathPlugins,
94
- parents: [{
95
- fieldId: "values",
96
- list: false
97
- }],
98
- system: false
99
- });
100
- return {
101
- ...collection,
102
- ...result
103
- };
104
- };
105
-
106
- //# sourceMappingURL=createFields.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["createSystemFields","CmsEntryFieldFilterPathPlugin","getMappedPlugins","getBaseFieldType","createFieldCollection","params","fields","parents","transformValuePlugins","valuePathPlugins","system","reduce","collection","field","fieldType","transformPlugin","valuePathPlugin","fieldId","list","map","f","join","createPath","canUse","p","parent","concat","transform","value","childFields","settings","length","result","Object","assign","createFields","plugins","type","property"],"sources":["createFields.ts"],"sourcesContent":["import type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport { createSystemFields } from \"./systemFields.js\";\nimport type { Field, FieldParent } from \"./types.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport type { CmsFieldFilterValueTransformPlugin } from \"~/types.js\";\nimport { CmsEntryFieldFilterPathPlugin } from \"~/plugins/index.js\";\nimport { getMappedPlugins } from \"./mapPlugins.js\";\nimport { getBaseFieldType } from \"@webiny/api-headless-cms/utils/getBaseFieldType.js\";\n\ninterface Params {\n fields: CmsModelField[];\n plugins: PluginsContainer;\n}\n\ninterface FieldCollection {\n [key: string]: Field;\n}\n\ninterface AddFieldsToCollectionParams {\n fields: CmsModelField[];\n parents: FieldParent[];\n transformValuePlugins: Record<string, CmsFieldFilterValueTransformPlugin>;\n valuePathPlugins: Record<string, CmsEntryFieldFilterPathPlugin>;\n system: boolean;\n}\n\nconst createFieldCollection = (params: AddFieldsToCollectionParams): FieldCollection => {\n const { fields, parents, transformValuePlugins, valuePathPlugins, system } = params;\n return fields.reduce<FieldCollection>((collection, field) => {\n const fieldType = getBaseFieldType(field);\n const transformPlugin = transformValuePlugins[fieldType];\n const valuePathPlugin = valuePathPlugins[fieldType];\n\n /**\n * The required fieldId is a product of all of its parents and its own fieldId.\n */\n const fieldId = [\n ...parents,\n {\n fieldId: field.fieldId,\n list: field.list\n }\n ]\n .map(f => f.fieldId)\n .join(\".\");\n\n collection[fieldId] = {\n ...field,\n parents,\n system,\n createPath: params => {\n if (\n valuePathPlugin &&\n valuePathPlugin.canUse(\n field,\n parents.map(p => p.fieldId)\n )\n ) {\n return valuePathPlugin.createPath(params);\n }\n\n return parents\n .map(parent => parent.fieldId)\n .concat([params.field.fieldId])\n .join(\".\");\n },\n transform: value => {\n if (!transformPlugin) {\n return value;\n }\n return transformPlugin.transform({\n field,\n value\n });\n }\n };\n const childFields = field.settings?.fields;\n if (!childFields?.length) {\n return collection;\n }\n\n const result = createFieldCollection({\n fields: childFields,\n parents: [\n ...parents,\n {\n fieldId: field.fieldId,\n list: field.list\n }\n ],\n transformValuePlugins,\n valuePathPlugins,\n system\n });\n Object.assign(collection, result);\n return collection;\n }, {});\n};\n/**\n * This method will map the fieldId (fieldId -> field) to the actual field.\n *\n * In case of nested fields, fieldId is all the parent fieldIds + current one, joined by the dot (.).\n */\nexport const createFields = (params: Params) => {\n const { fields, plugins } = params;\n\n const transformValuePlugins = getMappedPlugins<CmsFieldFilterValueTransformPlugin>({\n plugins,\n type: \"cms-field-filter-value-transform\",\n property: \"fieldType\"\n });\n const valuePathPlugins = getMappedPlugins<CmsEntryFieldFilterPathPlugin>({\n plugins,\n type: CmsEntryFieldFilterPathPlugin.type,\n property: \"fieldType\"\n });\n\n const collection = createFieldCollection({\n fields: createSystemFields(),\n transformValuePlugins,\n valuePathPlugins,\n parents: [],\n system: true\n });\n\n const result = createFieldCollection({\n fields,\n transformValuePlugins,\n valuePathPlugins,\n parents: [\n {\n fieldId: \"values\",\n list: false\n }\n ],\n system: false\n });\n\n return {\n ...collection,\n ...result\n };\n};\n"],"mappings":"AACA,SAASA,kBAAkB;AAI3B,SAASC,6BAA6B;AACtC,SAASC,gBAAgB;AACzB,SAASC,gBAAgB,QAAQ,oDAAoD;AAmBrF,MAAMC,qBAAqB,GAAIC,MAAmC,IAAsB;EACpF,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC,qBAAqB;IAAEC,gBAAgB;IAAEC;EAAO,CAAC,GAAGL,MAAM;EACnF,OAAOC,MAAM,CAACK,MAAM,CAAkB,CAACC,UAAU,EAAEC,KAAK,KAAK;IACzD,MAAMC,SAAS,GAAGX,gBAAgB,CAACU,KAAK,CAAC;IACzC,MAAME,eAAe,GAAGP,qBAAqB,CAACM,SAAS,CAAC;IACxD,MAAME,eAAe,GAAGP,gBAAgB,CAACK,SAAS,CAAC;;IAEnD;AACR;AACA;IACQ,MAAMG,OAAO,GAAG,CACZ,GAAGV,OAAO,EACV;MACIU,OAAO,EAAEJ,KAAK,CAACI,OAAO;MACtBC,IAAI,EAAEL,KAAK,CAACK;IAChB,CAAC,CACJ,CACIC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACH,OAAO,CAAC,CACnBI,IAAI,CAAC,GAAG,CAAC;IAEdT,UAAU,CAACK,OAAO,CAAC,GAAG;MAClB,GAAGJ,KAAK;MACRN,OAAO;MACPG,MAAM;MACNY,UAAU,EAAEjB,MAAM,IAAI;QAClB,IACIW,eAAe,IACfA,eAAe,CAACO,MAAM,CAClBV,KAAK,EACLN,OAAO,CAACY,GAAG,CAACK,CAAC,IAAIA,CAAC,CAACP,OAAO,CAC9B,CAAC,EACH;UACE,OAAOD,eAAe,CAACM,UAA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ACPC,IAAI,EAAEpC,6BAA6B,CAACoC,IAAI;IACxCC,QAAQ,EAAE;EACd,CAAC,CAAC;EAEF,MAAM1B,UAAU,GAAGR,qBAAqB,CAAC;IACrCE,MAAM,EAAEN,kBAAkB,CAAC,CAAC;IAC5BQ,qBAAqB;IACrBC,gBAAgB;IAChBF,OAAO,EAAE,EAAE;IACXG,MAAM,EAAE;EACZ,CAAC,CAAC;EAEF,MAAMsB,MAAM,GAAG5B,qBAAqB,CAAC;IACjCE,MAAM;IACNE,qBAAqB;IACrBC,gBAAgB;IAChBF,OAAO,EAAE,CACL;MACIU,OAAO,EAAE,QAAQ;MACjBC,IAAI,EAAE;IACV,CAAC,CACJ;IACDR,MAAM,EAAE;EACZ,CAAC,CAAC;EAEF,OAAO;IACH,GAAGE,UAAU;IACb,GAAGoB;EACP,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,17 +0,0 @@
1
- import type { Field } from "./types.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
- import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
4
- interface IResponse {
5
- valuePath: string;
6
- reverse: boolean;
7
- fieldId: string;
8
- field: Field;
9
- }
10
- interface IParams {
11
- model: CmsModel;
12
- sortBy: string;
13
- fields: Record<string, Field>;
14
- plugins: PluginsContainer;
15
- }
16
- export declare const extractSort: (params: IParams) => IResponse;
17
- export {};
@@ -1,84 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { CmsEntryFieldSortingPlugin } from "../../../plugins/index.js";
3
- const extractSortInfo = sortBy => {
4
- const rootSorting = sortBy.match(/^([a-zA-Z]+)_(ASC|DESC)$/);
5
- if (rootSorting) {
6
- return {
7
- fieldId: rootSorting[1],
8
- isValues: false,
9
- order: rootSorting[2]
10
- };
11
- }
12
- const valuesSorting = sortBy.match(/^values_([a-zA-Z0-9]+)_(ASC|DESC)$/);
13
- if (valuesSorting) {
14
- return {
15
- fieldId: valuesSorting[1],
16
- isValues: true,
17
- order: valuesSorting[2]
18
- };
19
- }
20
- throw new WebinyError("Problem in determining the sorting for the entry items.", "SORT_EXTRACT_ERROR", {
21
- sortBy
22
- });
23
- };
24
- export const extractSort = params => {
25
- const {
26
- model,
27
- sortBy,
28
- fields,
29
- plugins
30
- } = params;
31
- const {
32
- fieldId,
33
- isValues: isValuesSorting,
34
- order
35
- } = extractSortInfo(sortBy);
36
- const field = Object.values(fields).find(f => {
37
- /**
38
- * We do not support sorting by nested fields.
39
- */
40
- const isValues = f.parents[0]?.fieldId === "values";
41
- if (isValues && isValuesSorting) {
42
- return f.fieldId === fieldId;
43
- }
44
- if (f.parents.length > 0) {
45
- return false;
46
- }
47
- return f.fieldId === fieldId;
48
- });
49
- const plugin = plugins.byType(CmsEntryFieldSortingPlugin.type).reverse().find(plugin => {
50
- return plugin.canUse({
51
- model,
52
- field,
53
- fieldId,
54
- order,
55
- sortBy
56
- });
57
- });
58
- if (plugin) {
59
- return plugin.createSort({
60
- model,
61
- fieldId,
62
- order,
63
- sortBy,
64
- field,
65
- fields
66
- });
67
- } else if (!field) {
68
- throw new WebinyError("Sorting field does not exist in the content model.", "SORTING_FIELD_ERROR", {
69
- fieldId,
70
- fields
71
- });
72
- }
73
- const valuePath = field.createPath({
74
- field
75
- });
76
- return {
77
- field,
78
- fieldId,
79
- valuePath,
80
- reverse: order === "DESC"
81
- };
82
- };
83
-
84
- //# sourceMappingURL=extractSort.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","CmsEntryFieldSortingPlugin","extractSortInfo","sortBy","rootSorting","match","fieldId","isValues","order","valuesSorting","extractSort","params","model","fields","plugins","isValuesSorting","field","Object","values","find","f","parents","length","plugin","byType","type","reverse","canUse","createSort","valuePath","createPath"],"sources":["extractSort.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type { Field } from \"./types.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { CmsEntryFieldSortingPlugin } from \"~/plugins/index.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nconst extractSortInfo = (sortBy: string) => {\n const rootSorting = sortBy.match(/^([a-zA-Z]+)_(ASC|DESC)$/);\n if (rootSorting) {\n return {\n fieldId: rootSorting[1],\n isValues: false,\n order: rootSorting[2] as \"ASC\" | \"DESC\"\n };\n }\n const valuesSorting = sortBy.match(/^values_([a-zA-Z0-9]+)_(ASC|DESC)$/);\n if (valuesSorting) {\n return {\n fieldId: valuesSorting[1],\n isValues: true,\n order: valuesSorting[2] as \"ASC\" | \"DESC\"\n };\n }\n throw new WebinyError(\n \"Problem in determining the sorting for the entry items.\",\n \"SORT_EXTRACT_ERROR\",\n {\n sortBy\n }\n );\n};\n\ninterface IResponse {\n valuePath: string;\n reverse: boolean;\n fieldId: string;\n field: Field;\n}\n\ninterface IParams {\n model: CmsModel;\n sortBy: string;\n fields: Record<string, Field>;\n plugins: PluginsContainer;\n}\n\nexport const extractSort = (params: IParams): IResponse => {\n const { model, sortBy, fields, plugins } = params;\n const { fieldId, isValues: isValuesSorting, order } = extractSortInfo(sortBy);\n\n const field = Object.values(fields).find(f => {\n /**\n * We do not support sorting by nested fields.\n */\n const isValues = f.parents[0]?.fieldId === \"values\";\n if (isValues && isValuesSorting) {\n return f.fieldId === fieldId;\n }\n if (f.parents.length > 0) {\n return false;\n }\n return f.fieldId === fieldId;\n });\n\n const plugin = plugins\n .byType<CmsEntryFieldSortingPlugin>(CmsEntryFieldSortingPlugin.type)\n .reverse()\n .find(plugin => {\n return plugin.canUse({\n model,\n field,\n fieldId,\n order,\n sortBy\n });\n });\n\n if (plugin) {\n return plugin.createSort({\n model,\n fieldId,\n order,\n sortBy,\n field,\n fields\n });\n } else if (!field) {\n throw new WebinyError(\n \"Sorting field does not exist in the content model.\",\n \"SORTING_FIELD_ERROR\",\n {\n fieldId,\n fields\n }\n );\n }\n const valuePath = field.createPath({\n field\n });\n return {\n field,\n fieldId,\n valuePath,\n reverse: order === \"DESC\"\n };\n};\n"],"mappings":"AAAA,OAAOA,WAAW,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ACA,OAAOF,CAAC,CAACd,OAAO,KAAKA,OAAO;EAChC,CAAC,CAAC;EAEF,MAAMiB,MAAM,GAAGT,OAAO,CACjBU,MAAM,CAA6BvB,0BAA0B,CAACwB,IAAI,CAAC,CACnEC,OAAO,CAAC,CAAC,CACTP,IAAI,CAACI,MAAM,IAAI;IACZ,OAAOA,MAAM,CAACI,MAAM,CAAC;MACjBf,KAAK;MACLI,KAAK;MACLV,OAAO;MACPE,KAAK;MACLL;IACJ,CAAC,CAAC;EACN,CAAC,CAAC;EAEN,IAAIoB,MAAM,EAAE;IACR,OAAOA,MAAM,CAACK,UAAU,CAAC;MACrBhB,KAAK;MACLN,OAAO;MACPE,KAAK;MACLL,MAAM;MACNa,KAAK;MACLH;IACJ,CAAC,CAAC;EACN,CAAC,MAAM,IAAI,CAACG,KAAK,EAAE;IACf,MAAM,IAAIhB,WAAW,CACjB,oDAAoD,EACpD,qBAAqB,EACrB;MACIM,OAAO;MACPO;IACJ,CACJ,CAAC;EACL;EACA,MAAMgB,SAAS,GAAGb,KAAK,CAACc,UAAU,CAAC;IAC/Bd;EACJ,CAAC,CAAC;EACF,OAAO;IACHA,KAAK;IACLV,OAAO;IACPuB,SAAS;IACTH,OAAO,EAAElB,KAAK,KAAK;EACvB,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,16 +0,0 @@
1
- import type { CmsContext, CmsEntry, CmsEntryListWhere, CmsEntryValues } from "@webiny/api-headless-cms/types/index.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
- import type { Field } from "./types.js";
4
- interface IFilterParams<T extends CmsEntryValues = CmsEntryValues> {
5
- plugins: PluginsContainer;
6
- container: CmsContext["container"];
7
- items: CmsEntry<T>[];
8
- where: Partial<CmsEntryListWhere>;
9
- fields: Record<string, Field>;
10
- fullTextSearch?: {
11
- term?: string;
12
- fields?: string[];
13
- };
14
- }
15
- export declare const filter: <T extends CmsEntryValues = CmsEntryValues>(params: IFilterParams<T>) => CmsEntry<T>[];
16
- export {};