@webiny/api-headless-cms 5.37.3 → 5.37.4-beta.0

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 (175) hide show
  1. package/constants.js +1 -3
  2. package/context.js +1 -3
  3. package/crud/contentEntry/afterDelete.js +1 -3
  4. package/crud/contentEntry/beforeCreate.js +1 -3
  5. package/crud/contentEntry/beforeUpdate.js +1 -3
  6. package/crud/contentEntry/entryDataValidation.js +1 -3
  7. package/crud/contentEntry/markLockedFields.js +1 -3
  8. package/crud/contentEntry/referenceFieldsMapping.js +1 -3
  9. package/crud/contentEntry/searchableFields.js +1 -3
  10. package/crud/contentEntry.crud.js +1 -3
  11. package/crud/contentModel/afterCreate.js +1 -3
  12. package/crud/contentModel/afterCreateFrom.js +1 -3
  13. package/crud/contentModel/afterDelete.js +1 -3
  14. package/crud/contentModel/afterUpdate.js +1 -3
  15. package/crud/contentModel/beforeCreate.js +1 -3
  16. package/crud/contentModel/beforeDelete.js +1 -3
  17. package/crud/contentModel/beforeUpdate.js +1 -3
  18. package/crud/contentModel/compatibility/modelApiName.js +1 -3
  19. package/crud/contentModel/contentModelManagerFactory.js +1 -3
  20. package/crud/contentModel/createFieldStorageId.js +1 -3
  21. package/crud/contentModel/defaultFields.js +1 -3
  22. package/crud/contentModel/fields/descriptionField.js +1 -3
  23. package/crud/contentModel/fields/imageField.js +1 -3
  24. package/crud/contentModel/fields/titleField.js +1 -3
  25. package/crud/contentModel/validate/endingAllowed.js +1 -3
  26. package/crud/contentModel/validate/isModelEndingAllowed.js +1 -3
  27. package/crud/contentModel/validate/modelId.js +1 -3
  28. package/crud/contentModel/validate/pluralApiName.js +1 -3
  29. package/crud/contentModel/validate/singularApiName.js +1 -3
  30. package/crud/contentModel/validateLayout.js +1 -3
  31. package/crud/contentModel/validateModel.js +1 -3
  32. package/crud/contentModel/validateModelFields.js +1 -3
  33. package/crud/contentModel/validation.d.ts +56 -56
  34. package/crud/contentModel/validation.js +1 -3
  35. package/crud/contentModel.crud.js +1 -3
  36. package/crud/contentModelGroup/beforeCreate.js +1 -3
  37. package/crud/contentModelGroup/beforeDelete.js +1 -3
  38. package/crud/contentModelGroup/beforeUpdate.js +1 -3
  39. package/crud/contentModelGroup/validation.d.ts +1 -1
  40. package/crud/contentModelGroup/validation.js +1 -3
  41. package/crud/contentModelGroup.crud.js +1 -3
  42. package/crud/settings.crud.js +1 -3
  43. package/crud/system.crud.js +1 -3
  44. package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +1 -3
  45. package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +1 -3
  46. package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +1 -3
  47. package/fieldConverters/index.js +1 -3
  48. package/graphql/buildSchemaPlugins.js +1 -3
  49. package/graphql/checkEndpointAccess.js +1 -3
  50. package/graphql/createExecutableSchema.js +1 -3
  51. package/graphql/createRequestBody.js +1 -3
  52. package/graphql/formatErrorPayload.js +1 -3
  53. package/graphql/generateSchema.js +1 -3
  54. package/graphql/getSchema.js +1 -3
  55. package/graphql/graphQLHandlerFactory.js +1 -3
  56. package/graphql/handleRequest.js +1 -3
  57. package/graphql/index.d.ts +1 -1
  58. package/graphql/index.js +1 -3
  59. package/graphql/schema/baseContentSchema.js +1 -3
  60. package/graphql/schema/baseSchema.js +1 -3
  61. package/graphql/schema/contentEntries.js +1 -3
  62. package/graphql/schema/contentModelGroups.js +1 -3
  63. package/graphql/schema/contentModels.js +1 -3
  64. package/graphql/schema/createFieldResolvers.js +1 -3
  65. package/graphql/schema/createFieldTypePluginRecords.js +1 -3
  66. package/graphql/schema/createManageResolvers.js +1 -3
  67. package/graphql/schema/createManageSDL.js +1 -3
  68. package/graphql/schema/createPreviewResolvers.js +1 -3
  69. package/graphql/schema/createReadResolvers.js +1 -3
  70. package/graphql/schema/createReadSDL.js +1 -3
  71. package/graphql/schema/resolvers/commonFieldResolvers.js +1 -3
  72. package/graphql/schema/resolvers/manage/resolveCreate.js +1 -3
  73. package/graphql/schema/resolvers/manage/resolveCreateFrom.js +1 -3
  74. package/graphql/schema/resolvers/manage/resolveDelete.js +1 -3
  75. package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +1 -3
  76. package/graphql/schema/resolvers/manage/resolveGet.js +1 -3
  77. package/graphql/schema/resolvers/manage/resolveGetByIds.js +1 -3
  78. package/graphql/schema/resolvers/manage/resolveGetRevisions.js +1 -3
  79. package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +1 -3
  80. package/graphql/schema/resolvers/manage/resolveList.js +1 -3
  81. package/graphql/schema/resolvers/manage/resolveMove.js +1 -3
  82. package/graphql/schema/resolvers/manage/resolvePublish.js +1 -3
  83. package/graphql/schema/resolvers/manage/resolveRepublish.js +1 -3
  84. package/graphql/schema/resolvers/manage/resolveUnpublish.js +1 -3
  85. package/graphql/schema/resolvers/manage/resolveUpdate.js +1 -3
  86. package/graphql/schema/resolvers/preview/resolveGet.js +1 -3
  87. package/graphql/schema/resolvers/preview/resolveList.js +1 -3
  88. package/graphql/schema/resolvers/read/resolveGet.js +1 -3
  89. package/graphql/schema/resolvers/read/resolveList.js +1 -3
  90. package/graphql/schema/schemaPlugins.js +1 -3
  91. package/graphql/system.js +1 -3
  92. package/graphqlFields/boolean.js +1 -3
  93. package/graphqlFields/datetime.js +1 -3
  94. package/graphqlFields/dynamicZone/dynamicZoneField.js +1 -3
  95. package/graphqlFields/dynamicZone/dynamicZoneStorage.js +27 -16
  96. package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -1
  97. package/graphqlFields/dynamicZone/index.js +1 -3
  98. package/graphqlFields/file.js +1 -3
  99. package/graphqlFields/helpers.js +1 -3
  100. package/graphqlFields/index.js +1 -3
  101. package/graphqlFields/longText.js +1 -3
  102. package/graphqlFields/number.js +1 -3
  103. package/graphqlFields/object.js +1 -3
  104. package/graphqlFields/ref.js +1 -3
  105. package/graphqlFields/richText.js +1 -3
  106. package/graphqlFields/text.js +1 -3
  107. package/index.d.ts +1 -1
  108. package/index.js +1 -3
  109. package/modelManager/DefaultCmsModelManager.js +1 -3
  110. package/modelManager/index.js +1 -3
  111. package/package.json +18 -18
  112. package/parameters/context.js +1 -3
  113. package/parameters/header.js +1 -3
  114. package/parameters/index.js +1 -3
  115. package/parameters/manual.js +1 -3
  116. package/parameters/path.js +1 -3
  117. package/plugins/CmsGraphQLSchemaPlugin.js +1 -3
  118. package/plugins/CmsGraphQLSchemaSorterPlugin.js +1 -3
  119. package/plugins/CmsGroupPlugin.js +1 -3
  120. package/plugins/CmsModelFieldConverterPlugin.js +1 -3
  121. package/plugins/CmsModelPlugin.js +1 -3
  122. package/plugins/CmsParametersPlugin.js +1 -3
  123. package/plugins/StorageOperationsCmsModelPlugin.js +1 -3
  124. package/plugins/StorageTransformPlugin.js +1 -3
  125. package/plugins/index.js +1 -3
  126. package/storage/default.js +1 -3
  127. package/storage/object.js +1 -3
  128. package/types.js +1 -3
  129. package/utils/access.js +1 -3
  130. package/utils/converters/Converter.js +1 -3
  131. package/utils/converters/ConverterCollection.js +1 -3
  132. package/utils/converters/valueKeyStorageConverter.js +1 -3
  133. package/utils/createTypeFromFields.js +1 -3
  134. package/utils/createTypeName.js +1 -3
  135. package/utils/entryStorage.js +1 -3
  136. package/utils/filterAsync.js +1 -3
  137. package/utils/getBaseFieldType.js +1 -3
  138. package/utils/getEntryDescription.js +1 -3
  139. package/utils/getEntryImage.js +1 -3
  140. package/utils/getEntryTitle.js +1 -3
  141. package/utils/getSchemaFromFieldPlugins.d.ts +13 -2
  142. package/utils/getSchemaFromFieldPlugins.js +20 -6
  143. package/utils/getSchemaFromFieldPlugins.js.map +1 -1
  144. package/utils/incrementEntryIdVersion.js +1 -3
  145. package/utils/permissions/EntriesPermissions.js +1 -3
  146. package/utils/permissions/ModelGroupsPermissions.js +1 -3
  147. package/utils/permissions/ModelsPermissions.js +1 -3
  148. package/utils/permissions/SettingsPermissions.js +1 -3
  149. package/utils/renderFields.js +1 -3
  150. package/utils/renderGetFilterFields.js +1 -3
  151. package/utils/renderInputFields.js +1 -3
  152. package/utils/renderListFilterFields.js +1 -3
  153. package/utils/renderSortEnum.js +1 -3
  154. package/utils/toSlug.js +1 -3
  155. package/validators/dateGte.js +1 -3
  156. package/validators/dateLte.js +1 -3
  157. package/validators/dynamicZone.js +1 -3
  158. package/validators/gte.js +1 -3
  159. package/validators/in.js +1 -3
  160. package/validators/index.js +1 -3
  161. package/validators/lte.js +1 -3
  162. package/validators/maxLength.js +1 -3
  163. package/validators/minLength.js +1 -3
  164. package/validators/pattern.js +1 -3
  165. package/validators/patternPlugins/email.js +1 -3
  166. package/validators/patternPlugins/index.js +1 -3
  167. package/validators/patternPlugins/lowerCase.js +1 -3
  168. package/validators/patternPlugins/lowerCaseSpace.js +1 -3
  169. package/validators/patternPlugins/upperCase.js +1 -3
  170. package/validators/patternPlugins/upperCaseSpace.js +1 -3
  171. package/validators/patternPlugins/url.js +1 -3
  172. package/validators/required.js +1 -3
  173. package/validators/timeGte.js +1 -3
  174. package/validators/timeLte.js +1 -3
  175. package/validators/unique.js +1 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms",
