@webiny/api-headless-cms 5.23.1-beta.0 → 5.24.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/content/graphQLHandlerFactory.js +8 -2
- package/content/plugins/crud/contentEntry/afterDelete.d.ts +3 -2
- package/content/plugins/crud/contentEntry/beforeCreate.d.ts +3 -2
- package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +3 -2
- package/content/plugins/crud/contentEntry/markLockedFields.d.ts +2 -1
- package/content/plugins/crud/contentModel/afterCreate.d.ts +3 -2
- package/content/plugins/crud/contentModel/afterDelete.d.ts +3 -2
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +3 -2
- package/content/plugins/crud/contentModel/beforeCreate.d.ts +3 -2
- package/content/plugins/crud/contentModel/beforeDelete.d.ts +3 -2
- package/content/plugins/crud/contentModel/beforeUpdate.d.ts +3 -2
- package/content/plugins/crud/contentModel/beforeUpdate.js +69 -0
- package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +2 -2
- package/content/plugins/crud/contentModel/models.js +9 -0
- package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +3 -2
- package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +3 -2
- package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +3 -2
- package/content/plugins/graphqlFields/datetime.js +3 -1
- package/content/plugins/graphqlFields/object.js +9 -13
- package/content/plugins/graphqlFields/ref.js +25 -5
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +1 -1
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +1 -0
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +1 -1
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +1 -0
- package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +3 -3
- package/content/plugins/schema/createFieldResolvers.d.ts +8 -7
- package/content/plugins/schema/createFieldResolvers.js +25 -12
- package/content/plugins/schema/createManageResolvers.d.ts +7 -6
- package/content/plugins/schema/createManageSDL.d.ts +5 -4
- package/content/plugins/schema/createPreviewResolvers.d.ts +8 -6
- package/content/plugins/schema/createReadResolvers.d.ts +8 -6
- package/content/plugins/schema/createReadSDL.d.ts +7 -6
- package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +5 -4
- package/content/plugins/schema/resolvers/manage/resolveCreate.js +2 -4
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +5 -4
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.js +2 -4
- package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +6 -1
- package/content/plugins/schema/resolvers/manage/resolveDelete.js +4 -8
- package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +6 -1
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +6 -1
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.js +2 -4
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +6 -1
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.js +2 -4
- package/content/plugins/schema/resolvers/manage/resolveList.d.ts +4 -2
- package/content/plugins/schema/resolvers/manage/resolveList.js +2 -4
- package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +6 -1
- package/content/plugins/schema/resolvers/manage/resolveRepublish.d.ts +6 -1
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.d.ts +3 -2
- package/content/plugins/schema/resolvers/manage/resolveRequestChanges.js +2 -4
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.d.ts +3 -2
- package/content/plugins/schema/resolvers/manage/resolveRequestReview.js +2 -4
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +6 -1
- package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +5 -4
- package/content/plugins/schema/resolvers/manage/resolveUpdate.js +2 -4
- package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +4 -2
- package/content/plugins/schema/resolvers/preview/resolveList.d.ts +4 -2
- package/content/plugins/schema/resolvers/preview/resolveList.js +2 -4
- package/content/plugins/schema/resolvers/read/resolveGet.d.ts +4 -2
- package/content/plugins/schema/resolvers/read/resolveList.d.ts +4 -2
- package/content/plugins/schema/resolvers/read/resolveList.js +2 -4
- package/content/plugins/storage/StorageTransformPlugin.d.ts +2 -2
- package/content/plugins/storage/object.js +9 -8
- package/content/plugins/utils/createTypeName.d.ts +3 -3
- package/content/plugins/utils/getEntryTitle.d.ts +1 -1
- package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +7 -6
- package/content/plugins/utils/getSchemaFromFieldPlugins.js +6 -6
- package/content/plugins/utils/pluralizedTypeName.d.ts +1 -1
- package/content/plugins/utils/renderFields.d.ts +11 -12
- package/content/plugins/utils/renderFields.js +1 -1
- package/content/plugins/utils/renderGetFilterFields.d.ts +5 -4
- package/content/plugins/utils/renderGetFilterFields.js +23 -13
- package/content/plugins/utils/renderInputFields.d.ts +10 -10
- package/content/plugins/utils/renderListFilterFields.d.ts +7 -6
- package/content/plugins/utils/renderListFilterFields.js +24 -12
- package/content/plugins/utils/renderSortEnum.js +5 -5
- package/migrateCMSPermissions.d.ts +2 -2
- package/migrateCMSPermissions.js +4 -0
- package/package.json +24 -23
- package/plugins/graphql/system.d.ts +4 -3
- package/plugins/graphql/system.js +5 -3
- package/plugins/upgrades/v5.5.0/index.js +4 -0
- package/types.d.ts +12 -12
- package/utils.d.ts +4 -4
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { CmsFieldTypePlugins, CmsModel } from "../../../types";
|
|
1
|
+
import { ApiEndpoint, CmsFieldTypePlugins, CmsModel } from "../../../types";
|
|
2
|
+
interface RenderListFilterFieldsParams {
|
|
3
|
+
model: CmsModel;
|
|
4
|
+
type: ApiEndpoint;
|
|
5
|
+
fieldTypePlugins: CmsFieldTypePlugins;
|
|
6
|
+
}
|
|
2
7
|
interface RenderListFilterFields {
|
|
3
|
-
(params:
|
|
4
|
-
model: CmsModel;
|
|
5
|
-
type: "read" | "manage";
|
|
6
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
7
|
-
}): string;
|
|
8
|
+
(params: RenderListFilterFieldsParams): string;
|
|
8
9
|
}
|
|
9
10
|
export declare const renderListFilterFields: RenderListFilterFields;
|
|
10
11
|
export {};
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.renderListFilterFields = void 0;
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
/**
|
|
9
|
+
* We cast as read type, because input and output of read and manage are same. This way we ease things.
|
|
10
|
+
* Internal stuff so it should be ok.
|
|
11
|
+
* TODO note that if changing read/manage types, change this as well.
|
|
12
|
+
*/
|
|
13
|
+
const getCreateListFilters = (plugins, fieldType, type) => {
|
|
14
|
+
if (!plugins[fieldType]) {
|
|
15
|
+
return null;
|
|
16
|
+
} else if (!plugins[fieldType][type]) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return plugins[fieldType][type].createListFilters;
|
|
21
|
+
};
|
|
11
22
|
|
|
12
23
|
const renderListFilterFields = ({
|
|
13
24
|
model,
|
|
@@ -16,21 +27,22 @@ const renderListFilterFields = ({
|
|
|
16
27
|
}) => {
|
|
17
28
|
const fields = [["id: ID", "id_not: ID", "id_in: [ID!]", "id_not_in: [ID!]", "entryId: String", "entryId_not: String", "entryId_in: [String!]", "entryId_not_in: [String!]", "createdOn: DateTime", "createdOn_gt: DateTime", "createdOn_gte: DateTime", "createdOn_lt: DateTime", "createdOn_lte: DateTime", "createdOn_between: [DateTime!]", "createdOn_not_between: [DateTime!]", "savedOn: DateTime", "savedOn_gt: DateTime", "savedOn_gte: DateTime", "savedOn_lt: DateTime", "savedOn_lte: DateTime", "savedOn_between: [DateTime!]", "savedOn_not_between: [DateTime!]", "createdBy: String", "createdBy_not: String", "createdBy_in: [String!]", "createdBy_not_in: [String!]", "ownedBy: String", "ownedBy_not: String", "ownedBy_in: [String!]", "ownedBy_not_in: [String!]"].join("\n")];
|
|
18
29
|
|
|
19
|
-
for (
|
|
20
|
-
|
|
30
|
+
for (const field of model.fields) {
|
|
31
|
+
// Every time a client updates content model's fields, we check the type of each field. If a field plugin
|
|
21
32
|
// for a particular "field.type" doesn't exist on the backend yet, we throw an error. But still, we also
|
|
22
33
|
// want to be careful when accessing the field plugin here too. It is still possible to have a content model
|
|
23
34
|
// that contains a field, for which we don't have a plugin registered on the backend. For example, user
|
|
24
35
|
// could've just removed the plugin from the backend.
|
|
36
|
+
const createListFilters = getCreateListFilters(fieldTypePlugins, field.type, type);
|
|
25
37
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (typeof createListFilters === "function") {
|
|
29
|
-
fields.push(createListFilters({
|
|
30
|
-
model,
|
|
31
|
-
field
|
|
32
|
-
}));
|
|
38
|
+
if (typeof createListFilters !== "function") {
|
|
39
|
+
continue;
|
|
33
40
|
}
|
|
41
|
+
|
|
42
|
+
fields.push(createListFilters({
|
|
43
|
+
model,
|
|
44
|
+
field
|
|
45
|
+
}));
|
|
34
46
|
}
|
|
35
47
|
|
|
36
48
|
return fields.filter(Boolean).join("\n");
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.renderSortEnum = void 0;
|
|
9
7
|
|
|
10
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
|
11
|
-
|
|
12
8
|
const renderSortEnum = ({
|
|
13
9
|
model,
|
|
14
10
|
fieldTypePlugins
|
|
@@ -16,7 +12,11 @@ const renderSortEnum = ({
|
|
|
16
12
|
const sorters = [`id_ASC`, `id_DESC`, "savedOn_ASC", "savedOn_DESC", "createdOn_ASC", "createdOn_DESC"];
|
|
17
13
|
|
|
18
14
|
for (const field of model.fields) {
|
|
19
|
-
|
|
15
|
+
if (!fieldTypePlugins[field.type]) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const isSortable = fieldTypePlugins[field.type].isSortable;
|
|
20
20
|
|
|
21
21
|
if (!isSortable) {
|
|
22
22
|
continue;
|
|
@@ -5,13 +5,13 @@ declare type Group = {
|
|
|
5
5
|
declare type Model = {
|
|
6
6
|
[code: string]: string[];
|
|
7
7
|
};
|
|
8
|
-
|
|
8
|
+
interface CMSPermission {
|
|
9
9
|
name: string;
|
|
10
10
|
rwd?: string;
|
|
11
11
|
pw?: string;
|
|
12
12
|
own?: boolean;
|
|
13
13
|
groups?: Group;
|
|
14
14
|
models?: Model;
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
export declare const migrateCMSPermissions: (permissions: CMSPermission[], getModel: (modelId: string) => Promise<CmsModel>) => Promise<CMSPermission[]>;
|
|
17
17
|
export {};
|
package/migrateCMSPermissions.js
CHANGED
|
@@ -11,6 +11,10 @@ var _mergeWith = _interopRequireDefault(require("lodash/mergeWith"));
|
|
|
11
11
|
|
|
12
12
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Not used anymore so ignore.
|
|
16
|
+
*/
|
|
17
|
+
// @ts-nocheck
|
|
14
18
|
var AccessTypes;
|
|
15
19
|
|
|
16
20
|
(function (AccessTypes) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.24.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -21,27 +21,28 @@
|
|
|
21
21
|
"@babel/runtime": "7.16.7",
|
|
22
22
|
"@commodo/fields": "1.1.2-beta.20",
|
|
23
23
|
"@graphql-tools/schema": "7.1.5",
|
|
24
|
-
"@webiny/api-file-manager": "5.
|
|
25
|
-
"@webiny/api-i18n": "5.
|
|
26
|
-
"@webiny/api-i18n-content": "5.
|
|
27
|
-
"@webiny/api-i18n-ddb": "5.
|
|
28
|
-
"@webiny/api-security": "5.
|
|
29
|
-
"@webiny/api-tenancy": "5.
|
|
30
|
-
"@webiny/api-upgrade": "5.
|
|
31
|
-
"@webiny/error": "5.
|
|
32
|
-
"@webiny/handler": "5.
|
|
33
|
-
"@webiny/handler-aws": "5.
|
|
34
|
-
"@webiny/handler-db": "5.
|
|
35
|
-
"@webiny/handler-graphql": "5.
|
|
36
|
-
"@webiny/handler-http": "5.
|
|
37
|
-
"@webiny/plugins": "5.
|
|
38
|
-
"@webiny/pubsub": "5.
|
|
39
|
-
"@webiny/utils": "5.
|
|
40
|
-
"@webiny/validation": "5.
|
|
24
|
+
"@webiny/api-file-manager": "5.24.0",
|
|
25
|
+
"@webiny/api-i18n": "5.24.0",
|
|
26
|
+
"@webiny/api-i18n-content": "5.24.0",
|
|
27
|
+
"@webiny/api-i18n-ddb": "5.24.0",
|
|
28
|
+
"@webiny/api-security": "5.24.0",
|
|
29
|
+
"@webiny/api-tenancy": "5.24.0",
|
|
30
|
+
"@webiny/api-upgrade": "5.24.0",
|
|
31
|
+
"@webiny/error": "5.24.0",
|
|
32
|
+
"@webiny/handler": "5.24.0",
|
|
33
|
+
"@webiny/handler-aws": "5.24.0",
|
|
34
|
+
"@webiny/handler-db": "5.24.0",
|
|
35
|
+
"@webiny/handler-graphql": "5.24.0",
|
|
36
|
+
"@webiny/handler-http": "5.24.0",
|
|
37
|
+
"@webiny/plugins": "5.24.0",
|
|
38
|
+
"@webiny/pubsub": "5.24.0",
|
|
39
|
+
"@webiny/utils": "5.24.0",
|
|
40
|
+
"@webiny/validation": "5.24.0",
|
|
41
41
|
"boolean": "3.1.4",
|
|
42
42
|
"commodo-fields-object": "1.0.6",
|
|
43
43
|
"dataloader": "2.0.0",
|
|
44
44
|
"dot-prop": "6.0.1",
|
|
45
|
+
"graphql-tag": "2.12.6",
|
|
45
46
|
"lodash": "4.17.21",
|
|
46
47
|
"p-map": "4.0.0",
|
|
47
48
|
"p-reduce": "2.1.0",
|
|
@@ -54,10 +55,10 @@
|
|
|
54
55
|
"@babel/core": "^7.16.0",
|
|
55
56
|
"@babel/preset-env": "^7.16.4",
|
|
56
57
|
"@babel/preset-flow": "^7.16.0",
|
|
57
|
-
"@webiny/api-security-so-ddb": "^5.
|
|
58
|
-
"@webiny/api-tenancy-so-ddb": "^5.
|
|
59
|
-
"@webiny/cli": "^5.
|
|
60
|
-
"@webiny/project-utils": "^5.
|
|
58
|
+
"@webiny/api-security-so-ddb": "^5.24.0",
|
|
59
|
+
"@webiny/api-tenancy-so-ddb": "^5.24.0",
|
|
60
|
+
"@webiny/cli": "^5.24.0",
|
|
61
|
+
"@webiny/project-utils": "^5.24.0",
|
|
61
62
|
"apollo-graphql": "^0.9.5",
|
|
62
63
|
"get-yarn-workspaces": "^1.0.2",
|
|
63
64
|
"graphql": "^15.7.2",
|
|
@@ -77,5 +78,5 @@
|
|
|
77
78
|
"build": "yarn webiny run build",
|
|
78
79
|
"watch": "yarn webiny run watch"
|
|
79
80
|
},
|
|
80
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "be0cbfcaa9247c658c44179af7943cc5d6d71bc7"
|
|
81
82
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ErrorResponse, Response } from "@webiny/handler-graphql";
|
|
2
2
|
import { CmsContext } from "../../types";
|
|
3
|
+
interface CmsMutationUpgradeArgs {
|
|
4
|
+
version: string;
|
|
5
|
+
}
|
|
3
6
|
declare const _default: {
|
|
4
7
|
typeDefs: string;
|
|
5
8
|
resolvers: {
|
|
@@ -8,9 +11,7 @@ declare const _default: {
|
|
|
8
11
|
};
|
|
9
12
|
CmsMutation: {
|
|
10
13
|
install: (_: any, __: any, { cms }: CmsContext) => Promise<ErrorResponse | Response<boolean>>;
|
|
11
|
-
upgrade: (_: any, {
|
|
12
|
-
version: any;
|
|
13
|
-
}, { cms }: CmsContext) => Promise<ErrorResponse | Response<boolean>>;
|
|
14
|
+
upgrade: (_: any, args: CmsMutationUpgradeArgs, { cms }: CmsContext) => Promise<ErrorResponse | Response<boolean>>;
|
|
14
15
|
};
|
|
15
16
|
};
|
|
16
17
|
};
|
|
@@ -54,11 +54,13 @@ var _default = {
|
|
|
54
54
|
return new _handlerGraphql.ErrorResponse(e);
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
-
upgrade: async (_, {
|
|
58
|
-
version
|
|
59
|
-
}, {
|
|
57
|
+
upgrade: async (_, args, {
|
|
60
58
|
cms
|
|
61
59
|
}) => {
|
|
60
|
+
const {
|
|
61
|
+
version
|
|
62
|
+
} = args;
|
|
63
|
+
|
|
62
64
|
try {
|
|
63
65
|
await cms.upgradeSystem(version);
|
|
64
66
|
return new _handlerGraphql.Response(true);
|
|
@@ -13,6 +13,10 @@ var _migrateCMSPermissions = require("../../../migrateCMSPermissions");
|
|
|
13
13
|
|
|
14
14
|
var _helpers = require("./helpers");
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* Not used anymore so ignore.
|
|
18
|
+
*/
|
|
19
|
+
// @ts-nocheck
|
|
16
20
|
const plugin = {
|
|
17
21
|
name: "api-upgrade-cms-5.5.0",
|
|
18
22
|
type: "api-upgrade",
|
package/types.d.ts
CHANGED
|
@@ -10,11 +10,12 @@ import { DbContext } from "@webiny/handler-db/types";
|
|
|
10
10
|
import { FileManagerContext } from "@webiny/api-file-manager/types";
|
|
11
11
|
import { UpgradePlugin } from "@webiny/api-upgrade/types";
|
|
12
12
|
import { Topic } from "@webiny/pubsub/types";
|
|
13
|
+
export declare type ApiEndpoint = "manage" | "preview" | "read";
|
|
13
14
|
export interface HeadlessCms extends CmsSettingsContext, CmsSystemContext, CmsGroupContext, CmsModelContext, CmsEntryContext {
|
|
14
15
|
/**
|
|
15
16
|
* API type
|
|
16
17
|
*/
|
|
17
|
-
type:
|
|
18
|
+
type: ApiEndpoint;
|
|
18
19
|
/**
|
|
19
20
|
* Requested locale
|
|
20
21
|
*/
|
|
@@ -370,14 +371,15 @@ export interface CmsModelFieldDefinition {
|
|
|
370
371
|
fields: string;
|
|
371
372
|
typeDefs?: string;
|
|
372
373
|
}
|
|
374
|
+
interface CmsModelFieldToGraphQLCreateResolverParams {
|
|
375
|
+
models: CmsModel[];
|
|
376
|
+
model: CmsModel;
|
|
377
|
+
graphQLType: string;
|
|
378
|
+
field: CmsModelField;
|
|
379
|
+
createFieldResolvers: any;
|
|
380
|
+
}
|
|
373
381
|
export interface CmsModelFieldToGraphQLCreateResolver {
|
|
374
|
-
(params: {
|
|
375
|
-
models: CmsModel[];
|
|
376
|
-
model: CmsModel;
|
|
377
|
-
graphQLType: string;
|
|
378
|
-
field: CmsModelField;
|
|
379
|
-
createFieldResolvers: any;
|
|
380
|
-
}): GraphQLFieldResolver | {
|
|
382
|
+
(params: CmsModelFieldToGraphQLCreateResolverParams): GraphQLFieldResolver | {
|
|
381
383
|
resolver: GraphQLFieldResolver;
|
|
382
384
|
typeResolvers: Resolvers<CmsContext>;
|
|
383
385
|
} | false;
|
|
@@ -511,7 +513,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
511
513
|
*/
|
|
512
514
|
createSchema?: (params: {
|
|
513
515
|
models: CmsModel[];
|
|
514
|
-
model: CmsModel;
|
|
515
516
|
}) => GraphQLSchemaDefinition<CmsContext>;
|
|
516
517
|
};
|
|
517
518
|
manage: {
|
|
@@ -554,7 +555,6 @@ export interface CmsModelFieldToGraphQLPlugin extends Plugin {
|
|
|
554
555
|
*/
|
|
555
556
|
createSchema?: (params: {
|
|
556
557
|
models: CmsModel[];
|
|
557
|
-
model: CmsModel;
|
|
558
558
|
}) => GraphQLSchemaDefinition<CmsContext>;
|
|
559
559
|
/**
|
|
560
560
|
* Definition of the field type for GraphQL - be aware if multiple values is selected. Probably same as `read.createTypeField`.
|
|
@@ -1181,11 +1181,11 @@ export interface CmsModelManager {
|
|
|
1181
1181
|
/**
|
|
1182
1182
|
* Create a entry.
|
|
1183
1183
|
*/
|
|
1184
|
-
create: (data:
|
|
1184
|
+
create: (data: CreateCmsEntryInput) => Promise<CmsEntry>;
|
|
1185
1185
|
/**
|
|
1186
1186
|
* Update a entry.
|
|
1187
1187
|
*/
|
|
1188
|
-
update: (id: string, data:
|
|
1188
|
+
update: (id: string, data: UpdateCmsEntryInput) => Promise<CmsEntry>;
|
|
1189
1189
|
/**
|
|
1190
1190
|
* Delete a entry.
|
|
1191
1191
|
*/
|
package/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SecurityPermission } from "@webiny/api-security/types";
|
|
2
2
|
import { CmsModel, CmsContext, CreatedBy, CmsGroupPermission, CmsGroup } from "./types";
|
|
3
|
-
export declare const hasRwd: (permission:
|
|
4
|
-
export declare const hasPw: (permission:
|
|
3
|
+
export declare const hasRwd: (permission: SecurityPermission, rwd: string) => boolean;
|
|
4
|
+
export declare const hasPw: (permission: SecurityPermission, pw: string) => boolean;
|
|
5
5
|
export declare const checkPermissions: <TPermission extends SecurityPermission = SecurityPermission>(context: CmsContext, name: string, check?: {
|
|
6
6
|
rwd?: string;
|
|
7
7
|
pw?: string;
|
|
@@ -21,5 +21,5 @@ export declare const validateOwnership: (context: CmsContext, permission: Securi
|
|
|
21
21
|
export declare const checkModelAccess: (context: CmsContext, model: CmsModel) => Promise<void>;
|
|
22
22
|
export declare const validateModelAccess: (context: CmsContext, model: CmsModel) => Promise<boolean>;
|
|
23
23
|
export declare const validateGroupAccess: (context: CmsContext, permission: CmsGroupPermission, group: CmsGroup) => boolean;
|
|
24
|
-
export declare const toSlug: (text:
|
|
25
|
-
export declare const filterAsync: <T = Record<string, any>>(items: T[], predicate: (
|
|
24
|
+
export declare const toSlug: (text: string) => string;
|
|
25
|
+
export declare const filterAsync: <T = Record<string, any>>(items: T[], predicate: (param: T) => Promise<boolean>) => Promise<T[]>;
|