@webiny/api-headless-cms-ddb 0.0.0-mt-2 → 0.0.0-unstable.085ff6572f

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 (168) hide show
  1. package/definitions/entry.d.ts +2 -1
  2. package/definitions/entry.js +12 -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 +25 -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 +7 -17
  21. package/dynamoDb/index.js.map +1 -0
  22. package/dynamoDb/path/locationFolderId.d.ts +2 -0
  23. package/dynamoDb/path/locationFolderId.js +41 -0
  24. package/dynamoDb/path/locationFolderId.js.map +1 -0
  25. package/dynamoDb/path/plainObject.d.ts +2 -3
  26. package/dynamoDb/path/plainObject.js +25 -25
  27. package/dynamoDb/path/plainObject.js.map +1 -0
  28. package/dynamoDb/storage/date.d.ts +3 -3
  29. package/dynamoDb/storage/date.js +71 -54
  30. package/dynamoDb/storage/date.js.map +1 -0
  31. package/dynamoDb/storage/longText.d.ts +7 -4
  32. package/dynamoDb/storage/longText.js +72 -64
  33. package/dynamoDb/storage/longText.js.map +1 -0
  34. package/dynamoDb/storage/richText.d.ts +2 -8
  35. package/dynamoDb/storage/richText.js +62 -77
  36. package/dynamoDb/storage/richText.js.map +1 -0
  37. package/dynamoDb/transformValue/datetime.d.ts +4 -2
  38. package/dynamoDb/transformValue/datetime.js +28 -30
  39. package/dynamoDb/transformValue/datetime.js.map +1 -0
  40. package/index.d.ts +1 -0
  41. package/index.js +54 -45
  42. package/index.js.map +1 -0
  43. package/operations/entry/dataLoader/DataLoaderCache.d.ts +17 -0
  44. package/operations/entry/dataLoader/DataLoaderCache.js +43 -0
  45. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
  46. package/operations/entry/dataLoader/constants.d.ts +1 -0
  47. package/operations/entry/dataLoader/constants.js +9 -0
  48. package/operations/entry/dataLoader/constants.js.map +1 -0
  49. package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
  50. package/operations/entry/dataLoader/createBatchScheduleFn.js +23 -0
  51. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
  52. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
  53. package/operations/entry/dataLoader/getAllEntryRevisions.js +43 -0
  54. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
  55. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
  56. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +57 -0
  57. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
  58. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
  59. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +57 -0
  60. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
  61. package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
  62. package/operations/entry/dataLoader/getRevisionById.js +63 -0
  63. package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
  64. package/operations/entry/dataLoader/index.d.ts +8 -0
  65. package/operations/entry/dataLoader/index.js +38 -0
  66. package/operations/entry/dataLoader/index.js.map +1 -0
  67. package/operations/entry/dataLoader/types.d.ts +6 -0
  68. package/operations/entry/dataLoader/types.js +5 -0
  69. package/operations/entry/dataLoader/types.js.map +1 -0
  70. package/operations/entry/dataLoaders.d.ts +17 -28
  71. package/operations/entry/dataLoaders.js +51 -239
  72. package/operations/entry/dataLoaders.js.map +1 -0
  73. package/operations/entry/filtering/createExpressions.d.ts +26 -0
  74. package/operations/entry/filtering/createExpressions.js +176 -0
  75. package/operations/entry/filtering/createExpressions.js.map +1 -0
  76. package/operations/entry/filtering/createFields.d.ts +16 -0
  77. package/operations/entry/filtering/createFields.js +105 -0
  78. package/operations/entry/filtering/createFields.js.map +1 -0
  79. package/operations/entry/filtering/extractSort.d.ts +17 -0
  80. package/operations/entry/filtering/extractSort.js +67 -0
  81. package/operations/entry/filtering/extractSort.js.map +1 -0
  82. package/operations/entry/filtering/filter.d.ts +15 -0
  83. package/operations/entry/filtering/filter.js +143 -0
  84. package/operations/entry/filtering/filter.js.map +1 -0
  85. package/operations/entry/filtering/fullTextSearch.d.ts +14 -0
  86. package/operations/entry/filtering/fullTextSearch.js +48 -0
  87. package/operations/entry/filtering/fullTextSearch.js.map +1 -0
  88. package/operations/entry/filtering/getValue.d.ts +5 -0
  89. package/operations/entry/filtering/getValue.js +63 -0
  90. package/operations/entry/filtering/getValue.js.map +1 -0
  91. package/operations/entry/filtering/index.d.ts +2 -0
  92. package/operations/entry/filtering/index.js +19 -0
  93. package/operations/entry/filtering/index.js.map +1 -0
  94. package/operations/entry/filtering/mapPlugins.d.ts +8 -0
  95. package/operations/entry/filtering/mapPlugins.js +31 -0
  96. package/operations/entry/filtering/mapPlugins.js.map +1 -0
  97. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +2 -0
  98. package/operations/entry/filtering/plugins/defaultFilterCreate.js +43 -0
  99. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -0
  100. package/operations/entry/filtering/plugins/index.d.ts +1 -0
  101. package/operations/entry/filtering/plugins/index.js +13 -0
  102. package/operations/entry/filtering/plugins/index.js.map +1 -0
  103. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +2 -0
  104. package/operations/entry/filtering/plugins/objectFilterCreate.js +88 -0
  105. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -0
  106. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +2 -0
  107. package/operations/entry/filtering/plugins/refFilterCreate.js +73 -0
  108. package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -0
  109. package/operations/entry/filtering/sort.d.ts +12 -0
  110. package/operations/entry/filtering/sort.js +69 -0
  111. package/operations/entry/filtering/sort.js.map +1 -0
  112. package/operations/entry/filtering/systemFields.d.ts +4 -0
  113. package/operations/entry/filtering/systemFields.js +88 -0
  114. package/operations/entry/filtering/systemFields.js.map +1 -0
  115. package/operations/entry/filtering/transform.d.ts +6 -0
  116. package/operations/entry/filtering/transform.js +16 -0
  117. package/operations/entry/filtering/transform.js.map +1 -0
  118. package/operations/entry/filtering/types.d.ts +40 -0
  119. package/operations/entry/filtering/types.js +5 -0
  120. package/operations/entry/filtering/types.js.map +1 -0
  121. package/operations/entry/filtering/values.d.ts +2 -0
  122. package/operations/entry/filtering/values.js +22 -0
  123. package/operations/entry/filtering/values.js.map +1 -0
  124. package/operations/entry/filtering/where.d.ts +5 -0
  125. package/operations/entry/filtering/where.js +33 -0
  126. package/operations/entry/filtering/where.js.map +1 -0
  127. package/operations/entry/index.d.ts +3 -3
  128. package/operations/entry/index.js +425 -330
  129. package/operations/entry/index.js.map +1 -0
  130. package/operations/entry/keys.js +7 -14
  131. package/operations/entry/keys.js.map +1 -0
  132. package/operations/group/index.d.ts +3 -2
  133. package/operations/group/index.js +9 -45
  134. package/operations/group/index.js.map +1 -0
  135. package/operations/model/index.d.ts +3 -2
  136. package/operations/model/index.js +13 -37
  137. package/operations/model/index.js.map +1 -0
  138. package/operations/settings/index.d.ts +3 -2
  139. package/operations/settings/index.js +7 -37
  140. package/operations/settings/index.js.map +1 -0
  141. package/operations/system/index.d.ts +3 -2
  142. package/operations/system/index.js +5 -28
  143. package/operations/system/index.js.map +1 -0
  144. package/package.json +25 -26
  145. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +23 -0
  146. package/plugins/CmsEntryFieldFilterPathPlugin.js +43 -0
  147. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -0
  148. package/plugins/CmsEntryFieldFilterPlugin.d.ts +43 -0
  149. package/plugins/CmsEntryFieldFilterPlugin.js +24 -0
  150. package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -0
  151. package/plugins/CmsEntryFieldSortingPlugin.d.ts +42 -0
  152. package/plugins/CmsEntryFieldSortingPlugin.js +28 -0
  153. package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -0
  154. package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +11 -0
  155. package/plugins/CmsFieldFilterValueTransformPlugin.js +24 -0
  156. package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -0
  157. package/plugins/index.d.ts +4 -0
  158. package/plugins/index.js +49 -0
  159. package/plugins/index.js.map +1 -0
  160. package/types.d.ts +11 -33
  161. package/types.js +0 -1
  162. package/types.js.map +1 -0
  163. package/dynamoDb/path/ref.d.ts +0 -3
  164. package/dynamoDb/path/ref.js +0 -27
  165. package/operations/entry/systemFields.d.ts +0 -2
  166. package/operations/entry/systemFields.js +0 -50
  167. package/operations/entry/utils.d.ts +0 -31
  168. package/operations/entry/utils.js +0 -406
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.CmsFieldFilterValueTransformPlugin = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _plugins = require("@webiny/plugins");
10
+ class CmsFieldFilterValueTransformPlugin extends _plugins.Plugin {
11
+ get fieldType() {
12
+ return this.config.fieldType;
13
+ }
14
+ get transform() {
15
+ return this.config.transform;
16
+ }
17
+ constructor(config) {
18
+ super();
19
+ (0, _defineProperty2.default)(this, "config", void 0);
20
+ this.config = config;
21
+ }
22
+ }
23
+ exports.CmsFieldFilterValueTransformPlugin = CmsFieldFilterValueTransformPlugin;
24
+ (0, _defineProperty2.default)(CmsFieldFilterValueTransformPlugin, "type", "cms-field-filter-value-transform");
@@ -0,0 +1 @@
1
+ {"version":3,"names":["CmsFieldFilterValueTransformPlugin","Plugin","fieldType","config","transform","constructor"],"sources":["CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from \"~/types\";\n\ntype CmsFieldFilterValueTransformPluginParams = Omit<\n CmsFieldFilterValueTransformPluginInterface,\n \"type\"\n>;\nexport class CmsFieldFilterValueTransformPlugin\n extends Plugin\n implements Omit<CmsFieldFilterValueTransformPluginInterface, \"type\">\n{\n public static override type = \"cms-field-filter-value-transform\";\n\n private config: CmsFieldFilterValueTransformPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public get transform(): CmsFieldFilterValueTransformPluginParams[\"transform\"] {\n return this.config.transform;\n }\n\n public constructor(config: CmsFieldFilterValueTransformPluginParams) {\n super();\n this.config = config;\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAOO,MAAMA,kCAAkC,SACnCC,eAAM,CAElB;EAKI,IAAWC,SAAS,GAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEA,IAAWE,SAAS,GAA0D;IAC1E,OAAO,IAAI,CAACD,MAAM,CAACC,SAAS;EAChC;EAEOC,WAAW,CAACF,MAAgD,EAAE;IACjE,KAAK,EAAE;IAAC;IACR,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;AACJ;AAAC;AAAA,8BApBYH,kCAAkC,UAIb,kCAAkC"}
@@ -0,0 +1,4 @@
1
+ export * from "./CmsEntryFieldFilterPathPlugin";
2
+ export * from "./CmsEntryFieldSortingPlugin";
3
+ export * from "./CmsEntryFieldFilterPlugin";
4
+ export * from "./CmsFieldFilterValueTransformPlugin";
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _CmsEntryFieldFilterPathPlugin = require("./CmsEntryFieldFilterPathPlugin");
7
+ Object.keys(_CmsEntryFieldFilterPathPlugin).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _CmsEntryFieldFilterPathPlugin[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _CmsEntryFieldFilterPathPlugin[key];
14
+ }
15
+ });
16
+ });
17
+ var _CmsEntryFieldSortingPlugin = require("./CmsEntryFieldSortingPlugin");
18
+ Object.keys(_CmsEntryFieldSortingPlugin).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _CmsEntryFieldSortingPlugin[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _CmsEntryFieldSortingPlugin[key];
25
+ }
26
+ });
27
+ });
28
+ var _CmsEntryFieldFilterPlugin = require("./CmsEntryFieldFilterPlugin");
29
+ Object.keys(_CmsEntryFieldFilterPlugin).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _CmsEntryFieldFilterPlugin[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _CmsEntryFieldFilterPlugin[key];
36
+ }
37
+ });
38
+ });
39
+ var _CmsFieldFilterValueTransformPlugin = require("./CmsFieldFilterValueTransformPlugin");
40
+ Object.keys(_CmsFieldFilterValueTransformPlugin).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _CmsFieldFilterValueTransformPlugin[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _CmsFieldFilterValueTransformPlugin[key];
47
+ }
48
+ });
49
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin\";\nexport * from \"./CmsEntryFieldSortingPlugin\";\nexport * from \"./CmsEntryFieldFilterPlugin\";\nexport * from \"./CmsFieldFilterValueTransformPlugin\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
package/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins/types";
2
- import { CmsModelField, CmsModelFieldToGraphQLPlugin, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
2
+ import { CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
3
3
  import { DynamoDBTypes, TableConstructor } from "dynamodb-toolbox/dist/classes/Table";
4
4
  import { EntityAttributeConfig, EntityCompositeAttributes } from "dynamodb-toolbox/dist/classes/Entity";
5
5
  import { DocumentClient } from "aws-sdk/clients/dynamodb";
@@ -8,7 +8,7 @@ interface CmsFieldFilterValueTransformParams {
8
8
  /**
9
9
  * A field which value we are transforming.
10
10
  */
11
- field: CmsModelField;
11
+ field: Partial<CmsModelField> & Pick<CmsModelField, "id" | "storageId" | "fieldId" | "settings">;
12
12
  value: any;
13
13
  }
14
14
  export interface CmsFieldFilterValueTransformPlugin extends Plugin {
@@ -25,36 +25,6 @@ export interface CmsFieldFilterValueTransformPlugin extends Plugin {
25
25
  */
26
26
  transform: (params: CmsFieldFilterValueTransformParams) => any;
27
27
  }
28
- interface CmsFieldFilterPathParams {
29
- /**
30
- * A field for which we are creating the value path.
31
- */
32
- field: CmsModelField;
33
- /**
34
- * If value is an array we will need index position.
35
- * It is up to the developer to add.
36
- */
37
- index?: number | string;
38
- }
39
- export interface CmsFieldFilterPathPlugin extends Plugin {
40
- /**
41
- * A plugin type.
42
- */
43
- type: "cms-field-filter-path";
44
- /**
45
- * A field type this plugin is for.
46
- */
47
- fieldType: string;
48
- /**
49
- * A field id this plugin is for.
50
- * It is meant for targeting only specific fields in a certain type.
51
- */
52
- fieldId?: string[];
53
- /**
54
- * Get a path for given field.
55
- */
56
- createPath: (params: CmsFieldFilterPathParams) => string;
57
- }
58
28
  export declare type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;
59
29
  export declare type Attributes = Record<string, AttributeDefinition>;
60
30
  export declare enum ENTITIES {
@@ -70,7 +40,6 @@ export interface TableModifier {
70
40
  export interface StorageOperationsFactoryParams {
71
41
  documentClient: DocumentClient;
72
42
  table?: TableModifier;
73
- modelFieldToGraphQLPlugins: CmsModelFieldToGraphQLPlugin[];
74
43
  attributes?: Record<ENTITIES, Attributes>;
75
44
  plugins?: Plugin[] | Plugin[][];
76
45
  }
@@ -81,4 +50,13 @@ export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOper
81
50
  export interface StorageOperationsFactory {
82
51
  (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
83
52
  }
53
+ export interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {
54
+ dataLoaders: DataLoadersHandlerInterface;
55
+ }
56
+ export interface DataLoadersHandlerInterfaceClearAllParams {
57
+ model: Pick<CmsModel, "tenant" | "locale">;
58
+ }
59
+ export interface DataLoadersHandlerInterface {
60
+ clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
61
+ }
84
62
  export {};
package/types.js CHANGED
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ENTITIES = void 0;
7
7
  let ENTITIES;
8
8
  exports.ENTITIES = ENTITIES;
9
-
10
9
  (function (ENTITIES) {
11
10
  ENTITIES["SYSTEM"] = "CmsSystem";
12
11
  ENTITIES["SETTINGS"] = "CmsSettings";
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport {\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport { DynamoDBTypes, TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\n\ninterface CmsFieldFilterValueTransformParams {\n /**\n * A field which value we are transforming.\n */\n field: Partial<CmsModelField> &\n Pick<CmsModelField, \"id\" | \"storageId\" | \"fieldId\" | \"settings\">;\n value: any;\n}\n\nexport interface CmsFieldFilterValueTransformPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-field-filter-value-transform\";\n /**\n * A field type this plugin is for.\n */\n fieldType: string;\n /**\n * Transform method which expect field definition and value to transform.\n */\n transform: (params: CmsFieldFilterValueTransformParams) => any;\n}\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n SETTINGS = \"CmsSettings\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor): TableConstructor;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DocumentClient;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: Plugin[] | Plugin[][];\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => Table;\n getEntities: () => Record<\"system\" | \"settings\" | \"groups\" | \"models\" | \"entries\", Entity<any>>;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: DataLoadersHandlerInterface;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\">;\n}\nexport interface DataLoadersHandlerInterface {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":";;;;;;IA2CYA,QAAQ;AAAA;AAAA,WAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,wBAARA,QAAQ"}
@@ -1,3 +0,0 @@
1
- import { CmsFieldFilterPathPlugin } from "../../types";
2
- declare const _default: () => CmsFieldFilterPathPlugin;
3
- export default _default;
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _default = () => ({
9
- type: "cms-field-filter-path",
10
- name: "cms-field-filter-path-ref",
11
- fieldType: "ref",
12
- createPath: ({
13
- field,
14
- index
15
- }) => {
16
- const paths = [field.fieldId];
17
-
18
- if (index !== undefined) {
19
- paths.push(String(index));
20
- }
21
-
22
- paths.push("entryId");
23
- return paths.join(".");
24
- }
25
- });
26
-
27
- exports.default = _default;
@@ -1,2 +0,0 @@
1
- import { CmsModelField } from "@webiny/api-headless-cms/types";
2
- export declare const systemFields: Record<string, CmsModelField>;
@@ -1,50 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.systemFields = void 0;
7
-
8
- const createSystemField = field => {
9
- return field;
10
- };
11
-
12
- const systemFields = {
13
- id: createSystemField({
14
- id: "id",
15
- type: "text",
16
- fieldId: "id"
17
- }),
18
- entryId: createSystemField({
19
- id: "entryId",
20
- type: "text",
21
- fieldId: "entryId"
22
- }),
23
- createdOn: createSystemField({
24
- id: "createdOn",
25
- type: "datetime",
26
- fieldId: "createdOn"
27
- }),
28
- savedOn: createSystemField({
29
- id: "savedOn",
30
- type: "datetime",
31
- fieldId: "savedOn"
32
- }),
33
- createdBy: createSystemField({
34
- id: "createdBy",
35
- type: "plainObject",
36
- fieldId: "createdBy",
37
- settings: {
38
- path: "createdBy.id"
39
- }
40
- }),
41
- ownedBy: createSystemField({
42
- id: "ownedBy",
43
- type: "plainObject",
44
- fieldId: "ownedBy",
45
- settings: {
46
- path: "ownedBy.id"
47
- }
48
- })
49
- };
50
- exports.systemFields = systemFields;
@@ -1,31 +0,0 @@
1
- import { CmsEntry, CmsEntryListWhere, CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
2
- import { PluginsContainer } from "@webiny/plugins";
3
- interface ModelField {
4
- def: CmsModelField;
5
- valueTransformer: (value: any) => any;
6
- valuePath: string;
7
- isSystemField?: boolean;
8
- }
9
- declare type ModelFieldRecords = Record<string, ModelField>;
10
- export interface FilterItemFromStorage {
11
- (field: CmsModelField, value: any): Promise<any>;
12
- }
13
- interface FilterItemsParams {
14
- items: CmsEntry[];
15
- where: CmsEntryListWhere;
16
- plugins: PluginsContainer;
17
- fields: ModelFieldRecords;
18
- fromStorage: FilterItemFromStorage;
19
- }
20
- export declare const filterItems: (params: FilterItemsParams) => Promise<CmsEntry[]>;
21
- interface SortEntryItemsArgs {
22
- items: CmsEntry[];
23
- sort: string[];
24
- fields: ModelFieldRecords;
25
- }
26
- export declare const sortEntryItems: (params: SortEntryItemsArgs) => CmsEntry[];
27
- export declare const buildModelFields: ({ plugins, model }: {
28
- plugins: PluginsContainer;
29
- model: CmsModel;
30
- }) => Record<string, ModelField>;
31
- export {};