@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,40 +0,0 @@
1
- import type { CmsModelField } from "@webiny/api-headless-cms/types";
2
- import type { CreatePathCallable } from "../../../plugins";
3
- interface FieldValueTransform {
4
- (value: any): any;
5
- }
6
- export interface FieldParent {
7
- fieldId: string;
8
- multipleValues?: boolean;
9
- }
10
- export interface Field extends Partial<Omit<CmsModelField, "id" | "type" | "storageId" | "fieldId">>, Pick<CmsModelField, "id" | "type" | "storageId" | "fieldId"> {
11
- /**
12
- * A list od fieldId of all parents of the current field.
13
- *
14
- * This is used to check if we need to iterate through an array of parent values.
15
- */
16
- parents: FieldParent[];
17
- /**
18
- * The method which creates a path for the filtering.
19
- *
20
- * Always exists. In most cases it will return some fixed value.
21
- * When having a CmsEntryFieldFilterPathPlugin then it is executed to create a path.
22
- */
23
- createPath: CreatePathCallable;
24
- /**
25
- * In most cases, return value of this method is what ever is the input.
26
- *
27
- * In some cases there might be a CmsFieldFilterValueTransformPlugin, which transforms value to a comparable one.
28
- * For example, time in format 15:45:58 is not comparable, so we transform it into the seconds and then compare.
29
- */
30
- transform: FieldValueTransform;
31
- /**
32
- * Is the field a system field?
33
- * System fields are built into the code and cannot be changed.
34
- */
35
- system: boolean;
36
- }
37
- export interface FilterItemFromStorage {
38
- <T = any>(field: Partial<CmsModelField> & Pick<CmsModelField, "fieldId" | "storageId" | "id" | "settings" | "type">, value: any): Promise<T>;
39
- }
40
- export {};
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport type { CreatePathCallable } from \"~/plugins\";\n\ninterface FieldValueTransform {\n (value: any): any;\n}\n\nexport interface FieldParent {\n fieldId: string;\n multipleValues?: boolean;\n}\n\nexport interface Field\n extends Partial<Omit<CmsModelField, \"id\" | \"type\" | \"storageId\" | \"fieldId\">>,\n Pick<CmsModelField, \"id\" | \"type\" | \"storageId\" | \"fieldId\"> {\n /**\n * A list od fieldId of all parents of the current field.\n *\n * This is used to check if we need to iterate through an array of parent values.\n */\n parents: FieldParent[];\n /**\n * The method which creates a path for the filtering.\n *\n * Always exists. In most cases it will return some fixed value.\n * When having a CmsEntryFieldFilterPathPlugin then it is executed to create a path.\n */\n createPath: CreatePathCallable;\n /**\n * In most cases, return value of this method is what ever is the input.\n *\n * In some cases there might be a CmsFieldFilterValueTransformPlugin, which transforms value to a comparable one.\n * For example, time in format 15:45:58 is not comparable, so we transform it into the seconds and then compare.\n */\n transform: FieldValueTransform;\n /**\n * Is the field a system field?\n * System fields are built into the code and cannot be changed.\n */\n system: boolean;\n}\n\nexport interface FilterItemFromStorage {\n <T = any>(\n field: Partial<CmsModelField> &\n Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"id\" | \"settings\" | \"type\">,\n value: any\n ): Promise<T>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import type { CmsEntryListWhere } from "@webiny/api-headless-cms/types";
2
- export declare const getWhereValues: (value: unknown, condition: "AND" | "OR") => CmsEntryListWhere[];
@@ -1,24 +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.getWhereValues = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
9
- const getWhereValues = (value, condition) => {
10
- const values = value;
11
- if (!Array.isArray(values)) {
12
- throw new _error.default(`Trying to run filtering with "${condition}", but the value sent is not an array.`, `MALFORMED_${condition}_CONDITION`, {
13
- value
14
- });
15
- } else if (values.length === 0) {
16
- throw new _error.default(`Trying to run filtering with "${condition}", but the value sent is empty array.`, `MALFORMED_${condition}_CONDITION`, {
17
- value
18
- });
19
- }
20
- return values;
21
- };
22
- exports.getWhereValues = getWhereValues;
23
-
24
- //# sourceMappingURL=values.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","getWhereValues","value","condition","values","Array","isArray","WebinyError","length","exports"],"sources":["values.ts"],"sourcesContent":["import type { CmsEntryListWhere } from \"@webiny/api-headless-cms/types\";\nimport WebinyError from \"@webiny/error\";\n\nexport const getWhereValues = (value: unknown, condition: \"AND\" | \"OR\") => {\n const values = value as CmsEntryListWhere[] | undefined;\n if (!Array.isArray(values)) {\n throw new WebinyError(\n `Trying to run filtering with \"${condition}\", but the value sent is not an array.`,\n `MALFORMED_${condition}_CONDITION`,\n {\n value\n }\n );\n } else if (values.length === 0) {\n throw new WebinyError(\n `Trying to run filtering with \"${condition}\", but the value sent is empty array.`,\n `MALFORMED_${condition}_CONDITION`,\n {\n value\n }\n );\n }\n return values;\n};\n"],"mappings":";;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,MAAMC,cAAc,GAAGA,CAACC,KAAc,EAAEC,SAAuB,KAAK;EACvE,MAAMC,MAAM,GAAGF,KAAwC;EACvD,IAAI,CAACG,KAAK,CAACC,OAAO,CAACF,MAAM,CAAC,EAAE;IACxB,MAAM,IAAIG,cAAW,CACjB,iCAAiCJ,SAAS,wCAAwC,EAClF,aAAaA,SAAS,YAAY,EAClC;MACID;IACJ,CACJ,CAAC;EACL,CAAC,MAAM,IAAIE,MAAM,CAACI,MAAM,KAAK,CAAC,EAAE;IAC5B,MAAM,IAAID,cAAW,CACjB,iCAAiCJ,SAAS,uCAAuC,EACjF,aAAaA,SAAS,YAAY,EAClC;MACID;IACJ,CACJ,CAAC;EACL;EACA,OAAOE,MAAM;AACjB,CAAC;AAACK,OAAA,CAAAR,cAAA,GAAAA,cAAA","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- export declare const extractWhereParams: (key: string) => {
2
- fieldId: string;
3
- operation: string;
4
- negate: boolean;
5
- } | null;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.extractWhereParams = void 0;
7
- const extractWhereParams = key => {
8
- const isWbyAco = key.match("wbyAco_") !== null;
9
- const result = key.replace("wbyAco_", "").split("_");
10
- const fieldId = result.shift();
11
- if (!fieldId) {
12
- return null;
13
- }
14
- const rawOp = result.length === 0 ? "eq" : result.join("_");
15
- /**
16
- * When rawOp is not, it means it is equal negated so just return that.
17
- */
18
- if (rawOp === "not") {
19
- return {
20
- fieldId,
21
- operation: "eq",
22
- negate: true
23
- };
24
- }
25
- const negate = rawOp.match("not_") !== null;
26
- const operation = rawOp.replace("not_", "");
27
- return {
28
- fieldId: isWbyAco ? `wbyAco_${fieldId}` : fieldId,
29
- operation,
30
- negate
31
- };
32
- };
33
- exports.extractWhereParams = extractWhereParams;
34
-
35
- //# sourceMappingURL=where.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["extractWhereParams","key","isWbyAco","match","result","replace","split","fieldId","shift","rawOp","length","join","operation","negate","exports"],"sources":["where.ts"],"sourcesContent":["export const extractWhereParams = (key: string) => {\n const isWbyAco = key.match(\"wbyAco_\") !== null;\n const result = key.replace(\"wbyAco_\", \"\").split(\"_\");\n const fieldId = result.shift();\n if (!fieldId) {\n return null;\n }\n const rawOp = result.length === 0 ? \"eq\" : result.join(\"_\");\n /**\n * When rawOp is not, it means it is equal negated so just return that.\n */\n if (rawOp === \"not\") {\n return {\n fieldId,\n operation: \"eq\",\n negate: true\n };\n }\n const negate = rawOp.match(\"not_\") !== null;\n const operation = rawOp.replace(\"not_\", \"\");\n return {\n fieldId: isWbyAco ? `wbyAco_${fieldId}` : fieldId,\n operation,\n negate\n };\n};\n"],"mappings":";;;;;;AAAO,MAAMA,kBAAkB,GAAIC,GAAW,IAAK;EAC/C,MAAMC,QAAQ,GAAGD,GAAG,CAACE,KAAK,CAAC,SAAS,CAAC,KAAK,IAAI;EAC9C,MAAMC,MAAM,GAAGH,GAAG,CAACI,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAACC,KAAK,CAAC,GAAG,CAAC;EACpD,MAAMC,OAAO,GAAGH,MAAM,CAACI,KAAK,CAAC,CAAC;EAC9B,IAAI,CAACD,OAAO,EAAE;IACV,OAAO,IAAI;EACf;EACA,MAAME,KAAK,GAAGL,MAAM,CAACM,MAAM,KAAK,CAAC,GAAG,IAAI,GAAGN,MAAM,CAACO,IAAI,CAAC,GAAG,CAAC;EAC3D;AACJ;AACA;EACI,IAAIF,KAAK,KAAK,KAAK,EAAE;IACjB,OAAO;MACHF,OAAO;MACPK,SAAS,EAAE,IAAI;MACfC,MAAM,EAAE;IACZ,CAAC;EACL;EACA,MAAMA,MAAM,GAAGJ,KAAK,CAACN,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI;EAC3C,MAAMS,SAAS,GAAGH,KAAK,CAACJ,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;EAC3C,OAAO;IACHE,OAAO,EAAEL,QAAQ,GAAG,UAAUK,OAAO,EAAE,GAAGA,OAAO;IACjDK,SAAS;IACTC;EACJ,CAAC;AACL,CAAC;AAACC,OAAA,CAAAd,kBAAA,GAAAA,kBAAA","ignoreList":[]}
@@ -1,8 +0,0 @@
1
- import type { Entity } from "@webiny/db-dynamodb/toolbox";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
- import type { CmsEntryStorageOperations } from "../../types";
4
- export interface CreateEntriesStorageOperationsParams {
5
- entity: Entity<any>;
6
- plugins: PluginsContainer;
7
- }
8
- export declare const createEntriesStorageOperations: (params: CreateEntriesStorageOperationsParams) => CmsEntryStorageOperations;