@webiny/api-headless-cms-aco 6.5.2-beta.2 → 6.5.2-beta.4
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/features/ScheduleEntryFolderGuard/ScheduleEntryFolderGuard.d.ts +11 -0
- package/features/ScheduleEntryFolderGuard/ScheduleEntryFolderGuard.js +21 -0
- package/features/ScheduleEntryFolderGuard/ScheduleEntryFolderGuard.js.map +1 -0
- package/features/ScheduleEntryFolderGuard/feature.d.ts +4 -0
- package/features/ScheduleEntryFolderGuard/feature.js +11 -0
- package/features/ScheduleEntryFolderGuard/feature.js.map +1 -0
- package/features/ScheduleEntryFolderGuard/index.d.ts +1 -0
- package/features/ScheduleEntryFolderGuard/index.js +1 -0
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/package.json +15 -13
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScheduleEntryGuard } from "@webiny/api-headless-cms-scheduler/exports/api/cms/scheduler.js";
|
|
2
|
+
import { FolderLevelPermissions } from "@webiny/api-aco/features/flp/FolderLevelPermissions/index.js";
|
|
3
|
+
declare class ScheduleEntryFolderGuardImpl implements ScheduleEntryGuard.Interface {
|
|
4
|
+
private flp;
|
|
5
|
+
constructor(flp: FolderLevelPermissions.Interface);
|
|
6
|
+
canSchedule({ entry }: ScheduleEntryGuard.Params): Promise<boolean>;
|
|
7
|
+
}
|
|
8
|
+
export declare const ScheduleEntryFolderGuard: typeof ScheduleEntryFolderGuardImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-headless-cms-scheduler/features/ScheduleEntryGuard/abstractions").IScheduleEntryGuard>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ScheduleEntryGuard } from "@webiny/api-headless-cms-scheduler/exports/api/cms/scheduler.js";
|
|
2
|
+
import { FolderLevelPermissions } from "@webiny/api-aco/features/flp/FolderLevelPermissions/index.js";
|
|
3
|
+
import { canAccessEntryFolder } from "@webiny/api-aco/features/cms/decorators/canAccessEntryFolder.js";
|
|
4
|
+
class ScheduleEntryFolderGuardImpl {
|
|
5
|
+
constructor(flp){
|
|
6
|
+
this.flp = flp;
|
|
7
|
+
}
|
|
8
|
+
async canSchedule({ entry }) {
|
|
9
|
+
if (!this.flp.canUseFolderLevelPermissions()) return true;
|
|
10
|
+
return canAccessEntryFolder(this.flp, entry.location?.folderId, "w");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const ScheduleEntryFolderGuard = ScheduleEntryGuard.createImplementation({
|
|
14
|
+
implementation: ScheduleEntryFolderGuardImpl,
|
|
15
|
+
dependencies: [
|
|
16
|
+
FolderLevelPermissions
|
|
17
|
+
]
|
|
18
|
+
});
|
|
19
|
+
export { ScheduleEntryFolderGuard };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=ScheduleEntryFolderGuard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ScheduleEntryFolderGuard/ScheduleEntryFolderGuard.js","sources":["../../../src/features/ScheduleEntryFolderGuard/ScheduleEntryFolderGuard.ts"],"sourcesContent":["import { ScheduleEntryGuard } from \"@webiny/api-headless-cms-scheduler/exports/api/cms/scheduler.js\";\nimport { FolderLevelPermissions } from \"@webiny/api-aco/features/flp/FolderLevelPermissions/index.js\";\nimport { canAccessEntryFolder } from \"@webiny/api-aco/features/cms/decorators/canAccessEntryFolder.js\";\n\nclass ScheduleEntryFolderGuardImpl implements ScheduleEntryGuard.Interface {\n public constructor(private flp: FolderLevelPermissions.Interface) {}\n\n public async canSchedule({ entry }: ScheduleEntryGuard.Params): Promise<boolean> {\n if (!this.flp.canUseFolderLevelPermissions()) {\n return true;\n }\n\n // Scheduling a publish or unpublish changes the entry later without authorization,\n // so the folder must allow writing now, same as publishing directly.\n return canAccessEntryFolder(this.flp, entry.location?.folderId, \"w\");\n }\n}\n\nexport const ScheduleEntryFolderGuard = ScheduleEntryGuard.createImplementation({\n implementation: ScheduleEntryFolderGuardImpl,\n dependencies: [FolderLevelPermissions]\n});\n"],"names":["ScheduleEntryFolderGuardImpl","flp","entry","canAccessEntryFolder","ScheduleEntryFolderGuard","ScheduleEntryGuard","FolderLevelPermissions"],"mappings":";;;AAIA,MAAMA;IACF,YAA2BC,GAAqC,CAAE;aAAvCA,GAAG,GAAHA;IAAwC;IAEnE,MAAa,YAAY,EAAEC,KAAK,EAA6B,EAAoB;QAC7E,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,4BAA4B,IACtC,OAAO;QAKX,OAAOC,qBAAqB,IAAI,CAAC,GAAG,EAAED,MAAM,QAAQ,EAAE,UAAU;IACpE;AACJ;AAEO,MAAME,2BAA2BC,mBAAmB,oBAAoB,CAAC;IAC5E,gBAAgBL;IAChB,cAAc;QAACM;KAAuB;AAC1C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api";
|
|
2
|
+
import { ScheduleEntryFolderGuard } from "./ScheduleEntryFolderGuard.js";
|
|
3
|
+
const ScheduleEntryFolderGuardFeature = createFeature({
|
|
4
|
+
name: "ScheduleEntryFolderGuard",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(ScheduleEntryFolderGuard);
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { ScheduleEntryFolderGuardFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ScheduleEntryFolderGuard/feature.js","sources":["../../../src/features/ScheduleEntryFolderGuard/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { ScheduleEntryFolderGuard } from \"./ScheduleEntryFolderGuard.js\";\n\nexport const ScheduleEntryFolderGuardFeature = createFeature({\n name: \"ScheduleEntryFolderGuard\",\n register(container) {\n container.register(ScheduleEntryFolderGuard);\n }\n});\n"],"names":["ScheduleEntryFolderGuardFeature","createFeature","container","ScheduleEntryFolderGuard"],"mappings":";;AAGO,MAAMA,kCAAkCC,cAAc;IACzD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;IACvB;AACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ScheduleEntryFolderGuardFeature } from "./feature.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ScheduleEntryFolderGuardFeature } from "./feature.js";
|
package/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ContextPlugin } from "@webiny/api";
|
|
2
2
|
import { CmsFolderPermissions } from "./features/CmsFolderPermissions/CmsFolderPermissions.js";
|
|
3
3
|
import { SetLocationOnEntryRestoreFeature } from "./features/SetLocationOnEntryRestore/index.js";
|
|
4
|
+
import { ScheduleEntryFolderGuardFeature } from "./features/ScheduleEntryFolderGuard/index.js";
|
|
4
5
|
export * from "./plugins/index.js";
|
|
5
6
|
const createAcoHcmsContext = ()=>{
|
|
6
7
|
const plugin = new ContextPlugin((context)=>{
|
|
7
8
|
SetLocationOnEntryRestoreFeature.register(context.container);
|
|
9
|
+
ScheduleEntryFolderGuardFeature.register(context.container);
|
|
8
10
|
context.container.register(CmsFolderPermissions);
|
|
9
11
|
});
|
|
10
12
|
plugin.name = "hcms-aco.createContext";
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { CmsFolderPermissions } from \"~/features/CmsFolderPermissions/CmsFolderPermissions.js\";\nimport type { HcmsAcoContext } from \"~/types.js\";\nimport { SetLocationOnEntryRestoreFeature } from \"~/features/SetLocationOnEntryRestore/index.js\";\n\nexport const createAcoHcmsContext = () => {\n const plugin = new ContextPlugin<HcmsAcoContext>(context => {\n SetLocationOnEntryRestoreFeature.register(context.container);\n context.container.register(CmsFolderPermissions);\n });\n\n plugin.name = \"hcms-aco.createContext\";\n\n return plugin;\n};\n\nexport * from \"./plugins/index.js\";\n"],"names":["createAcoHcmsContext","plugin","ContextPlugin","context","SetLocationOnEntryRestoreFeature","CmsFolderPermissions"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { CmsFolderPermissions } from \"~/features/CmsFolderPermissions/CmsFolderPermissions.js\";\nimport type { HcmsAcoContext } from \"~/types.js\";\nimport { SetLocationOnEntryRestoreFeature } from \"~/features/SetLocationOnEntryRestore/index.js\";\nimport { ScheduleEntryFolderGuardFeature } from \"~/features/ScheduleEntryFolderGuard/index.js\";\n\nexport const createAcoHcmsContext = () => {\n const plugin = new ContextPlugin<HcmsAcoContext>(context => {\n SetLocationOnEntryRestoreFeature.register(context.container);\n ScheduleEntryFolderGuardFeature.register(context.container);\n context.container.register(CmsFolderPermissions);\n });\n\n plugin.name = \"hcms-aco.createContext\";\n\n return plugin;\n};\n\nexport * from \"./plugins/index.js\";\n"],"names":["createAcoHcmsContext","plugin","ContextPlugin","context","SetLocationOnEntryRestoreFeature","ScheduleEntryFolderGuardFeature","CmsFolderPermissions"],"mappings":";;;;;AAMO,MAAMA,uBAAuB;IAChC,MAAMC,SAAS,IAAIC,cAA8BC,CAAAA;QAC7CC,iCAAiC,QAAQ,CAACD,QAAQ,SAAS;QAC3DE,gCAAgC,QAAQ,CAACF,QAAQ,SAAS;QAC1DA,QAAQ,SAAS,CAAC,QAAQ,CAACG;IAC/B;IAEAL,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-aco",
|
|
3
|
-
"version": "6.5.2-beta.
|
|
3
|
+
"version": "6.5.2-beta.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -21,22 +21,24 @@
|
|
|
21
21
|
"access": "public"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@webiny/api-core": "6.5.2-beta.
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/handler-
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"@webiny/
|
|
24
|
+
"@webiny/api-core": "6.5.2-beta.4",
|
|
25
|
+
"@webiny/api-scheduler": "6.5.2-beta.4",
|
|
26
|
+
"@webiny/build-tools": "6.5.2-beta.4",
|
|
27
|
+
"@webiny/handler-aws": "6.5.2-beta.4",
|
|
28
|
+
"@webiny/handler-graphql": "6.5.2-beta.4",
|
|
29
|
+
"@webiny/plugins": "6.5.2-beta.4",
|
|
30
|
+
"@webiny/project-utils": "6.5.2-beta.4",
|
|
31
|
+
"@webiny/wcp": "6.5.2-beta.4",
|
|
31
32
|
"graphql": "16.15.0",
|
|
32
33
|
"typescript": "7.0.2"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@webiny/api": "6.5.2-beta.
|
|
36
|
-
"@webiny/api-aco": "6.5.2-beta.
|
|
37
|
-
"@webiny/api-headless-cms": "6.5.2-beta.
|
|
38
|
-
"@webiny/
|
|
39
|
-
"@webiny/
|
|
36
|
+
"@webiny/api": "6.5.2-beta.4",
|
|
37
|
+
"@webiny/api-aco": "6.5.2-beta.4",
|
|
38
|
+
"@webiny/api-headless-cms": "6.5.2-beta.4",
|
|
39
|
+
"@webiny/api-headless-cms-scheduler": "6.5.2-beta.4",
|
|
40
|
+
"@webiny/feature": "6.5.2-beta.4",
|
|
41
|
+
"@webiny/handler": "6.5.2-beta.4",
|
|
40
42
|
"vitest": "5.1.0"
|
|
41
43
|
},
|
|
42
44
|
"webiny": {
|