@webiny/api-headless-cms-ddb 0.0.0-mt-3 → 0.0.0-unstable.2af142b57e

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 (135) hide show
  1. package/definitions/entry.d.ts +2 -1
  2. package/definitions/entry.js +6 -12
  3. package/definitions/entry.js.map +1 -0
  4. package/definitions/group.d.ts +2 -1
  5. package/definitions/group.js +3 -12
  6. package/definitions/group.js.map +1 -0
  7. package/definitions/model.d.ts +2 -1
  8. package/definitions/model.js +8 -12
  9. package/definitions/model.js.map +1 -0
  10. package/definitions/settings.d.ts +2 -1
  11. package/definitions/settings.js +3 -12
  12. package/definitions/settings.js.map +1 -0
  13. package/definitions/system.d.ts +2 -1
  14. package/definitions/system.js +3 -12
  15. package/definitions/system.js.map +1 -0
  16. package/definitions/table.d.ts +2 -1
  17. package/definitions/table.js +0 -3
  18. package/definitions/table.js.map +1 -0
  19. package/dynamoDb/index.d.ts +1 -1
  20. package/dynamoDb/index.js +6 -17
  21. package/dynamoDb/index.js.map +1 -0
  22. package/dynamoDb/path/plainObject.d.ts +2 -3
  23. package/dynamoDb/path/plainObject.js +25 -25
  24. package/dynamoDb/path/plainObject.js.map +1 -0
  25. package/dynamoDb/storage/date.d.ts +3 -3
  26. package/dynamoDb/storage/date.js +80 -54
  27. package/dynamoDb/storage/date.js.map +1 -0
  28. package/dynamoDb/storage/longText.d.ts +7 -4
  29. package/dynamoDb/storage/longText.js +72 -64
  30. package/dynamoDb/storage/longText.js.map +1 -0
  31. package/dynamoDb/storage/richText.d.ts +2 -8
  32. package/dynamoDb/storage/richText.js +62 -77
  33. package/dynamoDb/storage/richText.js.map +1 -0
  34. package/dynamoDb/transformValue/datetime.d.ts +4 -2
  35. package/dynamoDb/transformValue/datetime.js +28 -30
  36. package/dynamoDb/transformValue/datetime.js.map +1 -0
  37. package/index.d.ts +1 -0
  38. package/index.js +50 -41
  39. package/index.js.map +1 -0
  40. package/operations/entry/dataLoaders.d.ts +12 -8
  41. package/operations/entry/dataLoaders.js +27 -52
  42. package/operations/entry/dataLoaders.js.map +1 -0
  43. package/operations/entry/filtering/createExpressions.d.ts +26 -0
  44. package/operations/entry/filtering/createExpressions.js +176 -0
  45. package/operations/entry/filtering/createExpressions.js.map +1 -0
  46. package/operations/entry/filtering/createFields.d.ts +14 -0
  47. package/operations/entry/filtering/createFields.js +105 -0
  48. package/operations/entry/filtering/createFields.js.map +1 -0
  49. package/operations/entry/filtering/extractSort.d.ts +17 -0
  50. package/operations/entry/filtering/extractSort.js +67 -0
  51. package/operations/entry/filtering/extractSort.js.map +1 -0
  52. package/operations/entry/filtering/filter.d.ts +15 -0
  53. package/operations/entry/filtering/filter.js +143 -0
  54. package/operations/entry/filtering/filter.js.map +1 -0
  55. package/operations/entry/filtering/fullTextSearch.d.ts +14 -0
  56. package/operations/entry/filtering/fullTextSearch.js +48 -0
  57. package/operations/entry/filtering/fullTextSearch.js.map +1 -0
  58. package/operations/entry/filtering/getValue.d.ts +5 -0
  59. package/operations/entry/filtering/getValue.js +63 -0
  60. package/operations/entry/filtering/getValue.js.map +1 -0
  61. package/operations/entry/filtering/index.d.ts +2 -0
  62. package/operations/entry/filtering/index.js +19 -0
  63. package/operations/entry/filtering/index.js.map +1 -0
  64. package/operations/entry/filtering/mapPlugins.d.ts +8 -0
  65. package/operations/entry/filtering/mapPlugins.js +31 -0
  66. package/operations/entry/filtering/mapPlugins.js.map +1 -0
  67. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +2 -0
  68. package/operations/entry/filtering/plugins/defaultFilterCreate.js +41 -0
  69. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -0
  70. package/operations/entry/filtering/plugins/index.d.ts +1 -0
  71. package/operations/entry/filtering/plugins/index.js +13 -0
  72. package/operations/entry/filtering/plugins/index.js.map +1 -0
  73. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +2 -0
  74. package/operations/entry/filtering/plugins/objectFilterCreate.js +86 -0
  75. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -0
  76. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +2 -0
  77. package/operations/entry/filtering/plugins/refFilterCreate.js +71 -0
  78. package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -0
  79. package/operations/entry/filtering/sort.d.ts +12 -0
  80. package/operations/entry/filtering/sort.js +69 -0
  81. package/operations/entry/filtering/sort.js.map +1 -0
  82. package/operations/entry/filtering/systemFields.d.ts +4 -0
  83. package/operations/entry/filtering/systemFields.js +70 -0
  84. package/operations/entry/filtering/systemFields.js.map +1 -0
  85. package/operations/entry/filtering/transform.d.ts +6 -0
  86. package/operations/entry/filtering/transform.js +16 -0
  87. package/operations/entry/filtering/transform.js.map +1 -0
  88. package/operations/entry/filtering/types.d.ts +40 -0
  89. package/operations/entry/filtering/types.js +5 -0
  90. package/operations/entry/filtering/types.js.map +1 -0
  91. package/operations/entry/filtering/values.d.ts +2 -0
  92. package/operations/entry/filtering/values.js +22 -0
  93. package/operations/entry/filtering/values.js.map +1 -0
  94. package/operations/entry/filtering/where.d.ts +5 -0
  95. package/operations/entry/filtering/where.js +32 -0
  96. package/operations/entry/filtering/where.js.map +1 -0
  97. package/operations/entry/index.d.ts +2 -2
  98. package/operations/entry/index.js +273 -309
  99. package/operations/entry/index.js.map +1 -0
  100. package/operations/entry/keys.js +7 -14
  101. package/operations/entry/keys.js.map +1 -0
  102. package/operations/entry/systemFields.js +24 -2
  103. package/operations/entry/systemFields.js.map +1 -0
  104. package/operations/group/index.d.ts +3 -2
  105. package/operations/group/index.js +9 -45
  106. package/operations/group/index.js.map +1 -0
  107. package/operations/model/index.d.ts +3 -2
  108. package/operations/model/index.js +13 -37
  109. package/operations/model/index.js.map +1 -0
  110. package/operations/settings/index.d.ts +3 -2
  111. package/operations/settings/index.js +7 -37
  112. package/operations/settings/index.js.map +1 -0
  113. package/operations/system/index.d.ts +3 -2
  114. package/operations/system/index.js +5 -28
  115. package/operations/system/index.js.map +1 -0
  116. package/package.json +22 -23
  117. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +22 -0
  118. package/plugins/CmsEntryFieldFilterPathPlugin.js +41 -0
  119. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -0
  120. package/plugins/CmsEntryFieldFilterPlugin.d.ts +43 -0
  121. package/plugins/CmsEntryFieldFilterPlugin.js +24 -0
  122. package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -0
  123. package/plugins/CmsEntryFieldSortingPlugin.d.ts +42 -0
  124. package/plugins/CmsEntryFieldSortingPlugin.js +28 -0
  125. package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -0
  126. package/plugins/index.d.ts +3 -0
  127. package/plugins/index.js +38 -0
  128. package/plugins/index.js.map +1 -0
  129. package/types.d.ts +2 -33
  130. package/types.js +0 -1
  131. package/types.js.map +1 -0
  132. package/dynamoDb/path/ref.d.ts +0 -3
  133. package/dynamoDb/path/ref.js +0 -27
  134. package/operations/entry/utils.d.ts +0 -31
  135. package/operations/entry/utils.js +0 -406
