@webiny/api-headless-cms-ddb 0.0.0-ee-vpcs.549378cf03

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 (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +25 -0
  3. package/definitions/entry.d.ts +9 -0
  4. package/definitions/entry.js +96 -0
  5. package/definitions/entry.js.map +1 -0
  6. package/definitions/group.d.ts +9 -0
  7. package/definitions/group.js +70 -0
  8. package/definitions/group.js.map +1 -0
  9. package/definitions/model.d.ts +9 -0
  10. package/definitions/model.js +97 -0
  11. package/definitions/model.js.map +1 -0
  12. package/definitions/settings.d.ts +9 -0
  13. package/definitions/settings.js +58 -0
  14. package/definitions/settings.js.map +1 -0
  15. package/definitions/system.d.ts +9 -0
  16. package/definitions/system.js +46 -0
  17. package/definitions/system.js.map +1 -0
  18. package/definitions/table.d.ts +9 -0
  19. package/definitions/table.js +30 -0
  20. package/definitions/table.js.map +1 -0
  21. package/dynamoDb/index.d.ts +2 -0
  22. package/dynamoDb/index.js +20 -0
  23. package/dynamoDb/index.js.map +1 -0
  24. package/dynamoDb/path/plainObject.d.ts +2 -0
  25. package/dynamoDb/path/plainObject.js +40 -0
  26. package/dynamoDb/path/plainObject.js.map +1 -0
  27. package/dynamoDb/storage/date.d.ts +3 -0
  28. package/dynamoDb/storage/date.js +109 -0
  29. package/dynamoDb/storage/date.js.map +1 -0
  30. package/dynamoDb/storage/longText.d.ts +10 -0
  31. package/dynamoDb/storage/longText.js +108 -0
  32. package/dynamoDb/storage/longText.js.map +1 -0
  33. package/dynamoDb/storage/richText.d.ts +2 -0
  34. package/dynamoDb/storage/richText.js +113 -0
  35. package/dynamoDb/storage/richText.js.map +1 -0
  36. package/dynamoDb/transformValue/datetime.d.ts +5 -0
  37. package/dynamoDb/transformValue/datetime.js +52 -0
  38. package/dynamoDb/transformValue/datetime.js.map +1 -0
  39. package/index.d.ts +3 -0
  40. package/index.js +150 -0
  41. package/index.js.map +1 -0
  42. package/operations/entry/dataLoaders.d.ts +42 -0
  43. package/operations/entry/dataLoaders.js +321 -0
  44. package/operations/entry/dataLoaders.js.map +1 -0
  45. package/operations/entry/filtering/createExpressions.d.ts +26 -0
  46. package/operations/entry/filtering/createExpressions.js +217 -0
  47. package/operations/entry/filtering/createExpressions.js.map +1 -0
  48. package/operations/entry/filtering/createFields.d.ts +14 -0
  49. package/operations/entry/filtering/createFields.js +123 -0
  50. package/operations/entry/filtering/createFields.js.map +1 -0
  51. package/operations/entry/filtering/extractSort.d.ts +13 -0
  52. package/operations/entry/filtering/extractSort.js +55 -0
  53. package/operations/entry/filtering/extractSort.js.map +1 -0
  54. package/operations/entry/filtering/filter.d.ts +15 -0
  55. package/operations/entry/filtering/filter.js +178 -0
  56. package/operations/entry/filtering/filter.js.map +1 -0
  57. package/operations/entry/filtering/fullTextSearch.d.ts +14 -0
  58. package/operations/entry/filtering/fullTextSearch.js +60 -0
  59. package/operations/entry/filtering/fullTextSearch.js.map +1 -0
  60. package/operations/entry/filtering/getValue.d.ts +5 -0
  61. package/operations/entry/filtering/getValue.js +81 -0
  62. package/operations/entry/filtering/getValue.js.map +1 -0
  63. package/operations/entry/filtering/index.d.ts +2 -0
  64. package/operations/entry/filtering/index.js +21 -0
  65. package/operations/entry/filtering/index.js.map +1 -0
  66. package/operations/entry/filtering/mapPlugins.d.ts +8 -0
  67. package/operations/entry/filtering/mapPlugins.js +39 -0
  68. package/operations/entry/filtering/mapPlugins.js.map +1 -0
  69. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +2 -0
  70. package/operations/entry/filtering/plugins/defaultFilterCreate.js +48 -0
  71. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -0
  72. package/operations/entry/filtering/plugins/index.d.ts +1 -0
  73. package/operations/entry/filtering/plugins/index.js +18 -0
  74. package/operations/entry/filtering/plugins/index.js.map +1 -0
  75. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +2 -0
  76. package/operations/entry/filtering/plugins/objectFilterCreate.js +107 -0
  77. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -0
  78. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +2 -0
  79. package/operations/entry/filtering/plugins/refFilterCreate.js +89 -0
  80. package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -0
  81. package/operations/entry/filtering/sort.d.ts +9 -0
  82. package/operations/entry/filtering/sort.js +80 -0
  83. package/operations/entry/filtering/sort.js.map +1 -0
  84. package/operations/entry/filtering/systemFields.d.ts +4 -0
  85. package/operations/entry/filtering/systemFields.js +72 -0
  86. package/operations/entry/filtering/systemFields.js.map +1 -0
  87. package/operations/entry/filtering/transform.d.ts +6 -0
  88. package/operations/entry/filtering/transform.js +19 -0
  89. package/operations/entry/filtering/transform.js.map +1 -0
  90. package/operations/entry/filtering/types.d.ts +40 -0
  91. package/operations/entry/filtering/types.js +5 -0
  92. package/operations/entry/filtering/types.js.map +1 -0
  93. package/operations/entry/filtering/values.d.ts +2 -0
  94. package/operations/entry/filtering/values.js +28 -0
  95. package/operations/entry/filtering/values.js.map +1 -0
  96. package/operations/entry/filtering/where.d.ts +5 -0
  97. package/operations/entry/filtering/where.js +38 -0
  98. package/operations/entry/filtering/where.js.map +1 -0
  99. package/operations/entry/index.d.ts +8 -0
  100. package/operations/entry/index.js +872 -0
  101. package/operations/entry/index.js.map +1 -0
  102. package/operations/entry/keys.d.ts +25 -0
  103. package/operations/entry/keys.js +73 -0
  104. package/operations/entry/keys.js.map +1 -0
  105. package/operations/entry/systemFields.d.ts +2 -0
  106. package/operations/entry/systemFields.js +74 -0
  107. package/operations/entry/systemFields.js.map +1 -0
  108. package/operations/group/index.d.ts +9 -0
  109. package/operations/group/index.js +192 -0
  110. package/operations/group/index.js.map +1 -0
  111. package/operations/model/index.d.ts +7 -0
  112. package/operations/model/index.js +162 -0
  113. package/operations/model/index.js.map +1 -0
  114. package/operations/settings/index.d.ts +7 -0
  115. package/operations/settings/index.js +135 -0
  116. package/operations/settings/index.js.map +1 -0
  117. package/operations/system/index.d.ts +7 -0
  118. package/operations/system/index.js +99 -0
  119. package/operations/system/index.js.map +1 -0
  120. package/package.json +60 -0
  121. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +22 -0
  122. package/plugins/CmsEntryFieldFilterPathPlugin.js +55 -0
  123. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -0
  124. package/plugins/CmsEntryFieldFilterPlugin.d.ts +43 -0
  125. package/plugins/CmsEntryFieldFilterPlugin.js +31 -0
  126. package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -0
  127. package/plugins/index.d.ts +1 -0
  128. package/plugins/index.js +18 -0
  129. package/plugins/index.js.map +1 -0
  130. package/types.d.ts +53 -0
  131. package/types.js +16 -0
  132. package/types.js.map +1 -0
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getWhereValues = void 0;
9
+
10
+ var _error = _interopRequireDefault(require("@webiny/error"));
11
+
12
+ const getWhereValues = (value, condition) => {
13
+ const values = value;
14
+
15
+ if (!Array.isArray(values)) {
16
+ throw new _error.default(`Trying to run filtering with "${condition}", but the value sent is not an array.`, `MALFORMED_${condition}_CONDITION`, {
17
+ value
18
+ });
19
+ } else if (values.length === 0) {
20
+ throw new _error.default(`Trying to run filtering with "${condition}", but the value sent is empty array.`, `MALFORMED_${condition}_CONDITION`, {
21
+ value
22
+ });
23
+ }
24
+
25
+ return values;
26
+ };
27
+
28
+ exports.getWhereValues = getWhereValues;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["getWhereValues","value","condition","values","Array","isArray","WebinyError","length"],"sources":["values.ts"],"sourcesContent":["import { 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;;AAEO,MAAMA,cAAc,GAAG,CAACC,KAAD,EAAiBC,SAAjB,KAA6C;EACvE,MAAMC,MAAM,GAAGF,KAAf;;EACA,IAAI,CAACG,KAAK,CAACC,OAAN,CAAcF,MAAd,CAAL,EAA4B;IACxB,MAAM,IAAIG,cAAJ,CACD,iCAAgCJ,SAAU,wCADzC,EAED,aAAYA,SAAU,YAFrB,EAGF;MACID;IADJ,CAHE,CAAN;EAOH,CARD,MAQO,IAAIE,MAAM,CAACI,MAAP,KAAkB,CAAtB,EAAyB;IAC5B,MAAM,IAAID,cAAJ,CACD,iCAAgCJ,SAAU,uCADzC,EAED,aAAYA,SAAU,YAFrB,EAGF;MACID;IADJ,CAHE,CAAN;EAOH;;EACD,OAAOE,MAAP;AACH,CApBM"}
@@ -0,0 +1,5 @@
1
+ export declare const extractWhereParams: (key: string) => {
2
+ fieldId: string;
3
+ operation: string;
4
+ negate: boolean;
5
+ } | null;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.extractWhereParams = void 0;
7
+
8
+ const extractWhereParams = key => {
9
+ const result = key.split("_");
10
+ const fieldId = result.shift();
11
+
12
+ if (!fieldId) {
13
+ return null;
14
+ }
15
+
16
+ const rawOp = result.length === 0 ? "eq" : result.join("_");
17
+ /**
18
+ * When rawOp is not, it means it is equal negated so just return that.
19
+ */
20
+
21
+ if (rawOp === "not") {
22
+ return {
23
+ fieldId,
24
+ operation: "eq",
25
+ negate: true
26
+ };
27
+ }
28
+
29
+ const negate = rawOp.match("not_") !== null;
30
+ const operation = rawOp.replace("not_", "");
31
+ return {
32
+ fieldId,
33
+ operation,
34
+ negate
35
+ };
36
+ };
37
+
38
+ exports.extractWhereParams = extractWhereParams;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["extractWhereParams","key","result","split","fieldId","shift","rawOp","length","join","operation","negate","match","replace"],"sources":["where.ts"],"sourcesContent":["export const extractWhereParams = (key: string) => {\n const result = key.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,\n operation,\n negate\n };\n};\n"],"mappings":";;;;;;;AAAO,MAAMA,kBAAkB,GAAIC,GAAD,IAAiB;EAC/C,MAAMC,MAAM,GAAGD,GAAG,CAACE,KAAJ,CAAU,GAAV,CAAf;EACA,MAAMC,OAAO,GAAGF,MAAM,CAACG,KAAP,EAAhB;;EACA,IAAI,CAACD,OAAL,EAAc;IACV,OAAO,IAAP;EACH;;EACD,MAAME,KAAK,GAAGJ,MAAM,CAACK,MAAP,KAAkB,CAAlB,GAAsB,IAAtB,GAA6BL,MAAM,CAACM,IAAP,CAAY,GAAZ,CAA3C;EACA;AACJ;AACA;;EACI,IAAIF,KAAK,KAAK,KAAd,EAAqB;IACjB,OAAO;MACHF,OADG;MAEHK,SAAS,EAAE,IAFR;MAGHC,MAAM,EAAE;IAHL,CAAP;EAKH;;EACD,MAAMA,MAAM,GAAGJ,KAAK,CAACK,KAAN,CAAY,MAAZ,MAAwB,IAAvC;EACA,MAAMF,SAAS,GAAGH,KAAK,CAACM,OAAN,CAAc,MAAd,EAAsB,EAAtB,CAAlB;EACA,OAAO;IACHR,OADG;IAEHK,SAFG;IAGHC;EAHG,CAAP;AAKH,CAxBM"}
@@ -0,0 +1,8 @@
1
+ import { CmsEntryStorageOperations } from "@webiny/api-headless-cms/types";
2
+ import { Entity } from "dynamodb-toolbox";
3
+ import { PluginsContainer } from "@webiny/plugins";
4
+ export interface CreateEntriesStorageOperationsParams {
5
+ entity: Entity<any>;
6
+ plugins: PluginsContainer;
7
+ }
8
+ export declare const createEntriesStorageOperations: (params: CreateEntriesStorageOperationsParams) => CmsEntryStorageOperations;