3
- "version": "5.37.3",
3
+ "version": "5.37.4-beta.0",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "cms:base"
@@ -20,19 +20,19 @@
20
20
  "dependencies": {
21
21
  "@babel/runtime": "7.22.6",
22
22
  "@graphql-tools/schema": "7.1.5",
23
- "@webiny/api": "5.37.3",
24
- "@webiny/api-i18n": "5.37.3",
25
- "@webiny/api-security": "5.37.3",
26
- "@webiny/api-tenancy": "5.37.3",
27
- "@webiny/error": "5.37.3",
28
- "@webiny/handler": "5.37.3",
29
- "@webiny/handler-aws": "5.37.3",
30
- "@webiny/handler-db": "5.37.3",
31
- "@webiny/handler-graphql": "5.37.3",
32
- "@webiny/plugins": "5.37.3",
33
- "@webiny/pubsub": "5.37.3",
34
- "@webiny/utils": "5.37.3",
35
- "@webiny/validation": "5.37.3",
23
+ "@webiny/api": "5.37.4-beta.0",
24
+ "@webiny/api-i18n": "5.37.4-beta.0",
25
+ "@webiny/api-security": "5.37.4-beta.0",
26
+ "@webiny/api-tenancy": "5.37.4-beta.0",
27
+ "@webiny/error": "5.37.4-beta.0",
28
+ "@webiny/handler": "5.37.4-beta.0",
29
+ "@webiny/handler-aws": "5.37.4-beta.0",
30
+ "@webiny/handler-db": "5.37.4-beta.0",
31
+ "@webiny/handler-graphql": "5.37.4-beta.0",
32
+ "@webiny/plugins": "5.37.4-beta.0",
33
+ "@webiny/pubsub": "5.37.4-beta.0",
34
+ "@webiny/utils": "5.37.4-beta.0",
35
+ "@webiny/validation": "5.37.4-beta.0",
36
36
  "code-frame": "5.0.0",
37
37
  "dataloader": "2.2.1",
38
38
  "dot-prop": "6.0.1",
@@ -49,9 +49,9 @@
49
49
  "@babel/cli": "7.22.6",
50
50
  "@babel/core": "7.22.8",
51
51
  "@babel/preset-env": "7.22.7",
52
- "@webiny/api-wcp": "5.37.3",
53
- "@webiny/cli": "5.37.3",
54
- "@webiny/project-utils": "5.37.3",
52
+ "@webiny/api-wcp": "5.37.4-beta.0",
53
+ "@webiny/cli": "5.37.4-beta.0",
54
+ "@webiny/project-utils": "5.37.4-beta.0",
55
55
  "apollo-graphql": "0.9.7",
56
56
  "get-yarn-workspaces": "1.0.2",
57
57
  "graphql": "15.8.0",
@@ -71,5 +71,5 @@
71
71
  "build": "yarn webiny run build",
72
72
  "watch": "yarn webiny run watch"
73
73
  },
