@webiny/api-file-manager-aco 6.4.11 → 6.6.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import { type Container } from "@webiny/feature/api";
2
+ export declare const FileManagerAcoFeature: {
3
+ name: string;
4
+ register(container: Container): void;
5
+ };
@@ -0,0 +1,11 @@
1
+ import { createFeature } from "@webiny/feature/api";
2
+ import { EnsureFolderIsEmptyBeforeDeleteFeature } from "./features/EnsureFolderIsEmptyBeforeDelete/feature.js";
3
+ const FileManagerAcoFeature = createFeature({
4
+ name: "FileManagerAco",
5
+ register (container) {
6
+ EnsureFolderIsEmptyBeforeDeleteFeature.register(container);
7
+ }
8
+ });
9
+ export { FileManagerAcoFeature };
10
+
11
+ //# sourceMappingURL=FileManagerAcoFeature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileManagerAcoFeature.js","sources":["../src/FileManagerAcoFeature.ts"],"sourcesContent":["import { type Container, createFeature } from \"@webiny/feature/api\";\nimport { EnsureFolderIsEmptyBeforeDeleteFeature } from \"./features/EnsureFolderIsEmptyBeforeDelete/feature.js\";\n\nexport const FileManagerAcoFeature = createFeature({\n name: \"FileManagerAco\",\n register(container: Container) {\n // Pure DI registration — no legacy ContextPlugin bridge needed.\n EnsureFolderIsEmptyBeforeDeleteFeature.register(container);\n }\n});\n"],"names":["FileManagerAcoFeature","createFeature","container","EnsureFolderIsEmptyBeforeDeleteFeature"],"mappings":";;AAGO,MAAMA,wBAAwBC,cAAc;IAC/C,MAAM;IACN,UAASC,SAAoB;QAEzBC,uCAAuC,QAAQ,CAACD;IACpD;AACJ"}
@@ -20,7 +20,6 @@ class EnsureFolderIsEmptyBeforeDeleteImpl {
20
20
  },
21
21
  limit: 1
22
22
  });
23
- if (result.isFail()) throw result.error;
24
23
  const { items } = result.value;
25
24
  return items.length > 0;
26
25
  });
