@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.
- package/constants.js +1 -3
- package/context.js +1 -3
- package/crud/contentEntry/afterDelete.js +1 -3
- package/crud/contentEntry/beforeCreate.js +1 -3
- package/crud/contentEntry/beforeUpdate.js +1 -3
- package/crud/contentEntry/entryDataValidation.js +1 -3
- package/crud/contentEntry/markLockedFields.js +1 -3
- package/crud/contentEntry/referenceFieldsMapping.js +1 -3
- package/crud/contentEntry/searchableFields.js +1 -3
- package/crud/contentEntry.crud.js +1 -3
- package/crud/contentModel/afterCreate.js +1 -3
- package/crud/contentModel/afterCreateFrom.js +1 -3
- package/crud/contentModel/afterDelete.js +1 -3
- package/crud/contentModel/afterUpdate.js +1 -3
- package/crud/contentModel/beforeCreate.js +1 -3
- package/crud/contentModel/beforeDelete.js +1 -3
- package/crud/contentModel/beforeUpdate.js +1 -3
- package/crud/contentModel/compatibility/modelApiName.js +1 -3
- package/crud/contentModel/contentModelManagerFactory.js +1 -3
- package/crud/contentModel/createFieldStorageId.js +1 -3
- package/crud/contentModel/defaultFields.js +1 -3
- package/crud/contentModel/fields/descriptionField.js +1 -3
- package/crud/contentModel/fields/imageField.js +1 -3
- package/crud/contentModel/fields/titleField.js +1 -3
- package/crud/contentModel/validate/endingAllowed.js +1 -3
- package/crud/contentModel/validate/isModelEndingAllowed.js +1 -3
- package/crud/contentModel/validate/modelId.js +1 -3
- package/crud/contentModel/validate/pluralApiName.js +1 -3
- package/crud/contentModel/validate/singularApiName.js +1 -3
- package/crud/contentModel/validateLayout.js +1 -3
- package/crud/contentModel/validateModel.js +1 -3
- package/crud/contentModel/validateModelFields.js +1 -3
- package/crud/contentModel/validation.d.ts +56 -56
- package/crud/contentModel/validation.js +1 -3
- package/crud/contentModel.crud.js +1 -3
- package/crud/contentModelGroup/beforeCreate.js +1 -3
- package/crud/contentModelGroup/beforeDelete.js +1 -3
- package/crud/contentModelGroup/beforeUpdate.js +1 -3
- package/crud/contentModelGroup/validation.d.ts +1 -1
- package/crud/contentModelGroup/validation.js +1 -3
- package/crud/contentModelGroup.crud.js +1 -3
- package/crud/settings.crud.js +1 -3
- package/crud/system.crud.js +1 -3
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +1 -3
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +1 -3
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +1 -3
- package/fieldConverters/index.js +1 -3
- package/graphql/buildSchemaPlugins.js +1 -3
- package/graphql/checkEndpointAccess.js +1 -3
- package/graphql/createExecutableSchema.js +1 -3
- package/graphql/createRequestBody.js +1 -3
- package/graphql/formatErrorPayload.js +1 -3
- package/graphql/generateSchema.js +1 -3
- package/graphql/getSchema.js +1 -3
- package/graphql/graphQLHandlerFactory.js +1 -3
- package/graphql/handleRequest.js +1 -3
- package/graphql/index.d.ts +1 -1
- package/graphql/index.js +1 -3
- package/graphql/schema/baseContentSchema.js +1 -3
- package/graphql/schema/baseSchema.js +1 -3
- package/graphql/schema/contentEntries.js +1 -3
- package/graphql/schema/contentModelGroups.js +1 -3
- package/graphql/schema/contentModels.js +1 -3
- package/graphql/schema/createFieldResolvers.js +1 -3
- package/graphql/schema/createFieldTypePluginRecords.js +1 -3
- package/graphql/schema/createManageResolvers.js +1 -3
- package/graphql/schema/createManageSDL.js +1 -3
- package/graphql/schema/createPreviewResolvers.js +1 -3
- package/graphql/schema/createReadResolvers.js +1 -3
- package/graphql/schema/createReadSDL.js +1 -3
- package/graphql/schema/resolvers/commonFieldResolvers.js +1 -3
- package/graphql/schema/resolvers/manage/resolveCreate.js +1 -3
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js +1 -3
- package/graphql/schema/resolvers/manage/resolveDelete.js +1 -3
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +1 -3
- package/graphql/schema/resolvers/manage/resolveGet.js +1 -3
- package/graphql/schema/resolvers/manage/resolveGetByIds.js +1 -3
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js +1 -3
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +1 -3
- package/graphql/schema/resolvers/manage/resolveList.js +1 -3
- package/graphql/schema/resolvers/manage/resolveMove.js +1 -3
- package/graphql/schema/resolvers/manage/resolvePublish.js +1 -3
- package/graphql/schema/resolvers/manage/resolveRepublish.js +1 -3
- package/graphql/schema/resolvers/manage/resolveUnpublish.js +1 -3
- package/graphql/schema/resolvers/manage/resolveUpdate.js +1 -3
- package/graphql/schema/resolvers/preview/resolveGet.js +1 -3
- package/graphql/schema/resolvers/preview/resolveList.js +1 -3
- package/graphql/schema/resolvers/read/resolveGet.js +1 -3
- package/graphql/schema/resolvers/read/resolveList.js +1 -3
- package/graphql/schema/schemaPlugins.js +1 -3
- package/graphql/system.js +1 -3
- package/graphqlFields/boolean.js +1 -3
- package/graphqlFields/datetime.js +1 -3
- package/graphqlFields/dynamicZone/dynamicZoneField.js +1 -3
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js +27 -16
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -1
- package/graphqlFields/dynamicZone/index.js +1 -3
- package/graphqlFields/file.js +1 -3
- package/graphqlFields/helpers.js +1 -3
- package/graphqlFields/index.js +1 -3
- package/graphqlFields/longText.js +1 -3
- package/graphqlFields/number.js +1 -3
- package/graphqlFields/object.js +1 -3
- package/graphqlFields/ref.js +1 -3
- package/graphqlFields/richText.js +1 -3
- package/graphqlFields/text.js +1 -3
- package/index.d.ts +1 -1
- package/index.js +1 -3
- package/modelManager/DefaultCmsModelManager.js +1 -3
- package/modelManager/index.js +1 -3
- package/package.json +18 -18
- package/parameters/context.js +1 -3
- package/parameters/header.js +1 -3
- package/parameters/index.js +1 -3
- package/parameters/manual.js +1 -3
- package/parameters/path.js +1 -3
- package/plugins/CmsGraphQLSchemaPlugin.js +1 -3
- package/plugins/CmsGraphQLSchemaSorterPlugin.js +1 -3
- package/plugins/CmsGroupPlugin.js +1 -3
- package/plugins/CmsModelFieldConverterPlugin.js +1 -3
- package/plugins/CmsModelPlugin.js +1 -3
- package/plugins/CmsParametersPlugin.js +1 -3
- package/plugins/StorageOperationsCmsModelPlugin.js +1 -3
- package/plugins/StorageTransformPlugin.js +1 -3
- package/plugins/index.js +1 -3
- package/storage/default.js +1 -3
- package/storage/object.js +1 -3
- package/types.js +1 -3
- package/utils/access.js +1 -3
- package/utils/converters/Converter.js +1 -3
- package/utils/converters/ConverterCollection.js +1 -3
- package/utils/converters/valueKeyStorageConverter.js +1 -3
- package/utils/createTypeFromFields.js +1 -3
- package/utils/createTypeName.js +1 -3
- package/utils/entryStorage.js +1 -3
- package/utils/filterAsync.js +1 -3
- package/utils/getBaseFieldType.js +1 -3
- package/utils/getEntryDescription.js +1 -3
- package/utils/getEntryImage.js +1 -3
- package/utils/getEntryTitle.js +1 -3
- package/utils/getSchemaFromFieldPlugins.d.ts +13 -2
- package/utils/getSchemaFromFieldPlugins.js +20 -6
- package/utils/getSchemaFromFieldPlugins.js.map +1 -1
- package/utils/incrementEntryIdVersion.js +1 -3
- package/utils/permissions/EntriesPermissions.js +1 -3
- package/utils/permissions/ModelGroupsPermissions.js +1 -3
- package/utils/permissions/ModelsPermissions.js +1 -3
- package/utils/permissions/SettingsPermissions.js +1 -3
- package/utils/renderFields.js +1 -3
- package/utils/renderGetFilterFields.js +1 -3
- package/utils/renderInputFields.js +1 -3
- package/utils/renderListFilterFields.js +1 -3
- package/utils/renderSortEnum.js +1 -3
- package/utils/toSlug.js +1 -3
- package/validators/dateGte.js +1 -3
- package/validators/dateLte.js +1 -3
- package/validators/dynamicZone.js +1 -3
- package/validators/gte.js +1 -3
- package/validators/in.js +1 -3
- package/validators/index.js +1 -3
- package/validators/lte.js +1 -3
- package/validators/maxLength.js +1 -3
- package/validators/minLength.js +1 -3
- package/validators/pattern.js +1 -3
- package/validators/patternPlugins/email.js +1 -3
- package/validators/patternPlugins/index.js +1 -3
- package/validators/patternPlugins/lowerCase.js +1 -3
- package/validators/patternPlugins/lowerCaseSpace.js +1 -3
- package/validators/patternPlugins/upperCase.js +1 -3
- package/validators/patternPlugins/upperCaseSpace.js +1 -3
- package/validators/patternPlugins/url.js +1 -3
- package/validators/required.js +1 -3
- package/validators/timeGte.js +1 -3
- package/validators/timeLte.js +1 -3
- 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
|
+
"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.
|
|
24
|
-
"@webiny/api-i18n": "5.37.
|
|
25
|
-
"@webiny/api-security": "5.37.
|
|
26
|
-
"@webiny/api-tenancy": "5.37.
|
|
27
|
-
"@webiny/error": "5.37.
|
|
28
|
-
"@webiny/handler": "5.37.
|
|
29
|
-
"@webiny/handler-aws": "5.37.
|
|
30
|
-
"@webiny/handler-db": "5.37.
|
|
31
|
-
"@webiny/handler-graphql": "5.37.
|
|
32
|
-
"@webiny/plugins": "5.37.
|
|
33
|
-
"@webiny/pubsub": "5.37.
|
|
34
|
-
"@webiny/utils": "5.37.
|
|
35
|
-
"@webiny/validation": "5.37.
|
|
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.
|
|
53
|
-
"@webiny/cli": "5.37.
|
|
54
|
-
"@webiny/project-utils": "5.37.
|
|
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": "
|
|
74
|
+
"gitHead": "2b8d53b8aec843ba8fe5590cfd4aa82f95c4adad"
|
|
75
75
|
}
|
package/parameters/context.js
CHANGED
package/parameters/header.js
CHANGED
package/parameters/index.js
CHANGED
package/parameters/manual.js
CHANGED
package/parameters/path.js
CHANGED
|
@@ -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;
|
|
@@ -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
package/storage/default.js
CHANGED
package/storage/object.js
CHANGED
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
|
@@ -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;
|
package/utils/createTypeName.js
CHANGED
|
@@ -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;
|
package/utils/entryStorage.js
CHANGED
|
@@ -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;
|
package/utils/filterAsync.js
CHANGED
package/utils/getEntryImage.js
CHANGED
package/utils/getEntryTitle.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import {
|
|
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<
|
|
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
|
-
|
|
34
|
-
plugin
|
|
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","
|
|
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"}
|
|
@@ -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;
|
|
@@ -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;
|
package/utils/renderFields.js
CHANGED
|
@@ -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;
|
package/utils/renderSortEnum.js
CHANGED
package/utils/toSlug.js
CHANGED
package/validators/dateGte.js
CHANGED
package/validators/dateLte.js
CHANGED
package/validators/gte.js
CHANGED
package/validators/in.js
CHANGED
package/validators/index.js
CHANGED
|
@@ -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
package/validators/maxLength.js
CHANGED
package/validators/minLength.js
CHANGED
package/validators/pattern.js
CHANGED
|
@@ -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;
|