@webiny/db-dynamodb 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/DynamoDbDriver.js +204 -209
  2. package/DynamoDbDriver.js.map +1 -1
  3. package/exports/api/db.d.ts +2 -0
  4. package/exports/api/db.js +2 -0
  5. package/feature/FilterUtil/FilterUtil.d.ts +11 -0
  6. package/feature/FilterUtil/FilterUtil.js +26 -0
  7. package/feature/FilterUtil/FilterUtil.js.map +1 -0
  8. package/feature/FilterUtil/abstractions/FilterUtil.d.ts +17 -0
  9. package/feature/FilterUtil/abstractions/FilterUtil.js +5 -0
  10. package/feature/FilterUtil/abstractions/FilterUtil.js.map +1 -0
  11. package/feature/FilterUtil/createFilters.d.ts +22 -0
  12. package/feature/FilterUtil/createFilters.js +92 -0
  13. package/feature/FilterUtil/createFilters.js.map +1 -0
  14. package/feature/FilterUtil/extractWhereArgs.d.ts +7 -0
  15. package/feature/FilterUtil/extractWhereArgs.js +20 -0
  16. package/feature/FilterUtil/extractWhereArgs.js.map +1 -0
  17. package/feature/FilterUtil/feature.d.ts +4 -0
  18. package/feature/FilterUtil/feature.js +11 -0
  19. package/feature/FilterUtil/feature.js.map +1 -0
  20. package/feature/FilterUtil/index.d.ts +2 -0
  21. package/feature/FilterUtil/index.js +2 -0
  22. package/feature/ValueFilter/ValueFilterRegistry.d.ts +12 -0
  23. package/feature/ValueFilter/ValueFilterRegistry.js +27 -0
  24. package/feature/ValueFilter/ValueFilterRegistry.js.map +1 -0
  25. package/feature/ValueFilter/abstractions/ValueFilter.d.ts +22 -0
  26. package/feature/ValueFilter/abstractions/ValueFilter.js +5 -0
  27. package/feature/ValueFilter/abstractions/ValueFilter.js.map +1 -0
  28. package/feature/ValueFilter/abstractions/ValueFilterRegistry.d.ts +10 -0
  29. package/feature/ValueFilter/abstractions/ValueFilterRegistry.js +5 -0
  30. package/feature/ValueFilter/abstractions/ValueFilterRegistry.js.map +1 -0
  31. package/feature/ValueFilter/feature.d.ts +4 -0
  32. package/feature/ValueFilter/feature.js +33 -0
  33. package/feature/ValueFilter/feature.js.map +1 -0
  34. package/feature/ValueFilter/filters/AndInFilter.d.ts +11 -0
  35. package/feature/ValueFilter/filters/AndInFilter.js +28 -0
  36. package/feature/ValueFilter/filters/AndInFilter.js.map +1 -0
  37. package/feature/ValueFilter/filters/BetweenFilter.d.ts +11 -0
  38. package/feature/ValueFilter/filters/BetweenFilter.js +31 -0
  39. package/feature/ValueFilter/filters/BetweenFilter.js.map +1 -0
  40. package/feature/ValueFilter/filters/ContainsFilter.d.ts +11 -0
  41. package/feature/ValueFilter/filters/ContainsFilter.js +42 -0
  42. package/feature/ValueFilter/filters/ContainsFilter.js.map +1 -0
  43. package/feature/ValueFilter/filters/EqFilter.d.ts +11 -0
  44. package/feature/ValueFilter/filters/EqFilter.js +24 -0
  45. package/feature/ValueFilter/filters/EqFilter.js.map +1 -0
  46. package/feature/ValueFilter/filters/FuzzyFilter.d.ts +11 -0
  47. package/feature/ValueFilter/filters/FuzzyFilter.js +37 -0
  48. package/feature/ValueFilter/filters/FuzzyFilter.js.map +1 -0
  49. package/feature/ValueFilter/filters/GtFilter.d.ts +11 -0
  50. package/feature/ValueFilter/filters/GtFilter.js +22 -0
  51. package/feature/ValueFilter/filters/GtFilter.js.map +1 -0
  52. package/feature/ValueFilter/filters/GteFilter.d.ts +11 -0
  53. package/feature/ValueFilter/filters/GteFilter.js +22 -0
  54. package/feature/ValueFilter/filters/GteFilter.js.map +1 -0
  55. package/feature/ValueFilter/filters/InFilter.d.ts +11 -0
  56. package/feature/ValueFilter/filters/InFilter.js +28 -0
  57. package/feature/ValueFilter/filters/InFilter.js.map +1 -0
  58. package/feature/ValueFilter/filters/LtFilter.d.ts +11 -0
  59. package/feature/ValueFilter/filters/LtFilter.js +22 -0
  60. package/feature/ValueFilter/filters/LtFilter.js.map +1 -0
  61. package/feature/ValueFilter/filters/LteFilter.d.ts +11 -0
  62. package/feature/ValueFilter/filters/LteFilter.js +22 -0
  63. package/feature/ValueFilter/filters/LteFilter.js.map +1 -0
  64. package/feature/ValueFilter/filters/StartsWithFilter.d.ts +11 -0
  65. package/feature/ValueFilter/filters/StartsWithFilter.js +29 -0
  66. package/feature/ValueFilter/filters/StartsWithFilter.js.map +1 -0
  67. package/feature/ValueFilter/index.d.ts +3 -0
  68. package/feature/ValueFilter/index.js +3 -0
  69. package/index.d.ts +1 -0
  70. package/index.js +9 -2
  71. package/index.js.map +1 -1
  72. package/package.json +28 -20
  73. package/plugins/definitions/DateTimeTransformPlugin.js +18 -27
  74. package/plugins/definitions/DateTimeTransformPlugin.js.map +1 -1
  75. package/plugins/definitions/FieldPlugin.js +34 -37
  76. package/plugins/definitions/FieldPlugin.js.map +1 -1
  77. package/plugins/definitions/TimeTransformPlugin.js +25 -37
  78. package/plugins/definitions/TimeTransformPlugin.js.map +1 -1
  79. package/plugins/definitions/ValueTransformPlugin.d.ts +1 -6
  80. package/plugins/definitions/ValueTransformPlugin.js +17 -22
  81. package/plugins/definitions/ValueTransformPlugin.js.map +1 -1
  82. package/plugins/definitions/assignFields.js +14 -18
  83. package/plugins/definitions/assignFields.js.map +1 -1
  84. package/plugins/index.d.ts +0 -5
  85. package/plugins/index.js +0 -12
  86. package/store/entity.js +6 -9
  87. package/store/entity.js.map +1 -1
  88. package/store/keys.js +6 -13
  89. package/store/keys.js.map +1 -1
  90. package/store/types.js +0 -3
  91. package/toolbox.d.ts +53 -1
  92. package/toolbox.js +0 -4
  93. package/types.js +0 -3
  94. package/utils/batch/batchRead.js +37 -56
  95. package/utils/batch/batchRead.js.map +1 -1
  96. package/utils/batch/batchWrite.js +33 -51
  97. package/utils/batch/batchWrite.js.map +1 -1
  98. package/utils/batch/index.js +0 -2
  99. package/utils/batch/types.js +0 -3
  100. package/utils/cleanup.js +35 -25
  101. package/utils/cleanup.js.map +1 -1
  102. package/utils/count.js +8 -13
  103. package/utils/count.js.map +1 -1
  104. package/utils/createEntity.d.ts +1 -1
  105. package/utils/createEntity.js +75 -78
  106. package/utils/createEntity.js.map +1 -1
  107. package/utils/createTable.js +25 -35
  108. package/utils/createTable.js.map +1 -1
  109. package/utils/cursor.js +7 -10
  110. package/utils/cursor.js.map +1 -1
  111. package/utils/delete.js +6 -8
  112. package/utils/delete.js.map +1 -1
  113. package/utils/entity/Entity.d.ts +1 -1
  114. package/utils/entity/Entity.js +85 -89
  115. package/utils/entity/Entity.js.map +1 -1
  116. package/utils/entity/EntityReadBatch.js +23 -31
  117. package/utils/entity/EntityReadBatch.js.map +1 -1
  118. package/utils/entity/EntityReadBatchBuilder.js +12 -15
  119. package/utils/entity/EntityReadBatchBuilder.js.map +1 -1
  120. package/utils/entity/EntityWriteBatch.js +34 -41
  121. package/utils/entity/EntityWriteBatch.js.map +1 -1
  122. package/utils/entity/EntityWriteBatchBuilder.js +15 -16
  123. package/utils/entity/EntityWriteBatchBuilder.js.map +1 -1
  124. package/utils/entity/getEntity.js +8 -9
  125. package/utils/entity/getEntity.js.map +1 -1
  126. package/utils/entity/index.js +0 -2
  127. package/utils/entity/types.js +0 -4
  128. package/utils/get.js +12 -26
  129. package/utils/get.js.map +1 -1
  130. package/utils/index.d.ts +1 -5
  131. package/utils/index.js +1 -7
  132. package/utils/put.js +7 -9
  133. package/utils/put.js.map +1 -1
  134. package/utils/query.js +77 -128
  135. package/utils/query.js.map +1 -1
  136. package/utils/scan.js +47 -73
  137. package/utils/scan.js.map +1 -1
  138. package/utils/sort.js +37 -61
  139. package/utils/sort.js.map +1 -1
  140. package/utils/table/Table.js +22 -21
  141. package/utils/table/Table.js.map +1 -1
  142. package/utils/table/TableReadBatch.js +37 -45
  143. package/utils/table/TableReadBatch.js.map +1 -1
  144. package/utils/table/TableWriteBatch.js +47 -56
  145. package/utils/table/TableWriteBatch.js.map +1 -1
  146. package/utils/table/index.js +0 -2
  147. package/utils/table/types.js +0 -3
  148. package/plugins/definitions/AttributePlugin.d.ts +0 -18
  149. package/plugins/definitions/AttributePlugin.js +0 -38
  150. package/plugins/definitions/AttributePlugin.js.map +0 -1
  151. package/plugins/definitions/FieldPathPlugin.d.ts +0 -22
  152. package/plugins/definitions/FieldPathPlugin.js +0 -26
  153. package/plugins/definitions/FieldPathPlugin.js.map +0 -1
  154. package/plugins/definitions/ValueFilterPlugin.d.ts +0 -22
  155. package/plugins/definitions/ValueFilterPlugin.js +0 -35
  156. package/plugins/definitions/ValueFilterPlugin.js.map +0 -1
  157. package/plugins/filters/andIn.d.ts +0 -3
  158. package/plugins/filters/andIn.js +0 -24
  159. package/plugins/filters/andIn.js.map +0 -1
  160. package/plugins/filters/between.d.ts +0 -3
  161. package/plugins/filters/between.js +0 -25
  162. package/plugins/filters/between.js.map +0 -1
  163. package/plugins/filters/contains.d.ts +0 -3
  164. package/plugins/filters/contains.js +0 -53
  165. package/plugins/filters/contains.js.map +0 -1
  166. package/plugins/filters/eq.d.ts +0 -3
  167. package/plugins/filters/eq.js +0 -26
  168. package/plugins/filters/eq.js.map +0 -1
  169. package/plugins/filters/fuzzy.d.ts +0 -3
  170. package/plugins/filters/fuzzy.js +0 -29
  171. package/plugins/filters/fuzzy.js.map +0 -1
  172. package/plugins/filters/gt.d.ts +0 -3
  173. package/plugins/filters/gt.js +0 -14
  174. package/plugins/filters/gt.js.map +0 -1
  175. package/plugins/filters/gte.d.ts +0 -3
  176. package/plugins/filters/gte.js +0 -14
  177. package/plugins/filters/gte.js.map +0 -1
  178. package/plugins/filters/in.d.ts +0 -3
  179. package/plugins/filters/in.js +0 -24
  180. package/plugins/filters/in.js.map +0 -1
  181. package/plugins/filters/index.d.ts +0 -2
  182. package/plugins/filters/index.js +0 -14
  183. package/plugins/filters/index.js.map +0 -1
  184. package/plugins/filters/lt.d.ts +0 -3
  185. package/plugins/filters/lt.js +0 -14
  186. package/plugins/filters/lt.js.map +0 -1
  187. package/plugins/filters/lte.d.ts +0 -3
  188. package/plugins/filters/lte.js +0 -14
  189. package/plugins/filters/lte.js.map +0 -1
  190. package/plugins/filters/startsWith.d.ts +0 -3
  191. package/plugins/filters/startsWith.js +0 -34
  192. package/plugins/filters/startsWith.js.map +0 -1
  193. package/plugins/index.js.map +0 -1
  194. package/store/types.js.map +0 -1
  195. package/toolbox.js.map +0 -1
  196. package/types.js.map +0 -1
  197. package/utils/attributes.d.ts +0 -10
  198. package/utils/attributes.js +0 -19
  199. package/utils/attributes.js.map +0 -1
  200. package/utils/batch/index.js.map +0 -1
  201. package/utils/batch/types.js.map +0 -1
  202. package/utils/entity/index.js.map +0 -1
  203. package/utils/entity/types.js.map +0 -1
  204. package/utils/filter.d.ts +0 -12
  205. package/utils/filter.js +0 -174
  206. package/utils/filter.js.map +0 -1
  207. package/utils/index.js.map +0 -1
  208. package/utils/listResponse.d.ts +0 -13
  209. package/utils/listResponse.js +0 -25
  210. package/utils/listResponse.js.map +0 -1
  211. package/utils/table/index.js.map +0 -1
  212. package/utils/table/types.js.map +0 -1
  213. package/utils/update.d.ts +0 -12
  214. package/utils/update.js +0 -12
  215. package/utils/update.js.map +0 -1