74
- "gitHead": "c454fc068c68c86bd817b21291e51c845296c15a"
74
+ "gitHead": "2b8d53b8aec843ba8fe5590cfd4aa82f95c4adad"
75
75
  }
@@ -15,6 +15,4 @@ const createContextParameterPlugin = () => {
15
15
  };
16
16
  });
17
17
  };
18
- exports.createContextParameterPlugin = createContextParameterPlugin;
19
-
20
- //# sourceMappingURL=context.js.map
18
+ exports.createContextParameterPlugin = createContextParameterPlugin;
@@ -41,6 +41,4 @@ const createHeaderParameterPlugin = () => {
41
41
  };
42
42
  });
43
43
  };
44
- exports.createHeaderParameterPlugin = createHeaderParameterPlugin;
45
-
46
- //# sourceMappingURL=header.js.map
44
+ exports.createHeaderParameterPlugin = createHeaderParameterPlugin;
@@ -46,6 +46,4 @@ Object.keys(_header).forEach(function (key) {
46
46
  return _header[key];
47
47
  }
48
48
  });
49
- });
50
-
51
- //# sourceMappingURL=index.js.map
49
+ });
@@ -34,6 +34,4 @@ const createManualPlugin = params => {
34
34
  };
35
35
  });
36
36
  };
37
- exports.createManualPlugin = createManualPlugin;
38
-
39
- //# sourceMappingURL=manual.js.map
37
+ exports.createManualPlugin = createManualPlugin;
@@ -37,6 +37,4 @@ const createPathParameterPlugin = () => {
37
37
  };
38
38
  });
39
39
  };
40
- exports.createPathParameterPlugin = createPathParameterPlugin;
41
-
42
- //# sourceMappingURL=path.js.map
40
+ exports.createPathParameterPlugin = createPathParameterPlugin;
@@ -9,6 +9,4 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _handlerGraphql = require("@webiny/handler-graphql");
10
10
  class CmsGraphQLSchemaPlugin extends _handlerGraphql.GraphQLSchemaPlugin {}
11
11
  exports.CmsGraphQLSchemaPlugin = CmsGraphQLSchemaPlugin;
12
- (0, _defineProperty2.default)(CmsGraphQLSchemaPlugin, "type", "cms.graphql.schema");
13
-
14
- //# sourceMappingURL=CmsGraphQLSchemaPlugin.js.map
12
+ (0, _defineProperty2.default)(CmsGraphQLSchemaPlugin, "type", "cms.graphql.schema");
@@ -25,6 +25,4 @@ exports.CmsGraphQLSchemaSorterPlugin = CmsGraphQLSchemaSorterPlugin;
25
25
  const createCmsGraphQLSchemaSorterPlugin = cb => {
26
26
  return new CmsGraphQLSchemaSorterPlugin(cb);
27
27
  };
28
- exports.createCmsGraphQLSchemaSorterPlugin = createCmsGraphQLSchemaSorterPlugin;
29
-
30
- //# sourceMappingURL=CmsGraphQLSchemaSorterPlugin.js.map
28
+ exports.createCmsGraphQLSchemaSorterPlugin = createCmsGraphQLSchemaSorterPlugin;
@@ -19,6 +19,4 @@ exports.CmsGroupPlugin = CmsGroupPlugin;
19
19
  const createCmsGroup = group => {
20
20
  return new CmsGroupPlugin(group);
21
21
  };
22
- exports.createCmsGroup = createCmsGroup;
23
-
24
- //# sourceMappingURL=CmsGroupPlugin.js.map
22
+ exports.createCmsGroup = createCmsGroup;
@@ -9,6 +9,4 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _plugins = require("@webiny/plugins");
10
10
  class CmsModelFieldConverterPlugin extends _plugins.Plugin {}
11
11
  exports.CmsModelFieldConverterPlugin = CmsModelFieldConverterPlugin;
