@webiny/api-headless-cms 0.0.0-mt-1
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/LICENSE +21 -0
- package/README.md +73 -0
- package/content/contextSetup.d.ts +4 -0
- package/content/contextSetup.js +65 -0
- package/content/graphQLHandlerFactory.d.ts +5 -0
- package/content/graphQLHandlerFactory.js +173 -0
- package/content/plugins/CmsGroupPlugin.d.ts +11 -0
- package/content/plugins/CmsGroupPlugin.js +24 -0
- package/content/plugins/CmsModelPlugin.d.ts +11 -0
- package/content/plugins/CmsModelPlugin.js +24 -0
- package/content/plugins/buildSchemaPlugins.d.ts +7 -0
- package/content/plugins/buildSchemaPlugins.js +29 -0
- package/content/plugins/crud/contentEntry/afterDelete.d.ts +7 -0
- package/content/plugins/crud/contentEntry/afterDelete.js +41 -0
- package/content/plugins/crud/contentEntry/beforeCreate.d.ts +7 -0
- package/content/plugins/crud/contentEntry/beforeCreate.js +28 -0
- package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +7 -0
- package/content/plugins/crud/contentEntry/beforeUpdate.js +28 -0
- package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +4 -0
- package/content/plugins/crud/contentEntry/entryDataValidation.js +188 -0
- package/content/plugins/crud/contentEntry/markLockedFields.d.ts +12 -0
- package/content/plugins/crud/contentEntry/markLockedFields.js +117 -0
- package/content/plugins/crud/contentEntry.crud.d.ts +17 -0
- package/content/plugins/crud/contentEntry.crud.js +931 -0
- package/content/plugins/crud/contentModel/afterCreate.d.ts +7 -0
- package/content/plugins/crud/contentModel/afterCreate.js +18 -0
- package/content/plugins/crud/contentModel/afterDelete.d.ts +7 -0
- package/content/plugins/crud/contentModel/afterDelete.js +18 -0
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +7 -0
- package/content/plugins/crud/contentModel/afterUpdate.js +18 -0
- package/content/plugins/crud/contentModel/beforeCreate.d.ts +9 -0
- package/content/plugins/crud/contentModel/beforeCreate.js +146 -0
- package/content/plugins/crud/contentModel/beforeDelete.d.ts +9 -0
- package/content/plugins/crud/contentModel/beforeDelete.js +56 -0
- package/content/plugins/crud/contentModel/beforeUpdate.d.ts +9 -0
- package/content/plugins/crud/contentModel/beforeUpdate.js +128 -0
- package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +2 -0
- package/content/plugins/crud/contentModel/contentModelManagerFactory.js +29 -0
- package/content/plugins/crud/contentModel/createFieldModels.d.ts +2 -0
- package/content/plugins/crud/contentModel/createFieldModels.js +22 -0
- package/content/plugins/crud/contentModel/idValidation.d.ts +2 -0
- package/content/plugins/crud/contentModel/idValidation.js +22 -0
- package/content/plugins/crud/contentModel/models.d.ts +3 -0
- package/content/plugins/crud/contentModel/models.js +141 -0
- package/content/plugins/crud/contentModel/validateLayout.d.ts +2 -0
- package/content/plugins/crud/contentModel/validateLayout.js +38 -0
- package/content/plugins/crud/contentModel.crud.d.ts +12 -0
- package/content/plugins/crud/contentModel.crud.js +425 -0
- package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +9 -0
- package/content/plugins/crud/contentModelGroup/beforeCreate.js +66 -0
- package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +9 -0
- package/content/plugins/crud/contentModelGroup/beforeDelete.js +48 -0
- package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +8 -0
- package/content/plugins/crud/contentModelGroup/beforeUpdate.js +28 -0
- package/content/plugins/crud/contentModelGroup.crud.d.ts +12 -0
- package/content/plugins/crud/contentModelGroup.crud.js +351 -0
- package/content/plugins/crud/index.d.ts +6 -0
- package/content/plugins/crud/index.js +100 -0
- package/content/plugins/graphqlFields/boolean.d.ts +3 -0
- package/content/plugins/graphqlFields/boolean.js +69 -0
- package/content/plugins/graphqlFields/datetime.d.ts +3 -0
- package/content/plugins/graphqlFields/datetime.js +83 -0
- package/content/plugins/graphqlFields/file.d.ts +3 -0
- package/content/plugins/graphqlFields/file.js +49 -0
- package/content/plugins/graphqlFields/index.d.ts +2 -0
- package/content/plugins/graphqlFields/index.js +30 -0
- package/content/plugins/graphqlFields/longText.d.ts +3 -0
- package/content/plugins/graphqlFields/longText.js +62 -0
- package/content/plugins/graphqlFields/number.d.ts +3 -0
- package/content/plugins/graphqlFields/number.js +75 -0
- package/content/plugins/graphqlFields/object.d.ts +3 -0
- package/content/plugins/graphqlFields/object.js +180 -0
- package/content/plugins/graphqlFields/ref.d.ts +3 -0
- package/content/plugins/graphqlFields/ref.js +205 -0
- package/content/plugins/graphqlFields/richText.d.ts +3 -0
- package/content/plugins/graphqlFields/richText.js +55 -0
- package/content/plugins/graphqlFields/text.d.ts +3 -0
- package/content/plugins/graphqlFields/text.js +72 -0
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +8 -0
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +54 -0
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +7 -0
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +35 -0
- package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +15 -0
- package/content/plugins/modelManager/DefaultCmsModelManager.js +62 -0
- package/content/plugins/modelManager/index.d.ts +3 -0
- package/content/plugins/modelManager/index.js +20 -0
- package/content/plugins/schema/baseSchema.d.ts +4 -0
- package/content/plugins/schema/baseSchema.js +98 -0
- package/content/plugins/schema/contentEntries.d.ts +4 -0
- package/content/plugins/schema/contentEntries.js +166 -0
- package/content/plugins/schema/contentModelGroups.d.ts +4 -0
- package/content/plugins/schema/contentModelGroups.js +153 -0
- package/content/plugins/schema/contentModels.d.ts +4 -0
- package/content/plugins/schema/contentModels.js +225 -0
- package/content/plugins/schema/createFieldResolvers.d.ts +19 -0
- package/content/plugins/schema/createFieldResolvers.js +92 -0
- package/content/plugins/schema/createManageResolvers.d.ts +11 -0
- package/content/plugins/schema/createManageResolvers.js +135 -0
- package/content/plugins/schema/createManageSDL.d.ts +9 -0
- package/content/plugins/schema/createManageSDL.js +153 -0
- package/content/plugins/schema/createPreviewResolvers.d.ts +10 -0
- package/content/plugins/schema/createPreviewResolvers.js +55 -0
- package/content/plugins/schema/createReadResolvers.d.ts +10 -0
- package/content/plugins/schema/createReadResolvers.js +55 -0
- package/content/plugins/schema/createReadSDL.d.ts +9 -0
- package/content/plugins/schema/createReadSDL.js +96 -0
- package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +6 -0
- package/content/plugins/schema/resolvers/commonFieldResolvers.js +14 -0
- package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +6 -0
- package/content/plugins/schema/resolvers/manage/resolveCreate.js +23 -0
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +7 -0
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.js +23 -0
- package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +2 -0
- package/content/plugins/schema/resolvers/manage/resolveDelete.js +30 -0
- package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +2 -0
- package/content/plugins/schema/resolvers/manage/resolveGet.js +21 -0
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +2 -0
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.js +23 -0
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +2 -0
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.js +23 -0
- package/content/plugins/schema/resolvers/manage/resolveList.d.ts +2 -0
- package/content/plugins/schema/resolvers/manage/resolveList.js +23 -0
- package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +2 -0
- package/content/plugins/schema/resolvers/manage/resolvePublish.js +21 -0
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.d.ts +6 -0
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js +23 -0
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.d.ts +6 -0
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.js +23 -0
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +2 -0
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.js +21 -0
- package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +7 -0
- package/content/plugins/schema/resolvers/manage/resolveUpdate.js +23 -0
- package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +2 -0
- package/content/plugins/schema/resolvers/preview/resolveGet.js +38 -0
- package/content/plugins/schema/resolvers/preview/resolveList.d.ts +2 -0
- package/content/plugins/schema/resolvers/preview/resolveList.js +23 -0
- package/content/plugins/schema/resolvers/read/resolveGet.d.ts +2 -0
- package/content/plugins/schema/resolvers/read/resolveGet.js +38 -0
- package/content/plugins/schema/resolvers/read/resolveList.d.ts +2 -0
- package/content/plugins/schema/resolvers/read/resolveList.js +23 -0
- package/content/plugins/schema/schemaPlugins.d.ts +3 -0
- package/content/plugins/schema/schemaPlugins.js +92 -0
- package/content/plugins/storage/StorageTransformPlugin.d.ts +30 -0
- package/content/plugins/storage/StorageTransformPlugin.js +36 -0
- package/content/plugins/storage/default.d.ts +3 -0
- package/content/plugins/storage/default.js +28 -0
- package/content/plugins/storage/object.d.ts +3 -0
- package/content/plugins/storage/object.js +119 -0
- package/content/plugins/utils/createTypeName.d.ts +3 -0
- package/content/plugins/utils/createTypeName.js +28 -0
- package/content/plugins/utils/entryStorage.d.ts +17 -0
- package/content/plugins/utils/entryStorage.js +125 -0
- package/content/plugins/utils/getEntryTitle.d.ts +2 -0
- package/content/plugins/utils/getEntryTitle.js +42 -0
- package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +11 -0
- package/content/plugins/utils/getSchemaFromFieldPlugins.js +30 -0
- package/content/plugins/utils/pluralizedTypeName.d.ts +1 -0
- package/content/plugins/utils/pluralizedTypeName.js +26 -0
- package/content/plugins/utils/renderFields.d.ts +16 -0
- package/content/plugins/utils/renderFields.js +51 -0
- package/content/plugins/utils/renderGetFilterFields.d.ts +9 -0
- package/content/plugins/utils/renderGetFilterFields.js +41 -0
- package/content/plugins/utils/renderInputFields.d.ts +14 -0
- package/content/plugins/utils/renderInputFields.js +53 -0
- package/content/plugins/utils/renderListFilterFields.d.ts +10 -0
- package/content/plugins/utils/renderListFilterFields.js +39 -0
- package/content/plugins/utils/renderSortEnum.d.ts +9 -0
- package/content/plugins/utils/renderSortEnum.js +32 -0
- package/content/plugins/validators/dateGte.d.ts +3 -0
- package/content/plugins/validators/dateGte.js +37 -0
- package/content/plugins/validators/dateLte.d.ts +3 -0
- package/content/plugins/validators/dateLte.js +37 -0
- package/content/plugins/validators/gte.d.ts +3 -0
- package/content/plugins/validators/gte.js +32 -0
- package/content/plugins/validators/in.d.ts +3 -0
- package/content/plugins/validators/in.js +32 -0
- package/content/plugins/validators/index.d.ts +2 -0
- package/content/plugins/validators/index.js +36 -0
- package/content/plugins/validators/lte.d.ts +3 -0
- package/content/plugins/validators/lte.js +32 -0
- package/content/plugins/validators/maxLength.d.ts +3 -0
- package/content/plugins/validators/maxLength.js +32 -0
- package/content/plugins/validators/minLength.d.ts +3 -0
- package/content/plugins/validators/minLength.js +32 -0
- package/content/plugins/validators/pattern.d.ts +3 -0
- package/content/plugins/validators/pattern.js +47 -0
- package/content/plugins/validators/patternPlugins/email.d.ts +3 -0
- package/content/plugins/validators/patternPlugins/email.js +17 -0
- package/content/plugins/validators/patternPlugins/index.d.ts +2 -0
- package/content/plugins/validators/patternPlugins/index.js +19 -0
- package/content/plugins/validators/patternPlugins/lowerCase.d.ts +3 -0
- package/content/plugins/validators/patternPlugins/lowerCase.js +17 -0
- package/content/plugins/validators/patternPlugins/upperCase.d.ts +3 -0
- package/content/plugins/validators/patternPlugins/upperCase.js +17 -0
- package/content/plugins/validators/patternPlugins/url.d.ts +3 -0
- package/content/plugins/validators/patternPlugins/url.js +17 -0
- package/content/plugins/validators/required.d.ts +3 -0
- package/content/plugins/validators/required.js +25 -0
- package/content/plugins/validators/timeGte.d.ts +3 -0
- package/content/plugins/validators/timeGte.js +32 -0
- package/content/plugins/validators/timeLte.d.ts +3 -0
- package/content/plugins/validators/timeLte.js +32 -0
- package/index.d.ts +12 -0
- package/index.js +66 -0
- package/migrateCMSPermissions.d.ts +17 -0
- package/migrateCMSPermissions.js +193 -0
- package/package.json +80 -0
- package/plugins/context.d.ts +4 -0
- package/plugins/context.js +34 -0
- package/plugins/crud/index.d.ts +6 -0
- package/plugins/crud/index.js +100 -0
- package/plugins/crud/settings.crud.d.ts +10 -0
- package/plugins/crud/settings.crud.js +93 -0
- package/plugins/crud/system.crud.d.ts +10 -0
- package/plugins/crud/system.crud.js +182 -0
- package/plugins/graphql/system.d.ts +17 -0
- package/plugins/graphql/system.js +72 -0
- package/plugins/graphql.d.ts +2 -0
- package/plugins/graphql.js +79 -0
- package/plugins/upgrades/index.d.ts +2 -0
- package/plugins/upgrades/index.js +14 -0
- package/plugins/upgrades/v5.5.0/helpers.d.ts +6 -0
- package/plugins/upgrades/v5.5.0/helpers.js +10 -0
- package/plugins/upgrades/v5.5.0/index.d.ts +4 -0
- package/plugins/upgrades/v5.5.0/index.js +129 -0
- package/transformers.d.ts +2 -0
- package/transformers.js +25 -0
- package/types.d.ts +2149 -0
- package/types.js +366 -0
- package/utils.d.ts +25 -0
- package/utils.js +251 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _ContextPlugin = require("@webiny/handler/plugins/ContextPlugin");
|
|
13
|
+
|
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
+
|
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
+
|
|
18
|
+
var _default = () => {
|
|
19
|
+
return new _ContextPlugin.ContextPlugin(context => {
|
|
20
|
+
const locale = context.i18n.getCurrentLocale();
|
|
21
|
+
context.cms = _objectSpread(_objectSpread({}, context.cms || {}), {}, {
|
|
22
|
+
locale: locale ? locale.code : "en-US",
|
|
23
|
+
|
|
24
|
+
getLocale() {
|
|
25
|
+
return locale || {
|
|
26
|
+
code: "en-US"
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
exports.default = _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CmsContext, HeadlessCmsStorageOperations } from "../../types";
|
|
2
|
+
import { ContextPlugin } from "@webiny/handler/plugins/ContextPlugin";
|
|
3
|
+
export interface Params {
|
|
4
|
+
storageOperations: HeadlessCmsStorageOperations;
|
|
5
|
+
}
|
|
6
|
+
export declare const createAdminCruds: (params: Params) => ContextPlugin<CmsContext>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createAdminCruds = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _settings = require("./settings.crud");
|
|
13
|
+
|
|
14
|
+
var _system = require("./system.crud");
|
|
15
|
+
|
|
16
|
+
var _ContextPlugin = require("@webiny/handler/plugins/ContextPlugin");
|
|
17
|
+
|
|
18
|
+
var _contentModelGroup = require("../../content/plugins/crud/contentModelGroup.crud");
|
|
19
|
+
|
|
20
|
+
var _contentModel = require("../../content/plugins/crud/contentModel.crud");
|
|
21
|
+
|
|
22
|
+
var _contentEntry = require("../../content/plugins/crud/contentEntry.crud");
|
|
23
|
+
|
|
24
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
+
|
|
26
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
|
+
|
|
28
|
+
const debug = process.env.DEBUG === "true";
|
|
29
|
+
|
|
30
|
+
const createAdminCruds = params => {
|
|
31
|
+
const {
|
|
32
|
+
storageOperations
|
|
33
|
+
} = params;
|
|
34
|
+
return new _ContextPlugin.ContextPlugin(async context => {
|
|
35
|
+
/**
|
|
36
|
+
* This should never happen in the actual project.
|
|
37
|
+
* It is to make sure that we load setup context before the CRUD init in our internal code.
|
|
38
|
+
*/
|
|
39
|
+
if (!context.cms) {
|
|
40
|
+
debug && console.log(`Missing initial "cms" on the context. Make sure that you set it up before creating Admin CRUDs.`);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const getLocale = () => {
|
|
45
|
+
return context.i18n.getCurrentLocale();
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getIdentity = () => {
|
|
49
|
+
return context.security.getIdentity();
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const getTenant = () => {
|
|
53
|
+
return context.tenancy.getCurrentTenant();
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
if (storageOperations.plugins && storageOperations.plugins.length > 0) {
|
|
57
|
+
context.plugins.register(storageOperations.plugins);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
context.cms = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, context.cms), {}, {
|
|
61
|
+
storageOperations
|
|
62
|
+
}, (0, _system.createSystemCrud)({
|
|
63
|
+
context,
|
|
64
|
+
getTenant,
|
|
65
|
+
getIdentity,
|
|
66
|
+
storageOperations
|
|
67
|
+
})), (0, _settings.createSettingsCrud)({
|
|
68
|
+
context,
|
|
69
|
+
getTenant,
|
|
70
|
+
getLocale,
|
|
71
|
+
storageOperations
|
|
72
|
+
})), (0, _contentModelGroup.createModelGroupsCrud)({
|
|
73
|
+
context,
|
|
74
|
+
getTenant,
|
|
75
|
+
getLocale,
|
|
76
|
+
getIdentity,
|
|
77
|
+
storageOperations
|
|
78
|
+
})), (0, _contentModel.createModelsCrud)({
|
|
79
|
+
context,
|
|
80
|
+
getTenant,
|
|
81
|
+
getLocale,
|
|
82
|
+
getIdentity,
|
|
83
|
+
storageOperations
|
|
84
|
+
})), (0, _contentEntry.createContentEntryCrud)({
|
|
85
|
+
context,
|
|
86
|
+
getTenant,
|
|
87
|
+
getLocale,
|
|
88
|
+
getIdentity,
|
|
89
|
+
storageOperations
|
|
90
|
+
}));
|
|
91
|
+
|
|
92
|
+
if (!storageOperations.init) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
await storageOperations.init(context.cms);
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
exports.createAdminCruds = createAdminCruds;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CmsContext, HeadlessCmsStorageOperations, CmsSettingsContext } from "../../types";
|
|
2
|
+
import { Tenant } from "@webiny/api-tenancy/types";
|
|
3
|
+
import { I18NLocale } from "@webiny/api-i18n/types";
|
|
4
|
+
export interface Params {
|
|
5
|
+
getTenant: () => Tenant;
|
|
6
|
+
getLocale: () => I18NLocale;
|
|
7
|
+
storageOperations: HeadlessCmsStorageOperations;
|
|
8
|
+
context: CmsContext;
|
|
9
|
+
}
|
|
10
|
+
export declare const createSettingsCrud: (params: Params) => CmsSettingsContext;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createSettingsCrud = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var utils = _interopRequireWildcard(require("../../utils"));
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
+
|
|
22
|
+
const createSettingsCrud = params => {
|
|
23
|
+
const {
|
|
24
|
+
storageOperations,
|
|
25
|
+
context,
|
|
26
|
+
getTenant,
|
|
27
|
+
getLocale
|
|
28
|
+
} = params;
|
|
29
|
+
|
|
30
|
+
const checkPermissions = () => {
|
|
31
|
+
return utils.checkPermissions(context, "cms.settings");
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
return {
|
|
35
|
+
getSettings: async () => {
|
|
36
|
+
await checkPermissions();
|
|
37
|
+
return await storageOperations.settings.get({
|
|
38
|
+
tenant: getTenant().id,
|
|
39
|
+
locale: getLocale().code
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
updateModelLastChange: async () => {
|
|
43
|
+
const original = await storageOperations.settings.get({
|
|
44
|
+
tenant: getTenant().id,
|
|
45
|
+
locale: getLocale().code
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const settings = _objectSpread(_objectSpread({}, original || {}), {}, {
|
|
49
|
+
contentModelLastChange: new Date(),
|
|
50
|
+
tenant: getTenant().id,
|
|
51
|
+
locale: getLocale().code
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
if (!original) {
|
|
55
|
+
await storageOperations.settings.create({
|
|
56
|
+
settings
|
|
57
|
+
});
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
await storageOperations.settings.update({
|
|
62
|
+
original,
|
|
63
|
+
settings
|
|
64
|
+
});
|
|
65
|
+
},
|
|
66
|
+
getModelLastChange: async () => {
|
|
67
|
+
try {
|
|
68
|
+
const settings = await storageOperations.settings.get({
|
|
69
|
+
tenant: getTenant().id,
|
|
70
|
+
locale: getLocale().code
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
if (!settings || !settings.contentModelLastChange) {
|
|
74
|
+
return new Date();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return settings.contentModelLastChange;
|
|
78
|
+
} catch (ex) {
|
|
79
|
+
console.log({
|
|
80
|
+
error: {
|
|
81
|
+
message: ex.message,
|
|
82
|
+
code: ex.code || "COULD_NOT_FETCH_CONTENT_MODEL_LAST_CHANGE",
|
|
83
|
+
data: ex
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return new Date();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
exports.createSettingsCrud = createSettingsCrud;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CmsContext, CmsSystemContext, HeadlessCmsStorageOperations } from "../../types";
|
|
2
|
+
import { Tenant } from "@webiny/api-tenancy/types";
|
|
3
|
+
import { SecurityIdentity } from "@webiny/api-security/types";
|
|
4
|
+
export interface Params {
|
|
5
|
+
getTenant: () => Tenant;
|
|
6
|
+
storageOperations: HeadlessCmsStorageOperations;
|
|
7
|
+
context: CmsContext;
|
|
8
|
+
getIdentity: () => SecurityIdentity;
|
|
9
|
+
}
|
|
10
|
+
export declare const createSystemCrud: (params: Params) => CmsSystemContext;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createSystemCrud = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _crypto = _interopRequireDefault(require("crypto"));
|
|
13
|
+
|
|
14
|
+
var _apiSecurity = require("@webiny/api-security");
|
|
15
|
+
|
|
16
|
+
var _apiUpgrade = require("@webiny/api-upgrade");
|
|
17
|
+
|
|
18
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
19
|
+
|
|
20
|
+
var _pubsub = require("@webiny/pubsub");
|
|
21
|
+
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
|
+
|
|
26
|
+
const initialContentModelGroup = {
|
|
27
|
+
name: "Ungrouped",
|
|
28
|
+
slug: "ungrouped",
|
|
29
|
+
description: "A generic content model group",
|
|
30
|
+
icon: "fas/star"
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const createSystemCrud = params => {
|
|
34
|
+
const {
|
|
35
|
+
getTenant,
|
|
36
|
+
storageOperations,
|
|
37
|
+
context,
|
|
38
|
+
getIdentity
|
|
39
|
+
} = params;
|
|
40
|
+
const onBeforeInstall = (0, _pubsub.createTopic)();
|
|
41
|
+
const onAfterInstall = (0, _pubsub.createTopic)();
|
|
42
|
+
|
|
43
|
+
const createReadAPIKey = () => {
|
|
44
|
+
return _crypto.default.randomBytes(Math.ceil(48 / 2)).toString("hex");
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const getVersion = async () => {
|
|
48
|
+
if (!getTenant()) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const system = await storageOperations.system.get({
|
|
53
|
+
tenant: getTenant().id
|
|
54
|
+
});
|
|
55
|
+
return system ? system.version : null;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const setVersion = async version => {
|
|
59
|
+
const original = await storageOperations.system.get({
|
|
60
|
+
tenant: getTenant().id
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const system = _objectSpread(_objectSpread({}, original || {}), {}, {
|
|
64
|
+
version,
|
|
65
|
+
tenant: getTenant().id
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if (!original) {
|
|
69
|
+
await storageOperations.system.create({
|
|
70
|
+
system
|
|
71
|
+
});
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
await storageOperations.system.update({
|
|
76
|
+
original,
|
|
77
|
+
system
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
onBeforeSystemInstall: onBeforeInstall,
|
|
83
|
+
onAfterSystemInstall: onAfterInstall,
|
|
84
|
+
getSystemVersion: getVersion,
|
|
85
|
+
setSystemVersion: setVersion,
|
|
86
|
+
getReadAPIKey: async () => {
|
|
87
|
+
const original = await storageOperations.system.get({
|
|
88
|
+
tenant: getTenant().id
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
if (!original) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (!original.readAPIKey) {
|
|
96
|
+
const readAPIKey = createReadAPIKey();
|
|
97
|
+
|
|
98
|
+
const system = _objectSpread(_objectSpread({}, original), {}, {
|
|
99
|
+
readAPIKey
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
await storageOperations.system.update({
|
|
103
|
+
original,
|
|
104
|
+
system
|
|
105
|
+
});
|
|
106
|
+
return readAPIKey;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
return original.readAPIKey;
|
|
110
|
+
},
|
|
111
|
+
installSystem: async () => {
|
|
112
|
+
const identity = getIdentity();
|
|
113
|
+
|
|
114
|
+
if (!identity) {
|
|
115
|
+
throw new _apiSecurity.NotAuthorizedError();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const version = await getVersion();
|
|
119
|
+
|
|
120
|
+
if (version) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
await onBeforeInstall.publish({
|
|
125
|
+
tenant: getTenant().id
|
|
126
|
+
});
|
|
127
|
+
/**
|
|
128
|
+
* Add default content model group.
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
try {
|
|
132
|
+
await context.cms.createGroup(initialContentModelGroup);
|
|
133
|
+
} catch (ex) {
|
|
134
|
+
throw new _error.default(ex.message, "CMS_INSTALLATION_CONTENT_MODEL_GROUP_ERROR", {
|
|
135
|
+
group: initialContentModelGroup
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
await onAfterInstall.publish({
|
|
140
|
+
tenant: getTenant().id
|
|
141
|
+
});
|
|
142
|
+
const system = {
|
|
143
|
+
version: context.WEBINY_VERSION,
|
|
144
|
+
readAPIKey: createReadAPIKey(),
|
|
145
|
+
tenant: getTenant().id
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* We need to create the system data.
|
|
149
|
+
*/
|
|
150
|
+
|
|
151
|
+
await storageOperations.system.create({
|
|
152
|
+
system
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
async upgradeSystem(version) {
|
|
157
|
+
const identity = getIdentity();
|
|
158
|
+
|
|
159
|
+
if (!identity) {
|
|
160
|
+
throw new _apiSecurity.NotAuthorizedError();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const upgradePlugins = context.plugins.byType("api-upgrade").filter(pl => pl.app === "headless-cms");
|
|
164
|
+
const plugin = (0, _apiUpgrade.getApplicablePlugin)({
|
|
165
|
+
deployedVersion: context.WEBINY_VERSION,
|
|
166
|
+
installedAppVersion: await this.getVersion(),
|
|
167
|
+
upgradePlugins,
|
|
168
|
+
upgradeToVersion: version
|
|
169
|
+
});
|
|
170
|
+
await plugin.apply(context);
|
|
171
|
+
/**
|
|
172
|
+
* Store new app version.
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
await setVersion(version);
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
exports.createSystemCrud = createSystemCrud;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ErrorResponse, Response } from "@webiny/handler-graphql";
|
|
2
|
+
import { CmsContext } from "../../types";
|
|
3
|
+
declare const _default: {
|
|
4
|
+
typeDefs: string;
|
|
5
|
+
resolvers: {
|
|
6
|
+
CmsQuery: {
|
|
7
|
+
version: (_: any, __: any, context: CmsContext) => Promise<string | ErrorResponse>;
|
|
8
|
+
};
|
|
9
|
+
CmsMutation: {
|
|
10
|
+
install: (_: any, __: any, { cms }: CmsContext) => Promise<ErrorResponse | Response<boolean>>;
|
|
11
|
+
upgrade: (_: any, { version }: {
|
|
12
|
+
version: any;
|
|
13
|
+
}, { cms }: CmsContext) => Promise<ErrorResponse | Response<boolean>>;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
9
|
+
|
|
10
|
+
var _default = {
|
|
11
|
+
typeDefs:
|
|
12
|
+
/* GraphQL */
|
|
13
|
+
`
|
|
14
|
+
extend type CmsQuery {
|
|
15
|
+
# Get installed version
|
|
16
|
+
version: String
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
extend type CmsMutation {
|
|
20
|
+
# Install CMS
|
|
21
|
+
install: CmsBooleanResponse
|
|
22
|
+
|
|
23
|
+
# Upgrade CMS
|
|
24
|
+
upgrade(version: String!): CmsBooleanResponse
|
|
25
|
+
}
|
|
26
|
+
`,
|
|
27
|
+
resolvers: {
|
|
28
|
+
CmsQuery: {
|
|
29
|
+
version: async (_, __, context) => {
|
|
30
|
+
try {
|
|
31
|
+
return context.cms.getSystemVersion();
|
|
32
|
+
} catch (e) {
|
|
33
|
+
return new _handlerGraphql.ErrorResponse(e);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
CmsMutation: {
|
|
38
|
+
install: async (_, __, {
|
|
39
|
+
cms
|
|
40
|
+
}) => {
|
|
41
|
+
try {
|
|
42
|
+
const version = await cms.getSystemVersion();
|
|
43
|
+
|
|
44
|
+
if (version) {
|
|
45
|
+
return new _handlerGraphql.ErrorResponse({
|
|
46
|
+
code: "CMS_INSTALLATION_ERROR",
|
|
47
|
+
message: "CMS is already installed."
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
await cms.installSystem();
|
|
52
|
+
return new _handlerGraphql.Response(true);
|
|
53
|
+
} catch (e) {
|
|
54
|
+
return new _handlerGraphql.ErrorResponse(e);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
upgrade: async (_, {
|
|
58
|
+
version
|
|
59
|
+
}, {
|
|
60
|
+
cms
|
|
61
|
+
}) => {
|
|
62
|
+
try {
|
|
63
|
+
await cms.upgradeSystem(version);
|
|
64
|
+
return new _handlerGraphql.Response(true);
|
|
65
|
+
} catch (e) {
|
|
66
|
+
return new _handlerGraphql.ErrorResponse(e);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
exports.default = _default;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createGraphQLPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _merge = _interopRequireDefault(require("lodash/merge"));
|
|
11
|
+
|
|
12
|
+
var _system = _interopRequireDefault(require("./graphql/system"));
|
|
13
|
+
|
|
14
|
+
const emptyResolver = () => ({});
|
|
15
|
+
|
|
16
|
+
const createGraphQLPlugin = () => ({
|
|
17
|
+
name: "graphql-schema-headless",
|
|
18
|
+
type: "graphql-schema",
|
|
19
|
+
schema: {
|
|
20
|
+
typeDefs:
|
|
21
|
+
/* GraphQL */
|
|
22
|
+
`
|
|
23
|
+
type CmsError {
|
|
24
|
+
code: String
|
|
25
|
+
message: String
|
|
26
|
+
data: JSON
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type CmsCursors {
|
|
30
|
+
next: String
|
|
31
|
+
previous: String
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type CmsListMeta {
|
|
35
|
+
cursor: String
|
|
36
|
+
hasMoreItems: Boolean
|
|
37
|
+
totalCount: Int
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type CmsDeleteResponse {
|
|
41
|
+
data: Boolean
|
|
42
|
+
error: CmsError
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
type CmsBooleanResponse {
|
|
46
|
+
data: Boolean
|
|
47
|
+
error: CmsError
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
extend type Query {
|
|
51
|
+
cms: CmsQuery
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
extend type Mutation {
|
|
55
|
+
cms: CmsMutation
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
type CmsQuery {
|
|
59
|
+
_empty: String
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
type CmsMutation {
|
|
63
|
+
_empty: String
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
${_system.default.typeDefs}
|
|
67
|
+
`,
|
|
68
|
+
resolvers: (0, _merge.default)({
|
|
69
|
+
Query: {
|
|
70
|
+
cms: emptyResolver
|
|
71
|
+
},
|
|
72
|
+
Mutation: {
|
|
73
|
+
cms: emptyResolver
|
|
74
|
+
}
|
|
75
|
+
}, _system.default.resolvers)
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
exports.createGraphQLPlugin = createGraphQLPlugin;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _v = _interopRequireDefault(require("./v5.5.0"));
|
|
11
|
+
|
|
12
|
+
var _default = () => [_v.default];
|
|
13
|
+
|
|
14
|
+
exports.default = _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isCmsContentPermission = void 0;
|
|
7
|
+
|
|
8
|
+
const isCmsContentPermission = permission => permission.name.includes("cms.") && !permission.name.includes("cms.endpoint.");
|
|
9
|
+
|
|
10
|
+
exports.isCmsContentPermission = isCmsContentPermission;
|