@webiny/api-aco 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.a9593f74dd
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 +5 -0
- package/apps/AcoApp.js +56 -21
- package/apps/AcoApp.js.map +1 -1
- package/apps/AcoApps.js +7 -8
- package/apps/AcoApps.js.map +1 -1
- package/apps/app.gql.js +6 -4
- package/apps/app.gql.js.map +1 -1
- package/apps/index.js +3 -1
- package/apps/index.js.map +1 -1
- package/createAcoContext.d.ts +5 -1
- package/createAcoContext.js +119 -25
- package/createAcoContext.js.map +1 -1
- package/createAcoGraphQL.js +6 -2
- package/createAcoGraphQL.js.map +1 -1
- package/createAcoHooks.js +9 -3
- package/createAcoHooks.js.map +1 -1
- package/createAcoModels.js +6 -19
- package/createAcoModels.js.map +1 -1
- package/createAcoStorageOperations.d.ts +0 -1
- package/createAcoStorageOperations.js +10 -7
- package/createAcoStorageOperations.js.map +1 -1
- package/fields/index.js +3 -1
- package/fields/index.js.map +1 -1
- package/fields/location.js +3 -1
- package/fields/location.js.map +1 -1
- package/filter/filter.crud.d.ts +3 -0
- package/filter/filter.crud.js +94 -0
- package/filter/filter.crud.js.map +1 -0
- package/filter/filter.gql.d.ts +3 -0
- package/filter/filter.gql.js +153 -0
- package/filter/filter.gql.js.map +1 -0
- package/filter/filter.model.d.ts +2 -0
- package/filter/filter.model.js +125 -0
- package/filter/filter.model.js.map +1 -0
- package/filter/filter.so.d.ts +3 -0
- package/filter/filter.so.js +98 -0
- package/filter/filter.so.js.map +1 -0
- package/filter/filter.types.d.ts +95 -0
- package/filter/filter.types.js +14 -0
- package/filter/filter.types.js.map +1 -0
- package/folder/folder.crud.d.ts +8 -1
- package/folder/folder.crud.js +194 -15
- package/folder/folder.crud.js.map +1 -1
- package/folder/folder.gql.js +85 -8
- package/folder/folder.gql.js.map +1 -1
- package/folder/folder.model.d.ts +1 -3
- package/folder/folder.model.js +54 -7
- package/folder/folder.model.js.map +1 -1
- package/folder/folder.so.js +38 -18
- package/folder/folder.so.js.map +1 -1
- package/folder/folder.types.d.ts +28 -2
- package/folder/folder.types.js +3 -1
- package/folder/folder.types.js.map +1 -1
- package/folder/onFolderBeforeDeleteAco.hook.d.ts +2 -0
- package/folder/onFolderBeforeDeleteAco.hook.js +67 -0
- package/folder/onFolderBeforeDeleteAco.hook.js.map +1 -0
- package/folder/onFolderBeforeDeleteFm.hook.d.ts +2 -0
- package/folder/onFolderBeforeDeleteFm.hook.js +49 -0
- package/folder/onFolderBeforeDeleteFm.hook.js.map +1 -0
- package/folder/onFolderBeforeDeleteHcms.hook.d.ts +2 -0
- package/folder/onFolderBeforeDeleteHcms.hook.js +56 -0
- package/folder/onFolderBeforeDeleteHcms.hook.js.map +1 -0
- package/index.d.ts +5 -1
- package/index.js +14 -4
- package/index.js.map +1 -1
- package/package.json +31 -27
- package/plugins/AcoAppModifierPlugin.js +4 -5
- package/plugins/AcoAppModifierPlugin.js.map +1 -1
- package/plugins/AcoAppRegisterPlugin.js +4 -5
- package/plugins/AcoAppRegisterPlugin.js.map +1 -1
- package/plugins/index.js +3 -1
- package/plugins/index.js.map +1 -1
- package/record/graphql/createAppResolvers.js +26 -19
- package/record/graphql/createAppResolvers.js.map +1 -1
- package/record/graphql/createAppSchema.js +10 -5
- package/record/graphql/createAppSchema.js.map +1 -1
- package/record/record.crud.js +3 -1
- package/record/record.crud.js.map +1 -1
- package/record/record.gql.js +3 -1
- package/record/record.gql.js.map +1 -1
- package/record/record.model.d.ts +1 -3
- package/record/record.model.js +7 -7
- package/record/record.model.js.map +1 -1
- package/record/record.so.js +35 -23
- package/record/record.so.js.map +1 -1
- package/record/record.types.d.ts +4 -3
- package/record/record.types.js +3 -1
- package/record/record.types.js.map +1 -1
- package/types.d.ts +23 -6
- package/types.js +25 -4
- package/types.js.map +1 -1
- package/utils/FolderLevelPermissions.d.ts +71 -0
- package/utils/FolderLevelPermissions.js +353 -0
- package/utils/FolderLevelPermissions.js.map +1 -0
- package/utils/acoRecordId.js +3 -1
- package/utils/acoRecordId.js.map +1 -1
- package/utils/createListSort.js +3 -1
- package/utils/createListSort.js.map +1 -1
- package/utils/createModelField.js +3 -1
- package/utils/createModelField.js.map +1 -1
- package/utils/createOperationsWrapper.js +3 -1
- package/utils/createOperationsWrapper.js.map +1 -1
- package/utils/decorators/CmsEntriesCrudDecorators.d.ts +11 -0
- package/utils/decorators/CmsEntriesCrudDecorators.js +232 -0
- package/utils/decorators/CmsEntriesCrudDecorators.js.map +1 -0
- package/utils/decorators/constants.d.ts +1 -0
- package/utils/decorators/constants.js +10 -0
- package/utils/decorators/constants.js.map +1 -0
- package/utils/decorators/where.d.ts +14 -0
- package/utils/decorators/where.js +52 -0
- package/utils/decorators/where.js.map +1 -0
- package/utils/ensureAuthentication.d.ts +2 -0
- package/utils/{checkPermissions.js → ensureAuthentication.js} +5 -3
- package/utils/ensureAuthentication.js.map +1 -0
- package/utils/getFolderAndItsAncestors.d.ts +2 -2
- package/utils/getFolderAndItsAncestors.js +16 -11
- package/utils/getFolderAndItsAncestors.js.map +1 -1
- package/utils/isInstallationPending.js +3 -1
- package/utils/isInstallationPending.js.map +1 -1
- package/utils/modelFactory.d.ts +1 -3
- package/utils/modelFactory.js +7 -10
- package/utils/modelFactory.js.map +1 -1
- package/utils/pickEntryFieldValues.d.ts +3 -0
- package/utils/pickEntryFieldValues.js +31 -0
- package/utils/pickEntryFieldValues.js.map +1 -0
- package/utils/resolve.js +3 -1
- package/utils/resolve.js.map +1 -1
- package/folder/onFolderBeforeDelete.hook.d.ts +0 -2
- package/folder/onFolderBeforeDelete.hook.js +0 -66
- package/folder/onFolderBeforeDelete.hook.js.map +0 -1
- package/utils/checkPermissions.d.ts +0 -2
- package/utils/checkPermissions.js.map +0 -1
- package/utils/fieldResolver.d.ts +0 -16
- package/utils/fieldResolver.js +0 -44
- package/utils/fieldResolver.js.map +0 -1
- package/utils/getFieldValues.d.ts +0 -5
- package/utils/getFieldValues.js +0 -16
- package/utils/getFieldValues.js.map +0 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.onFolderBeforeDeleteAcoHook = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
const throwDeleteError = folder => {
|
|
10
|
+
throw new _error.default("Delete all child folders and entries before proceeding.", "DELETE_FOLDER_WITH_CHILDREN", {
|
|
11
|
+
folder
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
const onFolderBeforeDeleteAcoHook = ({
|
|
15
|
+
aco
|
|
16
|
+
}) => {
|
|
17
|
+
aco.folder.onFolderBeforeDelete.subscribe(async ({
|
|
18
|
+
folder
|
|
19
|
+
}) => {
|
|
20
|
+
try {
|
|
21
|
+
const {
|
|
22
|
+
id,
|
|
23
|
+
type
|
|
24
|
+
} = folder;
|
|
25
|
+
/**
|
|
26
|
+
* First we check for the child folders.
|
|
27
|
+
*/
|
|
28
|
+
const [children] = await aco.folder.list({
|
|
29
|
+
where: {
|
|
30
|
+
type,
|
|
31
|
+
parentId: id
|
|
32
|
+
},
|
|
33
|
+
limit: 1
|
|
34
|
+
});
|
|
35
|
+
if (children.length > 0) {
|
|
36
|
+
throwDeleteError(folder);
|
|
37
|
+
}
|
|
38
|
+
let app = undefined;
|
|
39
|
+
try {
|
|
40
|
+
app = aco.getApp(type);
|
|
41
|
+
} catch {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const [records] = await app.search.list({
|
|
45
|
+
where: {
|
|
46
|
+
type,
|
|
47
|
+
location: {
|
|
48
|
+
folderId: id
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
limit: 1
|
|
52
|
+
});
|
|
53
|
+
if (records.length === 0) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
throwDeleteError(folder);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
throw _error.default.from(error, {
|
|
59
|
+
message: "Error while executing onFolderBeforeDeleteAcoHook hook.",
|
|
60
|
+
code: "ACO_BEFORE_FOLDER_DELETE_ACO_HOOK"
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
exports.onFolderBeforeDeleteAcoHook = onFolderBeforeDeleteAcoHook;
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=onFolderBeforeDeleteAco.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","throwDeleteError","folder","WebinyError","onFolderBeforeDeleteAcoHook","aco","onFolderBeforeDelete","subscribe","id","type","children","list","where","parentId","limit","length","app","undefined","getApp","records","search","location","folderId","error","from","message","code","exports"],"sources":["onFolderBeforeDeleteAco.hook.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { AcoContext, Folder, IAcoApp } from \"~/types\";\n\nconst throwDeleteError = (folder: Folder) => {\n throw new WebinyError(\n \"Delete all child folders and entries before proceeding.\",\n \"DELETE_FOLDER_WITH_CHILDREN\",\n {\n folder\n }\n );\n};\n\nexport const onFolderBeforeDeleteAcoHook = ({ aco }: AcoContext) => {\n aco.folder.onFolderBeforeDelete.subscribe(async ({ folder }) => {\n try {\n const { id, type } = folder;\n /**\n * First we check for the child folders.\n */\n const [children] = await aco.folder.list({\n where: {\n type,\n parentId: id\n },\n limit: 1\n });\n\n if (children.length > 0) {\n throwDeleteError(folder);\n }\n\n let app: IAcoApp | undefined = undefined;\n try {\n app = aco.getApp(type);\n } catch {\n return;\n }\n const [records] = await app.search.list({\n where: {\n type,\n location: {\n folderId: id\n }\n },\n limit: 1\n });\n if (records.length === 0) {\n return;\n }\n throwDeleteError(folder);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onFolderBeforeDeleteAcoHook hook.\",\n code: \"ACO_BEFORE_FOLDER_DELETE_ACO_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,MAAMC,gBAAgB,GAAIC,MAAc,IAAK;EACzC,MAAM,IAAIC,cAAW,CACjB,yDAAyD,EACzD,6BAA6B,EAC7B;IACID;EACJ,CACJ,CAAC;AACL,CAAC;AAEM,MAAME,2BAA2B,GAAGA,CAAC;EAAEC;AAAgB,CAAC,KAAK;EAChEA,GAAG,CAACH,MAAM,CAACI,oBAAoB,CAACC,SAAS,CAAC,OAAO;IAAEL;EAAO,CAAC,KAAK;IAC5D,IAAI;MACA,MAAM;QAAEM,EAAE;QAAEC;MAAK,CAAC,GAAGP,MAAM;MAC3B;AACZ;AACA;MACY,MAAM,CAACQ,QAAQ,CAAC,GAAG,MAAML,GAAG,CAACH,MAAM,CAACS,IAAI,CAAC;QACrCC,KAAK,EAAE;UACHH,IAAI;UACJI,QAAQ,EAAEL;QACd,CAAC;QACDM,KAAK,EAAE;MACX,CAAC,CAAC;MAEF,IAAIJ,QAAQ,CAACK,MAAM,GAAG,CAAC,EAAE;QACrBd,gBAAgB,CAACC,MAAM,CAAC;MAC5B;MAEA,IAAIc,GAAwB,GAAGC,SAAS;MACxC,IAAI;QACAD,GAAG,GAAGX,GAAG,CAACa,MAAM,CAACT,IAAI,CAAC;MAC1B,CAAC,CAAC,MAAM;QACJ;MACJ;MACA,MAAM,CAACU,OAAO,CAAC,GAAG,MAAMH,GAAG,CAACI,MAAM,CAACT,IAAI,CAAC;QACpCC,KAAK,EAAE;UACHH,IAAI;UACJY,QAAQ,EAAE;YACNC,QAAQ,EAAEd;UACd;QACJ,CAAC;QACDM,KAAK,EAAE;MACX,CAAC,CAAC;MACF,IAAIK,OAAO,CAACJ,MAAM,KAAK,CAAC,EAAE;QACtB;MACJ;MACAd,gBAAgB,CAACC,MAAM,CAAC;IAC5B,CAAC,CAAC,OAAOqB,KAAK,EAAE;MACZ,MAAMpB,cAAW,CAACqB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,yDAAyD;QAClEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAvB,2BAAA,GAAAA,2BAAA"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.onFolderBeforeDeleteFmHook = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
const onFolderBeforeDeleteFmHook = context => {
|
|
10
|
+
context.aco.folder.onFolderBeforeDelete.subscribe(async ({
|
|
11
|
+
folder
|
|
12
|
+
}) => {
|
|
13
|
+
try {
|
|
14
|
+
const {
|
|
15
|
+
id,
|
|
16
|
+
type
|
|
17
|
+
} = folder;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Exit if the folder type is not related to File Manager
|
|
21
|
+
*/
|
|
22
|
+
if (type !== "FmFile") {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const [files] = await context.fileManager.listFiles({
|
|
26
|
+
where: {
|
|
27
|
+
location: {
|
|
28
|
+
folderId: id
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
limit: 1
|
|
32
|
+
});
|
|
33
|
+
if (files.length === 0) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
throw new _error.default("Delete all child folders and files before proceeding.", "DELETE_FOLDER_WITH_CHILDREN", {
|
|
37
|
+
folder
|
|
38
|
+
});
|
|
39
|
+
} catch (error) {
|
|
40
|
+
throw _error.default.from(error, {
|
|
41
|
+
message: "Error while executing onFolderBeforeDeleteFmHook hook.",
|
|
42
|
+
code: "ACO_BEFORE_FOLDER_DELETE_FILE_HOOK"
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
exports.onFolderBeforeDeleteFmHook = onFolderBeforeDeleteFmHook;
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=onFolderBeforeDeleteFm.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","onFolderBeforeDeleteFmHook","context","aco","folder","onFolderBeforeDelete","subscribe","id","type","files","fileManager","listFiles","where","location","folderId","limit","length","WebinyError","error","from","message","code","exports"],"sources":["onFolderBeforeDeleteFm.hook.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { AcoContext } from \"~/types\";\n\nexport const onFolderBeforeDeleteFmHook = (context: AcoContext) => {\n context.aco.folder.onFolderBeforeDelete.subscribe(async ({ folder }) => {\n try {\n const { id, type } = folder;\n\n /**\n * Exit if the folder type is not related to File Manager\n */\n if (type !== \"FmFile\") {\n return;\n }\n\n const [files] = await context.fileManager.listFiles({\n where: {\n location: {\n folderId: id\n }\n },\n limit: 1\n });\n\n if (files.length === 0) {\n return;\n }\n\n throw new WebinyError(\n \"Delete all child folders and files before proceeding.\",\n \"DELETE_FOLDER_WITH_CHILDREN\",\n {\n folder\n }\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onFolderBeforeDeleteFmHook hook.\",\n code: \"ACO_BEFORE_FOLDER_DELETE_FILE_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGO,MAAMC,0BAA0B,GAAIC,OAAmB,IAAK;EAC/DA,OAAO,CAACC,GAAG,CAACC,MAAM,CAACC,oBAAoB,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAO,CAAC,KAAK;IACpE,IAAI;MACA,MAAM;QAAEG,EAAE;QAAEC;MAAK,CAAC,GAAGJ,MAAM;;MAE3B;AACZ;AACA;MACY,IAAII,IAAI,KAAK,QAAQ,EAAE;QACnB;MACJ;MAEA,MAAM,CAACC,KAAK,CAAC,GAAG,MAAMP,OAAO,CAACQ,WAAW,CAACC,SAAS,CAAC;QAChDC,KAAK,EAAE;UACHC,QAAQ,EAAE;YACNC,QAAQ,EAAEP;UACd;QACJ,CAAC;QACDQ,KAAK,EAAE;MACX,CAAC,CAAC;MAEF,IAAIN,KAAK,CAACO,MAAM,KAAK,CAAC,EAAE;QACpB;MACJ;MAEA,MAAM,IAAIC,cAAW,CACjB,uDAAuD,EACvD,6BAA6B,EAC7B;QACIb;MACJ,CACJ,CAAC;IACL,CAAC,CAAC,OAAOc,KAAK,EAAE;MACZ,MAAMD,cAAW,CAACE,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAArB,0BAAA,GAAAA,0BAAA"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.onFolderBeforeDeleteHcmsHook = void 0;
|
|
8
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
+
const onFolderBeforeDeleteHcmsHook = context => {
|
|
10
|
+
context.aco.folder.onFolderBeforeDelete.subscribe(async ({
|
|
11
|
+
folder
|
|
12
|
+
}) => {
|
|
13
|
+
try {
|
|
14
|
+
const {
|
|
15
|
+
id,
|
|
16
|
+
type
|
|
17
|
+
} = folder;
|
|
18
|
+
const modelId = type.split(":")[1];
|
|
19
|
+
if (!modelId) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
let model = null;
|
|
23
|
+
try {
|
|
24
|
+
model = await context.cms.getModel(modelId);
|
|
25
|
+
if (!model) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
} catch {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const [entries] = await context.cms.listEntries(model, {
|
|
32
|
+
where: {
|
|
33
|
+
latest: true,
|
|
34
|
+
wbyAco_location: {
|
|
35
|
+
folderId: id
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
limit: 1
|
|
39
|
+
});
|
|
40
|
+
if (entries.length === 0) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
throw new _error.default("Delete all child folders and entries before proceeding.", "DELETE_FOLDER_WITH_CHILDREN", {
|
|
44
|
+
folder
|
|
45
|
+
});
|
|
46
|
+
} catch (error) {
|
|
47
|
+
throw _error.default.from(error, {
|
|
48
|
+
message: "Error while executing onFolderBeforeDeleteHcmsHook hook.",
|
|
49
|
+
code: "ACO_BEFORE_FOLDER_DELETE_HCMS_HOOK"
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
exports.onFolderBeforeDeleteHcmsHook = onFolderBeforeDeleteHcmsHook;
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=onFolderBeforeDeleteHcms.hook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","onFolderBeforeDeleteHcmsHook","context","aco","folder","onFolderBeforeDelete","subscribe","id","type","modelId","split","model","cms","getModel","entries","listEntries","where","latest","wbyAco_location","folderId","limit","length","WebinyError","error","from","message","code","exports"],"sources":["onFolderBeforeDeleteHcms.hook.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { AcoContext } from \"~/types\";\n\nexport const onFolderBeforeDeleteHcmsHook = (context: AcoContext) => {\n context.aco.folder.onFolderBeforeDelete.subscribe(async ({ folder }) => {\n try {\n const { id, type } = folder;\n\n const modelId = type.split(\":\")[1];\n\n if (!modelId) {\n return;\n }\n\n let model: CmsModel | null = null;\n try {\n model = await context.cms.getModel(modelId);\n\n if (!model) {\n return;\n }\n } catch {\n return;\n }\n\n const [entries] = await context.cms.listEntries(model, {\n where: {\n latest: true,\n wbyAco_location: {\n folderId: id\n }\n },\n limit: 1\n });\n\n if (entries.length === 0) {\n return;\n }\n\n throw new WebinyError(\n \"Delete all child folders and entries before proceeding.\",\n \"DELETE_FOLDER_WITH_CHILDREN\",\n {\n folder\n }\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing onFolderBeforeDeleteHcmsHook hook.\",\n code: \"ACO_BEFORE_FOLDER_DELETE_HCMS_HOOK\"\n });\n }\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAIO,MAAMC,4BAA4B,GAAIC,OAAmB,IAAK;EACjEA,OAAO,CAACC,GAAG,CAACC,MAAM,CAACC,oBAAoB,CAACC,SAAS,CAAC,OAAO;IAAEF;EAAO,CAAC,KAAK;IACpE,IAAI;MACA,MAAM;QAAEG,EAAE;QAAEC;MAAK,CAAC,GAAGJ,MAAM;MAE3B,MAAMK,OAAO,GAAGD,IAAI,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;MAElC,IAAI,CAACD,OAAO,EAAE;QACV;MACJ;MAEA,IAAIE,KAAsB,GAAG,IAAI;MACjC,IAAI;QACAA,KAAK,GAAG,MAAMT,OAAO,CAACU,GAAG,CAACC,QAAQ,CAACJ,OAAO,CAAC;QAE3C,IAAI,CAACE,KAAK,EAAE;UACR;QACJ;MACJ,CAAC,CAAC,MAAM;QACJ;MACJ;MAEA,MAAM,CAACG,OAAO,CAAC,GAAG,MAAMZ,OAAO,CAACU,GAAG,CAACG,WAAW,CAACJ,KAAK,EAAE;QACnDK,KAAK,EAAE;UACHC,MAAM,EAAE,IAAI;UACZC,eAAe,EAAE;YACbC,QAAQ,EAAEZ;UACd;QACJ,CAAC;QACDa,KAAK,EAAE;MACX,CAAC,CAAC;MAEF,IAAIN,OAAO,CAACO,MAAM,KAAK,CAAC,EAAE;QACtB;MACJ;MAEA,MAAM,IAAIC,cAAW,CACjB,yDAAyD,EACzD,6BAA6B,EAC7B;QACIlB;MACJ,CACJ,CAAC;IACL,CAAC,CAAC,OAAOmB,KAAK,EAAE;MACZ,MAAMD,cAAW,CAACE,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,0DAA0D;QACnEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAA1B,4BAAA,GAAAA,4BAAA"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export { SEARCH_RECORD_MODEL_ID } from "./record/record.model";
|
|
2
2
|
export { FOLDER_MODEL_ID } from "./folder/folder.model";
|
|
3
|
+
export { FILTER_MODEL_ID } from "./filter/filter.model";
|
|
3
4
|
export * from "./apps";
|
|
4
5
|
export * from "./plugins";
|
|
5
|
-
export
|
|
6
|
+
export interface CreateAcoParams {
|
|
7
|
+
useFolderLevelPermissions?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const createAco: (params?: CreateAcoParams) => (import("@webiny/api-headless-cms/types").CmsModelFieldToGraphQLPlugin<import("@webiny/api-headless-cms/types").CmsModelField> | import("@webiny/api").ContextPlugin<import("./types").AcoContext> | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("./types").AcoContext>)[];
|
package/index.js
CHANGED
|
@@ -6,8 +6,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
createAco: true,
|
|
8
8
|
SEARCH_RECORD_MODEL_ID: true,
|
|
9
|
-
FOLDER_MODEL_ID: true
|
|
9
|
+
FOLDER_MODEL_ID: true,
|
|
10
|
+
FILTER_MODEL_ID: true
|
|
10
11
|
};
|
|
12
|
+
Object.defineProperty(exports, "FILTER_MODEL_ID", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _filter.FILTER_MODEL_ID;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
11
18
|
Object.defineProperty(exports, "FOLDER_MODEL_ID", {
|
|
12
19
|
enumerable: true,
|
|
13
20
|
get: function () {
|
|
@@ -26,6 +33,7 @@ var _createAcoGraphQL = require("./createAcoGraphQL");
|
|
|
26
33
|
var _fields = require("./fields");
|
|
27
34
|
var _record = require("./record/record.model");
|
|
28
35
|
var _folder = require("./folder/folder.model");
|
|
36
|
+
var _filter = require("./filter/filter.model");
|
|
29
37
|
var _apps = require("./apps");
|
|
30
38
|
Object.keys(_apps).forEach(function (key) {
|
|
31
39
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -50,7 +58,9 @@ Object.keys(_plugins).forEach(function (key) {
|
|
|
50
58
|
}
|
|
51
59
|
});
|
|
52
60
|
});
|
|
53
|
-
const createAco = () => {
|
|
54
|
-
return [...(0, _fields.createFields)(), (0, _createAcoContext.createAcoContext)(), ...(0, _createAcoGraphQL.createAcoGraphQL)()];
|
|
61
|
+
const createAco = (params = {}) => {
|
|
62
|
+
return [...(0, _fields.createFields)(), (0, _createAcoContext.createAcoContext)(params), ...(0, _createAcoGraphQL.createAcoGraphQL)()];
|
|
55
63
|
};
|
|
56
|
-
exports.createAco = createAco;
|
|
64
|
+
exports.createAco = createAco;
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createAco","createFields","createAcoContext","createAcoGraphQL"],"sources":["index.ts"],"sourcesContent":["import { createAcoContext } from \"~/createAcoContext\";\nimport { createAcoGraphQL } from \"~/createAcoGraphQL\";\nimport { createFields } from \"~/fields\";\n\nexport { SEARCH_RECORD_MODEL_ID } from \"./record/record.model\";\nexport { FOLDER_MODEL_ID } from \"./folder/folder.model\";\nexport * from \"./apps\";\nexport * from \"./plugins\";\n\nexport const createAco = () => {\n return [...createFields(), createAcoContext(), ...createAcoGraphQL()];\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_createAcoContext","require","_createAcoGraphQL","_fields","_record","_folder","_filter","_apps","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_plugins","createAco","params","createFields","createAcoContext","createAcoGraphQL"],"sources":["index.ts"],"sourcesContent":["import { createAcoContext } from \"~/createAcoContext\";\nimport { createAcoGraphQL } from \"~/createAcoGraphQL\";\nimport { createFields } from \"~/fields\";\n\nexport { SEARCH_RECORD_MODEL_ID } from \"./record/record.model\";\nexport { FOLDER_MODEL_ID } from \"./folder/folder.model\";\nexport { FILTER_MODEL_ID } from \"./filter/filter.model\";\nexport * from \"./apps\";\nexport * from \"./plugins\";\n\nexport interface CreateAcoParams {\n useFolderLevelPermissions?: boolean;\n}\n\nexport const createAco = (params: CreateAcoParams = {}) => {\n return [...createFields(), createAcoContext(params), ...createAcoGraphQL()];\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAF,KAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,KAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,KAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AACA,IAAAS,QAAA,GAAAnB,OAAA;AAAAO,MAAA,CAAAC,IAAA,CAAAW,QAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,QAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,QAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AAMO,MAAMU,SAAS,GAAGA,CAACC,MAAuB,GAAG,CAAC,CAAC,KAAK;EACvD,OAAO,CAAC,GAAG,IAAAC,oBAAY,EAAC,CAAC,EAAE,IAAAC,kCAAgB,EAACF,MAAM,CAAC,EAAE,GAAG,IAAAG,kCAAgB,EAAC,CAAC,CAAC;AAC/E,CAAC;AAACT,OAAA,CAAAK,SAAA,GAAAA,SAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-aco",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.a9593f74dd",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"aco:base"
|
|
@@ -22,39 +22,43 @@
|
|
|
22
22
|
"directory": "dist"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@
|
|
26
|
-
"@webiny/api": "0.0.0-unstable.
|
|
27
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
28
|
-
"@webiny/api-i18n": "0.0.0-unstable.
|
|
29
|
-
"@webiny/api-security": "0.0.0-unstable.
|
|
30
|
-
"@webiny/api-tenancy": "0.0.0-unstable.
|
|
31
|
-
"@webiny/error": "0.0.0-unstable.
|
|
32
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
33
|
-
"@webiny/handler-graphql": "0.0.0-unstable.
|
|
34
|
-
"@webiny/pubsub": "0.0.0-unstable.
|
|
35
|
-
"@webiny/utils": "0.0.0-unstable.
|
|
25
|
+
"@webiny/api": "0.0.0-unstable.a9593f74dd",
|
|
26
|
+
"@webiny/api-authentication": "0.0.0-unstable.a9593f74dd",
|
|
27
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.a9593f74dd",
|
|
28
|
+
"@webiny/api-i18n": "0.0.0-unstable.a9593f74dd",
|
|
29
|
+
"@webiny/api-security": "0.0.0-unstable.a9593f74dd",
|
|
30
|
+
"@webiny/api-tenancy": "0.0.0-unstable.a9593f74dd",
|
|
31
|
+
"@webiny/error": "0.0.0-unstable.a9593f74dd",
|
|
32
|
+
"@webiny/handler": "0.0.0-unstable.a9593f74dd",
|
|
33
|
+
"@webiny/handler-graphql": "0.0.0-unstable.a9593f74dd",
|
|
34
|
+
"@webiny/pubsub": "0.0.0-unstable.a9593f74dd",
|
|
35
|
+
"@webiny/utils": "0.0.0-unstable.a9593f74dd",
|
|
36
|
+
"@webiny/validation": "0.0.0-unstable.a9593f74dd",
|
|
36
37
|
"lodash": "4.17.21"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@babel/cli": "7.
|
|
40
|
-
"@babel/core": "7.
|
|
41
|
-
"@babel/preset-env": "7.
|
|
42
|
-
"@babel/preset-typescript": "7.
|
|
43
|
-
"@babel/runtime": "7.
|
|
40
|
+
"@babel/cli": "7.22.6",
|
|
41
|
+
"@babel/core": "7.22.8",
|
|
42
|
+
"@babel/preset-env": "7.22.7",
|
|
43
|
+
"@babel/preset-typescript": "7.22.5",
|
|
44
|
+
"@babel/runtime": "7.22.6",
|
|
44
45
|
"@types/ungap__structured-clone": "0.3.0",
|
|
45
|
-
"@webiny/api-
|
|
46
|
-
"@webiny/api-
|
|
47
|
-
"@webiny/api-
|
|
48
|
-
"@webiny/api-
|
|
49
|
-
"@webiny/
|
|
50
|
-
"@webiny/
|
|
51
|
-
"@webiny/
|
|
52
|
-
"@webiny/
|
|
53
|
-
"
|
|
46
|
+
"@webiny/api-admin-users": "0.0.0-unstable.a9593f74dd",
|
|
47
|
+
"@webiny/api-file-manager": "0.0.0-unstable.a9593f74dd",
|
|
48
|
+
"@webiny/api-i18n-ddb": "0.0.0-unstable.a9593f74dd",
|
|
49
|
+
"@webiny/api-security-so-ddb": "0.0.0-unstable.a9593f74dd",
|
|
50
|
+
"@webiny/api-tenancy-so-ddb": "0.0.0-unstable.a9593f74dd",
|
|
51
|
+
"@webiny/api-wcp": "0.0.0-unstable.a9593f74dd",
|
|
52
|
+
"@webiny/cli": "0.0.0-unstable.a9593f74dd",
|
|
53
|
+
"@webiny/handler-aws": "0.0.0-unstable.a9593f74dd",
|
|
54
|
+
"@webiny/plugins": "0.0.0-unstable.a9593f74dd",
|
|
55
|
+
"@webiny/project-utils": "0.0.0-unstable.a9593f74dd",
|
|
56
|
+
"@webiny/wcp": "0.0.0-unstable.a9593f74dd",
|
|
57
|
+
"graphql": "15.8.0",
|
|
54
58
|
"prettier": "2.8.8",
|
|
55
59
|
"rimraf": "3.0.2",
|
|
56
60
|
"ttypescript": "1.5.15",
|
|
57
61
|
"typescript": "4.7.4"
|
|
58
62
|
},
|
|
59
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "a9593f74ddf9ce93263eadb0ddc0807ed343f5ee"
|
|
60
64
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createAcoAppModifier = exports.AcoAppModifierPlugin = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _plugins = require("@webiny/plugins");
|
|
10
8
|
const createModifier = ({
|
|
11
9
|
app,
|
|
@@ -26,9 +24,9 @@ const createModifier = ({
|
|
|
26
24
|
};
|
|
27
25
|
};
|
|
28
26
|
class AcoAppModifierPlugin extends _plugins.Plugin {
|
|
27
|
+
static type = "aco.app.modifier";
|
|
29
28
|
constructor(params) {
|
|
30
29
|
super();
|
|
31
|
-
(0, _defineProperty2.default)(this, "params", void 0);
|
|
32
30
|
this.params = params;
|
|
33
31
|
}
|
|
34
32
|
static create(params) {
|
|
@@ -49,11 +47,12 @@ class AcoAppModifierPlugin extends _plugins.Plugin {
|
|
|
49
47
|
}
|
|
50
48
|
}
|
|
51
49
|
exports.AcoAppModifierPlugin = AcoAppModifierPlugin;
|
|
52
|
-
(0, _defineProperty2.default)(AcoAppModifierPlugin, "type", "aco.app.modifier");
|
|
53
50
|
const createAcoAppModifier = (name, cb) => {
|
|
54
51
|
return AcoAppModifierPlugin.create({
|
|
55
52
|
name,
|
|
56
53
|
cb
|
|
57
54
|
});
|
|
58
55
|
};
|
|
59
|
-
exports.createAcoAppModifier = createAcoAppModifier;
|
|
56
|
+
exports.createAcoAppModifier = createAcoAppModifier;
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=AcoAppModifierPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createModifier","app","context","addField","field","removeField","id","modifyField","cb","AcoAppModifierPlugin","Plugin","constructor","params","create","canUse","name","modify","createAcoAppModifier"],"sources":["AcoAppModifierPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n AcoContext,\n IAcoApp,\n IAcoAppAddFieldCallable,\n IAcoAppModifyFieldCallable,\n IAcoAppRemoveFieldCallable\n} from \"~/types\";\nimport { Context } from \"@webiny/handler/types\";\n\nexport interface AcoAppModifierPluginModifyParams<T extends Context = AcoContext> {\n app: IAcoApp;\n context: T;\n}\n\nexport interface AcoAppModifierPluginParamsCallable<T extends Context = AcoContext> {\n (params: AppModifier<T>): Promise<void> | void;\n}\n\nexport interface AcoAppModifierPluginParams<T extends Context = AcoContext> {\n name: string;\n cb: AcoAppModifierPluginParamsCallable<T>;\n}\n\nexport interface AppModifier<T extends Context = AcoContext> {\n /**\n * We can access the app if really required.\n * @internal\n */\n app: IAcoApp;\n /**\n * We can access the context if really required.\n * @internal\n */\n context: T;\n addField: IAcoAppAddFieldCallable;\n removeField: IAcoAppRemoveFieldCallable;\n modifyField: IAcoAppModifyFieldCallable;\n}\n\nexport interface AppModifierParams<T extends Context = AcoContext> {\n app: IAcoApp;\n context: T;\n}\n\nconst createModifier = <T extends Context>({\n app,\n context\n}: AppModifierParams<T>): AppModifier<T> => {\n return {\n app,\n context,\n addField: field => {\n app.addField(field);\n },\n removeField: id => {\n app.removeField(id);\n },\n modifyField: (id, cb) => {\n app.modifyField(id, cb);\n }\n };\n};\n\nexport class AcoAppModifierPlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"aco.app.modifier\";\n\n private readonly params: AcoAppModifierPluginParams<T>;\n\n private constructor(params: AcoAppModifierPluginParams<T>) {\n super();\n this.params = params;\n }\n\n public static create<C extends Context = AcoContext>(params: AcoAppModifierPluginParams<C>) {\n return new AcoAppModifierPlugin<C>(params);\n }\n\n public canUse(app: IAcoApp): boolean {\n return app.name === this.params.name;\n }\n\n public async modify(params: AcoAppModifierPluginModifyParams<T>): Promise<void> {\n const { app, context } = params;\n return this.params.cb(\n createModifier<T>({\n app,\n context\n })\n );\n }\n}\n\nexport type CreateAcoAppModifierCallable<T extends Context = AcoContext> =\n AcoAppModifierPluginParamsCallable<T>;\n\nexport const createAcoAppModifier = <T extends Context = AcoContext>(\n name: string,\n cb: CreateAcoAppModifierCallable<T>\n) => {\n return AcoAppModifierPlugin.create<T>({\n name,\n cb\n });\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_plugins","require","createModifier","app","context","addField","field","removeField","id","modifyField","cb","AcoAppModifierPlugin","Plugin","type","constructor","params","create","canUse","name","modify","exports","createAcoAppModifier"],"sources":["AcoAppModifierPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport {\n AcoContext,\n IAcoApp,\n IAcoAppAddFieldCallable,\n IAcoAppModifyFieldCallable,\n IAcoAppRemoveFieldCallable\n} from \"~/types\";\nimport { Context } from \"@webiny/handler/types\";\n\nexport interface AcoAppModifierPluginModifyParams<T extends Context = AcoContext> {\n app: IAcoApp;\n context: T;\n}\n\nexport interface AcoAppModifierPluginParamsCallable<T extends Context = AcoContext> {\n (params: AppModifier<T>): Promise<void> | void;\n}\n\nexport interface AcoAppModifierPluginParams<T extends Context = AcoContext> {\n name: string;\n cb: AcoAppModifierPluginParamsCallable<T>;\n}\n\nexport interface AppModifier<T extends Context = AcoContext> {\n /**\n * We can access the app if really required.\n * @internal\n */\n app: IAcoApp;\n /**\n * We can access the context if really required.\n * @internal\n */\n context: T;\n addField: IAcoAppAddFieldCallable;\n removeField: IAcoAppRemoveFieldCallable;\n modifyField: IAcoAppModifyFieldCallable;\n}\n\nexport interface AppModifierParams<T extends Context = AcoContext> {\n app: IAcoApp;\n context: T;\n}\n\nconst createModifier = <T extends Context>({\n app,\n context\n}: AppModifierParams<T>): AppModifier<T> => {\n return {\n app,\n context,\n addField: field => {\n app.addField(field);\n },\n removeField: id => {\n app.removeField(id);\n },\n modifyField: (id, cb) => {\n app.modifyField(id, cb);\n }\n };\n};\n\nexport class AcoAppModifierPlugin<T extends Context = Context> extends Plugin {\n public static override readonly type: string = \"aco.app.modifier\";\n\n private readonly params: AcoAppModifierPluginParams<T>;\n\n private constructor(params: AcoAppModifierPluginParams<T>) {\n super();\n this.params = params;\n }\n\n public static create<C extends Context = AcoContext>(params: AcoAppModifierPluginParams<C>) {\n return new AcoAppModifierPlugin<C>(params);\n }\n\n public canUse(app: IAcoApp): boolean {\n return app.name === this.params.name;\n }\n\n public async modify(params: AcoAppModifierPluginModifyParams<T>): Promise<void> {\n const { app, context } = params;\n return this.params.cb(\n createModifier<T>({\n app,\n context\n })\n );\n }\n}\n\nexport type CreateAcoAppModifierCallable<T extends Context = AcoContext> =\n AcoAppModifierPluginParamsCallable<T>;\n\nexport const createAcoAppModifier = <T extends Context = AcoContext>(\n name: string,\n cb: CreateAcoAppModifierCallable<T>\n) => {\n return AcoAppModifierPlugin.create<T>({\n name,\n cb\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AA6CA,MAAMC,cAAc,GAAGA,CAAoB;EACvCC,GAAG;EACHC;AACkB,CAAC,KAAqB;EACxC,OAAO;IACHD,GAAG;IACHC,OAAO;IACPC,QAAQ,EAAEC,KAAK,IAAI;MACfH,GAAG,CAACE,QAAQ,CAACC,KAAK,CAAC;IACvB,CAAC;IACDC,WAAW,EAAEC,EAAE,IAAI;MACfL,GAAG,CAACI,WAAW,CAACC,EAAE,CAAC;IACvB,CAAC;IACDC,WAAW,EAAEA,CAACD,EAAE,EAAEE,EAAE,KAAK;MACrBP,GAAG,CAACM,WAAW,CAACD,EAAE,EAAEE,EAAE,CAAC;IAC3B;EACJ,CAAC;AACL,CAAC;AAEM,MAAMC,oBAAoB,SAAsCC,eAAM,CAAC;EAC1E,OAAgCC,IAAI,GAAW,kBAAkB;EAIzDC,WAAWA,CAACC,MAAqC,EAAE;IACvD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,OAAcC,MAAMA,CAAiCD,MAAqC,EAAE;IACxF,OAAO,IAAIJ,oBAAoB,CAAII,MAAM,CAAC;EAC9C;EAEOE,MAAMA,CAACd,GAAY,EAAW;IACjC,OAAOA,GAAG,CAACe,IAAI,KAAK,IAAI,CAACH,MAAM,CAACG,IAAI;EACxC;EAEA,MAAaC,MAAMA,CAACJ,MAA2C,EAAiB;IAC5E,MAAM;MAAEZ,GAAG;MAAEC;IAAQ,CAAC,GAAGW,MAAM;IAC/B,OAAO,IAAI,CAACA,MAAM,CAACL,EAAE,CACjBR,cAAc,CAAI;MACdC,GAAG;MACHC;IACJ,CAAC,CACL,CAAC;EACL;AACJ;AAACgB,OAAA,CAAAT,oBAAA,GAAAA,oBAAA;AAKM,MAAMU,oBAAoB,GAAGA,CAChCH,IAAY,EACZR,EAAmC,KAClC;EACD,OAAOC,oBAAoB,CAACK,MAAM,CAAI;IAClCE,IAAI;IACJR;EACJ,CAAC,CAAC;AACN,CAAC;AAACU,OAAA,CAAAC,oBAAA,GAAAA,oBAAA"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.registerAcoApp = exports.AcoAppRegisterPlugin = void 0;
|
|
8
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
7
|
var _plugins = require("@webiny/plugins");
|
|
10
8
|
class AcoAppRegisterPlugin extends _plugins.Plugin {
|
|
9
|
+
static type = "aco.apps.create.app";
|
|
11
10
|
constructor(app) {
|
|
12
11
|
super();
|
|
13
|
-
(0, _defineProperty2.default)(this, "app", void 0);
|
|
14
12
|
this.app = app;
|
|
15
13
|
}
|
|
16
14
|
}
|
|
17
15
|
exports.AcoAppRegisterPlugin = AcoAppRegisterPlugin;
|
|
18
|
-
(0, _defineProperty2.default)(AcoAppRegisterPlugin, "type", "aco.apps.create.app");
|
|
19
16
|
const registerAcoApp = app => {
|
|
20
17
|
return new AcoAppRegisterPlugin(app);
|
|
21
18
|
};
|
|
22
|
-
exports.registerAcoApp = registerAcoApp;
|
|
19
|
+
exports.registerAcoApp = registerAcoApp;
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=AcoAppRegisterPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AcoAppRegisterPlugin","Plugin","constructor","app","registerAcoApp"],"sources":["AcoAppRegisterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { IAcoAppRegisterParams } from \"~/types\";\n\nexport class AcoAppRegisterPlugin extends Plugin {\n public static override type = \"aco.apps.create.app\";\n public readonly app: IAcoAppRegisterParams;\n\n public constructor(app: IAcoAppRegisterParams) {\n super();\n this.app = app;\n }\n}\n\nexport const registerAcoApp = (app: IAcoAppRegisterParams) => {\n return new AcoAppRegisterPlugin(app);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_plugins","require","AcoAppRegisterPlugin","Plugin","type","constructor","app","exports","registerAcoApp"],"sources":["AcoAppRegisterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { IAcoAppRegisterParams } from \"~/types\";\n\nexport class AcoAppRegisterPlugin extends Plugin {\n public static override type = \"aco.apps.create.app\";\n public readonly app: IAcoAppRegisterParams;\n\n public constructor(app: IAcoAppRegisterParams) {\n super();\n this.app = app;\n }\n}\n\nexport const registerAcoApp = (app: IAcoAppRegisterParams) => {\n return new AcoAppRegisterPlugin(app);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGO,MAAMC,oBAAoB,SAASC,eAAM,CAAC;EAC7C,OAAuBC,IAAI,GAAG,qBAAqB;EAG5CC,WAAWA,CAACC,GAA0B,EAAE;IAC3C,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,GAAG,GAAGA,GAAG;EAClB;AACJ;AAACC,OAAA,CAAAL,oBAAA,GAAAA,oBAAA;AAEM,MAAMM,cAAc,GAAIF,GAA0B,IAAK;EAC1D,OAAO,IAAIJ,oBAAoB,CAACI,GAAG,CAAC;AACxC,CAAC;AAACC,OAAA,CAAAC,cAAA,GAAAA,cAAA"}
|
package/plugins/index.js
CHANGED
package/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./AcoAppRegisterPlugin\";\nexport * from \"./AcoAppModifierPlugin\";\n"],"mappings":";;;;;AAAA;
|
|
1
|
+
{"version":3,"names":["_AcoAppRegisterPlugin","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_AcoAppModifierPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"./AcoAppRegisterPlugin\";\nexport * from \"./AcoAppModifierPlugin\";\n"],"mappings":";;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,qBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,qBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,qBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,qBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,qBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,qBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,qBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createAppResolvers = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
7
|
var _createFieldResolvers = require("@webiny/api-headless-cms/graphql/schema/createFieldResolvers");
|
|
10
8
|
var _resolve = require("../../utils/resolve");
|
|
11
9
|
var _utils = require("@webiny/utils");
|
|
12
10
|
var _acoRecordId = require("../../utils/acoRecordId");
|
|
13
|
-
var
|
|
11
|
+
var _ensureAuthentication = require("../../utils/ensureAuthentication");
|
|
14
12
|
const createAppResolvers = params => {
|
|
15
13
|
const {
|
|
16
|
-
app,
|
|
14
|
+
app: targetApp,
|
|
17
15
|
models,
|
|
18
16
|
plugins
|
|
19
17
|
} = params;
|
|
20
|
-
const model =
|
|
18
|
+
const model = targetApp.model;
|
|
21
19
|
const apiName = model.singularApiName;
|
|
22
20
|
const createFieldResolvers = (0, _createFieldResolvers.createFieldResolversFactory)({
|
|
23
21
|
endpointType: "manage",
|
|
@@ -27,8 +25,8 @@ const createAppResolvers = params => {
|
|
|
27
25
|
});
|
|
28
26
|
const fieldResolvers = createFieldResolvers({
|
|
29
27
|
graphQLType: apiName,
|
|
30
|
-
fields:
|
|
31
|
-
isRoot:
|
|
28
|
+
fields: targetApp.model.fields,
|
|
29
|
+
isRoot: false,
|
|
32
30
|
extraResolvers: {
|
|
33
31
|
id: entry => {
|
|
34
32
|
const {
|
|
@@ -41,40 +39,45 @@ const createAppResolvers = params => {
|
|
|
41
39
|
const resolvers = {
|
|
42
40
|
SearchQuery: {
|
|
43
41
|
[`get${apiName}`]: async (_, args, context) => {
|
|
42
|
+
const app = context.aco.getApp(targetApp.name);
|
|
44
43
|
return (0, _resolve.resolve)(() => {
|
|
45
|
-
(0,
|
|
44
|
+
(0, _ensureAuthentication.ensureAuthentication)(context);
|
|
46
45
|
return app.search.get(args.id);
|
|
47
46
|
});
|
|
48
47
|
},
|
|
49
48
|
[`list${apiName}`]: async (_, args, context) => {
|
|
49
|
+
const app = context.aco.getApp(targetApp.name);
|
|
50
50
|
return (0, _resolve.resolveList)(() => {
|
|
51
|
-
(0,
|
|
51
|
+
(0, _ensureAuthentication.ensureAuthentication)(context);
|
|
52
52
|
return app.search.list(args);
|
|
53
53
|
});
|
|
54
54
|
},
|
|
55
55
|
[`list${apiName}Tags`]: async (_, args, context) => {
|
|
56
|
+
const app = context.aco.getApp(targetApp.name);
|
|
56
57
|
return (0, _resolve.resolveList)(() => {
|
|
57
|
-
(0,
|
|
58
|
+
(0, _ensureAuthentication.ensureAuthentication)(context);
|
|
58
59
|
return app.search.listTags(args);
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
SearchMutation: {
|
|
63
64
|
[`create${apiName}`]: async (_, args, context) => {
|
|
65
|
+
const app = context.aco.getApp(targetApp.name);
|
|
64
66
|
return (0, _resolve.resolve)(() => {
|
|
65
|
-
|
|
66
|
-
(0, _checkPermissions.checkPermissions)(context);
|
|
67
|
+
(0, _ensureAuthentication.ensureAuthentication)(context);
|
|
67
68
|
const {
|
|
68
69
|
id
|
|
69
|
-
} = (0, _utils.parseIdentifier)(
|
|
70
|
-
return app.search.create(
|
|
70
|
+
} = (0, _utils.parseIdentifier)(args.data?.id);
|
|
71
|
+
return app.search.create({
|
|
72
|
+
...args.data,
|
|
71
73
|
id
|
|
72
|
-
})
|
|
74
|
+
});
|
|
73
75
|
});
|
|
74
76
|
},
|
|
75
77
|
[`update${apiName}`]: async (_, args, context) => {
|
|
78
|
+
const app = context.aco.getApp(targetApp.name);
|
|
76
79
|
return (0, _resolve.resolve)(() => {
|
|
77
|
-
(0,
|
|
80
|
+
(0, _ensureAuthentication.ensureAuthentication)(context);
|
|
78
81
|
const {
|
|
79
82
|
id
|
|
80
83
|
} = (0, _utils.parseIdentifier)(args.id);
|
|
@@ -82,8 +85,9 @@ const createAppResolvers = params => {
|
|
|
82
85
|
});
|
|
83
86
|
},
|
|
84
87
|
[`move${apiName}`]: async (_, args, context) => {
|
|
88
|
+
const app = context.aco.getApp(targetApp.name);
|
|
85
89
|
return (0, _resolve.resolve)(() => {
|
|
86
|
-
(0,
|
|
90
|
+
(0, _ensureAuthentication.ensureAuthentication)(context);
|
|
87
91
|
const {
|
|
88
92
|
id
|
|
89
93
|
} = (0, _utils.parseIdentifier)(args.id);
|
|
@@ -91,8 +95,9 @@ const createAppResolvers = params => {
|
|
|
91
95
|
});
|
|
92
96
|
},
|
|
93
97
|
[`delete${apiName}`]: async (_, args, context) => {
|
|
98
|
+
const app = context.aco.getApp(targetApp.name);
|
|
94
99
|
return (0, _resolve.resolve)(() => {
|
|
95
|
-
(0,
|
|
100
|
+
(0, _ensureAuthentication.ensureAuthentication)(context);
|
|
96
101
|
const {
|
|
97
102
|
id
|
|
98
103
|
} = (0, _utils.parseIdentifier)(args.id);
|
|
@@ -105,4 +110,6 @@ const createAppResolvers = params => {
|
|
|
105
110
|
delete resolvers[apiName].entryId;
|
|
106
111
|
return resolvers;
|
|
107
112
|
};
|
|
108
|
-
exports.createAppResolvers = createAppResolvers;
|
|
113
|
+
exports.createAppResolvers = createAppResolvers;
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=createAppResolvers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createAppResolvers","params","app","models","plugins","model","apiName","singularApiName","createFieldResolvers","createFieldResolversFactory","endpointType","fieldTypePlugins","fieldResolvers","graphQLType","fields","isRoot","extraResolvers","id","entry","parseIdentifier","removeAcoRecordPrefix","resolvers","SearchQuery","_","args","context","resolve","
|
|
1
|
+
{"version":3,"names":["_createFieldResolvers","require","_resolve","_utils","_acoRecordId","_ensureAuthentication","createAppResolvers","params","app","targetApp","models","plugins","model","apiName","singularApiName","createFieldResolvers","createFieldResolversFactory","endpointType","fieldTypePlugins","fieldResolvers","graphQLType","fields","isRoot","extraResolvers","id","entry","parseIdentifier","removeAcoRecordPrefix","resolvers","SearchQuery","_","args","context","aco","getApp","name","resolve","ensureAuthentication","search","get","resolveList","list","listTags","SearchMutation","data","create","update","move","folderId","delete","Object","assign","entryId","exports"],"sources":["createAppResolvers.ts"],"sourcesContent":["import { CmsEntry, CmsFieldTypePlugins, CmsModel } from \"@webiny/api-headless-cms/types\";\nimport { createFieldResolversFactory } from \"@webiny/api-headless-cms/graphql/schema/createFieldResolvers\";\nimport { AcoContext, IAcoApp } from \"~/types\";\nimport { resolve, resolveList } from \"~/utils/resolve\";\nimport { parseIdentifier } from \"@webiny/utils\";\nimport { removeAcoRecordPrefix } from \"~/utils/acoRecordId\";\nimport { ensureAuthentication } from \"~/utils/ensureAuthentication\";\n\ninterface Params {\n app: IAcoApp;\n models: CmsModel[];\n plugins: CmsFieldTypePlugins;\n}\n\ninterface Resolvers {\n SearchQuery: Record<string, any>;\n SearchMutation: Record<string, any>;\n [key: string]: Record<string, any>;\n}\n\nexport const createAppResolvers = (params: Params): Resolvers => {\n const { app: targetApp, models, plugins } = params;\n\n const model = targetApp.model;\n const apiName = model.singularApiName;\n\n const createFieldResolvers = createFieldResolversFactory({\n endpointType: \"manage\",\n models,\n model,\n fieldTypePlugins: plugins\n });\n\n const fieldResolvers = createFieldResolvers({\n graphQLType: apiName,\n fields: targetApp.model.fields,\n isRoot: false,\n extraResolvers: {\n id: (entry: CmsEntry) => {\n const { id } = parseIdentifier(entry.id);\n return removeAcoRecordPrefix(id);\n }\n }\n });\n\n const resolvers: Resolvers = {\n SearchQuery: {\n [`get${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n const app = context.aco.getApp(targetApp.name);\n return resolve(() => {\n ensureAuthentication(context);\n return app.search.get(args.id);\n });\n },\n [`list${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n const app = context.aco.getApp(targetApp.name);\n return resolveList(() => {\n ensureAuthentication(context);\n return app.search.list(args);\n });\n },\n [`list${apiName}Tags`]: async (_: unknown, args: any, context: AcoContext) => {\n const app = context.aco.getApp(targetApp.name);\n return resolveList(() => {\n ensureAuthentication(context);\n return app.search.listTags(args);\n });\n }\n },\n SearchMutation: {\n [`create${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n const app = context.aco.getApp(targetApp.name);\n return resolve(() => {\n ensureAuthentication(context);\n const { id } = parseIdentifier(args.data?.id);\n return app.search.create({\n ...args.data,\n id\n });\n });\n },\n [`update${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n const app = context.aco.getApp(targetApp.name);\n return resolve(() => {\n ensureAuthentication(context);\n const { id } = parseIdentifier(args.id);\n return app.search.update(id, args.data || {});\n });\n },\n [`move${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n const app = context.aco.getApp(targetApp.name);\n return resolve(() => {\n ensureAuthentication(context);\n const { id } = parseIdentifier(args.id);\n return app.search.move(id, args.folderId);\n });\n },\n [`delete${apiName}`]: async (_: unknown, args: any, context: AcoContext) => {\n const app = context.aco.getApp(targetApp.name);\n return resolve(() => {\n ensureAuthentication(context);\n const { id } = parseIdentifier(args.id);\n return app.search.delete(id);\n });\n }\n }\n };\n\n Object.assign(resolvers, fieldResolvers);\n delete resolvers[apiName].entryId;\n\n return resolvers;\n};\n"],"mappings":"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"}
|