12
- (0, _defineProperty2.default)(CmsModelFieldConverterPlugin, "type", "cms.field.converter");
13
-
14
- //# sourceMappingURL=CmsModelFieldConverterPlugin.js.map
12
+ (0, _defineProperty2.default)(CmsModelFieldConverterPlugin, "type", "cms.field.converter");
@@ -181,6 +181,4 @@ exports.CmsModelPlugin = CmsModelPlugin;
181
181
  const createCmsModel = (model, options) => {
182
182
  return new CmsModelPlugin(model, options);
183
183
  };
184
- exports.createCmsModel = createCmsModel;
185
-
186
- //# sourceMappingURL=CmsModelPlugin.js.map
184
+ exports.createCmsModel = createCmsModel;
@@ -22,6 +22,4 @@ class CmsParametersPlugin extends _plugins.Plugin {
22
22
  }
23
23
  }
24
24
  exports.CmsParametersPlugin = CmsParametersPlugin;
25
- (0, _defineProperty2.default)(CmsParametersPlugin, "type", "cms-parameters-plugin");
26
-
27
- //# sourceMappingURL=CmsParametersPlugin.js.map
25
+ (0, _defineProperty2.default)(CmsParametersPlugin, "type", "cms-parameters-plugin");
@@ -39,6 +39,4 @@ class StorageOperationsCmsModelPlugin extends _plugins.Plugin {
39
39
  }
40
40
  }
41
41
  exports.StorageOperationsCmsModelPlugin = StorageOperationsCmsModelPlugin;
42
- (0, _defineProperty2.default)(StorageOperationsCmsModelPlugin, "type", "cms.storageOperations.model");
43
-
44
- //# sourceMappingURL=StorageOperationsCmsModelPlugin.js.map
42
+ (0, _defineProperty2.default)(StorageOperationsCmsModelPlugin, "type", "cms.storageOperations.model");
@@ -25,6 +25,4 @@ class StorageTransformPlugin extends _Plugin.Plugin {
25
25
  }
26
26
  }
27
27
  exports.StorageTransformPlugin = StorageTransformPlugin;
28
- (0, _defineProperty2.default)(StorageTransformPlugin, "type", "cms.storage.transform.plugin");
29
-
30
- //# sourceMappingURL=StorageTransformPlugin.js.map
28
+ (0, _defineProperty2.default)(StorageTransformPlugin, "type", "cms.storage.transform.plugin");
package/plugins/index.js CHANGED
@@ -90,6 +90,4 @@ Object.keys(_StorageOperationsCmsModelPlugin).forEach(function (key) {
90
90
  return _StorageOperationsCmsModelPlugin[key];
91
91
  }
92
92
  });
93
- });
94
-
95
- //# sourceMappingURL=index.js.map
93
+ });
@@ -21,6 +21,4 @@ const createDefaultStorageTransform = () => {
21
21
  }
22
22
  });
23
23
  };
24
- exports.createDefaultStorageTransform = createDefaultStorageTransform;
25
-
26
- //# sourceMappingURL=default.js.map
24
+ exports.createDefaultStorageTransform = createDefaultStorageTransform;
package/storage/object.js CHANGED
@@ -105,6 +105,4 @@ const createObjectStorageTransform = () => {
105
105
  }
106
106
  });
107
107
  };
108
- exports.createObjectStorageTransform = createObjectStorageTransform;
109
-
110
- //# sourceMappingURL=object.js.map
108
+ exports.createObjectStorageTransform = createObjectStorageTransform;
package/types.js CHANGED
@@ -420,6 +420,4 @@ let CONTENT_ENTRY_STATUS = /*#__PURE__*/function (CONTENT_ENTRY_STATUS) {
420
420
  CONTENT_ENTRY_STATUS["UNPUBLISHED"] = "unpublished";
421
421
  return CONTENT_ENTRY_STATUS;
422
422
  }({});
423
- exports.CONTENT_ENTRY_STATUS = CONTENT_ENTRY_STATUS;
424
-
425
- //# sourceMappingURL=types.js.map
423
+ exports.CONTENT_ENTRY_STATUS = CONTENT_ENTRY_STATUS;
package/utils/access.js CHANGED
@@ -30,6 +30,4 @@ const checkModelAccess = async (context, model) => {
30
30
  model
31
31
  });
32
32
  };
33
- exports.checkModelAccess = checkModelAccess;
34
-
35
- //# sourceMappingURL=access.js.map
33
+ exports.checkModelAccess = checkModelAccess;
@@ -55,6 +55,4 @@ class Converter {
55
55
  });
56
56
  }
57
57
  }
58
- exports.Converter = Converter;
59
-
60
- //# sourceMappingURL=Converter.js.map
58
+ exports.Converter = Converter;
@@ -116,6 +116,4 @@ class ConverterCollection {
116
116
  });
117
117
  }
118
118
  }
119
- exports.ConverterCollection = ConverterCollection;
120
-
121
- //# sourceMappingURL=ConverterCollection.js.map
119
+ exports.ConverterCollection = ConverterCollection;
@@ -130,6 +130,4 @@ const createCmsModelFieldConvertersAttachFactory = plugins => {
130
130
  });
131
131
  };
132
132
  };