@@ -1,7 +1,10 @@
1
- import { StorageTransformPlugin } from "@webiny/api-headless-cms/content/plugins/storage/StorageTransformPlugin";
1
+ /**
2
+ * File is @internal
3
+ */
4
+ import { StorageTransformPlugin } from "@webiny/api-headless-cms";
2
5
  export interface StorageValue {
3
6
  compression: string;
4
- value: any;
7
+ value: string;
8
+ isArray?: boolean;
5
9
  }
6
- declare const _default: () => StorageTransformPlugin<string, StorageValue>;
7
- export default _default;
10
+ export declare const createLongTextStorageTransformPlugin: () => StorageTransformPlugin<string | string[], StorageValue, import("@webiny/api-headless-cms/types").CmsModelField>;
@@ -1,83 +1,91 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.default = void 0;
9
-
7
+ exports.createLongTextStorageTransformPlugin = void 0;
10
8
  var _error = _interopRequireDefault(require("@webiny/error"));
11
-
12
9
  var _gzip = require("@webiny/utils/compression/gzip");
13
-
14
- var _StorageTransformPlugin = require("@webiny/api-headless-cms/content/plugins/storage/StorageTransformPlugin");
10
+ var _apiHeadlessCms = require("@webiny/api-headless-cms");
11
+ /**
12
+ * File is @internal
13
+ */
15
14
 
16
15
  const GZIP = "gzip";
17
16
  const TO_STORAGE_ENCODING = "base64";
18
17
  const FROM_STORAGE_ENCODING = "utf8";
19
-
20
18
  const convertToBuffer = value => {
21
19
  if (typeof value === "string") {
22
20
  return Buffer.from(value, TO_STORAGE_ENCODING);
23
21
  }
24
-
25
22
  return value;
26
23
  };