@@ -1,35 +0,0 @@
1
- import { Plugin } from "@webiny/plugins";
2
- import WebinyError from "@webiny/error";
3
- export class ValueFilterPlugin extends Plugin {
4
- static type = "dynamodb.value.filter";
5
- get operation() {
6
- return this.getOperation();
7
- }
8
- constructor(params) {
9
- super();
10
- this._params = params;
11
- }
12
- canUse(params) {
13
- if (!this._params.canUse) {
14
- return true;
15
- }
16
- return this._params.canUse(params);
17
- }
18
- matches(params) {
19
- if (!this._params || !this._params.matches) {
20
- throw new WebinyError(`Missing "matches" in the plugin.`, "MATCHES_ERROR", {
21
- plugin: this,
22
- params
23
- });
24
- }
25
- return this._params.matches(params);
26
- }
27
- getOperation() {
28
- if (!this._params || !this._params.operation) {
29
- throw new WebinyError(`Missing "operation" in the plugin.`, "OPERATION_ERROR");
30
- }
31
- return this._params.operation;
32
- }
33
- }
34
-
35
- //# sourceMappingURL=ValueFilterPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Plugin","WebinyError","ValueFilterPlugin","type","operation","getOperation","constructor","params","_params","canUse","matches","plugin"],"sources":["ValueFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport WebinyError from \"@webiny/error\";\n\nexport interface ValueFilterPluginParamsMatchesParams<V = any, C = any> {\n value: V;\n compareValue: C;\n}\n\nexport interface ValueFilterPluginParamsMatches {\n (params: ValueFilterPluginParamsMatchesParams): boolean;\n}\n\nexport interface ValueFilterPluginParams {\n operation: string;\n canUse?: (params: ValueFilterPluginParamsMatchesParams) => boolean;\n matches: ValueFilterPluginParamsMatches;\n}\nexport class ValueFilterPlugin<V = any, C = any> extends Plugin {\n public static override readonly type: string = \"dynamodb.value.filter\";\n private readonly _params: ValueFilterPluginParams;\n\n public get operation(): string {\n return this.getOperation();\n }\n\n public constructor(params: ValueFilterPluginParams) {\n super();\n this._params = params;\n }\n\n public canUse(params: ValueFilterPluginParamsMatchesParams<V, C>): boolean {\n if (!this._params.canUse) {\n return true;\n }\n return this._params.canUse(params);\n }\n\n public matches(params: ValueFilterPluginParamsMatchesParams): boolean {\n if (!this._params || !this._params.matches) {\n throw new WebinyError(`Missing \"matches\" in the plugin.`, \"MATCHES_ERROR\", {\n plugin: this,\n params\n });\n }\n return this._params.matches(params);\n }\n\n public getOperation(): string {\n if (!this._params || !this._params.operation) {\n throw new WebinyError(`Missing \"operation\" in the plugin.`, \"OPERATION_ERROR\");\n }\n return this._params.operation;\n }\n}\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,iBAAiB;AACxC,OAAOC,WAAW,MAAM,eAAe;AAgBvC,OAAO,MAAMC,iBAAiB,SAA2BF,MAAM,CAAC;EAC5D,OAAgCG,IAAI,GAAW,uBAAuB;EAGtE,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,YAAY,CAAC,CAAC;EAC9B;EAEOC,WAAWA,CAACC,MAA+B,EAAE;IAChD,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,OAAO,GAAGD,MAAM;EACzB;EAEOE,MAAMA,CAACF,MAAkD,EAAW;IACvE,IAAI,CAAC,IAAI,CAACC,OAAO,CAACC,MAAM,EAAE;MACtB,OAAO,IAAI;IACf;IACA,OAAO,IAAI,CAACD,OAAO,CAACC,MAAM,CAACF,MAAM,CAAC;EACtC;EAEOG,OAAOA,CAACH,MAA4C,EAAW;IAClE,IAAI,CAAC,IAAI,CAACC,OAAO,IAAI,CAAC,IAAI,CAACA,OAAO,CAACE,OAAO,EAAE;MACxC,MAAM,IAAIT,WAAW,CAAC,kCAAkC,EAAE,eAAe,EAAE;QACvEU,MAAM,EAAE,IAAI;QACZJ;MACJ,CAAC,CAAC;IACN;IACA,OAAO,IAAI,CAACC,OAAO,CAACE,OAAO,CAACH,MAAM,CAAC;EACvC;EAEOF,YAAYA,CAAA,EAAW;IAC1B,IAAI,CAAC,IAAI,CAACG,OAAO,IAAI,CAAC,IAAI,CAACA,OAAO,CAACJ,SAAS,EAAE;MAC1C,MAAM,IAAIH,WAAW,CAAC,oCAAoC,EAAE,iBAAiB,CAAC;IAClF;IACA,OAAO,IAAI,CAACO,OAAO,CAACJ,SAAS;EACjC;AACJ","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,24 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- import WebinyError from "@webiny/error";
3
- const plugin = new ValueFilterPlugin({
4
- operation: "and_in",
5
- matches: ({
6
- value,
7
- compareValue
8
- }) => {
9
- if (!compareValue || Array.isArray(compareValue) === false) {
10
- throw new WebinyError(`The value given as "compareValue" must be an array!`, "COMPARE_VALUE_ERROR", {
11
- value,
12
- compareValue
13
- });
14
- }
15
- if (Array.isArray(value) === true) {
16
- return compareValue.every(c => value.includes(c));
17
- }
18
- return compareValue.includes(value);
19
- }
20
- });
21
- plugin.name = "dynamodb.value.filter.and_in";
22
- export default plugin;
23
-
24
- //# sourceMappingURL=andIn.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","WebinyError","plugin","operation","matches","value","compareValue","Array","isArray","every","c","includes","name"],"sources":["andIn.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\nimport WebinyError from \"@webiny/error\";\n\ninterface MatchesParams {\n value: any[];\n compareValue?: any[];\n}\n\nconst plugin = new ValueFilterPlugin({\n operation: \"and_in\",\n matches: ({ value, compareValue }: MatchesParams) => {\n if (!compareValue || Array.isArray(compareValue) === false) {\n throw new WebinyError(\n `The value given as \"compareValue\" must be an array!`,\n \"COMPARE_VALUE_ERROR\",\n {\n value,\n compareValue\n }\n );\n }\n if (Array.isArray(value) === true) {\n return compareValue.every(c => value.includes(c));\n }\n return compareValue.includes(value);\n }\n});\n\nplugin.name = \"dynamodb.value.filter.and_in\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,OAAOC,WAAW,MAAM,eAAe;AAOvC,MAAMC,MAAM,GAAG,IAAIF,iBAAiB,CAAC;EACjCG,SAAS,EAAE,QAAQ;EACnBC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAA4B,CAAC,KAAK;IACjD,IAAI,CAACA,YAAY,IAAIC,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,KAAK,KAAK,EAAE;MACxD,MAAM,IAAIL,WAAW,CACjB,qDAAqD,EACrD,qBAAqB,EACrB;QACII,KAAK;QACLC;MACJ,CACJ,CAAC;IACL;IACA,IAAIC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,KAAK,IAAI,EAAE;MAC/B,OAAOC,YAAY,CAACG,KAAK,CAACC,CAAC,IAAIL,KAAK,CAACM,QAAQ,CAACD,CAAC,CAAC,CAAC;IACrD;IACA,OAAOJ,YAAY,CAACK,QAAQ,CAACN,KAAK,CAAC;EACvC;AACJ,CAAC,CAAC;AAEFH,MAAM,CAACU,IAAI,GAAG,8BAA8B;AAE5C,eAAeV,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,25 +0,0 @@
1
- import WebinyError from "@webiny/error";
2
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
3
- const plugin = new ValueFilterPlugin({
4
- operation: "between",
5
- matches: ({
6
- value,
7
- compareValue
8
- }) => {
9
- if (Array.isArray(compareValue)) {
10
- if (compareValue.length !== 2) {
11
- throw new WebinyError("When comparing between and you give an array, there must be two items in it.", "FILTER_ERROR", {
12
- value,
13
- compareValue
14
- });
15
- }
16
- const [from, to] = compareValue;
17
- return value >= from && value <= to;
18
- }
19
- return value >= compareValue && value <= compareValue;
20
- }
21
- });
22
- plugin.name = "dynamodb.value.filter.between";
23
- export default plugin;
24
-
25
- //# sourceMappingURL=between.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","ValueFilterPlugin","plugin","operation","matches","value","compareValue","Array","isArray","length","from","to","name"],"sources":["between.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst plugin = new ValueFilterPlugin({\n operation: \"between\",\n matches: ({ value, compareValue }) => {\n if (Array.isArray(compareValue)) {\n if (compareValue.length !== 2) {\n throw new WebinyError(\n \"When comparing between and you give an array, there must be two items in it.\",\n \"FILTER_ERROR\",\n {\n value,\n compareValue\n }\n );\n }\n const [from, to] = compareValue;\n return value >= from && value <= to;\n }\n return value >= compareValue && value <= compareValue;\n }\n});\n\nplugin.name = \"dynamodb.value.filter.between\";\n\nexport default plugin;\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,iBAAiB;AAE1B,MAAMC,MAAM,GAAG,IAAID,iBAAiB,CAAC;EACjCE,SAAS,EAAE,SAAS;EACpBC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAa,CAAC,KAAK;IAClC,IAAIC,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,EAAE;MAC7B,IAAIA,YAAY,CAACG,MAAM,KAAK,CAAC,EAAE;QAC3B,MAAM,IAAIT,WAAW,CACjB,8EAA8E,EAC9E,cAAc,EACd;UACIK,KAAK;UACLC;QACJ,CACJ,CAAC;MACL;MACA,MAAM,CAACI,IAAI,EAAEC,EAAE,CAAC,GAAGL,YAAY;MAC/B,OAAOD,KAAK,IAAIK,IAAI,IAAIL,KAAK,IAAIM,EAAE;IACvC;IACA,OAAON,KAAK,IAAIC,YAAY,IAAID,KAAK,IAAIC,YAAY;EACzD;AACJ,CAAC,CAAC;AAEFJ,MAAM,CAACU,IAAI,GAAG,+BAA+B;AAE7C,eAAeV,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,53 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- const createValues = initialValue => {
3
- if (typeof initialValue === "string") {
4
- return [initialValue];
5
- }
6
- if (Array.isArray(initialValue)) {
7
- return initialValue.flat().map(v => v.toString()).filter(Boolean);
8
- }
9
- const result = [];
10
- const traverse = node => {
11
- if (node == null) {
12
- return;
13
- }
14
- if (typeof node === "string" || typeof node === "number") {
15
- result.push(node.toString());
16
- } else if (Array.isArray(node)) {
17
- node.forEach(traverse);
18
- } else if (typeof node === "object") {
19
- Object.values(node).forEach(traverse);
20
- }
21
- };
22
- traverse(initialValue);
23
- return result.filter(Boolean);
24
- };
25
- const createCompareValues = value => {
26
- return value.replace(/\s+/g, " ").trim().replace(/\?/g, `\\?`).replace(/\//g, `\\/`).replace(/:/g, ``).replace(/\-/g, `\\-`).split(" ").filter(val => {
27
- return val.length > 0;
28
- });
29
- };
30
- const plugin = new ValueFilterPlugin({
31
- operation: "contains",
32
- matches: ({
33
- value: initialValue,
34
- compareValue: initialCompareValue
35
- }) => {
36
- if (!initialValue || Array.isArray(initialValue) && initialValue.length === 0) {
37
- return false;
38
- } else if (initialCompareValue === undefined || initialCompareValue === null) {
39
- return true;
40
- }
41
- const values = createValues(initialValue);
42
- const compareValues = createCompareValues(initialCompareValue);
43
- return values.some(target => {
44
- return compareValues.every(compareValue => {
45
- return target.match(new RegExp(compareValue, "gi")) !== null;
46
- });
47
- });
48
- }
49
- });
50
- plugin.name = "dynamodb.value.filter.contains";
51
- export default plugin;
52
-
53
- //# sourceMappingURL=contains.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","createValues","initialValue","Array","isArray","flat","map","v","toString","filter","Boolean","result","traverse","node","push","forEach","Object","values","createCompareValues","value","replace","trim","split","val","length","plugin","operation","matches","compareValue","initialCompareValue","undefined","compareValues","some","target","every","match","RegExp","name"],"sources":["contains.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst createValues = (initialValue: string | string[] | object): string[] => {\n if (typeof initialValue === \"string\") {\n return [initialValue];\n }\n\n if (Array.isArray(initialValue)) {\n return initialValue\n .flat()\n .map(v => v.toString())\n .filter(Boolean);\n }\n\n const result: string[] = [];\n\n const traverse = (node: any): void => {\n if (node == null) {\n return;\n }\n if (typeof node === \"string\" || typeof node === \"number\") {\n result.push(node.toString());\n } else if (Array.isArray(node)) {\n node.forEach(traverse);\n } else if (typeof node === \"object\") {\n Object.values(node).forEach(traverse);\n }\n };\n\n traverse(initialValue);\n\n return result.filter(Boolean);\n};\n\nconst createCompareValues = (value: string) => {\n return value\n .replace(/\\s+/g, \" \")\n .trim()\n .replace(/\\?/g, `\\\\?`)\n .replace(/\\//g, `\\\\/`)\n .replace(/:/g, ``)\n .replace(/\\-/g, `\\\\-`)\n .split(\" \")\n .filter(val => {\n return val.length > 0;\n });\n};\n\nconst plugin = new ValueFilterPlugin({\n operation: \"contains\",\n matches: ({ value: initialValue, compareValue: initialCompareValue }) => {\n if (!initialValue || (Array.isArray(initialValue) && initialValue.length === 0)) {\n return false;\n } else if (initialCompareValue === undefined || initialCompareValue === null) {\n return true;\n }\n const values = createValues(initialValue);\n const compareValues = createCompareValues(initialCompareValue);\n return values.some(target => {\n return compareValues.every(compareValue => {\n return target.match(new RegExp(compareValue, \"gi\")) !== null;\n });\n });\n }\n});\n\nplugin.name = \"dynamodb.value.filter.contains\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,MAAMC,YAAY,GAAIC,YAAwC,IAAe;EACzE,IAAI,OAAOA,YAAY,KAAK,QAAQ,EAAE;IAClC,OAAO,CAACA,YAAY,CAAC;EACzB;EAEA,IAAIC,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,EAAE;IAC7B,OAAOA,YAAY,CACdG,IAAI,CAAC,CAAC,CACNC,GAAG,CAACC,CAAC,IAAIA,CAAC,CAACC,QAAQ,CAAC,CAAC,CAAC,CACtBC,MAAM,CAACC,OAAO,CAAC;EACxB;EAEA,MAAMC,MAAgB,GAAG,EAAE;EAE3B,MAAMC,QAAQ,GAAIC,IAAS,IAAW;IAClC,IAAIA,IAAI,IAAI,IAAI,EAAE;MACd;IACJ;IACA,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MACtDF,MAAM,CAACG,IAAI,CAACD,IAAI,CAACL,QAAQ,CAAC,CAAC,CAAC;IAChC,CAAC,MAAM,IAAIL,KAAK,CAACC,OAAO,CAACS,IAAI,CAAC,EAAE;MAC5BA,IAAI,CAACE,OAAO,CAACH,QAAQ,CAAC;IAC1B,CAAC,MAAM,IAAI,OAAOC,IAAI,KAAK,QAAQ,EAAE;MACjCG,MAAM,CAACC,MAAM,CAACJ,IAAI,CAAC,CAACE,OAAO,CAACH,QAAQ,CAAC;IACzC;EACJ,CAAC;EAEDA,QAAQ,CAACV,YAAY,CAAC;EAEtB,OAAOS,MAAM,CAACF,MAAM,CAACC,OAAO,CAAC;AACjC,CAAC;AAED,MAAMQ,mBAAmB,GAAIC,KAAa,IAAK;EAC3C,OAAOA,KAAK,CACPC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CACpBC,IAAI,CAAC,CAAC,CACND,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CACrBA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CACrBA,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CACjBA,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CACrBE,KAAK,CAAC,GAAG,CAAC,CACVb,MAAM,CAACc,GAAG,IAAI;IACX,OAAOA,GAAG,CAACC,MAAM,GAAG,CAAC;EACzB,CAAC,CAAC;AACV,CAAC;AAED,MAAMC,MAAM,GAAG,IAAIzB,iBAAiB,CAAC;EACjC0B,SAAS,EAAE,UAAU;EACrBC,OAAO,EAAEA,CAAC;IAAER,KAAK,EAAEjB,YAAY;IAAE0B,YAAY,EAAEC;EAAoB,CAAC,KAAK;IACrE,IAAI,CAAC3B,YAAY,IAAKC,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,IAAIA,YAAY,CAACsB,MAAM,KAAK,CAAE,EAAE;MAC7E,OAAO,KAAK;IAChB,CAAC,MAAM,IAAIK,mBAAmB,KAAKC,SAAS,IAAID,mBAAmB,KAAK,IAAI,EAAE;MAC1E,OAAO,IAAI;IACf;IACA,MAAMZ,MAAM,GAAGhB,YAAY,CAACC,YAAY,CAAC;IACzC,MAAM6B,aAAa,GAAGb,mBAAmB,CAACW,mBAAmB,CAAC;IAC9D,OAAOZ,MAAM,CAACe,IAAI,CAACC,MAAM,IAAI;MACzB,OAAOF,aAAa,CAACG,KAAK,CAACN,YAAY,IAAI;QACvC,OAAOK,MAAM,CAACE,KAAK,CAAC,IAAIC,MAAM,CAACR,YAAY,EAAE,IAAI,CAAC,CAAC,KAAK,IAAI;MAChE,CAAC,CAAC;IACN,CAAC,CAAC;EACN;AACJ,CAAC,CAAC;AAEFH,MAAM,CAACY,IAAI,GAAG,gCAAgC;AAE9C,eAAeZ,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,26 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- const plugin = new ValueFilterPlugin({
3
- operation: "eq",
4
- matches: ({
5
- value,
6
- compareValue
7
- }) => {
8
- /**
9
- * Possibility that either input value or one from the system is array.
10
- */
11
- if (Array.isArray(value) === true) {
12
- return value.some(v => {
13
- return Array.isArray(compareValue) ? compareValue.includes(v) : compareValue === v;
14
- });
15
- } else if (Array.isArray(compareValue) === true) {
16
- return compareValue.every(v => {
17
- return value == v;
18
- });
19
- }
20
- return value == compareValue;
21
- }
22
- });
23
- plugin.name = "dynamodb.value.filter.eq";
24
- export default plugin;
25
-
26
- //# sourceMappingURL=eq.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","plugin","operation","matches","value","compareValue","Array","isArray","some","v","includes","every","name"],"sources":["eq.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst plugin = new ValueFilterPlugin({\n operation: \"eq\",\n matches: ({ value, compareValue }) => {\n /**\n * Possibility that either input value or one from the system is array.\n */\n if (Array.isArray(value) === true) {\n return value.some((v: string) => {\n return Array.isArray(compareValue) ? compareValue.includes(v) : compareValue === v;\n });\n } else if (Array.isArray(compareValue) === true) {\n return compareValue.every((v: string) => {\n return value == v;\n });\n }\n return value == compareValue;\n }\n});\n\nplugin.name = \"dynamodb.value.filter.eq\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,MAAMC,MAAM,GAAG,IAAID,iBAAiB,CAAC;EACjCE,SAAS,EAAE,IAAI;EACfC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAa,CAAC,KAAK;IAClC;AACR;AACA;IACQ,IAAIC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,KAAK,IAAI,EAAE;MAC/B,OAAOA,KAAK,CAACI,IAAI,CAAEC,CAAS,IAAK;QAC7B,OAAOH,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,GAAGA,YAAY,CAACK,QAAQ,CAACD,CAAC,CAAC,GAAGJ,YAAY,KAAKI,CAAC;MACtF,CAAC,CAAC;IACN,CAAC,MAAM,IAAIH,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,KAAK,IAAI,EAAE;MAC7C,OAAOA,YAAY,CAACM,KAAK,CAAEF,CAAS,IAAK;QACrC,OAAOL,KAAK,IAAIK,CAAC;MACrB,CAAC,CAAC;IACN;IACA,OAAOL,KAAK,IAAIC,YAAY;EAChC;AACJ,CAAC,CAAC;AAEFJ,MAAM,CAACW,IAAI,GAAG,0BAA0B;AAExC,eAAeX,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,29 +0,0 @@
1
- import Fuse from "fuse.js";
2
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
3
- const plugin = new ValueFilterPlugin({
4
- operation: "fuzzy",
5
- matches: ({
6
- value: initialValue,
7
- compareValue: initialCompareValue
8
- }) => {
9
- if (typeof initialValue !== "string" || typeof initialCompareValue !== "string") {
10
- return false;
11
- }
12
- const value = initialValue.replaceAll("/", " ");
13
- const compareValue = initialCompareValue.replaceAll("/", " ");
14
- const f = new Fuse([value], {
15
- includeScore: true,
16
- minMatchCharLength: 3,
17
- threshold: 0.5,
18
- isCaseSensitive: false,
19
- findAllMatches: true,
20
- ignoreLocation: true
21
- });
22
- const result = f.search(compareValue);
23
- return result.length > 0;
24
- }
25
- });
26
- plugin.name = "dynamodb.value.filter.fuzzy";
27
- export default plugin;
28
-
29
- //# sourceMappingURL=fuzzy.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Fuse","ValueFilterPlugin","plugin","operation","matches","value","initialValue","compareValue","initialCompareValue","replaceAll","f","includeScore","minMatchCharLength","threshold","isCaseSensitive","findAllMatches","ignoreLocation","result","search","length","name"],"sources":["fuzzy.ts"],"sourcesContent":["import Fuse from \"fuse.js\";\nimport type { ValueFilterPluginParamsMatchesParams } from \"../definitions/ValueFilterPlugin.js\";\nimport { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst plugin = new ValueFilterPlugin({\n operation: \"fuzzy\",\n matches: ({\n value: initialValue,\n compareValue: initialCompareValue\n }: ValueFilterPluginParamsMatchesParams<\n string | null | undefined,\n string | null | undefined\n >) => {\n if (typeof initialValue !== \"string\" || typeof initialCompareValue !== \"string\") {\n return false;\n }\n const value = initialValue.replaceAll(\"/\", \" \");\n const compareValue = initialCompareValue.replaceAll(\"/\", \" \");\n\n const f = new Fuse([value], {\n includeScore: true,\n minMatchCharLength: 3,\n threshold: 0.5,\n isCaseSensitive: false,\n findAllMatches: true,\n ignoreLocation: true\n });\n const result = f.search(compareValue);\n\n return result.length > 0;\n }\n});\n\nplugin.name = \"dynamodb.value.filter.fuzzy\";\n\nexport default plugin;\n"],"mappings":"AAAA,OAAOA,IAAI,MAAM,SAAS;AAE1B,SAASC,iBAAiB;AAE1B,MAAMC,MAAM,GAAG,IAAID,iBAAiB,CAAC;EACjCE,SAAS,EAAE,OAAO;EAClBC,OAAO,EAAEA,CAAC;IACNC,KAAK,EAAEC,YAAY;IACnBC,YAAY,EAAEC;EAIlB,CAAC,KAAK;IACF,IAAI,OAAOF,YAAY,KAAK,QAAQ,IAAI,OAAOE,mBAAmB,KAAK,QAAQ,EAAE;MAC7E,OAAO,KAAK;IAChB;IACA,MAAMH,KAAK,GAAGC,YAAY,CAACG,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;IAC/C,MAAMF,YAAY,GAAGC,mBAAmB,CAACC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;IAE7D,MAAMC,CAAC,GAAG,IAAIV,IAAI,CAAC,CAACK,KAAK,CAAC,EAAE;MACxBM,YAAY,EAAE,IAAI;MAClBC,kBAAkB,EAAE,CAAC;MACrBC,SAAS,EAAE,GAAG;MACdC,eAAe,EAAE,KAAK;MACtBC,cAAc,EAAE,IAAI;MACpBC,cAAc,EAAE;IACpB,CAAC,CAAC;IACF,MAAMC,MAAM,GAAGP,CAAC,CAACQ,MAAM,CAACX,YAAY,CAAC;IAErC,OAAOU,MAAM,CAACE,MAAM,GAAG,CAAC;EAC5B;AACJ,CAAC,CAAC;AAEFjB,MAAM,CAACkB,IAAI,GAAG,6BAA6B;AAE3C,eAAelB,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,14 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- const plugin = new ValueFilterPlugin({
3
- operation: "gt",
4
- matches: ({
5
- value,
6
- compareValue
7
- }) => {
8
- return value > compareValue;
9
- }
10
- });
11
- plugin.name = "dynamodb.value.filter.gt";
12
- export default plugin;
13
-
14
- //# sourceMappingURL=gt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","plugin","operation","matches","value","compareValue","name"],"sources":["gt.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst plugin = new ValueFilterPlugin({\n operation: \"gt\",\n matches: ({ value, compareValue }) => {\n return value > compareValue;\n }\n});\n\nplugin.name = \"dynamodb.value.filter.gt\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,MAAMC,MAAM,GAAG,IAAID,iBAAiB,CAAC;EACjCE,SAAS,EAAE,IAAI;EACfC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAa,CAAC,KAAK;IAClC,OAAOD,KAAK,GAAGC,YAAY;EAC/B;AACJ,CAAC,CAAC;AAEFJ,MAAM,CAACK,IAAI,GAAG,0BAA0B;AAExC,eAAeL,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,14 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- const plugin = new ValueFilterPlugin({
3
- operation: "gte",
4
- matches: ({
5
- value,
6
- compareValue
7
- }) => {
8
- return value >= compareValue;
9
- }
10
- });
11
- plugin.name = "dynamodb.value.filter.gte";
12
- export default plugin;
13
-
14
- //# sourceMappingURL=gte.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","plugin","operation","matches","value","compareValue","name"],"sources":["gte.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst plugin = new ValueFilterPlugin({\n operation: \"gte\",\n matches: ({ value, compareValue }) => {\n return value >= compareValue;\n }\n});\n\nplugin.name = \"dynamodb.value.filter.gte\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,MAAMC,MAAM,GAAG,IAAID,iBAAiB,CAAC;EACjCE,SAAS,EAAE,KAAK;EAChBC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAa,CAAC,KAAK;IAClC,OAAOD,KAAK,IAAIC,YAAY;EAChC;AACJ,CAAC,CAAC;AAEFJ,MAAM,CAACK,IAAI,GAAG,2BAA2B;AAEzC,eAAeL,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,24 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- import WebinyError from "@webiny/error";
3
- const plugin = new ValueFilterPlugin({
4
- operation: "in",
5
- matches: ({
6
- value,
7
- compareValue
8
- }) => {
9
- if (!compareValue || Array.isArray(compareValue) === false) {
10
- throw new WebinyError(`The value given as "compareValue" must be an array!`, "COMPARE_VALUE_ERROR", {
11
- value,
12
- compareValue
13
- });
14
- }
15
- if (Array.isArray(value) === true) {
16
- return compareValue.some(c => value.includes(c));
17
- }
18
- return compareValue.includes(value);
19
- }
20
- });
21
- plugin.name = "dynamodb.value.filter.in";
22
- export default plugin;
23
-
24
- //# sourceMappingURL=in.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","WebinyError","plugin","operation","matches","value","compareValue","Array","isArray","some","c","includes","name"],"sources":["in.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\nimport WebinyError from \"@webiny/error\";\n\ninterface MatchesParams {\n value: any[];\n compareValue?: any[];\n}\n\nconst plugin = new ValueFilterPlugin({\n operation: \"in\",\n matches: ({ value, compareValue }: MatchesParams) => {\n if (!compareValue || Array.isArray(compareValue) === false) {\n throw new WebinyError(\n `The value given as \"compareValue\" must be an array!`,\n \"COMPARE_VALUE_ERROR\",\n {\n value,\n compareValue\n }\n );\n }\n if (Array.isArray(value) === true) {\n return compareValue.some(c => value.includes(c));\n }\n return compareValue.includes(value);\n }\n});\n\nplugin.name = \"dynamodb.value.filter.in\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAC1B,OAAOC,WAAW,MAAM,eAAe;AAOvC,MAAMC,MAAM,GAAG,IAAIF,iBAAiB,CAAC;EACjCG,SAAS,EAAE,IAAI;EACfC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAA4B,CAAC,KAAK;IACjD,IAAI,CAACA,YAAY,IAAIC,KAAK,CAACC,OAAO,CAACF,YAAY,CAAC,KAAK,KAAK,EAAE;MACxD,MAAM,IAAIL,WAAW,CACjB,qDAAqD,EACrD,qBAAqB,EACrB;QACII,KAAK;QACLC;MACJ,CACJ,CAAC;IACL;IACA,IAAIC,KAAK,CAACC,OAAO,CAACH,KAAK,CAAC,KAAK,IAAI,EAAE;MAC/B,OAAOC,YAAY,CAACG,IAAI,CAACC,CAAC,IAAIL,KAAK,CAACM,QAAQ,CAACD,CAAC,CAAC,CAAC;IACpD;IACA,OAAOJ,YAAY,CAACK,QAAQ,CAACN,KAAK,CAAC;EACvC;AACJ,CAAC,CAAC;AAEFH,MAAM,CAACU,IAAI,GAAG,0BAA0B;AAExC,eAAeV,MAAM","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- declare const _default: () => import("../index.js").ValueFilterPlugin<any, any>[];
2
- export default _default;
@@ -1,14 +0,0 @@
1
- import eqFilter from "./eq.js";
2
- import betweenFilter from "./between.js";
3
- import andInFilter from "./andIn.js";
4
- import inFilter from "./in.js";
5
- import gtFilter from "./gt.js";
6
- import gteFilter from "./gte.js";
7
- import ltFilter from "./lt.js";
8
- import lteFilter from "./lte.js";
9
- import containsFilter from "./contains.js";
10
- import fuzzyFilter from "./fuzzy.js";
11
- import startsWithFilter from "./startsWith.js";
12
- export default () => [eqFilter, andInFilter, inFilter, gtFilter, ltFilter, gteFilter, lteFilter, betweenFilter, containsFilter, fuzzyFilter, startsWithFilter];
13
-
14
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["eqFilter","betweenFilter","andInFilter","inFilter","gtFilter","gteFilter","ltFilter","lteFilter","containsFilter","fuzzyFilter","startsWithFilter"],"sources":["index.ts"],"sourcesContent":["import eqFilter from \"./eq.js\";\nimport betweenFilter from \"./between.js\";\nimport andInFilter from \"./andIn.js\";\nimport inFilter from \"./in.js\";\nimport gtFilter from \"./gt.js\";\nimport gteFilter from \"./gte.js\";\nimport ltFilter from \"./lt.js\";\nimport lteFilter from \"./lte.js\";\nimport containsFilter from \"./contains.js\";\nimport fuzzyFilter from \"./fuzzy.js\";\nimport startsWithFilter from \"./startsWith.js\";\n\nexport default () => [\n eqFilter,\n andInFilter,\n inFilter,\n gtFilter,\n ltFilter,\n gteFilter,\n lteFilter,\n betweenFilter,\n containsFilter,\n fuzzyFilter,\n startsWithFilter\n];\n"],"mappings":"AAAA,OAAOA,QAAQ;AACf,OAAOC,aAAa;AACpB,OAAOC,WAAW;AAClB,OAAOC,QAAQ;AACf,OAAOC,QAAQ;AACf,OAAOC,SAAS;AAChB,OAAOC,QAAQ;AACf,OAAOC,SAAS;AAChB,OAAOC,cAAc;AACrB,OAAOC,WAAW;AAClB,OAAOC,gBAAgB;AAEvB,eAAe,MAAM,CACjBV,QAAQ,EACRE,WAAW,EACXC,QAAQ,EACRC,QAAQ,EACRE,QAAQ,EACRD,SAAS,EACTE,SAAS,EACTN,aAAa,EACbO,cAAc,EACdC,WAAW,EACXC,gBAAgB,CACnB","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,14 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- const plugin = new ValueFilterPlugin({
3
- operation: "lt",
4
- matches: ({
5
- value,
6
- compareValue
7
- }) => {
8
- return value < compareValue;
9
- }
10
- });
11
- plugin.name = "dynamodb.value.filter.lt";
12
- export default plugin;
13
-
14
- //# sourceMappingURL=lt.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","plugin","operation","matches","value","compareValue","name"],"sources":["lt.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst plugin = new ValueFilterPlugin({\n operation: \"lt\",\n matches: ({ value, compareValue }) => {\n return value < compareValue;\n }\n});\n\nplugin.name = \"dynamodb.value.filter.lt\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,MAAMC,MAAM,GAAG,IAAID,iBAAiB,CAAC;EACjCE,SAAS,EAAE,IAAI;EACfC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAa,CAAC,KAAK;IAClC,OAAOD,KAAK,GAAGC,YAAY;EAC/B;AACJ,CAAC,CAAC;AAEFJ,MAAM,CAACK,IAAI,GAAG,0BAA0B;AAExC,eAAeL,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,14 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- const plugin = new ValueFilterPlugin({
3
- operation: "lte",
4
- matches: ({
5
- value,
6
- compareValue
7
- }) => {
8
- return value <= compareValue;
9
- }
10
- });
11
- plugin.name = "dynamodb.value.filter.lte";
12
- export default plugin;
13
-
14
- //# sourceMappingURL=lte.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","plugin","operation","matches","value","compareValue","name"],"sources":["lte.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst plugin = new ValueFilterPlugin({\n operation: \"lte\",\n matches: ({ value, compareValue }) => {\n return value <= compareValue;\n }\n});\n\nplugin.name = \"dynamodb.value.filter.lte\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,MAAMC,MAAM,GAAG,IAAID,iBAAiB,CAAC;EACjCE,SAAS,EAAE,KAAK;EAChBC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEC;EAAa,CAAC,KAAK;IAClC,OAAOD,KAAK,IAAIC,YAAY;EAChC;AACJ,CAAC,CAAC;AAEFJ,MAAM,CAACK,IAAI,GAAG,2BAA2B;AAEzC,eAAeL,MAAM","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- declare const plugin: ValueFilterPlugin<any, any>;
3
- export default plugin;
@@ -1,34 +0,0 @@
1
- import { ValueFilterPlugin } from "../definitions/ValueFilterPlugin.js";
2
- const plugin = new ValueFilterPlugin({
3
- operation: "startsWith",
4
- canUse: ({
5
- compareValue
6
- }) => {
7
- if (compareValue === "" || compareValue === null || compareValue === undefined) {
8
- return false;
9
- }
10
- return true;
11
- },
12
- matches: ({
13
- value,
14
- compareValue
15
- }) => {
16
- /**
17
- * We do "case-insensitive" comparison.
18
- */
19
- const compareValueInLowerCase = compareValue.toLowerCase();
20
- if (typeof value !== "string") {
21
- if (Array.isArray(value) === true) {
22
- return value.some(v => {
23
- return v.toLowerCase().startsWith(compareValueInLowerCase);
24
- });
25
- }
26
- return false;
27
- }
28
- return value.toLowerCase().startsWith(compareValueInLowerCase);
29
- }
30
- });
31
- plugin.name = "dynamodb.value.filter.startsWith";
32
- export default plugin;
33
-
34
- //# sourceMappingURL=startsWith.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["ValueFilterPlugin","plugin","operation","canUse","compareValue","undefined","matches","value","compareValueInLowerCase","toLowerCase","Array","isArray","some","v","startsWith","name"],"sources":["startsWith.ts"],"sourcesContent":["import { ValueFilterPlugin } from \"../definitions/ValueFilterPlugin.js\";\n\nconst plugin = new ValueFilterPlugin({\n operation: \"startsWith\",\n canUse: ({ compareValue }) => {\n if (compareValue === \"\" || compareValue === null || compareValue === undefined) {\n return false;\n }\n return true;\n },\n matches: ({ value, compareValue }) => {\n /**\n * We do \"case-insensitive\" comparison.\n */\n const compareValueInLowerCase = compareValue.toLowerCase();\n\n if (typeof value !== \"string\") {\n if (Array.isArray(value) === true) {\n return value.some((v: string) => {\n return v.toLowerCase().startsWith(compareValueInLowerCase);\n });\n }\n return false;\n }\n\n return value.toLowerCase().startsWith(compareValueInLowerCase);\n }\n});\n\nplugin.name = \"dynamodb.value.filter.startsWith\";\n\nexport default plugin;\n"],"mappings":"AAAA,SAASA,iBAAiB;AAE1B,MAAMC,MAAM,GAAG,IAAID,iBAAiB,CAAC;EACjCE,SAAS,EAAE,YAAY;EACvBC,MAAM,EAAEA,CAAC;IAAEC;EAAa,CAAC,KAAK;IAC1B,IAAIA,YAAY,KAAK,EAAE,IAAIA,YAAY,KAAK,IAAI,IAAIA,YAAY,KAAKC,SAAS,EAAE;MAC5E,OAAO,KAAK;IAChB;IACA,OAAO,IAAI;EACf,CAAC;EACDC,OAAO,EAAEA,CAAC;IAAEC,KAAK;IAAEH;EAAa,CAAC,KAAK;IAClC;AACR;AACA;IACQ,MAAMI,uBAAuB,GAAGJ,YAAY,CAACK,WAAW,CAAC,CAAC;IAE1D,IAAI,OAAOF,KAAK,KAAK,QAAQ,EAAE;MAC3B,IAAIG,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,KAAK,IAAI,EAAE;QAC/B,OAAOA,KAAK,CAACK,IAAI,CAAEC,CAAS,IAAK;UAC7B,OAAOA,CAAC,CAACJ,WAAW,CAAC,CAAC,CAACK,UAAU,CAACN,uBAAuB,CAAC;QAC9D,CAAC,CAAC;MACN;MACA,OAAO,KAAK;IAChB;IAEA,OAAOD,KAAK,CAACE,WAAW,CAAC,CAAC,CAACK,UAAU,CAACN,uBAAuB,CAAC;EAClE;AACJ,CAAC,CAAC;AAEFP,MAAM,CAACc,IAAI,GAAG,kCAAkC;AAEhD,eAAed,MAAM","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["filterPlugins"],"sources":["index.ts"],"sourcesContent":["export * from \"./definitions/assignFields.js\";\nexport * from \"./definitions/AttributePlugin.js\";\nexport * from \"./definitions/DateTimeTransformPlugin.js\";\nexport * from \"./definitions/FieldPathPlugin.js\";\nexport * from \"./definitions/FieldPlugin.js\";\nexport * from \"./definitions/TimeTransformPlugin.js\";\nexport * from \"./definitions/ValueFilterPlugin.js\";\nexport * from \"./definitions/ValueTransformPlugin.js\";\n/**\n * List everything that needs to be loaded by default.\n */\nimport filterPlugins from \"./filters/index.js\";\n\nexport default () => {\n return [filterPlugins()];\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAOA,aAAa;AAEpB,eAAe,MAAM;EACjB,OAAO,CAACA,aAAa,CAAC,CAAC,CAAC;AAC5B,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntity, IGlobalEntityAttributes } from \"~/utils/index.js\";\n\nexport interface IStoreEntityValue {\n key: string;\n value: string;\n}\n\nexport type IStoreEntity = IEntity<IGlobalEntityAttributes<IStoreEntityValue>>;\n"],"mappings":"","ignoreList":[]}
package/toolbox.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":["Entity","Table"],"sources":["toolbox.ts"],"sourcesContent":["export { Entity, Table } from \"dynamodb-toolbox\";\n\nimport { Entity, Table } from \"dynamodb-toolbox\";\n\nexport type ScanOptions = NonNullable<Parameters<Entity[\"scan\"]>[0]>;\nexport type DynamoDBTypes =\n | \"string\"\n | \"boolean\"\n | \"number\"\n | \"bigint\"\n | \"list\"\n | \"map\"\n | \"binary\"\n | \"set\";\n\ntype Key = string | number | symbol;\n\nexport type TableDef = Table<string, Key, Key | null>;\nexport type TableConstructor<\n A extends string,\n B extends Key,\n C extends Key\n> = ConstructorParameters<typeof Table<A, B, C>>[0];\n\n// TODO: this needs to be replaced with either inferred types, or manual cherry picked types.\nexport type {\n EntityConstructor,\n Readonly,\n AttributeDefinition,\n EntityQueryOptions,\n AttributeDefinitions\n} from \"dynamodb-toolbox/dist/cjs/classes/Entity/index.js\";\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,KAAK,QAAQ,kBAAkB;;AAwBhD","ignoreList":[]}
package/types.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["/**\n * We use this definition to search for a value in any given field that was passed.\n * It works as an \"OR\" condition.\n */\nexport interface DynamoDbContainsFilter {\n fields: string[];\n value: string;\n}\n\nexport interface ProcessStatementArgsParam {\n expression: string;\n attributeNames: Record<string, any>;\n attributeValues: Record<string, any>;\n}\nexport interface ProcessStatementQueryParam {\n [key: string]: any;\n}\nexport interface ProcessStatementParams {\n args: ProcessStatementArgsParam;\n query: ProcessStatementQueryParam;\n}\n\nexport interface ProcessStatementCallable {\n (params: ProcessStatementParams): void;\n}\n\nexport interface Query {\n [key: string]: string;\n}\nexport interface QueryKeyField {\n name: string;\n}\nexport interface QueryKey {\n fields: QueryKeyField[];\n primary?: boolean;\n unique?: boolean;\n name: string;\n}\nexport type QueryKeys = QueryKey[];\n\nexport type QuerySort = Record<string, -1 | 1>;\n\nexport type DbItem<TData extends Record<string, any> = Record<string, any>> = {\n PK: string;\n SK: string;\n GSI1_PK: string;\n GSI1_SK: string;\n TYPE: string;\n data: TData;\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- import type { Context } from "@webiny/api/types.js";
2
- import { AttributePlugin } from "../plugins/definitions/AttributePlugin.js";
3
- import type { PluginsContainer } from "@webiny/plugins";
4
- /**
5
- * Will be removed in favor of directly assigning attributes to a certain entity when creating the storage operations.
6
- *
7
- * @deprecated
8
- */
9
- export declare const getExtraAttributes: (context: Context, entity: string) => Record<string, AttributePlugin["_params"]>;
10
- export declare const getExtraAttributesFromPlugins: (plugins: PluginsContainer, entity: string) => Record<string, AttributePlugin["_params"]>;
@@ -1,19 +0,0 @@
1
- import { AttributePlugin } from "../plugins/definitions/AttributePlugin.js";
2
- /**
3
- * Will be removed in favor of directly assigning attributes to a certain entity when creating the storage operations.
4
- *
5
- * @deprecated
6
- */
7
- export const getExtraAttributes = (context, entity) => {
8
- return getExtraAttributesFromPlugins(context.plugins, entity);
9
- };
10
- export const getExtraAttributesFromPlugins = (plugins, entity) => {
11
- return plugins.byType(AttributePlugin.type).filter(plugin => plugin.entity === entity).reduce((attributes, plugin) => {
12
- return {
13
- ...attributes,
14
- ...plugin.getDefinition()
15
- };
16
- }, {});
17
- };
18
-
19
- //# sourceMappingURL=attributes.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["AttributePlugin","getExtraAttributes","context","entity","getExtraAttributesFromPlugins","plugins","byType","type","filter","plugin","reduce","attributes","getDefinition"],"sources":["attributes.ts"],"sourcesContent":["import type { Context } from \"@webiny/api/types.js\";\nimport { AttributePlugin } from \"~/plugins/definitions/AttributePlugin.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * Will be removed in favor of directly assigning attributes to a certain entity when creating the storage operations.\n *\n * @deprecated\n */\nexport const getExtraAttributes = (\n context: Context,\n entity: string\n): Record<string, AttributePlugin[\"_params\"]> => {\n return getExtraAttributesFromPlugins(context.plugins, entity);\n};\n\nexport const getExtraAttributesFromPlugins = (\n plugins: PluginsContainer,\n entity: string\n): Record<string, AttributePlugin[\"_params\"]> => {\n return plugins\n .byType<AttributePlugin>(AttributePlugin.type)\n .filter(plugin => plugin.entity === entity)\n .reduce((attributes, plugin) => {\n return {\n ...attributes,\n ...plugin.getDefinition()\n };\n }, {});\n};\n"],"mappings":"AACA,SAASA,eAAe;AAGxB;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,kBAAkB,GAAGA,CAC9BC,OAAgB,EAChBC,MAAc,KAC+B;EAC7C,OAAOC,6BAA6B,CAACF,OAAO,CAACG,OAAO,EAAEF,MAAM,CAAC;AACjE,CAAC;AAED,OAAO,MAAMC,6BAA6B,GAAGA,CACzCC,OAAyB,EACzBF,MAAc,KAC+B;EAC7C,OAAOE,OAAO,CACTC,MAAM,CAAkBN,eAAe,CAACO,IAAI,CAAC,CAC7CC,MAAM,CAACC,MAAM,IAAIA,MAAM,CAACN,MAAM,KAAKA,MAAM,CAAC,CAC1CO,MAAM,CAAC,CAACC,UAAU,EAAEF,MAAM,KAAK;IAC5B,OAAO;MACH,GAAGE,UAAU;MACb,GAAGF,MAAM,CAACG,aAAa,CAAC;IAC5B,CAAC;EACL,CAAC,EAAE,CAAC,CAAC,CAAC;AACd,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./batchRead.js\";\nexport * from \"./batchWrite.js\";\nexport * from \"./types.js\";\n"],"mappings":"AAAA;AACA;AACA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { WriteRequest } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\nexport interface BatchWriteResponse {\n next?: () => Promise<BatchWriteResponse>;\n $metadata: {\n httpStatusCode: number;\n requestId: string;\n attempts: number;\n totalRetryDelay: number;\n };\n UnprocessedItems?: {\n [table: string]: WriteRequest[];\n };\n}\n\nexport type BatchWriteResult = BatchWriteResponse[];\n\nexport interface IDeleteBatchItem {\n PK: string;\n SK: string;\n}\n\nexport type IPutBatchItem<T = GenericRecord> = {\n PK: string;\n SK: string;\n} & T;\n\nexport interface BatchWriteItem {\n [key: string]: WriteRequest;\n}\n\nexport interface IReadBatchItem {\n PK: string;\n SK: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./Entity.js\";\nexport * from \"./EntityReadBatch.js\";\nexport * from \"./EntityReadBatchBuilder.js\";\nexport * from \"./EntityWriteBatch.js\";\nexport * from \"./EntityWriteBatchBuilder.js\";\nexport * from \"./getEntity.js\";\nexport * from \"./types.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["queryAll","queryAllClean","queryOne","queryOneClean","queryPerPage"],"sources":["types.ts"],"sourcesContent":["import type { Entity as BaseEntity } from \"dynamodb-toolbox\";\nimport type {\n BatchWriteItem,\n BatchWriteResult,\n IDeleteBatchItem,\n IPutBatchItem\n} from \"~/utils/batch/types.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type { TableDef } from \"~/toolbox.js\";\nimport type { ITableWriteBatch } from \"~/utils/table/types.js\";\nimport type { IPutParamsItem, put } from \"~/utils/put.js\";\nimport {\n queryAll,\n queryAllClean,\n type QueryAllParams,\n queryOne,\n queryOneClean,\n type QueryOneParams\n} from \"~/utils/query.js\";\nimport type { get, getClean, GetRecordParamsKeys } from \"~/utils/get.js\";\nimport type { deleteItem, IDeleteItemKeys } from \"~/utils/delete.js\";\nimport type { batchReadAll, BatchReadItem } from \"~/utils/batch/batchRead.js\";\nimport type { IEntityWriteBatchParams } from \"./EntityWriteBatch.js\";\nimport type { IEntityReadBatchParams } from \"./EntityReadBatch.js\";\nimport { queryPerPage } from \"~/utils/index.js\";\n\nexport type IEntityQueryOneParams = Omit<QueryOneParams, \"entity\">;\n\nexport type IEntityQueryAllParams = Omit<QueryAllParams, \"entity\">;\nexport type IEntityQueryPerPageParams = Omit<QueryAllParams, \"entity\">;\n\nexport interface IEntityCreateEntityWriterParams<T = GenericRecord>\n extends Omit<IEntityWriteBatchParams<T>, \"entity\"> {}\nexport interface IEntityCreateEntityReaderParams extends Omit<IEntityReadBatchParams, \"entity\"> {}\n\nexport type IEntityPutResult = ReturnType<typeof put>;\nexport type IEntityGetResult<T> = ReturnType<typeof get<T>>;\nexport type IEntityGetCleanResult<T> = ReturnType<typeof getClean<T>>;\nexport type IEntityDeleteResult = ReturnType<typeof deleteItem>;\nexport type IEntityQueryOneResult<T> = ReturnType<typeof queryOne<T>>;\nexport type IEntityQueryOneCleanResult<T> = ReturnType<typeof queryOneClean<T>>;\nexport type IEntityQueryAllResult<T> = ReturnType<typeof queryAll<T>>;\nexport type IEntityQueryAllCleanResult<T> = ReturnType<typeof queryAllClean<T>>;\nexport type IEntityQueryPerPageResult<T> = ReturnType<typeof queryPerPage<T>>;\n\nexport interface IEntity<T extends GenericRecord = GenericRecord> {\n readonly entity: BaseEntity;\n readonly name: string;\n readonly table: TableDef;\n createEntityReader(params?: IEntityCreateEntityReaderParams): IEntityReadBatch<T>;\n createEntityWriter(params?: IEntityCreateEntityWriterParams<T>): IEntityWriteBatch<T>;\n createTableWriter(): ITableWriteBatch;\n put(item: IPutParamsItem<T>): IEntityPutResult;\n get<R extends T = T>(keys: GetRecordParamsKeys): IEntityGetResult<R>;\n getClean<R extends T = T>(keys: GetRecordParamsKeys): IEntityGetCleanResult<R>;\n delete(keys: IDeleteItemKeys): IEntityDeleteResult;\n queryOne<R extends T = T>(params: IEntityQueryOneParams): IEntityQueryOneResult<R>;\n queryOneClean<R extends T = T>(params: IEntityQueryOneParams): IEntityQueryOneCleanResult<R>;\n queryAll<R extends T = T>(params: IEntityQueryAllParams): IEntityQueryAllResult<R>;\n queryAllClean<R extends T = T>(params: IEntityQueryAllParams): IEntityQueryAllCleanResult<R>;\n queryPerPage<R extends T = T>(params: IEntityQueryPerPageParams): IEntityQueryPerPageResult<R>;\n}\n\nexport interface IEntityWriteBatchBuilder {\n // readonly entity: Entity;\n put<T extends Record<string, any>>(item: IPutBatchItem<T>): BatchWriteItem;\n delete(item: IDeleteBatchItem): BatchWriteItem;\n}\n\nexport interface IEntityWriteBatch<T = GenericRecord> {\n readonly total: number;\n readonly items: BatchWriteItem[];\n\n put(item: IPutBatchItem<T>): void;\n delete(item: IDeleteBatchItem): void;\n execute(): Promise<BatchWriteResult>;\n combine(items: BatchWriteItem[]): ITableWriteBatch;\n}\n\nexport interface IEntityReadBatchKey {\n PK: string;\n SK: string;\n}\n\nexport interface IEntityReadBatch<T = GenericRecord> {\n readonly total: number;\n readonly items: BatchReadItem[];\n get(input: IEntityReadBatchKey | IEntityReadBatchKey[]): void;\n execute(): ReturnType<typeof batchReadAll<T>>;\n}\n\nexport interface IEntityReadBatchBuilderGetResponse {\n Table: TableDef;\n Key: IEntityReadBatchKey;\n}\n\nexport interface IEntityReadBatchBuilder {\n get(item: IEntityReadBatchKey): IEntityReadBatchBuilderGetResponse;\n}\n"],"mappings":"AAWA,SACIA,QAAQ,EACRC,aAAa,EAEbC,QAAQ,EACRC,aAAa;AAQjB,SAASC,YAAY","ignoreList":[]}
package/utils/filter.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import type { PluginsContainer } from "@webiny/plugins";
2
- import type { FieldPlugin } from "../plugins/definitions/FieldPlugin.js";
3
- export interface Params<T = any> {
4
- plugins: PluginsContainer;
5
- items: T[];
6
- where: Record<string, any>;
7
- /**
8
- * An array of fields that require some special operation.
9
- */
10
- fields: FieldPlugin[];
11
- }
12
- export declare function filterItems<T = any>(params: Params<T>): T[];