133
- exports.createCmsModelFieldConvertersAttachFactory = createCmsModelFieldConvertersAttachFactory;
134
-
135
- //# sourceMappingURL=valueKeyStorageConverter.js.map
133
+ exports.createCmsModelFieldConvertersAttachFactory = createCmsModelFieldConvertersAttachFactory;
@@ -63,6 +63,4 @@ const createTypeFromFields = params => {
63
63
  `
64
64
  };
65
65
  };
66
- exports.createTypeFromFields = createTypeFromFields;
67
-
68
- //# sourceMappingURL=createTypeFromFields.js.map
66
+ exports.createTypeFromFields = createTypeFromFields;
@@ -10,6 +10,4 @@ var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
10
10
  const createTypeName = modelId => {
11
11
  return (0, _upperFirst.default)((0, _camelCase.default)(modelId));
12
12
  };
13
- exports.createTypeName = createTypeName;
14
-
15
- //# sourceMappingURL=createTypeName.js.map
13
+ exports.createTypeName = createTypeName;
@@ -101,6 +101,4 @@ const entryFieldFromStorageTransform = async params => {
101
101
  getStoragePlugin
102
102
  });
103
103
  };
104
- exports.entryFieldFromStorageTransform = entryFieldFromStorageTransform;
105
-
106
- //# sourceMappingURL=entryStorage.js.map
104
+ exports.entryFieldFromStorageTransform = entryFieldFromStorageTransform;
@@ -15,6 +15,4 @@ const filterAsync = async (items, predicate) => {
15
15
  }
16
16
  return filteredItems;
17
17
  };
18
- exports.filterAsync = filterAsync;
19
-
20
- //# sourceMappingURL=filterAsync.js.map
18
+ exports.filterAsync = filterAsync;
@@ -7,6 +7,4 @@ exports.getBaseFieldType = void 0;
7
7
  const getBaseFieldType = field => {
8
8
  return field.type.split(":")[0];
9
9
  };
10
- exports.getBaseFieldType = getBaseFieldType;
11
-
12
- //# sourceMappingURL=getBaseFieldType.js.map
10
+ exports.getBaseFieldType = getBaseFieldType;
@@ -14,6 +14,4 @@ function getEntryDescription(model, entry) {
14
14
  }
15
15
  const descriptionFieldId = field.fieldId;
16
16
  return entry.values[descriptionFieldId] || "";
17
- }
18
-
19
- //# sourceMappingURL=getEntryDescription.js.map
17
+ }
@@ -14,6 +14,4 @@ function getEntryImage(model, entry) {
14
14
  }
15
15
  const imageFieldId = field.fieldId;
16
16
  return entry.values[imageFieldId] || null;
17
- }
18
-
19
- //# sourceMappingURL=getEntryImage.js.map
17
+ }
@@ -31,6 +31,4 @@ function getEntryTitle(model, entry) {
31
31
  }
32
32
  }
33
33
  return titleValue;
34
- }
35
-
36
- //# sourceMappingURL=getEntryTitle.js.map
34
+ }
@@ -1,9 +1,20 @@
1
- import { CmsModel, CmsFieldTypePlugins, ApiEndpoint } from "../types";
1
+ import { ApiEndpoint, CmsContext, CmsFieldTypePlugins, CmsModel } from "../types";
2
2
  import { CmsGraphQLSchemaPlugin } from "../plugins";
3
+ import { GraphQLSchemaPlugin } from "@webiny/handler-graphql";
4
+ import { GraphQLSchemaDefinition } from "@webiny/handler-graphql/types";
5
+ interface CreatePluginCallableParams {
6
+ schema: GraphQLSchemaDefinition<CmsContext>;
7
+ type: "manage" | "preview" | "read";
8
+ fieldType: string;
9
+ }
10
+ interface CreatePluginCallable {
11
+ (params: CreatePluginCallableParams): GraphQLSchemaPlugin<CmsContext>;
12
+ }
3
13
  interface Params {
4
14
  models: CmsModel[];
5
15
  fieldTypePlugins: CmsFieldTypePlugins;
6
16
  type: ApiEndpoint;
17
+ createPlugin?: CreatePluginCallable;
7
18
  }
8
- export declare const createGraphQLSchemaPluginFromFieldPlugins: (params: Params) => CmsGraphQLSchemaPlugin<import("../types").CmsContext>[];
19
+ export declare const createGraphQLSchemaPluginFromFieldPlugins: (params: Params) => CmsGraphQLSchemaPlugin<CmsContext>[];
9
20
  export {};
@@ -10,11 +10,21 @@ const TYPE_MAP = {
10
10
  read: "read",
11
11
  manage: "manage"
12
12
  };
13
+ const defaultCreatePlugin = ({
14
+ schema,
15
+ type,
16
+ fieldType
17
+ }) => {
18
+ const plugin = new _plugins.CmsGraphQLSchemaPlugin(schema);
19
+ plugin.name = `headless-cms.graphql.schema.${type}.field.${fieldType}`;
20
+ return plugin;
21
+ };
13
22
  const createGraphQLSchemaPluginFromFieldPlugins = params => {
14
23
  const {
15
24
  models,
16
25
  fieldTypePlugins,
17
- type
26
+ type,
27
+ createPlugin = defaultCreatePlugin
18
28
  } = params;
19
29
  const plugins = [];
20
30
  for (const key in fieldTypePlugins) {
@@ -30,12 +40,16 @@ const createGraphQLSchemaPluginFromFieldPlugins = params => {
30
40
  const schema = createSchema({
31
41
  models
32
42
  });
33
- const plugin = new _plugins.CmsGraphQLSchemaPlugin(schema);
34
- plugin.name = `headless-cms.graphql.schema.${type}.field.${fieldTypePlugin.fieldType}`;
43
+
44
+ // const plugin = new CmsGraphQLSchemaPlugin(schema);
45
+ // plugin.name = `headless-cms.graphql.schema.${type}.field.${fieldTypePlugin.fieldType}`;
46
+ const plugin = createPlugin({
47
+ schema,
48
+ type,
49
+ fieldType: fieldTypePlugin.fieldType
50
+ });
35
51
  plugins.push(plugin);
36
52
  }
37
53
  return plugins;
38
54
  };
39
- exports.createGraphQLSchemaPluginFromFieldPlugins = createGraphQLSchemaPluginFromFieldPlugins;
40
-
41
- //# sourceMappingURL=getSchemaFromFieldPlugins.js.map
55
+ exports.createGraphQLSchemaPluginFromFieldPlugins = createGraphQLSchemaPluginFromFieldPlugins;
@@ -1 +1 @@
1
- {"version":3,"names":["_plugins","require","TYPE_MAP","preview","read","manage","createGraphQLSchemaPluginFromFieldPlugins","params","models","fieldTypePlugins","type","plugins","key","fieldTypePlugin","createSchema","schema","plugin","CmsGraphQLSchemaPlugin","name","fieldType","push","exports"],"sources":["getSchemaFromFieldPlugins.ts"],"sourcesContent":["import { CmsModel, CmsFieldTypePlugins, ApiEndpoint } from \"~/types\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\n\nconst TYPE_MAP: Record<string, \"manage\" | \"read\"> = {\n preview: \"read\",\n read: \"read\",\n manage: \"manage\"\n};\n\ninterface Params {\n models: CmsModel[];\n fieldTypePlugins: CmsFieldTypePlugins;\n type: ApiEndpoint;\n}\nexport const createGraphQLSchemaPluginFromFieldPlugins = (params: Params) => {\n const { models, fieldTypePlugins, type } = params;\n\n const plugins: CmsGraphQLSchemaPlugin[] = [];\n for (const key in fieldTypePlugins) {\n const fieldTypePlugin = fieldTypePlugins[key];\n if (!TYPE_MAP[type] || !fieldTypePlugin[TYPE_MAP[type]]) {\n continue;\n }\n const createSchema = fieldTypePlugin[TYPE_MAP[type]].createSchema;\n // Render gql types generated by field type plugins\n if (!createSchema) {\n continue;\n }\n const schema = createSchema({ models });\n\n const plugin = new CmsGraphQLSchemaPlugin(schema);\n plugin.name = `headless-cms.graphql.schema.${type}.field.${fieldTypePlugin.fieldType}`;\n plugins.push(plugin);\n }\n return plugins;\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAEA,MAAMC,QAA2C,GAAG;EAChDC,OAAO,EAAE,MAAM;EACfC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE;AACZ,CAAC;AAOM,MAAMC,yCAAyC,GAAIC,MAAc,IAAK;EACzE,MAAM;IAAEC,MAAM;IAAEC,gBAAgB;IAAEC;EAAK,CAAC,GAAGH,MAAM;EAEjD,MAAMI,OAAiC,GAAG,EAAE;EAC5C,KAAK,MAAMC,GAAG,IAAIH,gBAAgB,EAAE;IAChC,MAAMI,eAAe,GAAGJ,gBAAgB,CAACG,GAAG,CAAC;IAC7C,IAAI,CAACV,QAAQ,CAACQ,IAAI,CAAC,IAAI,CAACG,eAAe,CAACX,QAAQ,CAACQ,IAAI,CAAC,CAAC,EAAE;MACrD;IACJ;IACA,MAAMI,YAAY,GAAGD,eAAe,CAACX,QAAQ,CAACQ,IAAI,CAAC,CAAC,CAACI,YAAY;IACjE;IACA,IAAI,CAACA,YAAY,EAAE;MACf;IACJ;IACA,MAAMC,MAAM,GAAGD,YAAY,CAAC;MAAEN;IAAO,CAAC,CAAC;IAEvC,MAAMQ,MAAM,GAAG,IAAIC,+BAAsB,CAACF,MAAM,CAAC;IACjDC,MAAM,CAACE,IAAI,GAAI,+BAA8BR,IAAK,UAASG,eAAe,CAACM,SAAU,EAAC;IACtFR,OAAO,CAACS,IAAI,CAACJ,MAAM,CAAC;EACxB;EACA,OAAOL,OAAO;AAClB,CAAC;AAACU,OAAA,CAAAf,yCAAA,GAAAA,yCAAA"}
1
+ {"version":3,"names":["_plugins","require","TYPE_MAP","preview","read","manage","defaultCreatePlugin","schema","type","fieldType","plugin","CmsGraphQLSchemaPlugin","name","createGraphQLSchemaPluginFromFieldPlugins","params","models","fieldTypePlugins","createPlugin","plugins","key","fieldTypePlugin","createSchema","push","exports"],"sources":["getSchemaFromFieldPlugins.ts"],"sourcesContent":["import { ApiEndpoint, CmsContext, CmsFieldTypePlugins, CmsModel } from \"~/types\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { GraphQLSchemaDefinition } from \"@webiny/handler-graphql/types\";\n\nconst TYPE_MAP: Record<string, \"manage\" | \"read\"> = {\n preview: \"read\",\n read: \"read\",\n manage: \"manage\"\n};\n\ninterface CreatePluginCallableParams {\n schema: GraphQLSchemaDefinition<CmsContext>;\n type: \"manage\" | \"preview\" | \"read\";\n fieldType: string;\n}\n\ninterface CreatePluginCallable {\n (params: CreatePluginCallableParams): GraphQLSchemaPlugin<CmsContext>;\n}\n\nconst defaultCreatePlugin: CreatePluginCallable = ({ schema, type, fieldType }) => {\n const plugin = new CmsGraphQLSchemaPlugin(schema);\n plugin.name = `headless-cms.graphql.schema.${type}.field.${fieldType}`;\n return plugin;\n};\n\ninterface Params {\n models: CmsModel[];\n fieldTypePlugins: CmsFieldTypePlugins;\n type: ApiEndpoint;\n createPlugin?: CreatePluginCallable;\n}\nexport const createGraphQLSchemaPluginFromFieldPlugins = (params: Params) => {\n const { models, fieldTypePlugins, type, createPlugin = defaultCreatePlugin } = params;\n\n const plugins: CmsGraphQLSchemaPlugin[] = [];\n for (const key in fieldTypePlugins) {\n const fieldTypePlugin = fieldTypePlugins[key];\n if (!TYPE_MAP[type] || !fieldTypePlugin[TYPE_MAP[type]]) {\n continue;\n }\n const createSchema = fieldTypePlugin[TYPE_MAP[type]].createSchema;\n // Render gql types generated by field type plugins\n if (!createSchema) {\n continue;\n }\n const schema = createSchema({ models });\n\n // const plugin = new CmsGraphQLSchemaPlugin(schema);\n // plugin.name = `headless-cms.graphql.schema.${type}.field.${fieldTypePlugin.fieldType}`;\n const plugin = createPlugin({\n schema,\n type,\n fieldType: fieldTypePlugin.fieldType\n });\n plugins.push(plugin);\n }\n return plugins;\n};\n"],"mappings":";;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AAIA,MAAMC,QAA2C,GAAG;EAChDC,OAAO,EAAE,MAAM;EACfC,IAAI,EAAE,MAAM;EACZC,MAAM,EAAE;AACZ,CAAC;AAYD,MAAMC,mBAAyC,GAAGA,CAAC;EAAEC,MAAM;EAAEC,IAAI;EAAEC;AAAU,CAAC,KAAK;EAC/E,MAAMC,MAAM,GAAG,IAAIC,+BAAsB,CAACJ,MAAM,CAAC;EACjDG,MAAM,CAACE,IAAI,GAAI,+BAA8BJ,IAAK,UAASC,SAAU,EAAC;EACtE,OAAOC,MAAM;AACjB,CAAC;AAQM,MAAMG,yCAAyC,GAAIC,MAAc,IAAK;EACzE,MAAM;IAAEC,MAAM;IAAEC,gBAAgB;IAAER,IAAI;IAAES,YAAY,GAAGX;EAAoB,CAAC,GAAGQ,MAAM;EAErF,MAAMI,OAAiC,GAAG,EAAE;EAC5C,KAAK,MAAMC,GAAG,IAAIH,gBAAgB,EAAE;IAChC,MAAMI,eAAe,GAAGJ,gBAAgB,CAACG,GAAG,CAAC;IAC7C,IAAI,CAACjB,QAAQ,CAACM,IAAI,CAAC,IAAI,CAACY,eAAe,CAAClB,QAAQ,CAACM,IAAI,CAAC,CAAC,EAAE;MACrD;IACJ;IACA,MAAMa,YAAY,GAAGD,eAAe,CAAClB,QAAQ,CAACM,IAAI,CAAC,CAAC,CAACa,YAAY;IACjE;IACA,IAAI,CAACA,YAAY,EAAE;MACf;IACJ;IACA,MAAMd,MAAM,GAAGc,YAAY,CAAC;MAAEN;IAAO,CAAC,CAAC;;IAEvC;IACA;IACA,MAAML,MAAM,GAAGO,YAAY,CAAC;MACxBV,MAAM;MACNC,IAAI;MACJC,SAAS,EAAEW,eAAe,CAACX;IAC/B,CAAC,CAAC;IACFS,OAAO,CAACI,IAAI,CAACZ,MAAM,CAAC;EACxB;EACA,OAAOQ,OAAO;AAClB,CAAC;AAACK,OAAA,CAAAV,yCAAA,GAAAA,yCAAA"}
@@ -26,6 +26,4 @@ const incrementEntryIdVersion = id => {
26
26
  })
27
27
  };
28
28
  };
29
- exports.incrementEntryIdVersion = incrementEntryIdVersion;
30
-
31
- //# sourceMappingURL=incrementEntryIdVersion.js.map
29
+ exports.incrementEntryIdVersion = incrementEntryIdVersion;
@@ -6,6 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.EntriesPermissions = void 0;
7
7
  var _apiSecurity = require("@webiny/api-security");
8
8
  class EntriesPermissions extends _apiSecurity.AppPermissions {}
9
- exports.EntriesPermissions = EntriesPermissions;
10
-
11
- //# sourceMappingURL=EntriesPermissions.js.map
9
+ exports.EntriesPermissions = EntriesPermissions;
@@ -45,6 +45,4 @@ class ModelGroupsPermissions extends _apiSecurity.AppPermissions {
45
45
  });
46
46
  }
47
47
  }
48
- exports.ModelGroupsPermissions = ModelGroupsPermissions;
49
-
50
- //# sourceMappingURL=ModelGroupsPermissions.js.map
48
+ exports.ModelGroupsPermissions = ModelGroupsPermissions;
@@ -88,6 +88,4 @@ class ModelsPermissions extends _apiSecurity.AppPermissions {
88
88
  });
89
89
  }
90
90
  }
91
- exports.ModelsPermissions = ModelsPermissions;
92
-
93
- //# sourceMappingURL=ModelsPermissions.js.map
91
+ exports.ModelsPermissions = ModelsPermissions;
@@ -6,6 +6,4 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.SettingsPermissions = void 0;
7
7
  var _apiSecurity = require("@webiny/api-security");
8
8
  class SettingsPermissions extends _apiSecurity.AppPermissions {}
9
- exports.SettingsPermissions = SettingsPermissions;
10
-
11
- //# sourceMappingURL=SettingsPermissions.js.map
9
+ exports.SettingsPermissions = SettingsPermissions;
@@ -51,6 +51,4 @@ const renderField = ({
51
51
  }
52
52
  return defs;
53
53
  };
54
- exports.renderField = renderField;
55
-
56
- //# sourceMappingURL=renderFields.js.map
54
+ exports.renderField = renderField;
@@ -32,6 +32,4 @@ const renderGetFilterFields = ({
32
32
  }
33
33
  return filters.filter(Boolean).join("\n");
34
34
  };
35
- exports.renderGetFilterFields = renderGetFilterFields;
36
-
37
- //# sourceMappingURL=renderGetFilterFields.js.map
35
+ exports.renderGetFilterFields = renderGetFilterFields;
@@ -55,6 +55,4 @@ const renderInputField = ({
55
55
  }
56
56
  return def;
57
57
  };
58
- exports.renderInputField = renderInputField;
59
-
60
- //# sourceMappingURL=renderInputFields.js.map
58
+ exports.renderInputField = renderInputField;
@@ -45,6 +45,4 @@ const renderListFilterFields = params => {
45
45
  }
46
46
  return finalFields.filter(Boolean).join("\n");
47
47
  };
48
- exports.renderListFilterFields = renderListFilterFields;
49
-
50
- //# sourceMappingURL=renderListFilterFields.js.map
48
+ exports.renderListFilterFields = renderListFilterFields;
@@ -43,6 +43,4 @@ const renderSortEnum = ({
43
43
  });
44
44
  }, sorters).join("\n");
45
45
  };
46
- exports.renderSortEnum = renderSortEnum;
47
-
48
- //# sourceMappingURL=renderSortEnum.js.map
46
+ exports.renderSortEnum = renderSortEnum;
package/utils/toSlug.js CHANGED
@@ -13,6 +13,4 @@ const toSlug = text => {
13
13
  remove: /[*#\?<>_\{\}\[\]+~.()'"!:;@]/g
14
14
  });
15
15
  };
16
- exports.toSlug = toSlug;
17
-
18
- //# sourceMappingURL=toSlug.js.map
16
+ exports.toSlug = toSlug;
@@ -27,6 +27,4 @@ const createDateGteValidator = () => ({
27
27
  }
28
28
  }
29
29
  });
30
- exports.createDateGteValidator = createDateGteValidator;
31
-
32
- //# sourceMappingURL=dateGte.js.map
30
+ exports.createDateGteValidator = createDateGteValidator;
@@ -27,6 +27,4 @@ const createDateLteValidator = () => ({
27
27
  }
28
28
  }
29
29
  });
30
- exports.createDateLteValidator = createDateLteValidator;
31
-
32
- //# sourceMappingURL=dateLte.js.map
30
+ exports.createDateLteValidator = createDateLteValidator;
@@ -17,6 +17,4 @@ const createDynamicZoneValidator = () => {
17
17
  }
18
18
  };
19
19
  };
20
- exports.createDynamicZoneValidator = createDynamicZoneValidator;
21
-
22
- //# sourceMappingURL=dynamicZone.js.map
20
+ exports.createDynamicZoneValidator = createDynamicZoneValidator;
package/validators/gte.js CHANGED
@@ -25,6 +25,4 @@ const createGteValidator = () => {
25
25
  }
26
26
  };
27
27
  };
28
- exports.createGteValidator = createGteValidator;
29
-
30
- //# sourceMappingURL=gte.js.map
28
+ exports.createGteValidator = createGteValidator;
package/validators/in.js CHANGED
@@ -25,6 +25,4 @@ const createInValidator = () => {
25
25
  }
26
26
  };
27
27
  };
28
- exports.createInValidator = createInValidator;
29
-
30
- //# sourceMappingURL=in.js.map
28
+ exports.createInValidator = createInValidator;
@@ -19,6 +19,4 @@ var _timeGte = require("./timeGte");
19
19
  var _unique = require("./unique");
20
20
  var _dynamicZone = require("./dynamicZone");
21
21
  const createValidators = () => [(0, _gte.createGteValidator)(), (0, _in.createInValidator)(), (0, _lte.createLteValidator)(), (0, _maxLength.createMaxLengthValidator)(), (0, _minLength.createMinLengthValidator)(), (0, _pattern.createPatternValidator)(), (0, _required.createRequiredValidator)(), (0, _patternPlugins.createPatternValidatorPlugins)(), (0, _dateLte.createDateLteValidator)(), (0, _dateGte.createDateGteValidator)(), (0, _timeLte.createTimeLteValidator)(), (0, _timeGte.createTimeGteValidator)(), (0, _unique.createUniqueValidator)(), (0, _dynamicZone.createDynamicZoneValidator)()];
22
- exports.createValidators = createValidators;
23
-
24
- //# sourceMappingURL=index.js.map
22
+ exports.createValidators = createValidators;
package/validators/lte.js CHANGED
@@ -25,6 +25,4 @@ const createLteValidator = () => {
25
25
  }
26
26
  };
27
27
  };
28
- exports.createLteValidator = createLteValidator;
29
-
30
- //# sourceMappingURL=lte.js.map
28
+ exports.createLteValidator = createLteValidator;
@@ -25,6 +25,4 @@ const createMaxLengthValidator = () => {
25
25
  }
26
26
  };
27
27
  };
28
- exports.createMaxLengthValidator = createMaxLengthValidator;
29
-
30
- //# sourceMappingURL=maxLength.js.map
28
+ exports.createMaxLengthValidator = createMaxLengthValidator;
@@ -25,6 +25,4 @@ const createMinLengthValidator = () => {
25
25
  }
26
26
  };
27
27
  };
28
- exports.createMinLengthValidator = createMinLengthValidator;
29
-
30
- //# sourceMappingURL=minLength.js.map
28
+ exports.createMinLengthValidator = createMinLengthValidator;
@@ -38,6 +38,4 @@ const createPatternValidator = () => {
38
38
  }
39
39
  };
40
40
  };
41
- exports.createPatternValidator = createPatternValidator;
42
-
43
- //# sourceMappingURL=pattern.js.map
41
+ exports.createPatternValidator = createPatternValidator;
@@ -15,6 +15,4 @@ const createEmailPatternValidator = () => {
15
15
  }
16
16
  };
17
17
  };
18
- exports.createEmailPatternValidator = createEmailPatternValidator;
19
-
20
- //# sourceMappingURL=email.js.map
18
+ exports.createEmailPatternValidator = createEmailPatternValidator;
@@ -13,6 +13,4 @@ var _upperCaseSpace = require("./upperCaseSpace");
13
13
  const createPatternValidatorPlugins = () => {
14
14
  return [(0, _email.createEmailPatternValidator)(), (0, _url.createUrlPatternValidator)(), (0, _lowerCase.createLowerCasePatternValidator)(), (0, _upperCase.createUpperCasePatternValidator)(), (0, _lowerCaseSpace.createLowerCaseSpacePatternValidator)(), (0, _upperCaseSpace.createUpperCaseSpacePatternValidator)()];
15
15
  };
16
- exports.createPatternValidatorPlugins = createPatternValidatorPlugins;
17
-
18
- //# sourceMappingURL=index.js.map
16
+ exports.createPatternValidatorPlugins = createPatternValidatorPlugins;