@webiny/api-aco 0.0.0-unstable.c2780f51fe → 0.0.0-unstable.c7dec08bb0
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/apps/AcoApp.d.ts +16 -0
- package/apps/AcoApp.js +108 -0
- package/apps/AcoApp.js.map +1 -0
- package/apps/AcoApps.d.ts +10 -0
- package/apps/AcoApps.js +76 -0
- package/apps/AcoApps.js.map +1 -0
- package/apps/app.gql.d.ts +3 -0
- package/apps/app.gql.js +58 -0
- package/apps/app.gql.js.map +1 -0
- package/apps/index.d.ts +2 -0
- package/apps/index.js +27 -0
- package/apps/index.js.map +1 -0
- package/createAcoContext.js +50 -13
- package/createAcoContext.js.map +1 -1
- package/createAcoGraphQL.d.ts +2 -2
- package/createAcoGraphQL.js +34 -5
- package/createAcoGraphQL.js.map +1 -1
- package/createAcoModels.js +0 -23
- package/createAcoModels.js.map +1 -1
- package/{createAcoFields.d.ts → fields/index.d.ts} +1 -1
- package/fields/index.js +12 -0
- package/fields/index.js.map +1 -0
- package/fields/location.d.ts +2 -0
- package/fields/location.js +44 -0
- package/fields/location.js.map +1 -0
- package/folder/folder.crud.js +18 -0
- package/folder/folder.crud.js.map +1 -1
- package/folder/folder.gql.js +19 -4
- package/folder/folder.gql.js.map +1 -1
- package/folder/folder.so.js +4 -4
- package/folder/folder.so.js.map +1 -1
- package/folder/folder.types.d.ts +8 -2
- package/folder/folder.types.js.map +1 -1
- package/folder/onFolderBeforeDelete.hook.js +29 -16
- package/folder/onFolderBeforeDelete.hook.js.map +1 -1
- package/index.d.ts +5 -1
- package/index.js +45 -3
- package/index.js.map +1 -1
- package/package.json +34 -32
- package/plugins/AcoAppModifierPlugin.d.ts +43 -0
- package/plugins/AcoAppModifierPlugin.js +59 -0
- package/plugins/AcoAppModifierPlugin.js.map +1 -0
- package/plugins/AcoAppRegisterPlugin.d.ts +8 -0
- package/plugins/AcoAppRegisterPlugin.js +22 -0
- package/plugins/AcoAppRegisterPlugin.js.map +1 -0
- package/plugins/index.d.ts +2 -0
- package/plugins/index.js +27 -0
- package/plugins/index.js.map +1 -0
- package/record/graphql/createAppResolvers.d.ts +14 -0
- package/record/graphql/createAppResolvers.js +108 -0
- package/record/graphql/createAppResolvers.js.map +1 -0
- package/record/graphql/createAppSchema.d.ts +9 -0
- package/record/graphql/createAppSchema.js +142 -0
- package/record/graphql/createAppSchema.js.map +1 -0
- package/record/record.crud.js +46 -12
- package/record/record.crud.js.map +1 -1
- package/record/record.gql.d.ts +8 -3
- package/record/record.gql.js +36 -112
- package/record/record.gql.js.map +1 -1
- package/record/record.model.d.ts +7 -1
- package/record/record.model.js +37 -8
- package/record/record.model.js.map +1 -1
- package/record/record.so.js +91 -31
- package/record/record.so.js.map +1 -1
- package/record/record.types.d.ts +68 -16
- package/record/record.types.js.map +1 -1
- package/types.d.ts +47 -3
- package/types.js +27 -0
- package/types.js.map +1 -1
- package/utils/acoRecordId.d.ts +6 -0
- package/utils/acoRecordId.js +33 -0
- package/utils/acoRecordId.js.map +1 -0
- package/utils/checkPermissions.d.ts +2 -0
- package/utils/checkPermissions.js +14 -0
- package/utils/checkPermissions.js.map +1 -0
- package/utils/getFieldValues.d.ts +4 -1
- package/utils/getFieldValues.js +7 -10
- package/utils/getFieldValues.js.map +1 -1
- package/utils/getFolderAndItsAncestors.d.ts +7 -0
- package/utils/getFolderAndItsAncestors.js +48 -0
- package/utils/getFolderAndItsAncestors.js.map +1 -0
- package/utils/resolve.d.ts +3 -2
- package/utils/resolve.js +11 -2
- package/utils/resolve.js.map +1 -1
- package/context/folders.d.ts +0 -2
- package/context/folders.js +0 -261
- package/context/folders.js.map +0 -1
- package/context/index.d.ts +0 -2
- package/context/index.js +0 -22
- package/context/index.js.map +0 -1
- package/context/links.d.ts +0 -2
- package/context/links.js +0 -270
- package/context/links.js.map +0 -1
- package/createAcoCrud.d.ts +0 -2
- package/createAcoCrud.js +0 -17
- package/createAcoCrud.js.map +0 -1
- package/createAcoFields.js +0 -40
- package/createAcoFields.js.map +0 -1
- package/graphql/base.gql.d.ts +0 -3
- package/graphql/base.gql.js +0 -63
- package/graphql/base.gql.js.map +0 -1
- package/graphql/folders.gql.d.ts +0 -3
- package/graphql/folders.gql.js +0 -126
- package/graphql/folders.gql.js.map +0 -1
- package/graphql/index.d.ts +0 -1
- package/graphql/index.js +0 -15
- package/graphql/index.js.map +0 -1
- package/graphql/links.gql.d.ts +0 -3
- package/graphql/links.gql.js +0 -123
- package/graphql/links.gql.js.map +0 -1
- package/subscriptions/afterFolderDelete.d.ts +0 -3
- package/subscriptions/afterFolderDelete.js +0 -62
- package/subscriptions/afterFolderDelete.js.map +0 -1
- package/subscriptions/index.d.ts +0 -3
- package/subscriptions/index.js +0 -14
- package/subscriptions/index.js.map +0 -1
package/record/record.gql.d.ts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { AcoContext, IAcoApp } from "../types";
|
|
2
|
+
import { GraphQLSchemaPlugin } from "@webiny/handler-graphql";
|
|
3
|
+
interface Params {
|
|
4
|
+
context: AcoContext;
|
|
5
|
+
app: IAcoApp;
|
|
6
|
+
}
|
|
7
|
+
export declare const createSchema: (params: Params) => Promise<GraphQLSchemaPlugin<import("@webiny/api/types").Context>>;
|
|
8
|
+
export {};
|
package/record/record.gql.js
CHANGED
|
@@ -3,115 +3,39 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
title: String
|
|
43
|
-
content: String
|
|
44
|
-
location: SearchLocationInput
|
|
45
|
-
data: JSON
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
input SearchRecordListWhereInput {
|
|
49
|
-
type: String!
|
|
50
|
-
location: SearchLocationInput
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
type SearchRecordResponse {
|
|
54
|
-
data: SearchRecord
|
|
55
|
-
error: AcoError
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type SearchRecordListResponse {
|
|
59
|
-
data: [SearchRecord]
|
|
60
|
-
error: AcoError
|
|
61
|
-
meta: AcoMeta
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
extend type SearchQuery {
|
|
65
|
-
getRecord(id: ID!): SearchRecordResponse
|
|
66
|
-
listRecords(
|
|
67
|
-
where: SearchRecordListWhereInput
|
|
68
|
-
search: String
|
|
69
|
-
limit: Int
|
|
70
|
-
after: String
|
|
71
|
-
sort: AcoSort
|
|
72
|
-
): SearchRecordListResponse
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
extend type SearchMutation {
|
|
76
|
-
createRecord(data: SearchRecordCreateInput!): SearchRecordResponse
|
|
77
|
-
updateRecord(id: ID!, data: SearchRecordUpdateInput!): SearchRecordResponse
|
|
78
|
-
deleteRecord(id: ID!): AcoBooleanResponse
|
|
79
|
-
}
|
|
80
|
-
`,
|
|
81
|
-
resolvers: {
|
|
82
|
-
SearchQuery: {
|
|
83
|
-
getRecord: async (_, {
|
|
84
|
-
id
|
|
85
|
-
}, context) => {
|
|
86
|
-
return (0, _resolve.resolve)(() => context.aco.search.get(id));
|
|
87
|
-
},
|
|
88
|
-
listRecords: async (_, args, context) => {
|
|
89
|
-
try {
|
|
90
|
-
const [entries, meta] = await context.aco.search.list(args);
|
|
91
|
-
return new _responses.ListResponse(entries, meta);
|
|
92
|
-
} catch (e) {
|
|
93
|
-
return new _responses.ErrorResponse(e);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
SearchMutation: {
|
|
98
|
-
createRecord: async (_, {
|
|
99
|
-
data
|
|
100
|
-
}, context) => {
|
|
101
|
-
return (0, _resolve.resolve)(() => context.aco.search.create(data));
|
|
102
|
-
},
|
|
103
|
-
updateRecord: async (_, {
|
|
104
|
-
id,
|
|
105
|
-
data
|
|
106
|
-
}, context) => {
|
|
107
|
-
return (0, _resolve.resolve)(() => context.aco.search.update(id, data));
|
|
108
|
-
},
|
|
109
|
-
deleteRecord: async (_, {
|
|
110
|
-
id
|
|
111
|
-
}, context) => {
|
|
112
|
-
return (0, _resolve.resolve)(() => context.aco.search.delete(id));
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
exports.searchRecordSchema = searchRecordSchema;
|
|
6
|
+
exports.createSchema = void 0;
|
|
7
|
+
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
8
|
+
var _createAppSchema = require("./graphql/createAppSchema");
|
|
9
|
+
var _createAppResolvers = require("./graphql/createAppResolvers");
|
|
10
|
+
const createSchema = async params => {
|
|
11
|
+
const {
|
|
12
|
+
context,
|
|
13
|
+
app
|
|
14
|
+
} = params;
|
|
15
|
+
const plugins = context.plugins.byType("cms-model-field-to-graphql").reduce((fields, plugin) => {
|
|
16
|
+
fields[plugin.fieldType] = plugin;
|
|
17
|
+
return fields;
|
|
18
|
+
}, {});
|
|
19
|
+
const models = await context.security.withoutAuthorization(async () => {
|
|
20
|
+
return (await context.cms.listModels()).filter(model => {
|
|
21
|
+
return !model.isPrivate;
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
return context.benchmark.measure(`aco.schema.generate.${app.name}`, async () => {
|
|
25
|
+
const plugin = new _handlerGraphql.GraphQLSchemaPlugin({
|
|
26
|
+
typeDefs: (0, _createAppSchema.createAppSchema)({
|
|
27
|
+
models,
|
|
28
|
+
app,
|
|
29
|
+
plugins
|
|
30
|
+
}),
|
|
31
|
+
resolvers: (0, _createAppResolvers.createAppResolvers)({
|
|
32
|
+
models,
|
|
33
|
+
app,
|
|
34
|
+
plugins
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
plugin.name = `aco.graphql.appSchema.searchRecord.${app.name}`;
|
|
38
|
+
return plugin;
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
exports.createSchema = createSchema;
|
package/record/record.gql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createSchema","params","context","app","plugins","byType","reduce","fields","plugin","fieldType","models","security","withoutAuthorization","cms","listModels","filter","model","isPrivate","benchmark","measure","name","GraphQLSchemaPlugin","typeDefs","createAppSchema","resolvers","createAppResolvers"],"sources":["record.gql.ts"],"sourcesContent":["import { AcoContext, IAcoApp } from \"~/types\";\nimport { CmsFieldTypePlugins, CmsModelFieldToGraphQLPlugin } from \"@webiny/api-headless-cms/types\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { createAppSchema } from \"./graphql/createAppSchema\";\nimport { createAppResolvers } from \"./graphql/createAppResolvers\";\n\ninterface Params {\n context: AcoContext;\n app: IAcoApp;\n}\n\nexport const createSchema = async (params: Params) => {\n const { context, app } = params;\n const plugins = context.plugins\n .byType<CmsModelFieldToGraphQLPlugin>(\"cms-model-field-to-graphql\")\n .reduce<CmsFieldTypePlugins>((fields, plugin) => {\n fields[plugin.fieldType] = plugin;\n return fields;\n }, {});\n const models = await context.security.withoutAuthorization(async () => {\n return (await context.cms.listModels()).filter(model => {\n return !model.isPrivate;\n });\n });\n\n return context.benchmark.measure(`aco.schema.generate.${app.name}`, async () => {\n const plugin = new GraphQLSchemaPlugin({\n typeDefs: createAppSchema({\n models,\n app,\n plugins\n }),\n resolvers: createAppResolvers({\n models,\n app,\n plugins\n })\n });\n plugin.name = `aco.graphql.appSchema.searchRecord.${app.name}`;\n return plugin;\n });\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;AAOO,MAAMA,YAAY,GAAG,MAAOC,MAAc,IAAK;EAClD,MAAM;IAAEC,OAAO;IAAEC;EAAI,CAAC,GAAGF,MAAM;EAC/B,MAAMG,OAAO,GAAGF,OAAO,CAACE,OAAO,CAC1BC,MAAM,CAA+B,4BAA4B,CAAC,CAClEC,MAAM,CAAsB,CAACC,MAAM,EAAEC,MAAM,KAAK;IAC7CD,MAAM,CAACC,MAAM,CAACC,SAAS,CAAC,GAAGD,MAAM;IACjC,OAAOD,MAAM;EACjB,CAAC,EAAE,CAAC,CAAC,CAAC;EACV,MAAMG,MAAM,GAAG,MAAMR,OAAO,CAACS,QAAQ,CAACC,oBAAoB,CAAC,YAAY;IACnE,OAAO,CAAC,MAAMV,OAAO,CAACW,GAAG,CAACC,UAAU,EAAE,EAAEC,MAAM,CAACC,KAAK,IAAI;MACpD,OAAO,CAACA,KAAK,CAACC,SAAS;IAC3B,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,OAAOf,OAAO,CAACgB,SAAS,CAACC,OAAO,CAAE,uBAAsBhB,GAAG,CAACiB,IAAK,EAAC,EAAE,YAAY;IAC5E,MAAMZ,MAAM,GAAG,IAAIa,mCAAmB,CAAC;MACnCC,QAAQ,EAAE,IAAAC,gCAAe,EAAC;QACtBb,MAAM;QACNP,GAAG;QACHC;MACJ,CAAC,CAAC;MACFoB,SAAS,EAAE,IAAAC,sCAAkB,EAAC;QAC1Bf,MAAM;QACNP,GAAG;QACHC;MACJ,CAAC;IACL,CAAC,CAAC;IACFI,MAAM,CAACY,IAAI,GAAI,sCAAqCjB,GAAG,CAACiB,IAAK,EAAC;IAC9D,OAAOZ,MAAM;EACjB,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/record/record.model.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
+
import { CmsModelField } from "@webiny/api-headless-cms/types";
|
|
1
2
|
import { CmsPrivateModelFull } from "@webiny/api-headless-cms";
|
|
2
3
|
export declare type SearchRecordModelDefinition = Omit<CmsPrivateModelFull, "noValidate" | "group">;
|
|
3
4
|
export declare const SEARCH_RECORD_MODEL_ID = "acoSearchRecord";
|
|
4
|
-
|
|
5
|
+
interface CreateSearchModelDefinitionParams {
|
|
6
|
+
fields?: CmsModelField[];
|
|
7
|
+
}
|
|
8
|
+
export declare const DEFAULT_FIELDS: string[];
|
|
9
|
+
export declare const createSearchModelDefinition: (params?: CreateSearchModelDefinitionParams) => SearchRecordModelDefinition;
|
|
10
|
+
export {};
|
package/record/record.model.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.createSearchModelDefinition = exports.SEARCH_RECORD_MODEL_ID = void 0;
|
|
6
|
+
exports.createSearchModelDefinition = exports.SEARCH_RECORD_MODEL_ID = exports.DEFAULT_FIELDS = void 0;
|
|
7
7
|
var _createModelField = require("../utils/createModelField");
|
|
8
8
|
const typeField = () => (0, _createModelField.createModelField)({
|
|
9
9
|
label: "Type",
|
|
@@ -15,7 +15,11 @@ const typeField = () => (0, _createModelField.createModelField)({
|
|
|
15
15
|
});
|
|
16
16
|
const titleField = () => (0, _createModelField.createModelField)({
|
|
17
17
|
label: "Title",
|
|
18
|
-
type: "text"
|
|
18
|
+
type: "text",
|
|
19
|
+
validation: [{
|
|
20
|
+
name: "required",
|
|
21
|
+
message: "Value is required."
|
|
22
|
+
}]
|
|
19
23
|
});
|
|
20
24
|
const contentField = () => (0, _createModelField.createModelField)({
|
|
21
25
|
label: "Content",
|
|
@@ -25,6 +29,10 @@ const locationField = fields => (0, _createModelField.createModelField)({
|
|
|
25
29
|
label: "Location",
|
|
26
30
|
type: "object",
|
|
27
31
|
multipleValues: false,
|
|
32
|
+
validation: [{
|
|
33
|
+
name: "required",
|
|
34
|
+
message: "The location field must be populated."
|
|
35
|
+
}],
|
|
28
36
|
settings: {
|
|
29
37
|
fields
|
|
30
38
|
}
|
|
@@ -37,19 +45,40 @@ const locationFolderIdField = () => (0, _createModelField.createModelField)({
|
|
|
37
45
|
message: "Value is required."
|
|
38
46
|
}]
|
|
39
47
|
});
|
|
40
|
-
const dataField =
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
const dataField = fields => {
|
|
49
|
+
return (0, _createModelField.createModelField)({
|
|
50
|
+
label: "Data",
|
|
51
|
+
type: "object",
|
|
52
|
+
multipleValues: false,
|
|
53
|
+
validation: [{
|
|
54
|
+
name: "required",
|
|
55
|
+
message: "The data field must be populated."
|
|
56
|
+
}],
|
|
57
|
+
settings: {
|
|
58
|
+
fields
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const tagsField = () => (0, _createModelField.createModelField)({
|
|
63
|
+
label: "Tags",
|
|
64
|
+
type: "text",
|
|
65
|
+
multipleValues: true,
|
|
66
|
+
validation: [{
|
|
67
|
+
name: "required",
|
|
68
|
+
message: "The tags field must be populated."
|
|
69
|
+
}]
|
|
43
70
|
});
|
|
44
71
|
const SEARCH_RECORD_MODEL_ID = "acoSearchRecord";
|
|
45
72
|
exports.SEARCH_RECORD_MODEL_ID = SEARCH_RECORD_MODEL_ID;
|
|
46
|
-
const
|
|
73
|
+
const DEFAULT_FIELDS = ["type", "title", "content", "location", "data", "tags"];
|
|
74
|
+
exports.DEFAULT_FIELDS = DEFAULT_FIELDS;
|
|
75
|
+
const createSearchModelDefinition = params => {
|
|
47
76
|
return {
|
|
48
77
|
name: "ACO - Search Record",
|
|
49
78
|
modelId: SEARCH_RECORD_MODEL_ID,
|
|
50
79
|
titleFieldId: "title",
|
|
51
|
-
layout:
|
|
52
|
-
fields: [typeField(), titleField(), contentField(), locationField([locationFolderIdField()]), dataField()],
|
|
80
|
+
layout: DEFAULT_FIELDS.map(field => [field]),
|
|
81
|
+
fields: [typeField(), titleField(), contentField(), locationField([locationFolderIdField()]), dataField(params === null || params === void 0 ? void 0 : params.fields), tagsField()],
|
|
53
82
|
description: "ACO - Search record model",
|
|
54
83
|
isPrivate: true
|
|
55
84
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["typeField","createModelField","label","type","validation","name","message","titleField","contentField","locationField","fields","multipleValues","settings","locationFolderIdField","dataField","SEARCH_RECORD_MODEL_ID","createSearchModelDefinition","modelId","titleFieldId","layout","description","isPrivate"],"sources":["record.model.ts"],"sourcesContent":["import { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { createModelField } from \"~/utils/createModelField\";\nimport { CmsPrivateModelFull } from \"@webiny/api-headless-cms\";\n\nexport type SearchRecordModelDefinition = Omit<CmsPrivateModelFull, \"noValidate\" | \"group\">;\n\nconst typeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n validation: [\n {\n name: \"required\",\n message: \"Value is required.\"\n }\n ]\n });\n\nconst titleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\"\n });\n\nconst contentField = () =>\n createModelField({\n label: \"Content\",\n type: \"text\"\n });\n\nconst locationField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Location\",\n type: \"object\",\n multipleValues: false,\n
|
|
1
|
+
{"version":3,"names":["typeField","createModelField","label","type","validation","name","message","titleField","contentField","locationField","fields","multipleValues","settings","locationFolderIdField","dataField","tagsField","SEARCH_RECORD_MODEL_ID","DEFAULT_FIELDS","createSearchModelDefinition","params","modelId","titleFieldId","layout","map","field","description","isPrivate"],"sources":["record.model.ts"],"sourcesContent":["import { CmsModelField } from \"@webiny/api-headless-cms/types\";\nimport { createModelField } from \"~/utils/createModelField\";\nimport { CmsPrivateModelFull } from \"@webiny/api-headless-cms\";\n\nexport type SearchRecordModelDefinition = Omit<CmsPrivateModelFull, \"noValidate\" | \"group\">;\n\nconst typeField = () =>\n createModelField({\n label: \"Type\",\n type: \"text\",\n validation: [\n {\n name: \"required\",\n message: \"Value is required.\"\n }\n ]\n });\n\nconst titleField = () =>\n createModelField({\n label: \"Title\",\n type: \"text\",\n validation: [\n {\n name: \"required\",\n message: \"Value is required.\"\n }\n ]\n });\n\nconst contentField = () =>\n createModelField({\n label: \"Content\",\n type: \"text\"\n });\n\nconst locationField = (fields: CmsModelField[]) =>\n createModelField({\n label: \"Location\",\n type: \"object\",\n multipleValues: false,\n validation: [\n {\n name: \"required\",\n message: \"The location field must be populated.\"\n }\n ],\n settings: {\n fields\n }\n });\n\nconst locationFolderIdField = () =>\n createModelField({\n label: \"Folder Id\",\n type: \"text\",\n validation: [\n {\n name: \"required\",\n message: \"Value is required.\"\n }\n ]\n });\n\nconst dataField = (fields?: CmsModelField[]) => {\n return createModelField({\n label: \"Data\",\n type: \"object\",\n multipleValues: false,\n validation: [\n {\n name: \"required\",\n message: \"The data field must be populated.\"\n }\n ],\n settings: {\n fields\n }\n });\n};\n\nconst tagsField = () =>\n createModelField({\n label: \"Tags\",\n type: \"text\",\n multipleValues: true,\n validation: [\n {\n name: \"required\",\n message: \"The tags field must be populated.\"\n }\n ]\n });\n\nexport const SEARCH_RECORD_MODEL_ID = \"acoSearchRecord\";\n\ninterface CreateSearchModelDefinitionParams {\n fields?: CmsModelField[];\n}\n\nexport const DEFAULT_FIELDS = [\"type\", \"title\", \"content\", \"location\", \"data\", \"tags\"];\n\nexport const createSearchModelDefinition = (\n params?: CreateSearchModelDefinitionParams\n): SearchRecordModelDefinition => {\n return {\n name: \"ACO - Search Record\",\n modelId: SEARCH_RECORD_MODEL_ID,\n titleFieldId: \"title\",\n layout: DEFAULT_FIELDS.map(field => [field]),\n fields: [\n typeField(),\n titleField(),\n contentField(),\n locationField([locationFolderIdField()]),\n dataField(params?.fields),\n tagsField()\n ],\n description: \"ACO - Search record model\",\n isPrivate: true\n };\n};\n"],"mappings":";;;;;;AACA;AAKA,MAAM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J,CAAC,CAAC;AACN,CAAC;AAED,MAAMK,SAAS,GAAG,MACd,IAAAd,kCAAgB,EAAC;EACbC,KAAK,EAAE,MAAM;EACbC,IAAI,EAAE,MAAM;EACZQ,cAAc,EAAE,IAAI;EACpBP,UAAU,EAAE,CACR;IACIC,IAAI,EAAE,UAAU;IAChBC,OAAO,EAAE;EACb,CAAC;AAET,CAAC,CAAC;AAEC,MAAMU,sBAAsB,GAAG,iBAAiB;AAAC;AAMjD,MAAMC,cAAc,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC;AAAC;AAEhF,MAAMC,2BAA2B,GACpCC,MAA0C,IACZ;EAC9B,OAAO;IACHd,IAAI,EAAE,qBAAqB;IAC3Be,OAAO,EAAEJ,sBAAsB;IAC/BK,YAAY,EAAE,OAAO;IACrBC,MAAM,EAAEL,cAAc,CAACM,GAAG,CAACC,KAAK,IAAI,CAACA,KAAK,CAAC,CAAC;IAC5Cd,MAAM,EAAE,CACJV,SAAS,EAAE,EACXO,UAAU,EAAE,EACZC,YAAY,EAAE,EACdC,aAAa,CAAC,CAACI,qBAAqB,EAAE,CAAC,CAAC,EACxCC,SAAS,CAACK,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAET,MAAM,CAAC,EACzBK,SAAS,EAAE,CACd;IACDU,WAAW,EAAE,2BAA2B;IACxCC,SAAS,EAAE;EACf,CAAC;AACL,CAAC;AAAC"}
|
package/record/record.so.js
CHANGED
|
@@ -5,29 +5,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.createSearchRecordOperations = void 0;
|
|
8
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
8
9
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
10
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
10
|
-
var _record = require("./record.model");
|
|
11
|
-
var _createAcoStorageOperations = require("../createAcoStorageOperations");
|
|
12
|
-
var _createListSort = require("../utils/createListSort");
|
|
13
|
-
var _createOperationsWrapper = require("../utils/createOperationsWrapper");
|
|
14
11
|
var _getFieldValues = require("../utils/getFieldValues");
|
|
12
|
+
var _acoRecordId = require("../utils/acoRecordId");
|
|
13
|
+
var _record = require("./record.model");
|
|
14
|
+
const _excluded = ["tags", "data"];
|
|
15
15
|
const createSearchRecordOperations = params => {
|
|
16
16
|
const {
|
|
17
|
-
cms
|
|
17
|
+
cms,
|
|
18
|
+
security
|
|
18
19
|
} = params;
|
|
19
|
-
const {
|
|
20
|
-
withModel
|
|
21
|
-
} = (0, _createOperationsWrapper.createOperationsWrapper)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
22
|
-
modelName: _record.SEARCH_RECORD_MODEL_ID
|
|
23
|
-
}));
|
|
24
20
|
const getRecord = async (model, id) => {
|
|
25
21
|
/**
|
|
26
22
|
* The record "id" has been passed by the original entry.
|
|
27
23
|
* We need to retrieve it via `cms.storageOperations.entries.getLatestByIds()` method and return the first one.
|
|
28
24
|
*/
|
|
29
25
|
const revisions = await cms.storageOperations.entries.getLatestByIds(model, {
|
|
30
|
-
ids: [id]
|
|
26
|
+
ids: [(0, _acoRecordId.attachAcoRecordPrefix)(id)]
|
|
31
27
|
});
|
|
32
28
|
if (revisions.length === 0) {
|
|
33
29
|
throw new _error.default("Record not found.", "NOT_FOUND", {
|
|
@@ -37,51 +33,115 @@ const createSearchRecordOperations = params => {
|
|
|
37
33
|
return revisions[0];
|
|
38
34
|
};
|
|
39
35
|
return {
|
|
40
|
-
async getRecord({
|
|
36
|
+
async getRecord(model, {
|
|
41
37
|
id
|
|
42
38
|
}) {
|
|
43
|
-
return
|
|
39
|
+
return security.withoutAuthorization(async () => {
|
|
44
40
|
const record = await getRecord(model, id);
|
|
45
|
-
return (0, _getFieldValues.
|
|
41
|
+
return (0, _getFieldValues.getRecordFieldValues)(record);
|
|
46
42
|
});
|
|
47
43
|
},
|
|
48
|
-
listRecords(params) {
|
|
49
|
-
return
|
|
44
|
+
listRecords(model, params) {
|
|
45
|
+
return security.withoutAuthorization(async () => {
|
|
50
46
|
const {
|
|
51
47
|
sort,
|
|
52
48
|
where
|
|
53
49
|
} = params;
|
|
54
50
|
const [entries, meta] = await cms.listLatestEntries(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params), {}, {
|
|
55
|
-
sort
|
|
51
|
+
sort,
|
|
56
52
|
where: (0, _objectSpread2.default)({}, where || {})
|
|
57
53
|
}));
|
|
58
|
-
return [entries.map(entry => (0, _getFieldValues.
|
|
54
|
+
return [entries.map(entry => (0, _getFieldValues.getRecordFieldValues)(entry)), meta];
|
|
59
55
|
});
|
|
60
56
|
},
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
listTags(model, params) {
|
|
58
|
+
return security.withoutAuthorization(async () => {
|
|
59
|
+
const {
|
|
60
|
+
where
|
|
61
|
+
} = params;
|
|
62
|
+
const items = await cms.getUniqueFieldValues(model, {
|
|
63
|
+
where: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, where || {}), {}, {
|
|
64
|
+
latest: true
|
|
65
|
+
}),
|
|
66
|
+
fieldId: "tags"
|
|
67
|
+
});
|
|
68
|
+
const meta = {
|
|
69
|
+
hasMoreItems: false,
|
|
70
|
+
totalCount: items.length,
|
|
71
|
+
cursor: null
|
|
72
|
+
};
|
|
73
|
+
const tags = items.map(item => {
|
|
74
|
+
return {
|
|
75
|
+
tag: item.value,
|
|
76
|
+
count: item.count
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
return [tags, meta];
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
createRecord(model, {
|
|
83
|
+
data: SearchRecordData
|
|
63
84
|
}) {
|
|
64
|
-
return
|
|
65
|
-
const
|
|
66
|
-
|
|
85
|
+
return security.withoutAuthorization(async () => {
|
|
86
|
+
const {
|
|
87
|
+
tags = [],
|
|
88
|
+
data = {}
|
|
89
|
+
} = SearchRecordData,
|
|
90
|
+
rest = (0, _objectWithoutProperties2.default)(SearchRecordData, _excluded);
|
|
91
|
+
const entry = await cms.createEntry(model, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
92
|
+
tags,
|
|
93
|
+
data
|
|
94
|
+
}, rest), {}, {
|
|
95
|
+
id: (0, _acoRecordId.attachAcoRecordPrefix)(rest.id)
|
|
96
|
+
}));
|
|
97
|
+
return (0, _getFieldValues.getRecordFieldValues)(entry);
|
|
67
98
|
});
|
|
68
99
|
},
|
|
69
|
-
updateRecord({
|
|
100
|
+
updateRecord(model, {
|
|
70
101
|
id,
|
|
71
102
|
data
|
|
72
103
|
}) {
|
|
73
|
-
return
|
|
74
|
-
const original = await getRecord(model,
|
|
104
|
+
return security.withoutAuthorization(async () => {
|
|
105
|
+
const original = await this.getRecord(model, {
|
|
106
|
+
id
|
|
107
|
+
});
|
|
75
108
|
const input = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, original), data);
|
|
76
|
-
const entry = await cms.updateEntry(model, original.id, input);
|
|
77
|
-
return (0, _getFieldValues.
|
|
109
|
+
const entry = await cms.updateEntry(model, (0, _acoRecordId.attachAcoRecordPrefix)(original.id), input);
|
|
110
|
+
return (0, _getFieldValues.getRecordFieldValues)(entry);
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
moveRecord(model, params) {
|
|
114
|
+
const {
|
|
115
|
+
id,
|
|
116
|
+
folderId
|
|
117
|
+
} = params;
|
|
118
|
+
return security.withoutAuthorization(async () => {
|
|
119
|
+
const original = await this.getRecord(model, {
|
|
120
|
+
id
|
|
121
|
+
});
|
|
122
|
+
const input = {
|
|
123
|
+
wbyAco_location: {
|
|
124
|
+
folderId
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* We only apply the location to the search record model as we do not want to override the users data.
|
|
129
|
+
*/
|
|
130
|
+
const lookFor = `${_record.SEARCH_RECORD_MODEL_ID}-`;
|
|
131
|
+
if (model.modelId.substring(0, lookFor.length) === lookFor) {
|
|
132
|
+
input.location = {
|
|
133
|
+
folderId
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
await cms.updateEntry(model, (0, _acoRecordId.attachAcoRecordPrefix)(original.id), input);
|
|
137
|
+
return true;
|
|
78
138
|
});
|
|
79
139
|
},
|
|
80
|
-
deleteRecord({
|
|
140
|
+
deleteRecord(model, {
|
|
81
141
|
id
|
|
82
142
|
}) {
|
|
83
|
-
return
|
|
84
|
-
await cms.deleteEntry(model, id);
|
|
143
|
+
return security.withoutAuthorization(async () => {
|
|
144
|
+
await cms.deleteEntry(model, (0, _acoRecordId.attachAcoRecordPrefix)(id));
|
|
85
145
|
return true;
|
|
86
146
|
});
|
|
87
147
|
}
|
package/record/record.so.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createSearchRecordOperations","params","cms","
|
|
1
|
+
{"version":3,"names":["createSearchRecordOperations","params","cms","security","getRecord","model","id","revisions","storageOperations","entries","getLatestByIds","ids","attachAcoRecordPrefix","length","WebinyError","withoutAuthorization","record","getRecordFieldValues","listRecords","sort","where","meta","listLatestEntries","map","entry","listTags","items","getUniqueFieldValues","latest","fieldId","hasMoreItems","totalCount","cursor","tags","item","tag","value","count","createRecord","data","SearchRecordData","rest","createEntry","updateRecord","original","input","updateEntry","moveRecord","folderId","wbyAco_location","lookFor","SEARCH_RECORD_MODEL_ID","modelId","substring","location","deleteRecord","deleteEntry"],"sources":["record.so.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CreateAcoStorageOperationsParams } from \"~/createAcoStorageOperations\";\nimport { getRecordFieldValues } from \"~/utils/getFieldValues\";\nimport { AcoSearchRecordStorageOperations } from \"./record.types\";\nimport { CmsModel, UpdateCmsEntryInput } from \"@webiny/api-headless-cms/types\";\nimport { attachAcoRecordPrefix } from \"~/utils/acoRecordId\";\nimport { SEARCH_RECORD_MODEL_ID } from \"~/record/record.model\";\n\nexport const createSearchRecordOperations = (\n params: CreateAcoStorageOperationsParams\n): AcoSearchRecordStorageOperations => {\n const { cms, security } = params;\n\n const getRecord = async (model: CmsModel, id: string) => {\n /**\n * The record \"id\" has been passed by the original entry.\n * We need to retrieve it via `cms.storageOperations.entries.getLatestByIds()` method and return the first one.\n */\n const revisions = await cms.storageOperations.entries.getLatestByIds(model, {\n ids: [attachAcoRecordPrefix(id)]\n });\n\n if (revisions.length === 0) {\n throw new WebinyError(\"Record not found.\", \"NOT_FOUND\", {\n id\n });\n }\n\n return revisions[0];\n };\n\n return {\n async getRecord(model, { id }) {\n return security.withoutAuthorization(async () => {\n const record = await getRecord(model, id);\n return getRecordFieldValues(record);\n });\n },\n listRecords(model, params) {\n return security.withoutAuthorization(async () => {\n const { sort, where } = params;\n\n const [entries, meta] = await cms.listLatestEntries(model, {\n ...params,\n sort,\n where: {\n ...(where || {})\n }\n });\n\n return [entries.map(entry => getRecordFieldValues(entry)), meta];\n });\n },\n listTags(model, params) {\n return security.withoutAuthorization(async () => {\n const { where } = params;\n\n const items = await cms.getUniqueFieldValues(model, {\n where: {\n ...(where || {}),\n latest: true\n },\n fieldId: \"tags\"\n });\n\n const meta = {\n hasMoreItems: false,\n totalCount: items.length,\n cursor: null\n };\n\n const tags = items.map(item => {\n return {\n tag: item.value,\n count: item.count\n };\n });\n\n return [tags, meta];\n });\n },\n createRecord(model, { data: SearchRecordData }) {\n return security.withoutAuthorization(async () => {\n const { tags = [], data = {}, ...rest } = SearchRecordData;\n const entry = await cms.createEntry(model, {\n tags,\n data,\n ...rest,\n id: attachAcoRecordPrefix(rest.id)\n });\n\n return getRecordFieldValues(entry);\n });\n },\n updateRecord(this: AcoSearchRecordStorageOperations, model, { id, data }) {\n return security.withoutAuthorization(async () => {\n const original = await this.getRecord(model, { id });\n\n const input = {\n ...original,\n ...data\n };\n\n const entry = await cms.updateEntry(\n model,\n attachAcoRecordPrefix(original.id),\n input\n );\n\n return getRecordFieldValues(entry);\n });\n },\n moveRecord(this: AcoSearchRecordStorageOperations, model, params) {\n const { id, folderId } = params;\n return security.withoutAuthorization(async () => {\n const original = await this.getRecord(model, { id });\n\n const input: UpdateCmsEntryInput = {\n wbyAco_location: {\n folderId\n }\n };\n /**\n * We only apply the location to the search record model as we do not want to override the users data.\n */\n const lookFor = `${SEARCH_RECORD_MODEL_ID}-`;\n if (model.modelId.substring(0, lookFor.length) === lookFor) {\n input.location = {\n folderId\n };\n }\n\n await cms.updateEntry(model, attachAcoRecordPrefix(original.id), input);\n\n return true;\n });\n },\n deleteRecord(model, { id }) {\n return security.withoutAuthorization(async () => {\n await cms.deleteEntry(model, attachAcoRecordPrefix(id));\n return true;\n });\n }\n };\n};\n"],"mappings":";;;;;;;;;AAAA;AAEA;AAGA;AACA;AAA+D;AAExD,MAAMA,4BAA4B,GACrCC,MAAwC,IACL;EACnC,MAAM;IAAEC,GAAG;IAAEC;EAAS,CAAC,GAAGF,MAAM;EAEhC,MAAMG,SAAS,GAAG,OAAOC,KAAe,EAAEC,EAAU,KAAK;IACrD;AACR;AACA;AACA;IACQ,MAAMC,SAAS,GAAG,MAAML,GAAG,CAACM,iBAAiB,CAACC,OAAO,CAACC,cAAc,CAACL,KAAK,EAAE;MACxEM,GAAG,EAAE,CAAC,IAAAC,kCAAqB,EAACN,EAAE,CAAC;IACnC,CAAC,CAAC;IAEF,IAAIC,SAAS,CAACM,MAAM,KAAK,CAAC,EAAE;MACxB,MAAM,IAAIC,cAAW,CAAC,mBAAmB,EAAE,WAAW,EAAE;QACpDR;MACJ,CAAC,CAAC;IACN;IAEA,OAAOC,SAAS,CAAC,CAAC,CAAC;EACvB,CAAC;EAED,OAAO;IACH,MAAMH,SAAS,CAACC,KAAK,EAAE;MAAEC;IAAG,CAAC,EAAE;MAC3B,OAAOH,QAAQ,CAACY,oBAAoB,CAAC,YAAY;QAC7C,MAAMC,MAAM,GAAG,MAAMZ,SAAS,CAACC,KAAK,E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