27
-
28
- const plugin = new _StorageTransformPlugin.StorageTransformPlugin({
29
- fieldType: "long-text",
30
- fromStorage: async ({
31
- field,
32
- value: storageValue
33
- }) => {
34
- const typeOf = typeof storageValue;
35
-
36
- if (!storageValue || typeOf === "string" || typeOf === "number") {
37
- return storageValue;
38
- } else if (typeof storageValue !== "object") {
39
- throw new _error.default(`LongText value received in "fromStorage" function is not an object in field "${field.fieldId}".`);
24
+ const createLongTextStorageTransformPlugin = () => {
25
+ return new _apiHeadlessCms.StorageTransformPlugin({
26
+ fieldType: "long-text",
27
+ fromStorage: async ({
28
+ field,
29
+ value: storageValue
30
+ }) => {
31
+ const typeOf = typeof storageValue;
32
+ if (!storageValue || typeOf === "string" || typeOf === "number" || Array.isArray(storageValue) === true) {
33
+ return storageValue;
34
+ } else if (typeOf !== "object") {
35
+ throw new _error.default(`LongText value received in "fromStorage" function is not an object in field "${field.storageId}" - ${field.fieldId}.`);
36
+ }
37
+ const {
38
+ compression,
39
+ value,
40
+ isArray
41
+ } = storageValue;
42
+ /**
43
+ * Check if possibly undefined, null, empty...
44
+ */
45
+ if (!compression) {
46
+ throw new _error.default(`Missing compression in "fromStorage" function in field "${field.storageId}" - ${field.fieldId}.": ${JSON.stringify(storageValue)}.`, "MISSING_COMPRESSION", {
47
+ value: storageValue
48
+ });
49
+ } else if (compression !== GZIP) {
50
+ throw new _error.default(`This plugin cannot transform something not compressed with "GZIP".`, "WRONG_COMPRESSION", {
51
+ compression
52
+ });
53
+ }
54
+ try {
55
+ const buf = await (0, _gzip.decompress)(convertToBuffer(value));
56
+ const result = buf.toString(FROM_STORAGE_ENCODING);
57
+ if (!isArray) {
58
+ return result;
59
+ }
60
+ return JSON.parse(result);
61
+ } catch (ex) {
62
+ console.log("Error while transforming long-text.");
63
+ console.log(ex.message);
64
+ return "";
65
+ }
66
+ },
67
+ toStorage: async ({
68
+ value: initialValue
69
+ }) => {
70
+ /**
71
+ * There is a possibility that we are trying to compress already compressed value.
72
+ */
73
+ if (initialValue && initialValue.hasOwnProperty("compression") === true) {
74
+ return initialValue;
75
+ }
76
+ const isArray = Array.isArray(initialValue);
77
+ const value = isArray ? JSON.stringify(initialValue) : initialValue;
78
+ const compressedValue = await (0, _gzip.compress)(value);
79
+ const result = {
80
+ compression: GZIP,
81
+ value: compressedValue.toString(TO_STORAGE_ENCODING)
82
+ };
83
+ if (!isArray) {
84
+ return result;
85
+ }
86
+ result.isArray = isArray;
87
+ return result;
40
88
  }
41
-
42
- const {
43
- compression,
44
- value
45
- } = storageValue;
46
- /**
47
- * Check if possibly undefined, null, empty...
48
- */
49
-
50
- if (!compression) {
51
- throw new _error.default(`Missing compression in "fromStorage" function in field "${field.fieldId}": ${JSON.stringify(storageValue)}.`, "MISSING_COMPRESSION", {
52
- value: storageValue
53
- });
54
- } else if (compression !== GZIP) {
55
- throw new _error.default(`This plugin cannot transform something not compressed with "GZIP".`, "WRONG_COMPRESSION", {
56
- compression
57
- });
58
- }
59
-
60
- try {
61
- const buf = await (0, _gzip.decompress)(convertToBuffer(value));
62
- return buf.toString(FROM_STORAGE_ENCODING);
63
- } catch (ex) {
64
- console.log(ex.message);
65
- return null;
66
- }
67
- },
68
- toStorage: async ({
69
- value
70
- }) => {
71
- const compressedValue = await (0, _gzip.compress)(value);
72
- return {
73
- compression: GZIP,
74
- value: compressedValue.toString(TO_STORAGE_ENCODING)
75
- };
76
- }
77
- });
78
-
79
- var _default = () => {
80
- return plugin;
89
+ });
81
90
  };
82
-
83
- exports.default = _default;
91
+ exports.createLongTextStorageTransformPlugin = createLongTextStorageTransformPlugin;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["GZIP","TO_STORAGE_ENCODING","FROM_STORAGE_ENCODING","convertToBuffer","value","Buffer","from","createLongTextStorageTransformPlugin","StorageTransformPlugin","fieldType","fromStorage","field","storageValue","typeOf","Array","isArray","WebinyError","storageId","fieldId","compression","JSON","stringify","buf","ungzip","result","toString","parse","ex","console","log","message","toStorage","initialValue","hasOwnProperty","compressedValue","gzip"],"sources":["longText.ts"],"sourcesContent":["/**\n * File is @internal\n */\n\nimport WebinyError from \"@webiny/error\";\nimport { compress as gzip, decompress as ungzip } from \"@webiny/utils/compression/gzip\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\nconst FROM_STORAGE_ENCODING = \"utf8\";\n\nconst convertToBuffer = (value: string | Buffer): Buffer => {\n if (typeof value === \"string\") {\n return Buffer.from(value, TO_STORAGE_ENCODING);\n }\n return value;\n};\n\nexport interface StorageValue {\n compression: string;\n value: string;\n isArray?: boolean;\n}\n\nexport const createLongTextStorageTransformPlugin = () => {\n return new StorageTransformPlugin<string | string[], StorageValue>({\n fieldType: \"long-text\",\n fromStorage: async ({ field, value: storageValue }) => {\n const typeOf = typeof storageValue;\n if (\n !storageValue ||\n typeOf === \"string\" ||\n typeOf === \"number\" ||\n Array.isArray(storageValue) === true\n ) {\n return storageValue as unknown as string | string[];\n } else if (typeOf !== \"object\") {\n throw new WebinyError(\n `LongText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n const { compression, value, isArray } = storageValue;\n /**\n * Check if possibly undefined, null, empty...\n */\n if (!compression) {\n throw new WebinyError(\n `Missing compression in \"fromStorage\" function in field \"${\n field.storageId\n }\" - ${field.fieldId}.\": ${JSON.stringify(storageValue)}.`,\n \"MISSING_COMPRESSION\",\n {\n value: storageValue\n }\n );\n } else if (compression !== GZIP) {\n throw new WebinyError(\n `This plugin cannot transform something not compressed with \"GZIP\".`,\n \"WRONG_COMPRESSION\",\n {\n compression\n }\n );\n }\n try {\n const buf = await ungzip(convertToBuffer(value));\n const result = buf.toString(FROM_STORAGE_ENCODING);\n if (!isArray) {\n return result;\n }\n return JSON.parse(result);\n } catch (ex) {\n console.log(\"Error while transforming long-text.\");\n console.log(ex.message);\n return \"\";\n }\n },\n toStorage: async ({ value: initialValue }) => {\n /**\n * There is a possibility that we are trying to compress already compressed value.\n */\n if (initialValue && initialValue.hasOwnProperty(\"compression\") === true) {\n return initialValue as any;\n }\n const isArray = Array.isArray(initialValue);\n const value = isArray ? JSON.stringify(initialValue) : initialValue;\n const compressedValue = await gzip(value);\n\n const result: StorageValue = {\n compression: GZIP,\n value: compressedValue.toString(TO_STORAGE_ENCODING)\n };\n if (!isArray) {\n return result;\n }\n result.isArray = isArray;\n return result;\n }\n });\n};\n"],"mappings":"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"}
@@ -1,8 +1,2 @@
1
- import { StorageTransformPlugin } from "@webiny/api-headless-cms/content/plugins/storage/StorageTransformPlugin";
2
- export declare type OriginalValue = Record<string, any> | any[];
3
- export interface StorageValue {
4
- compression: string;
5
- value: any;
6
- }
7
- declare const _default: () => StorageTransformPlugin<any, any>;
8
- export default _default;
1
+ import { StorageTransformPlugin } from "@webiny/api-headless-cms";
2
+ export declare const createRichTextStorageTransformPlugin: () => StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types").CmsModelField>;
@@ -1,110 +1,95 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.default = void 0;
9
-
7
+ exports.createRichTextStorageTransformPlugin = void 0;
10
8
  var _jsonpack = _interopRequireDefault(require("jsonpack"));
11
-
12
9
  var _error = _interopRequireDefault(require("@webiny/error"));
13
-
14
- var _StorageTransformPlugin = require("@webiny/api-headless-cms/content/plugins/storage/StorageTransformPlugin");
10
+ var _apiHeadlessCms = require("@webiny/api-headless-cms");
11
+ /**
12
+ * File is @internal
13
+ */
15
14
 
16
15
  /**
17
16
  * Remove when jsonpack gets PR with a fix merged
18
17
  * https://github.com/rgcl/jsonpack/pull/25/files
19
18
  * NOTE 2021-07-28: it seems PR is not going to be merged so keep this.
20
19
  */
20
+ // TODO @ts-refactor figure better type
21
21
  const transformArray = value => {
22
22
  if (!value) {
23
23
  return value;
24
24
  }
25
-
26
25
  let isArray = Array.isArray(value);
27
26
  const shouldBeArray = value instanceof Array === false && isArray;
28
-
29
27
  if (shouldBeArray) {
30
28
  value = Array.from(value);
31
29
  isArray = true;
32
30
  }
33
-
34
31
  if (typeof value === "object" || isArray) {
35
32
  for (const k in value) {
36
33
  value[k] = transformArray(value[k]);
37
34
  }
38
35
  }
39
-
40
36
  return value;
41
37
  };
42
-
43
- const plugin = new _StorageTransformPlugin.StorageTransformPlugin({
44
- fieldType: "rich-text",
45
- fromStorage: async ({
46
- field,
47
- value: storageValue
48
- }) => {
49
- if (!storageValue) {
50
- return storageValue;
51
- } else if (typeof storageValue !== "object") {
52
- throw new _error.default(`RichText value received in "fromStorage" function is not an object in field "${field.fieldId}".`);
53
- }
54
- /**
55
- * This is to circumvent a bug introduced with 5.8.0 storage operations.
56
- * Do not remove.
57
- */
58
-
59
-
60
- if (storageValue.hasOwnProperty("compression") === false) {
61
- return storageValue;
62
- }
63
-
64
- const {
65
- compression,
38
+ const createRichTextStorageTransformPlugin = () => {
39
+ return new _apiHeadlessCms.StorageTransformPlugin({
40
+ fieldType: "rich-text",
41
+ fromStorage: async ({
42
+ field,
43
+ value: storageValue
44
+ }) => {
45
+ if (!storageValue) {
46
+ return storageValue;
47
+ } else if (typeof storageValue !== "object") {
48
+ throw new _error.default(`RichText value received in "fromStorage" function is not an object in field "${field.storageId}" - ${field.fieldId}.`);
49
+ }
50
+ /**
51
+ * This is to circumvent a bug introduced with 5.8.0 storage operations.
52
+ * Do not remove.
53
+ */
54
+ if (storageValue.hasOwnProperty("compression") === false) {
55
+ return storageValue;
56
+ }
57
+ const {
58
+ compression,
59
+ value
60
+ } = storageValue;
61
+ if (!compression) {
62
+ throw new _error.default(`Missing compression in "fromStorage" function in field "${field.fieldId}": ${JSON.stringify(storageValue)}.`, "MISSING_COMPRESSION", {
63
+ value: storageValue
64
+ });
65
+ }
66
+ if (compression !== "jsonpack") {
67
+ throw new _error.default(`This plugin cannot transform something not packed with "jsonpack".`, "WRONG_COMPRESSION", {
68
+ compression
69
+ });
70
+ }
71
+ try {
72
+ return _jsonpack.default.unpack(value);
73
+ } catch {
74
+ return null;
75
+ }
76
+ },
77
+ toStorage: async ({
66
78
  value
67
- } = storageValue;
68
-
69
- if (!compression) {
70
- throw new _error.default(`Missing compression in "fromStorage" function in field "${field.fieldId}": ${JSON.stringify(storageValue)}.`, "MISSING_COMPRESSION", {
71
- value: storageValue
72
- });
73
- }
74
-
75
- if (compression !== "jsonpack") {
76
- throw new _error.default(`This plugin cannot transform something not packed with "jsonpack".`, "WRONG_COMPRESSION", {
77
- compression
78
- });
79
- }
80
-
81
- try {
82
- return _jsonpack.default.unpack(value);
83
- } catch {
84
- return null;
79
+ }) => {
80
+ /**
81
+ * There is a possibility that we are trying to compress already compressed value.
82
+ * Introduced a bug with 5.8.0 storage operations, so just return the value to correct it.
83
+ */
84
+ if (value && value.hasOwnProperty("compression") === true) {
85
+ return value;
86
+ }
87
+ value = transformArray(value);
88
+ return {
89
+ compression: "jsonpack",
90
+ value: value ? _jsonpack.default.pack(value) : value
91
+ };
85
92
  }
86
- },
87
- toStorage: async ({
88
- value
89
- }) => {
90
- /**
91
- * There is a possibility that we are trying to compress already compressed value.
92
- * Introduced a bug with 5.8.0 storage operations, so just return the value to correct it.
93
- */
94
- if (value && value.hasOwnProperty("compression") === true) {
95
- return value;
96
- }
97
-
98
- value = transformArray(value);
99
- return {
100
- compression: "jsonpack",
101
- value: value ? _jsonpack.default.pack(value) : value
102
- };
103
- }
104
- });
105
-
106
- var _default = () => {
107
- return plugin;
93
+ });
108
94
  };
109
-
110
- exports.default = _default;
95
+ exports.createRichTextStorageTransformPlugin = createRichTextStorageTransformPlugin;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["transformArray","value","isArray","Array","shouldBeArray","from","k","createRichTextStorageTransformPlugin","StorageTransformPlugin","fieldType","fromStorage","field","storageValue","WebinyError","storageId","fieldId","hasOwnProperty","compression","JSON","stringify","jsonpack","unpack","toStorage","pack"],"sources":["richText.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport jsonpack from \"jsonpack\";\nimport WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\n\n/**\n * Remove when jsonpack gets PR with a fix merged\n * https://github.com/rgcl/jsonpack/pull/25/files\n * NOTE 2021-07-28: it seems PR is not going to be merged so keep this.\n */\n// TODO @ts-refactor figure better type\nconst transformArray = (value: any) => {\n if (!value) {\n return value;\n }\n let isArray = Array.isArray(value);\n const shouldBeArray = value instanceof Array === false && isArray;\n if (shouldBeArray) {\n value = Array.from(value);\n isArray = true;\n }\n if (typeof value === \"object\" || isArray) {\n for (const k in value) {\n value[k] = transformArray(value[k]);\n }\n }\n return value;\n};\n\nexport const createRichTextStorageTransformPlugin = () => {\n return new StorageTransformPlugin({\n fieldType: \"rich-text\",\n fromStorage: async ({ field, value: storageValue }) => {\n if (!storageValue) {\n return storageValue;\n } else if (typeof storageValue !== \"object\") {\n throw new WebinyError(\n `RichText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n /**\n * This is to circumvent a bug introduced with 5.8.0 storage operations.\n * Do not remove.\n */\n if (storageValue.hasOwnProperty(\"compression\") === false) {\n return storageValue;\n }\n const { compression, value } = storageValue;\n if (!compression) {\n throw new WebinyError(\n `Missing compression in \"fromStorage\" function in field \"${\n field.fieldId\n }\": ${JSON.stringify(storageValue)}.`,\n \"MISSING_COMPRESSION\",\n {\n value: storageValue\n }\n );\n }\n if (compression !== \"jsonpack\") {\n throw new WebinyError(\n `This plugin cannot transform something not packed with \"jsonpack\".`,\n \"WRONG_COMPRESSION\",\n {\n compression\n }\n );\n }\n try {\n return jsonpack.unpack(value);\n } catch {\n return null;\n }\n },\n toStorage: async ({ value }) => {\n /**\n * There is a possibility that we are trying to compress already compressed value.\n * Introduced a bug with 5.8.0 storage operations, so just return the value to correct it.\n */\n if (value && value.hasOwnProperty(\"compression\") === true) {\n return value;\n }\n value = transformArray(value);\n return {\n compression: \"jsonpack\",\n value: value ? jsonpack.pack(value) : value\n };\n }\n });\n};\n"],"mappings":";;;;;;;AAGA;AACA;AACA;AALA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAIC,KAAU,IAAK;EACnC,IAAI,CAACA,KAAK,EAAE;IACR,OAAOA,KAAK;EAChB;EACA,IAAIC,OAAO,GAAGC,KAAK,CAACD,OAAO,CAACD,KAAK,CAAC;EAClC,MAAMG,aAAa,GAAGH,KAAK,YAAYE,KAAK,KAAK,KAAK,IAAID,OAAO;EACjE,IAAIE,aAAa,EAAE;IACfH,KAAK,GAAGE,KAAK,CAACE,IAAI,CAACJ,KAAK,CAAC;IACzBC,OAAO,GAAG,IAAI;EAClB;EACA,IAAI,OAAOD,KAAK,KAAK,QAAQ,IAAIC,OAAO,EAAE;IACtC,KAAK,MAAMI,CAAC,IAAIL,KAAK,EAAE;MACnBA,KAAK,CAACK,CAAC,CAAC,GAAGN,cAAc,CAACC,KAAK,CAACK,CAAC,CAAC,CAAC;IACvC;EACJ;EACA,OAAOL,KAAK;AAChB,CAAC;AAEM,MAAMM,oCAAoC,GAAG,MAAM;EACtD,OAAO,IAAIC,sCAAsB,CAAC;IAC9BC,SAAS,EAAE,WAAW;IACtBC,WAAW,EAAE,OAAO;MAAEC,KAAK;MAAEV,KAAK,EAAEW;IAAa,CAAC,KAAK;MACnD,IAAI,CAACA,YAAY,EAAE;QACf,OAAOA,YAAY;MACvB,CAAC,MAAM,IAAI,OAAOA,YAAY,KAAK,QAAQ,EAAE;QACzC,MAAM,IAAIC,cAAW,CAChB,gFAA+EF,KAAK,CAACG,SAAU,OAAMH,KAAK,CAACI,OAAQ,GAAE,CACzH;MACL;MACA;AACZ;AACA;AACA;MACY,IAAIH,YAAY,CAACI,cAAc,CAAC,aAAa,CAAC,KAAK,KAAK,EAAE;QACtD,OAAOJ,YAAY;MACvB;MACA,MAAM;QAAEK,WAAW;QAAEhB;MAAM,CAAC,GAAGW,YAAY;MAC3C,IAAI,CAACK,WAAW,EAAE;QACd,MAAM,IAAIJ,cAAW,CAChB,2DACGF,KAAK,CAACI,OACT,MAAKG,IAAI,CAACC,SAAS,CAACP,YAAY,CAAE,GAAE,EACrC,qBAAqB,EACrB;UACIX,KAAK,EAAEW;QACX,CAAC,CACJ;MACL;MACA,IAAIK,WAAW,KAAK,UAAU,EAAE;QAC5B,MAAM,IAAIJ,cAAW,CAChB,oEAAmE,EACpE,mBAAmB,EACnB;UACII;QACJ,CAAC,CACJ;MACL;MACA,IAAI;QACA,OAAOG,iBAAQ,CAACC,MAAM,CAACpB,KAAK,CAAC;MACjC,CAAC,CAAC,MAAM;QACJ,OAAO,IAAI;MACf;IACJ,CAAC;IACDqB,SAAS,EAAE,OAAO;MAAErB;IAAM,CAAC,KAAK;MAC5B;AACZ;AACA;AACA;MACY,IAAIA,KAAK,IAAIA,KAAK,CAACe,cAAc,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE;QACvD,OAAOf,KAAK;MAChB;MACAA,KAAK,GAAGD,cAAc,CAACC,KAAK,CAAC;MAC7B,OAAO;QACHgB,WAAW,EAAE,UAAU;QACvBhB,KAAK,EAAEA,KAAK,GAAGmB,iBAAQ,CAACG,IAAI,CAACtB,KAAK,CAAC,GAAGA;MAC1C,CAAC;IACL;EACJ,CAAC,CAAC;AACN,CAAC;AAAC"}
@@ -1,3 +1,5 @@
1
+ /**
2
+ * File is @internal
3
+ */
1
4
  import { CmsFieldFilterValueTransformPlugin } from "../../types";
2
- declare const _default: () => CmsFieldFilterValueTransformPlugin;
3
- export default _default;
5
+ export declare const createDatetimeTransformValuePlugin: () => CmsFieldFilterValueTransformPlugin;
@@ -3,11 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
7
-
6
+ exports.createDatetimeTransformValuePlugin = void 0;
8
7
  var _TimeTransformPlugin = require("@webiny/db-dynamodb/plugins/definitions/TimeTransformPlugin");
9
-
10
8
  var _DateTimeTransformPlugin = require("@webiny/db-dynamodb/plugins/definitions/DateTimeTransformPlugin");
9
+ /**
10
+ * File is @internal
11
+ */
11
12
 
12
13
  const timeTransformer = new _TimeTransformPlugin.TimeTransformPlugin({
13
14
  fields: ["*"]
@@ -15,33 +16,30 @@ const timeTransformer = new _TimeTransformPlugin.TimeTransformPlugin({
15
16
  const dateTimeTransformer = new _DateTimeTransformPlugin.DateTimeTransformPlugin({
16
17
  fields: ["*"]
17
18
  });
18
-
19
- var _default = () => ({
20
- type: "cms-field-filter-value-transform",
21
- name: "cms-field-value-filter-transform-datetime",
22
- fieldType: "datetime",
23
-
24
- /**
25
- * Always transform into the milliseconds.
26
- */
27
- transform: ({
28
- field,
29
- value
30
- }) => {
31
- const {
32
- type
33
- } = field.settings || {};
34
-
35
- if (type === "time") {
36
- return timeTransformer.transform({
19
+ const createDatetimeTransformValuePlugin = () => {
20
+ return {
21
+ type: "cms-field-filter-value-transform",
22
+ name: "cms-field-value-filter-transform-datetime",
23
+ fieldType: "datetime",
24
+ /**
25
+ * Always transform into the milliseconds.
26
+ */
27
+ transform: ({
28
+ field,
29
+ value
30
+ }) => {
31
+ const {
32
+ type
33
+ } = field.settings || {};
34
+ if (type === "time") {
35
+ return timeTransformer.transform({
36
+ value
37
+ });
38
+ }
39
+ return dateTimeTransformer.transform({
37
40
  value
38
41
  });
39
42
  }
40
-
41
- return dateTimeTransformer.transform({
42
- value
43
- });
44
- }
45
- });
46
-
47
- exports.default = _default;
43
+ };
44
+ };
45
+ exports.createDatetimeTransformValuePlugin = createDatetimeTransformValuePlugin;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["timeTransformer","TimeTransformPlugin","fields","dateTimeTransformer","DateTimeTransformPlugin","createDatetimeTransformValuePlugin","type","name","fieldType","transform","field","value","settings"],"sources":["datetime.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport { CmsFieldFilterValueTransformPlugin } from \"~/types\";\nimport { TimeTransformPlugin } from \"@webiny/db-dynamodb/plugins/definitions/TimeTransformPlugin\";\nimport { DateTimeTransformPlugin } from \"@webiny/db-dynamodb/plugins/definitions/DateTimeTransformPlugin\";\n\nconst timeTransformer = new TimeTransformPlugin({\n fields: [\"*\"]\n});\nconst dateTimeTransformer = new DateTimeTransformPlugin({\n fields: [\"*\"]\n});\n\nexport const createDatetimeTransformValuePlugin = (): CmsFieldFilterValueTransformPlugin => {\n return {\n type: \"cms-field-filter-value-transform\",\n name: \"cms-field-value-filter-transform-datetime\",\n fieldType: \"datetime\",\n /**\n * Always transform into the milliseconds.\n */\n transform: ({ field, value }) => {\n const { type } = field.settings || {};\n if (type === \"time\") {\n return timeTransformer.transform({\n value\n });\n }\n return dateTimeTransformer.transform({\n value\n });\n }\n };\n};\n"],"mappings":";;;;;;AAIA;AACA;AALA;AACA;AACA;;AAKA,MAAMA,eAAe,GAAG,IAAIC,wCAAmB,CAAC;EAC5CC,MAAM,EAAE,CAAC,GAAG;AAChB,CAAC,CAAC;AACF,MAAMC,mBAAmB,GAAG,IAAIC,gDAAuB,CAAC;EACpDF,MAAM,EAAE,CAAC,GAAG;AAChB,CAAC,CAAC;AAEK,MAAMG,kCAAkC,GAAG,MAA0C;EACxF,OAAO;IACHC,IAAI,EAAE,kCAAkC;IACxCC,IAAI,EAAE,2CAA2C;IACjDC,SAAS,EAAE,UAAU;IACrB;AACR;AACA;IACQC,SAAS,EAAE,CAAC;MAAEC,KAAK;MAAEC;IAAM,CAAC,KAAK;MAC7B,MAAM;QAAEL;MAAK,CAAC,GAAGI,KAAK,CAACE,QAAQ,IAAI,CAAC,CAAC;MACrC,IAAIN,IAAI,KAAK,MAAM,EAAE;QACjB,OAAON,eAAe,CAACS,SAAS,CAAC;UAC7BE;QACJ,CAAC,CAAC;MACN;MACA,OAAOR,mBAAmB,CAACM,SAAS,CAAC;QACjCE;MACJ,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAAC"}
package/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import { StorageOperationsFactory } from "./types";
2
+ export * from "./plugins";
2
3
  export declare const createStorageOperations: StorageOperationsFactory;
package/index.js CHANGED
@@ -1,49 +1,47 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
7
+ var _exportNames = {
8
+ createStorageOperations: true
9
+ };
8
10
  exports.createStorageOperations = void 0;
9
-
10
11
  var _filters = _interopRequireDefault(require("@webiny/db-dynamodb/plugins/filters"));
11
-
12
12
  var _dynamoDb = _interopRequireDefault(require("./dynamoDb"));
13
-
14
13
  var _types = require("./types");
15
-
16
14
  var _table = require("./definitions/table");
17
-
18
15
  var _settings = require("./definitions/settings");
19
-
20
16
  var _system = require("./definitions/system");
21
-
22
17
  var _group = require("./definitions/group");
23
-
24
18
  var _model = require("./definitions/model");
25
-
26
19
  var _entry = require("./definitions/entry");
27
-
28
20
  var _plugins = require("@webiny/plugins");
29
-
30
21
  var _system2 = require("./operations/system");
31
-
32
22
  var _settings2 = require("./operations/settings");
33
-
34
23
  var _group2 = require("./operations/group");
35
-
36
24
  var _model2 = require("./operations/model");
37
-
38
25
  var _entry2 = require("./operations/entry");
39
-
26
+ var _plugins2 = require("./operations/entry/filtering/plugins");
27
+ var _plugins3 = require("./plugins");
28
+ Object.keys(_plugins3).forEach(function (key) {
29
+ if (key === "default" || key === "__esModule") return;
30
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
31
+ if (key in exports && exports[key] === _plugins3[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _plugins3[key];
36
+ }
37
+ });
38
+ });
40
39
  const createStorageOperations = params => {
41
40
  const {
42
- attributes = {},
41
+ attributes,
43
42
  table,
44
43
  documentClient,
45
- plugins: customPlugins,
46
- modelFieldToGraphQLPlugins
44
+ plugins: userPlugins
47
45
  } = params;
48
46
  const tableInstance = (0, _table.createTable)({
49
47
  table,
@@ -53,53 +51,65 @@ const createStorageOperations = params => {
53
51
  settings: (0, _settings.createSettingsEntity)({
54
52
  entityName: _types.ENTITIES.SETTINGS,
55
53
  table: tableInstance,
56
- attributes: attributes[_types.ENTITIES.SETTINGS]
54
+ attributes: attributes ? attributes[_types.ENTITIES.SETTINGS] : {}
57
55
  }),
58
56
  system: (0, _system.createSystemEntity)({
59
57
  entityName: _types.ENTITIES.SYSTEM,
60
58
  table: tableInstance,
61
- attributes: attributes[_types.ENTITIES.SYSTEM]
59
+ attributes: attributes ? attributes[_types.ENTITIES.SYSTEM] : {}
62
60
  }),
63
61
  groups: (0, _group.createGroupEntity)({
64
62
  entityName: _types.ENTITIES.GROUPS,
65
63
  table: tableInstance,
66
- attributes: attributes[_types.ENTITIES.GROUPS]
64
+ attributes: attributes ? attributes[_types.ENTITIES.GROUPS] : {}
67
65
  }),
68
66
  models: (0, _model.createModelEntity)({
69
67
  entityName: _types.ENTITIES.MODELS,
70
68
  table: tableInstance,
71
- attributes: attributes[_types.ENTITIES.MODELS]
69
+ attributes: attributes ? attributes[_types.ENTITIES.MODELS] : {}
72
70
  }),
73
71
  entries: (0, _entry.createEntryEntity)({
74
72
  entityName: _types.ENTITIES.ENTRIES,
75
73
  table: tableInstance,
76
- attributes: attributes[_types.ENTITIES.ENTRIES]
74
+ attributes: attributes ? attributes[_types.ENTITIES.ENTRIES] : {}
77
75
  })
78
76
  };
79
77
  const plugins = new _plugins.PluginsContainer([
80
78
  /**
81
- * User defined custom plugins.
79
+ * DynamoDB filter plugins for the where conditions.
82
80
  */
83
- ...(customPlugins || []),
81
+ (0, _filters.default)(),
84
82
  /**
85
- * Plugins of type CmsModelFieldToGraphQLPlugin.
83
+ * Field plugins for DynamoDB.
86
84
  */
87
- modelFieldToGraphQLPlugins,
85
+ (0, _dynamoDb.default)(),
88
86
  /**
89
- * DynamoDB filter plugins for the where conditions.
87
+ * Filter create plugins.
90
88
  */
91
- (0, _filters.default)(),
89
+ (0, _plugins2.createFilterCreatePlugins)(),
92
90
  /**
93
- * Field plugins for DynamoDB.
91
+ * User defined custom plugins.
94
92
  */
95
- (0, _dynamoDb.default)()]);
93
+ ...(userPlugins || [])]);
96
94
  return {
97
- plugins: [
98
- /**
99
- * Field plugins for DynamoDB.
100
- * We must pass them to the base application.
101
- */
102
- (0, _dynamoDb.default)()],
95
+ name: "dynamodb",
96
+ beforeInit: async context => {
97
+ /**
98
+ * Collect all required plugins from parent context.
99
+ */
100
+ const fieldPlugins = context.plugins.byType("cms-model-field-to-graphql");
101
+ plugins.register(fieldPlugins);
102
+ const filterPathPlugins = context.plugins.byType(_plugins3.CmsEntryFieldFilterPathPlugin.type);
103
+ plugins.register(filterPathPlugins);
104
+ const filterPlugins = context.plugins.byType(_plugins3.CmsEntryFieldFilterPlugin.type);
105
+ plugins.register(filterPlugins);
106
+ const sortingPlugins = context.plugins.byType(_plugins3.CmsEntryFieldSortingPlugin.type);
107
+ plugins.register(sortingPlugins);
108
+ /**
109
+ * Pass the plugins to the parent context.
110
+ */
111
+ context.plugins.register([(0, _dynamoDb.default)()]);
112
+ },
103
113
  getEntities: () => entities,
104
114
  getTable: () => tableInstance,
105
115
  system: (0, _system2.createSystemStorageOperations)({
@@ -121,5 +131,4 @@ const createStorageOperations = params => {
121
131
  })
122
132
  };
123
133
  };
124
-
125
134
  exports.createStorageOperations = createStorageOperations;