@@ -1 +1 @@
1
- {"version":3,"file":"features/EnsureFolderIsEmptyBeforeDelete/EnsureFolderIsEmptyBeforeDelete.js","sources":["../../../src/features/EnsureFolderIsEmptyBeforeDelete/EnsureFolderIsEmptyBeforeDelete.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { FolderBeforeDeleteEventHandler } from \"@webiny/api-aco/features/folder/DeleteFolder/index.js\";\nimport { ListFilesUseCase } from \"@webiny/api-file-manager/features/file/ListFiles/index.js\";\nimport { EnsureFolderIsEmpty } from \"@webiny/api-aco/features/folder/EnsureFolderIsEmpty/index.js\";\n\nclass EnsureFolderIsEmptyBeforeDeleteImpl implements FolderBeforeDeleteEventHandler.Interface {\n constructor(\n private ensureFolderIsEmpty: EnsureFolderIsEmpty.Interface,\n private listFiles: ListFilesUseCase.Interface\n ) {}\n\n async handle(event: FolderBeforeDeleteEventHandler.Event): Promise<void> {\n const { folder } = event.payload;\n\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 result = await this.ensureFolderIsEmpty.execute(type, id, async () => {\n const result = await this.listFiles.execute({\n where: {\n location: {\n folderId: id\n }\n },\n limit: 1\n });\n\n if (result.isFail()) {\n throw result.error;\n }\n\n const { items } = result.value;\n\n return items.length > 0;\n });\n\n if (result.isFail()) {\n throw WebinyError.from(result.error, {\n message: \"Error while ensuring folder is empty before delete.\",\n code: \"ACO_BEFORE_FOLDER_DELETE_FILE_HANDLER\"\n });\n }\n }\n}\n\nexport const EnsureFolderIsEmptyBeforeDelete = FolderBeforeDeleteEventHandler.createImplementation({\n implementation: EnsureFolderIsEmptyBeforeDeleteImpl,\n dependencies: [EnsureFolderIsEmpty, ListFilesUseCase]\n});\n"],"names":["EnsureFolderIsEmptyBeforeDeleteImpl","ensureFolderIsEmpty","listFiles","event","folder","id","type","result","items","WebinyError","EnsureFolderIsEmptyBeforeDelete","FolderBeforeDeleteEventHandler","EnsureFolderIsEmpty","ListFilesUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YACYC,mBAAkD,EAClDC,SAAqC,CAC/C;aAFUD,mBAAmB,GAAnBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,OAAOC,KAA2C,EAAiB;QACrE,MAAM,EAAEC,MAAM,EAAE,GAAGD,MAAM,OAAO;QAEhC,MAAM,EAAEE,EAAE,EAAEC,IAAI,EAAE,GAAGF;QAKrB,IAAIE,AAAS,aAATA,MACA;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAACD,MAAMD,IAAI;YAC5D,MAAME,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBACxC,OAAO;oBACH,UAAU;wBACN,UAAUF;oBACd;gBACJ;gBACA,OAAO;YACX;YAEA,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;YAGtB,MAAM,EAAEC,KAAK,EAAE,GAAGD,OAAO,KAAK;YAE9B,OAAOC,MAAM,MAAM,GAAG;QAC1B;QAEA,IAAID,OAAO,MAAM,IACb,MAAME,YAAY,IAAI,CAACF,OAAO,KAAK,EAAE;YACjC,SAAS;YACT,MAAM;QACV;IAER;AACJ;AAEO,MAAMG,kCAAkCC,+BAA+B,oBAAoB,CAAC;IAC/F,gBAAgBX;IAChB,cAAc;QAACY;QAAqBC;KAAiB;AACzD"}
1
+ {"version":3,"file":"features/EnsureFolderIsEmptyBeforeDelete/EnsureFolderIsEmptyBeforeDelete.js","sources":["../../../src/features/EnsureFolderIsEmptyBeforeDelete/EnsureFolderIsEmptyBeforeDelete.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { FolderBeforeDeleteEventHandler } from \"@webiny/api-aco/features/folder/DeleteFolder/index.js\";\nimport { ListFilesUseCase } from \"@webiny/api-file-manager/features/file/ListFiles/index.js\";\nimport { EnsureFolderIsEmpty } from \"@webiny/api-aco/features/folder/EnsureFolderIsEmpty/index.js\";\n\nclass EnsureFolderIsEmptyBeforeDeleteImpl implements FolderBeforeDeleteEventHandler.Interface {\n constructor(\n private ensureFolderIsEmpty: EnsureFolderIsEmpty.Interface,\n private listFiles: ListFilesUseCase.Interface\n ) {}\n\n async handle(event: FolderBeforeDeleteEventHandler.Event): Promise<void> {\n const { folder } = event.payload;\n\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 result = await this.ensureFolderIsEmpty.execute(type, id, async () => {\n const result = await this.listFiles.execute({\n where: {\n location: {\n folderId: id\n }\n },\n limit: 1\n });\n\n const { items } = result.value;\n\n return items.length > 0;\n });\n\n if (result.isFail()) {\n throw WebinyError.from(result.error, {\n message: \"Error while ensuring folder is empty before delete.\",\n code: \"ACO_BEFORE_FOLDER_DELETE_FILE_HANDLER\"\n });\n }\n }\n}\n\nexport const EnsureFolderIsEmptyBeforeDelete = FolderBeforeDeleteEventHandler.createImplementation({\n implementation: EnsureFolderIsEmptyBeforeDeleteImpl,\n dependencies: [EnsureFolderIsEmpty, ListFilesUseCase]\n});\n"],"names":["EnsureFolderIsEmptyBeforeDeleteImpl","ensureFolderIsEmpty","listFiles","event","folder","id","type","result","items","WebinyError","EnsureFolderIsEmptyBeforeDelete","FolderBeforeDeleteEventHandler","EnsureFolderIsEmpty","ListFilesUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YACYC,mBAAkD,EAClDC,SAAqC,CAC/C;aAFUD,mBAAmB,GAAnBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,OAAOC,KAA2C,EAAiB;QACrE,MAAM,EAAEC,MAAM,EAAE,GAAGD,MAAM,OAAO;QAEhC,MAAM,EAAEE,EAAE,EAAEC,IAAI,EAAE,GAAGF;QAKrB,IAAIE,AAAS,aAATA,MACA;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAACD,MAAMD,IAAI;YAC5D,MAAME,SAAS,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;gBACxC,OAAO;oBACH,UAAU;wBACN,UAAUF;oBACd;gBACJ;gBACA,OAAO;YACX;YAEA,MAAM,EAAEG,KAAK,EAAE,GAAGD,OAAO,KAAK;YAE9B,OAAOC,MAAM,MAAM,GAAG;QAC1B;QAEA,IAAID,OAAO,MAAM,IACb,MAAME,YAAY,IAAI,CAACF,OAAO,KAAK,EAAE;YACjC,SAAS;YACT,MAAM;QACV;IAER;AACJ;AAEO,MAAMG,kCAAkCC,+BAA+B,oBAAoB,CAAC;IAC/F,gBAAgBX;IAChB,cAAc;QAACY;QAAqBC;KAAiB;AACzD"}
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export * from "./plugins/index.js";
2
- export declare const createFileManagerAco: () => import("@webiny/api").ContextPlugin<import("@webiny/api/types.js").Context>;
2
+ export { FileManagerAcoFeature } from "./FileManagerAcoFeature.js";
package/index.js CHANGED
@@ -1,9 +1,2 @@
1
- import { createContextPlugin } from "@webiny/api";
2
- import { EnsureFolderIsEmptyBeforeDeleteFeature } from "./features/EnsureFolderIsEmptyBeforeDelete/feature.js";
3
1
  export * from "./plugins/index.js";
4
- const createFileManagerAco = ()=>createContextPlugin((context)=>{
5
- EnsureFolderIsEmptyBeforeDeleteFeature.register(context.container);
6
- });
7
- export { createFileManagerAco };
8
-
9
- //# sourceMappingURL=index.js.map
2
+ export { FileManagerAcoFeature } from "./FileManagerAcoFeature.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-file-manager-aco",
3
- "version": "6.4.11",
3
+ "version": "6.6.0-alpha.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -21,26 +21,28 @@
21
21
  "access": "public"
22
22
  },
23
23
  "dependencies": {
24
- "@webiny/api-aco": "6.4.11",
25
- "@webiny/api-file-manager": "6.4.11",
26
- "@webiny/error": "6.4.11",
27
- "@webiny/feature": "6.4.11"
24
+ "@webiny/api-aco": "6.6.0-alpha.1",
25
+ "@webiny/api-file-manager": "6.6.0-alpha.1",
26
+ "@webiny/api-graphql": "6.6.0-alpha.1",
27
+ "@webiny/error": "6.6.0-alpha.1",
28
+ "@webiny/feature": "6.6.0-alpha.1"
28
29
  },
29
30
  "devDependencies": {
30
- "@webiny/api": "6.4.11",
31
- "@webiny/api-core": "6.4.11",
32
- "@webiny/api-headless-cms": "6.4.11",
33
- "@webiny/build-tools": "6.4.11",
34
- "@webiny/handler": "6.4.11",
35
- "@webiny/handler-aws": "6.4.11",
36
- "@webiny/handler-graphql": "6.4.11",
37
- "@webiny/plugins": "6.4.11",
38
- "@webiny/project-utils": "6.4.11",
39
- "@webiny/utils": "6.4.11",
40
- "@webiny/wcp": "6.4.11",
31
+ "@webiny/api": "6.6.0-alpha.1",
32
+ "@webiny/api-core": "6.6.0-alpha.1",
33
+ "@webiny/api-core-testing": "6.6.0-alpha.1",
34
+ "@webiny/api-graphql": "6.6.0-alpha.1",
35
+ "@webiny/api-headless-cms": "6.6.0-alpha.1",
36
+ "@webiny/build-tools": "6.6.0-alpha.1",
37
+ "@webiny/di": "1.1.0",
38
+ "@webiny/event-handler-core": "6.6.0-alpha.1",
39
+ "@webiny/handler": "6.6.0-alpha.1",
40
+ "@webiny/plugins": "6.6.0-alpha.1",
41
+ "@webiny/utils": "6.6.0-alpha.1",
42
+ "@webiny/wcp": "6.6.0-alpha.1",
41
43
  "graphql": "16.14.2",
42
- "typescript": "6.0.3",
43
- "vitest": "4.1.10"
44
+ "typescript": "7.0.2",
45
+ "vitest": "4.1.11"
44
46
  },
45
47
  "webiny": {
46
48
  "publishFrom": "dist"
package/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { createContextPlugin } from \"@webiny/api\";\nimport { EnsureFolderIsEmptyBeforeDeleteFeature } from \"~/features/EnsureFolderIsEmptyBeforeDelete/feature.js\";\n\nexport * from \"./plugins/index.js\";\n\nexport const createFileManagerAco = () => {\n return createContextPlugin(context => {\n EnsureFolderIsEmptyBeforeDeleteFeature.register(context.container);\n });\n};\n"],"names":["createFileManagerAco","createContextPlugin","context","EnsureFolderIsEmptyBeforeDeleteFeature"],"mappings":";;;AAKO,MAAMA,uBAAuB,IACzBC,oBAAoBC,CAAAA;QACvBC,uCAAuC,QAAQ,CAACD,QAAQ,SAAS;IACrE"}