@webiny/api-audit-logs 6.1.0 → 6.2.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/context/AuditLogsContextValue.d.ts +1 -1
  2. package/context/AuditLogsContextValue.js.map +1 -1
  3. package/context/index.js +4 -2
  4. package/context/index.js.map +1 -1
  5. package/events/AuditLogAfterCreateEvent.d.ts +2 -2
  6. package/events/AuditLogAfterCreateEvent.js +1 -1
  7. package/events/AuditLogAfterCreateEvent.js.map +1 -1
  8. package/events/AuditLogAfterUpdateEvent.d.ts +2 -2
  9. package/events/AuditLogAfterUpdateEvent.js +1 -1
  10. package/events/AuditLogAfterUpdateEvent.js.map +1 -1
  11. package/events/AuditLogBeforeCreateEvent.d.ts +2 -2
  12. package/events/AuditLogBeforeCreateEvent.js +1 -1
  13. package/events/AuditLogBeforeCreateEvent.js.map +1 -1
  14. package/events/AuditLogBeforeUpdateEvent.d.ts +2 -2
  15. package/events/AuditLogBeforeUpdateEvent.js +1 -1
  16. package/events/AuditLogBeforeUpdateEvent.js.map +1 -1
  17. package/events/abstractions.d.ts +1 -1
  18. package/events/abstractions.js.map +1 -1
  19. package/index.js.map +1 -1
  20. package/package.json +24 -24
  21. package/storage/Converter.d.ts +3 -3
  22. package/storage/Converter.js +3 -3
  23. package/storage/Converter.js.map +1 -1
  24. package/storage/Storage.d.ts +2 -2
  25. package/storage/Storage.js +1 -1
  26. package/storage/Storage.js.map +1 -1
  27. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +2 -2
  28. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +1 -1
  29. package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -1
  30. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +2 -2
  31. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +1 -1
  32. package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -1
  33. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +2 -2
  34. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +1 -1
  35. package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -1
  36. package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.d.ts +1 -1
  37. package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +1 -1
  38. package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +1 -1
  39. package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +1 -1
  40. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +1 -1
  41. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +1 -1
  42. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +1 -1
  43. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +1 -1
  44. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +1 -1
  45. package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +1 -1
  46. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +1 -1
  47. package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +1 -1
  48. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +1 -1
  49. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +1 -1
  50. package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +1 -1
  51. package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +1 -1
  52. package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +1 -1
  53. package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +1 -1
  54. package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +1 -1
  55. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +2 -2
  56. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +1 -1
  57. package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -1
  58. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +2 -2
  59. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +1 -1
  60. package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -1
  61. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +2 -2
  62. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +1 -1
  63. package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -1
  64. package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +1 -1
  65. package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +1 -1
  66. package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +1 -1
  67. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +2 -2
  68. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +1 -1
  69. package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -1
  70. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +2 -2
  71. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +1 -1
  72. package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -1
  73. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +2 -2
  74. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +1 -1
  75. package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -1
  76. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +2 -2
  77. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +1 -1
  78. package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -1
  79. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +2 -2
  80. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +1 -1
  81. package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -1
  82. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +2 -2
  83. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +1 -1
  84. package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -1
  85. package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +1 -1
  86. package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +1 -1
  87. package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +1 -1
  88. package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +1 -1
  89. package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +1 -1
  90. package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +1 -1
  91. package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +1 -1
  92. package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +1 -1
  93. package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +1 -1
  94. package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +1 -1
  95. package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +1 -1
  96. package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","FolderAfterUpdateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogFolderAfterUpdateHandlerImpl","constructor","context","handle","event","folder","original","payload","type","createAuditLog","FILE_MANAGER","FILE_FOLDER","UPDATE","before","after","id","startsWith","HEADLESS_CMS","MODEL_FOLDER","error","from","message","code","AuditLogFolderAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogFolderAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { FolderAfterUpdateEventHandler } from \"@webiny/api-aco/features/folder/UpdateFolder\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogFolderAfterUpdateHandlerImpl implements FolderAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: FolderAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { folder, original } = event.payload;\n if (folder.type === \"FmFile\") {\n const createAuditLog = getAuditConfig(AUDIT.FILE_MANAGER.FILE_FOLDER.UPDATE);\n await createAuditLog(\n \"Folder updated\",\n { before: original, after: folder },\n folder.id,\n this.context\n );\n } else if (folder.type.startsWith(\"cms:\")) {\n const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.MODEL_FOLDER.UPDATE);\n await createAuditLog(\n \"Folder updated\",\n { before: original, after: folder },\n folder.id,\n this.context\n );\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogFolderAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_FOLDER_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogFolderAfterUpdateHandler = FolderAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogFolderAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,8CAA8C;AAC5F,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,oCAAoC,CAAoD;EAC1FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEC,MAAM;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC1C,IAAIF,MAAM,CAACG,IAAI,KAAK,QAAQ,EAAE;QAC1B,MAAMC,cAAc,GAAGV,cAAc,CAACD,KAAK,CAACY,YAAY,CAACC,WAAW,CAACC,MAAM,CAAC;QAC5E,MAAMH,cAAc,CAChB,gBAAgB,EAChB;UAAEI,MAAM,EAAEP,QAAQ;UAAEQ,KAAK,EAAET;QAAO,CAAC,EACnCA,MAAM,CAACU,EAAE,EACT,IAAI,CAACb,OACT,CAAC;MACL,CAAC,MAAM,IAAIG,MAAM,CAACG,IAAI,CAACQ,UAAU,CAAC,MAAM,CAAC,EAAE;QACvC,MAAMP,cAAc,GAAGV,cAAc,CAACD,KAAK,CAACmB,YAAY,CAACC,YAAY,CAACN,MAAM,CAAC;QAC7E,MAAMH,cAAc,CAChB,gBAAgB,EAChB;UAAEI,MAAM,EAAEP,QAAQ;UAAEQ,KAAK,EAAET;QAAO,CAAC,EACnCA,MAAM,CAACU,EAAE,EACT,IAAI,CAACb,OACT,CAAC;MACL;IACJ,CAAC,CAAC,OAAOiB,KAAK,EAAE;MACZ,MAAMxB,WAAW,CAACyB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAG3B,6BAA6B,CAAC4B,oBAAoB,CAAC;EAC/FC,cAAc,EAAEzB,oCAAoC;EACpD0B,YAAY,EAAE,CAAC7B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","FolderAfterUpdateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogFolderAfterUpdateHandlerImpl","constructor","context","handle","event","folder","original","payload","type","createAuditLog","FILE_MANAGER","FILE_FOLDER","UPDATE","before","after","id","startsWith","HEADLESS_CMS","MODEL_FOLDER","error","from","message","code","AuditLogFolderAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogFolderAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { FolderAfterUpdateEventHandler } from \"@webiny/api-aco/features/folder/UpdateFolder/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogFolderAfterUpdateHandlerImpl implements FolderAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: FolderAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { folder, original } = event.payload;\n if (folder.type === \"FmFile\") {\n const createAuditLog = getAuditConfig(AUDIT.FILE_MANAGER.FILE_FOLDER.UPDATE);\n await createAuditLog(\n \"Folder updated\",\n { before: original, after: folder },\n folder.id,\n this.context\n );\n } else if (folder.type.startsWith(\"cms:\")) {\n const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.MODEL_FOLDER.UPDATE);\n await createAuditLog(\n \"Folder updated\",\n { before: original, after: folder },\n folder.id,\n this.context\n );\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogFolderAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_FOLDER_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogFolderAfterUpdateHandler = FolderAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogFolderAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,uDAAuD;AACrG,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,oCAAoC,CAAoD;EAC1FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEC,MAAM;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC1C,IAAIF,MAAM,CAACG,IAAI,KAAK,QAAQ,EAAE;QAC1B,MAAMC,cAAc,GAAGV,cAAc,CAACD,KAAK,CAACY,YAAY,CAACC,WAAW,CAACC,MAAM,CAAC;QAC5E,MAAMH,cAAc,CAChB,gBAAgB,EAChB;UAAEI,MAAM,EAAEP,QAAQ;UAAEQ,KAAK,EAAET;QAAO,CAAC,EACnCA,MAAM,CAACU,EAAE,EACT,IAAI,CAACb,OACT,CAAC;MACL,CAAC,MAAM,IAAIG,MAAM,CAACG,IAAI,CAACQ,UAAU,CAAC,MAAM,CAAC,EAAE;QACvC,MAAMP,cAAc,GAAGV,cAAc,CAACD,KAAK,CAACmB,YAAY,CAACC,YAAY,CAACN,MAAM,CAAC;QAC7E,MAAMH,cAAc,CAChB,gBAAgB,EAChB;UAAEI,MAAM,EAAEP,QAAQ;UAAEQ,KAAK,EAAET;QAAO,CAAC,EACnCA,MAAM,CAACU,EAAE,EACT,IAAI,CAACb,OACT,CAAC;MACL;IACJ,CAAC,CAAC,OAAOiB,KAAK,EAAE;MACZ,MAAMxB,WAAW,CAACyB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAG3B,6BAA6B,CAAC4B,oBAAoB,CAAC;EAC/FC,cAAc,EAAEzB,oCAAoC;EACpD0B,YAAY,EAAE,CAAC7B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -6,6 +6,6 @@ declare class AuditLogFileAfterCreateHandlerImpl implements FileAfterCreateEvent
6
6
  handle(event: FileAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogFileAfterCreateHandler: typeof AuditLogFileAfterCreateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-file-manager/features/file/CreateFile/events").FileAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-file-manager/features/file/CreateFile/events").FileAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogFileAfterDeleteHandlerImpl implements FileAfterDeleteEvent
6
6
  handle(event: FileAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogFileAfterDeleteHandler: typeof AuditLogFileAfterDeleteHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-file-manager/features/file/DeleteFile/events").FileAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-file-manager/features/file/DeleteFile/events").FileAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogFileAfterUpdateHandlerImpl implements FileAfterUpdateEvent
6
6
  handle(event: FileAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogFileAfterUpdateHandler: typeof AuditLogFileAfterUpdateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-file-manager/features/file/UpdateFile/events").FileAfterUpdateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-file-manager/features/file/UpdateFile/events").FileAfterUpdateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogSettingsAfterUpdateHandlerImpl implements SettingsAfterUpd
6
6
  handle(event: SettingsAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogSettingsAfterUpdateHandler: typeof AuditLogSettingsAfterUpdateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-file-manager/features/settings/UpdateSettings/events").SettingsAfterUpdateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-file-manager/features/settings/UpdateSettings/events").SettingsAfterUpdateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogEntryAfterCreateHandlerImpl implements EntryAfterCreateEve
6
6
  handle(event: EntryAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogEntryAfterCreateEventHandler: typeof AuditLogEntryAfterCreateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/CreateEntry/events").EntryAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/CreateEntry/events").EntryAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogEntryAfterDeleteHandlerImpl implements EntryAfterDeleteEve
6
6
  handle(event: EntryAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogEntryAfterDeleteEventHandler: typeof AuditLogEntryAfterDeleteHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/DeleteEntry/events").EntryAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/DeleteEntry/events").EntryAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogEntryAfterPublishEventHandlerImpl implements EntryAfterPub
6
6
  handle(event: EntryAfterPublishEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogEntryAfterPublishEventHandler: typeof AuditLogEntryAfterPublishEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/PublishEntry/events").EntryAfterPublishEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/PublishEntry/events").EntryAfterPublishEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogEntryAfterRestoreFromBinEventHandlerImpl implements EntryA
6
6
  handle(event: EntryAfterRestoreFromBinEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogEntryAfterRestoreFromBinEventHandler: typeof AuditLogEntryAfterRestoreFromBinEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/RestoreEntryFromBin/events").EntryAfterRestoreFromBinEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/RestoreEntryFromBin/events").EntryAfterRestoreFromBinEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogEntryAfterUnpublishEventHandlerImpl implements EntryAfterU
6
6
  handle(event: EntryAfterUnpublishEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogEntryAfterUnpublishEventHandler: typeof AuditLogEntryAfterUnpublishEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/UnpublishEntry/events").EntryAfterUnpublishEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/UnpublishEntry/events").EntryAfterUnpublishEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogEntryAfterUpdateEventHandlerImpl implements EntryAfterUpda
6
6
  handle(event: EntryAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogEntryAfterUpdateEventHandler: typeof AuditLogEntryAfterUpdateEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/UpdateEntry/events").EntryAfterUpdateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/UpdateEntry/events").EntryAfterUpdateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogEntryRevisionAfterCreateHandlerImpl implements EntryRevisi
6
6
  handle(event: EntryRevisionAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogEntryRevisionAfterCreateEventHandler: typeof AuditLogEntryRevisionAfterCreateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/events").EntryRevisionAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/events").EntryRevisionAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogEntryRevisionAfterDeleteEventHandlerImpl implements EntryR
6
6
  handle(event: EntryRevisionAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogEntryRevisionAfterDeleteEventHandler: typeof AuditLogEntryRevisionAfterDeleteEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/DeleteEntryRevision/events").EntryRevisionAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/DeleteEntryRevision/events").EntryRevisionAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogGroupAfterCreateEventHandlerImpl implements GroupAfterCrea
6
6
  handle(event: GroupAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogGroupAfterCreateEventHandler: typeof AuditLogGroupAfterCreateEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModelGroup/CreateGroup/events").GroupAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModelGroup/CreateGroup/events").GroupAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogGroupAfterDeleteHandlerEventImpl implements GroupAfterDele
6
6
  handle(event: GroupAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogGroupAfterDeleteEventHandler: typeof AuditLogGroupAfterDeleteHandlerEventImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModelGroup/DeleteGroup/events").GroupAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModelGroup/DeleteGroup/events").GroupAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogGroupAfterUpdateEventHandlerImpl implements GroupAfterUpda
6
6
  handle(event: GroupAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogGroupAfterUpdateEventHandler: typeof AuditLogGroupAfterUpdateEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModelGroup/UpdateGroup/events").GroupAfterUpdateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModelGroup/UpdateGroup/events").GroupAfterUpdateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogModelAfterCreateEventHandlerImpl implements ModelAfterCrea
6
6
  handle(event: ModelAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogModelAfterCreateEventHandler: typeof AuditLogModelAfterCreateEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModel/CreateModel/events").ModelAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModel/CreateModel/events").ModelAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogModelAfterDeleteEventHandlerImpl implements ModelAfterDele
6
6
  handle(event: ModelAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogModelAfterDeleteEventHandler: typeof AuditLogModelAfterDeleteEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModel/DeleteModel/events").ModelAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModel/DeleteModel/events").ModelAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogModelAfterUpdateEventHandlerImpl implements ModelAfterUpda
6
6
  handle(event: ModelAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogModelAfterUpdateEventHandler: typeof AuditLogModelAfterUpdateEventHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModel/UpdateModel/events").ModelAfterUpdateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentModel/UpdateModel/events").ModelAfterUpdateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogMailerSettingsAfterSaveHandlerImpl implements MailerSettin
6
6
  handle(event: MailerSettingsAfterSaveEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogMailerSettingsAfterSaveHandler: typeof AuditLogMailerSettingsAfterSaveHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-mailer/features/SaveSettings/abstractions").MailerSettingsAfterSavePayload>>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/eventPublisher").DomainEvent<import("@webiny/api-mailer/features/SaveSettings/abstractions").MailerSettingsAfterSavePayload>>>;
10
10
  };
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import { ApiKeyAfterCreateEventHandler } from "@webiny/api-core/features/CreateApiKey";
1
+ import { ApiKeyAfterCreateEventHandler } from "@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js";
2
2
  import { AuditLogsContext } from "../../../abstractions.js";
3
3
  declare class AuditLogApiKeyAfterCreateHandlerImpl implements ApiKeyAfterCreateEventHandler.Interface {
4
4
  private context;
@@ -6,6 +6,6 @@ declare class AuditLogApiKeyAfterCreateHandlerImpl implements ApiKeyAfterCreateE
6
6
  handle(event: ApiKeyAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogApiKeyAfterCreateHandler: typeof AuditLogApiKeyAfterCreateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/CreateApiKey").ApiKeyAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/apiKeys/CreateApiKey/events").ApiKeyAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import WebinyError from "@webiny/error";
2
- import { ApiKeyAfterCreateEventHandler } from "@webiny/api-core/features/CreateApiKey";
2
+ import { ApiKeyAfterCreateEventHandler } from "@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js";
3
3
  import { AuditLogsContext } from "../../../abstractions.js";
4
4
  import { AUDIT } from "../../../config.js";
5
5
  import { getAuditConfig } from "../../../utils/getAuditConfig.js";
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","ApiKeyAfterCreateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterCreateHandlerImpl","constructor","context","handle","event","initialApiKey","payload","createAuditLog","SECURITY","API_KEY","CREATE","error","from","message","code","AuditLogApiKeyAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterCreateEventHandler } from \"@webiny/api-core/features/CreateApiKey\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterCreateHandlerImpl implements ApiKeyAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.CREATE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n await createAuditLog(\"API key created\", apiKey, apiKey.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterCreateHandler = ApiKeyAfterCreateEventHandler.createImplementation({\n implementation: AuditLogApiKeyAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,wCAAwC;AACtF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAAoD;EAC1FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEZ,MAAM,EAAEa;MAAc,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC/C,MAAMC,cAAc,GAAGjB,cAAc,CAACD,KAAK,CAACmB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMlB,MAAM,GAAGD,aAAa,CAACc,aAAa,CAAC;MAE3C,MAAME,cAAc,CAAC,iBAAiB,EAAEf,MAAM,EAAEA,MAAM,CAACC,EAAE,EAAE,IAAI,CAACS,OAAO,CAAC;IAC5E,CAAC,CAAC,OAAOS,KAAK,EAAE;MACZ,MAAMzB,WAAW,CAAC0B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAG5B,6BAA6B,CAAC6B,oBAAoB,CAAC;EAC/FC,cAAc,EAAEjB,oCAAoC;EACpDkB,YAAY,EAAE,CAAC9B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","ApiKeyAfterCreateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterCreateHandlerImpl","constructor","context","handle","event","initialApiKey","payload","createAuditLog","SECURITY","API_KEY","CREATE","error","from","message","code","AuditLogApiKeyAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterCreateEventHandler } from \"@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterCreateHandlerImpl implements ApiKeyAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.CREATE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n await createAuditLog(\"API key created\", apiKey, apiKey.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterCreateHandler = ApiKeyAfterCreateEventHandler.createImplementation({\n implementation: AuditLogApiKeyAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,kEAAkE;AAChH,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAAoD;EAC1FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEZ,MAAM,EAAEa;MAAc,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC/C,MAAMC,cAAc,GAAGjB,cAAc,CAACD,KAAK,CAACmB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMlB,MAAM,GAAGD,aAAa,CAACc,aAAa,CAAC;MAE3C,MAAME,cAAc,CAAC,iBAAiB,EAAEf,MAAM,EAAEA,MAAM,CAACC,EAAE,EAAE,IAAI,CAACS,OAAO,CAAC;IAC5E,CAAC,CAAC,OAAOS,KAAK,EAAE;MACZ,MAAMzB,WAAW,CAAC0B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAG5B,6BAA6B,CAAC6B,oBAAoB,CAAC;EAC/FC,cAAc,EAAEjB,oCAAoC;EACpDkB,YAAY,EAAE,CAAC9B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ApiKeyAfterDeleteEventHandler } from "@webiny/api-core/features/DeleteApiKey";
1
+ import { ApiKeyAfterDeleteEventHandler } from "@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js";
2
2
  import { AuditLogsContext } from "../../../abstractions.js";
3
3
  declare class AuditLogApiKeyAfterDeleteHandlerImpl implements ApiKeyAfterDeleteEventHandler.Interface {
4
4
  private context;
@@ -6,6 +6,6 @@ declare class AuditLogApiKeyAfterDeleteHandlerImpl implements ApiKeyAfterDeleteE
6
6
  handle(event: ApiKeyAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogApiKeyAfterDeleteHandler: typeof AuditLogApiKeyAfterDeleteHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/DeleteApiKey").ApiKeyAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/apiKeys/DeleteApiKey/events").ApiKeyAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import WebinyError from "@webiny/error";
2
- import { ApiKeyAfterDeleteEventHandler } from "@webiny/api-core/features/DeleteApiKey";
2
+ import { ApiKeyAfterDeleteEventHandler } from "@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js";
3
3
  import { AuditLogsContext } from "../../../abstractions.js";
4
4
  import { AUDIT } from "../../../config.js";
5
5
  import { getAuditConfig } from "../../../utils/getAuditConfig.js";
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","ApiKeyAfterDeleteEventHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterDeleteHandlerImpl","constructor","context","handle","event","initialApiKey","payload","createAuditLog","SECURITY","API_KEY","DELETE","error","from","message","code","AuditLogApiKeyAfterDeleteHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterDeleteEventHandler } from \"@webiny/api-core/features/DeleteApiKey\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterDeleteHandlerImpl implements ApiKeyAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.DELETE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n await createAuditLog(\"API key deleted\", apiKey, apiKey.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterDeleteHandler = ApiKeyAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogApiKeyAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,wCAAwC;AACtF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAAoD;EAC1FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEZ,MAAM,EAAEa;MAAc,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC/C,MAAMC,cAAc,GAAGjB,cAAc,CAACD,KAAK,CAACmB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMlB,MAAM,GAAGD,aAAa,CAACc,aAAa,CAAC;MAE3C,MAAME,cAAc,CAAC,iBAAiB,EAAEf,MAAM,EAAEA,MAAM,CAACC,EAAE,EAAE,IAAI,CAACS,OAAO,CAAC;IAC5E,CAAC,CAAC,OAAOS,KAAK,EAAE;MACZ,MAAMzB,WAAW,CAAC0B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAG5B,6BAA6B,CAAC6B,oBAAoB,CAAC;EAC/FC,cAAc,EAAEjB,oCAAoC;EACpDkB,YAAY,EAAE,CAAC9B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","ApiKeyAfterDeleteEventHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterDeleteHandlerImpl","constructor","context","handle","event","initialApiKey","payload","createAuditLog","SECURITY","API_KEY","DELETE","error","from","message","code","AuditLogApiKeyAfterDeleteHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterDeleteEventHandler } from \"@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterDeleteHandlerImpl implements ApiKeyAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.DELETE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n await createAuditLog(\"API key deleted\", apiKey, apiKey.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterDeleteHandler = ApiKeyAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogApiKeyAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,kEAAkE;AAChH,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAAoD;EAC1FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEZ,MAAM,EAAEa;MAAc,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC/C,MAAMC,cAAc,GAAGjB,cAAc,CAACD,KAAK,CAACmB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMlB,MAAM,GAAGD,aAAa,CAACc,aAAa,CAAC;MAE3C,MAAME,cAAc,CAAC,iBAAiB,EAAEf,MAAM,EAAEA,MAAM,CAACC,EAAE,EAAE,IAAI,CAACS,OAAO,CAAC;IAC5E,CAAC,CAAC,OAAOS,KAAK,EAAE;MACZ,MAAMzB,WAAW,CAAC0B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAG5B,6BAA6B,CAAC6B,oBAAoB,CAAC;EAC/FC,cAAc,EAAEjB,oCAAoC;EACpDkB,YAAY,EAAE,CAAC9B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { ApiKeyAfterUpdateEventHandler } from "@webiny/api-core/features/UpdateApiKey";
1
+ import { ApiKeyAfterUpdateEventHandler } from "@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js";
2
2
  import { AuditLogsContext } from "../../../abstractions.js";
3
3
  declare class AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateEventHandler.Interface {
4
4
  private context;
@@ -6,6 +6,6 @@ declare class AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateE
6
6
  handle(event: ApiKeyAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogApiKeyAfterUpdateHandler: typeof AuditLogApiKeyAfterUpdateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/UpdateApiKey").ApiKeyAfterUpdateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/apiKeys/UpdateApiKey/events").ApiKeyAfterUpdateEvent>>;
10
10
  };
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import WebinyError from "@webiny/error";
2
- import { ApiKeyAfterUpdateEventHandler } from "@webiny/api-core/features/UpdateApiKey";
2
+ import { ApiKeyAfterUpdateEventHandler } from "@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js";
3
3
  import { AuditLogsContext } from "../../../abstractions.js";
4
4
  import { AUDIT } from "../../../config.js";
5
5
  import { getAuditConfig } from "../../../utils/getAuditConfig.js";
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","ApiKeyAfterUpdateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterUpdateHandlerImpl","constructor","context","handle","event","updated","initialApiKey","original","initialOriginalApiKey","payload","createAuditLog","SECURITY","API_KEY","UPDATE","before","after","error","from","message","code","AuditLogApiKeyAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterUpdateEventHandler } from \"@webiny/api-core/features/UpdateApiKey\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated: initialApiKey, original: initialOriginalApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.UPDATE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n const original = cleanupApiKey(initialOriginalApiKey);\n\n await createAuditLog(\n \"API key updated\",\n {\n before: original,\n after: apiKey\n },\n apiKey.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterUpdateHandler = ApiKeyAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogApiKeyAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,wCAAwC;AACtF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAAoD;EAC1FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEC,OAAO,EAAEC,aAAa;QAAEC,QAAQ,EAAEC;MAAsB,CAAC,GAAGJ,KAAK,CAACK,OAAO;MACjF,MAAMC,cAAc,GAAGpB,cAAc,CAACD,KAAK,CAACsB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMrB,MAAM,GAAGD,aAAa,CAACe,aAAa,CAAC;MAC3C,MAAMC,QAAQ,GAAGhB,aAAa,CAACiB,qBAAqB,CAAC;MAErD,MAAME,cAAc,CAChB,iBAAiB,EACjB;QACII,MAAM,EAAEP,QAAQ;QAChBQ,KAAK,EAAEvB;MACX,CAAC,EACDA,MAAM,CAACC,EAAE,EACT,IAAI,CAACS,OACT,CAAC;IACL,CAAC,CAAC,OAAOc,KAAK,EAAE;MACZ,MAAM9B,WAAW,CAAC+B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAGjC,6BAA6B,CAACkC,oBAAoB,CAAC;EAC/FC,cAAc,EAAEtB,oCAAoC;EACpDuB,YAAY,EAAE,CAACnC,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","ApiKeyAfterUpdateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterUpdateHandlerImpl","constructor","context","handle","event","updated","initialApiKey","original","initialOriginalApiKey","payload","createAuditLog","SECURITY","API_KEY","UPDATE","before","after","error","from","message","code","AuditLogApiKeyAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterUpdateEventHandler } from \"@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated: initialApiKey, original: initialOriginalApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.UPDATE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n const original = cleanupApiKey(initialOriginalApiKey);\n\n await createAuditLog(\n \"API key updated\",\n {\n before: original,\n after: apiKey\n },\n apiKey.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterUpdateHandler = ApiKeyAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogApiKeyAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,kEAAkE;AAChH,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAAoD;EAC1FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEC,OAAO,EAAEC,aAAa;QAAEC,QAAQ,EAAEC;MAAsB,CAAC,GAAGJ,KAAK,CAACK,OAAO;MACjF,MAAMC,cAAc,GAAGpB,cAAc,CAACD,KAAK,CAACsB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMrB,MAAM,GAAGD,aAAa,CAACe,aAAa,CAAC;MAC3C,MAAMC,QAAQ,GAAGhB,aAAa,CAACiB,qBAAqB,CAAC;MAErD,MAAME,cAAc,CAChB,iBAAiB,EACjB;QACII,MAAM,EAAEP,QAAQ;QAChBQ,KAAK,EAAEvB;MACX,CAAC,EACDA,MAAM,CAACC,EAAE,EACT,IAAI,CAACS,OACT,CAAC;IACL,CAAC,CAAC,OAAOc,KAAK,EAAE;MACZ,MAAM9B,WAAW,CAAC+B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAGjC,6BAA6B,CAACkC,oBAAoB,CAAC;EAC/FC,cAAc,EAAEtB,oCAAoC;EACpDuB,YAAY,EAAE,CAACnC,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -6,6 +6,6 @@ declare class AuditLogRoleAfterCreateHandlerImpl implements RoleAfterCreateEvent
6
6
  handle(event: RoleAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogRoleAfterCreateHandler: typeof AuditLogRoleAfterCreateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/CreateRole/events").RoleAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/CreateRole/events").RoleAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogRoleAfterDeleteHandlerImpl implements RoleAfterDeleteEvent
6
6
  handle(event: RoleAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogRoleAfterDeleteHandler: typeof AuditLogRoleAfterDeleteHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/DeleteRole/events").RoleAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/DeleteRole/events").RoleAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -6,6 +6,6 @@ declare class AuditLogRoleAfterUpdateHandlerImpl implements RoleAfterUpdateEvent
6
6
  handle(event: RoleAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogRoleAfterUpdateHandler: typeof AuditLogRoleAfterUpdateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/UpdateRole/events").RoleAfterUpdateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/UpdateRole/events").RoleAfterUpdateEvent>>;
10
10
  };
11
11
  export {};
@@ -1,4 +1,4 @@
1
- import { TeamAfterCreateEventHandler } from "@webiny/api-core/features/CreateTeam";
1
+ import { TeamAfterCreateEventHandler } from "@webiny/api-core/features/security/teams/CreateTeam/index.js";
2
2
  import { AuditLogsContext } from "../../../abstractions.js";
3
3
  declare class AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateEventHandler.Interface {
4
4
  private context;
@@ -6,6 +6,6 @@ declare class AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateEvent
6
6
  handle(event: TeamAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogTeamAfterCreateHandler: typeof AuditLogTeamAfterCreateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/security/teams/CreateTeam/events").TeamAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/teams/CreateTeam/events").TeamAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import WebinyError from "@webiny/error";
2
- import { TeamAfterCreateEventHandler } from "@webiny/api-core/features/CreateTeam";
2
+ import { TeamAfterCreateEventHandler } from "@webiny/api-core/features/security/teams/CreateTeam/index.js";
3
3
  import { AuditLogsContext } from "../../../abstractions.js";
4
4
  import { AUDIT } from "../../../config.js";
5
5
  import { getAuditConfig } from "../../../utils/getAuditConfig.js";
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","TeamAfterCreateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterCreateHandlerImpl","constructor","context","handle","event","team","payload","createAuditLog","SECURITY","TEAM","CREATE","id","error","from","message","code","AuditLogTeamAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterCreateEventHandler } from \"@webiny/api-core/features/CreateTeam\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { team } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.CREATE);\n\n await createAuditLog(\"Team created\", team, team.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterCreateHandler = TeamAfterCreateEventHandler.createImplementation({\n implementation: AuditLogTeamAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,2BAA2B,QAAQ,sCAAsC;AAClF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAAkD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGR,cAAc,CAACD,KAAK,CAACU,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAAC,cAAc,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACrE,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGpB,2BAA2B,CAACqB,oBAAoB,CAAC;EAC3FC,cAAc,EAAElB,kCAAkC;EAClDmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","TeamAfterCreateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterCreateHandlerImpl","constructor","context","handle","event","team","payload","createAuditLog","SECURITY","TEAM","CREATE","id","error","from","message","code","AuditLogTeamAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterCreateEventHandler } from \"@webiny/api-core/features/security/teams/CreateTeam/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { team } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.CREATE);\n\n await createAuditLog(\"Team created\", team, team.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterCreateHandler = TeamAfterCreateEventHandler.createImplementation({\n implementation: AuditLogTeamAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,2BAA2B,QAAQ,8DAA8D;AAC1G,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAAkD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGR,cAAc,CAACD,KAAK,CAACU,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAAC,cAAc,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACrE,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGpB,2BAA2B,CAACqB,oBAAoB,CAAC;EAC3FC,cAAc,EAAElB,kCAAkC;EAClDmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { TeamAfterDeleteEventHandler } from "@webiny/api-core/features/DeleteTeam";
1
+ import { TeamAfterDeleteEventHandler } from "@webiny/api-core/features/security/teams/DeleteTeam/index.js";
2
2
  import { AuditLogsContext } from "../../../abstractions.js";
3
3
  declare class AuditLogTeamAfterDeleteHandlerImpl implements TeamAfterDeleteEventHandler.Interface {
4
4
  private context;
@@ -6,6 +6,6 @@ declare class AuditLogTeamAfterDeleteHandlerImpl implements TeamAfterDeleteEvent
6
6
  handle(event: TeamAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogTeamAfterDeleteHandler: typeof AuditLogTeamAfterDeleteHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/DeleteTeam").TeamAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/teams/DeleteTeam/events").TeamAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import WebinyError from "@webiny/error";
2
- import { TeamAfterDeleteEventHandler } from "@webiny/api-core/features/DeleteTeam";
2
+ import { TeamAfterDeleteEventHandler } from "@webiny/api-core/features/security/teams/DeleteTeam/index.js";
3
3
  import { AuditLogsContext } from "../../../abstractions.js";
4
4
  import { AUDIT } from "../../../config.js";
5
5
  import { getAuditConfig } from "../../../utils/getAuditConfig.js";
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","TeamAfterDeleteEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterDeleteHandlerImpl","constructor","context","handle","event","team","payload","createAuditLog","SECURITY","TEAM","DELETE","id","error","from","message","code","AuditLogTeamAfterDeleteHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterDeleteEventHandler } from \"@webiny/api-core/features/DeleteTeam\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterDeleteHandlerImpl implements TeamAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { team } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.DELETE);\n\n await createAuditLog(\"Team deleted\", team, team.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterDeleteHandler = TeamAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogTeamAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,2BAA2B,QAAQ,sCAAsC;AAClF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAAkD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGR,cAAc,CAACD,KAAK,CAACU,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAAC,cAAc,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACrE,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGpB,2BAA2B,CAACqB,oBAAoB,CAAC;EAC3FC,cAAc,EAAElB,kCAAkC;EAClDmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","TeamAfterDeleteEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterDeleteHandlerImpl","constructor","context","handle","event","team","payload","createAuditLog","SECURITY","TEAM","DELETE","id","error","from","message","code","AuditLogTeamAfterDeleteHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterDeleteEventHandler } from \"@webiny/api-core/features/security/teams/DeleteTeam/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterDeleteHandlerImpl implements TeamAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { team } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.DELETE);\n\n await createAuditLog(\"Team deleted\", team, team.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterDeleteHandler = TeamAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogTeamAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,2BAA2B,QAAQ,8DAA8D;AAC1G,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAAkD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGR,cAAc,CAACD,KAAK,CAACU,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAAC,cAAc,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACrE,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGpB,2BAA2B,CAACqB,oBAAoB,CAAC;EAC3FC,cAAc,EAAElB,kCAAkC;EAClDmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { TeamAfterUpdateEventHandler } from "@webiny/api-core/features/UpdateTeam";
1
+ import { TeamAfterUpdateEventHandler } from "@webiny/api-core/features/security/teams/UpdateTeam/index.js";
2
2
  import { AuditLogsContext } from "../../../abstractions.js";
3
3
  declare class AuditLogTeamAfterUpdateHandlerImpl implements TeamAfterUpdateEventHandler.Interface {
4
4
  private context;
@@ -6,6 +6,6 @@ declare class AuditLogTeamAfterUpdateHandlerImpl implements TeamAfterUpdateEvent
6
6
  handle(event: TeamAfterUpdateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogTeamAfterUpdateHandler: typeof AuditLogTeamAfterUpdateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/UpdateTeam").TeamAfterUpdateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/security/teams/UpdateTeam/events").TeamAfterUpdateEvent>>;
10
10
  };
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import WebinyError from "@webiny/error";
2
- import { TeamAfterUpdateEventHandler } from "@webiny/api-core/features/UpdateTeam";
2
+ import { TeamAfterUpdateEventHandler } from "@webiny/api-core/features/security/teams/UpdateTeam/index.js";
3
3
  import { AuditLogsContext } from "../../../abstractions.js";
4
4
  import { AUDIT } from "../../../config.js";
5
5
  import { getAuditConfig } from "../../../utils/getAuditConfig.js";
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","TeamAfterUpdateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterUpdateHandlerImpl","constructor","context","handle","event","updated","original","payload","createAuditLog","SECURITY","TEAM","UPDATE","before","after","id","error","from","message","code","AuditLogTeamAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterUpdateEventHandler } from \"@webiny/api-core/features/UpdateTeam\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterUpdateHandlerImpl implements TeamAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.UPDATE);\n\n await createAuditLog(\n \"Team updated\",\n { before: original, after: updated },\n updated.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterUpdateHandler = TeamAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogTeamAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,2BAA2B,QAAQ,sCAAsC;AAClF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAAkD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC,OAAO;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC3C,MAAMC,cAAc,GAAGT,cAAc,CAACD,KAAK,CAACW,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAChB,cAAc,EACd;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAQ,CAAC,EACpCA,OAAO,CAACS,EAAE,EACV,IAAI,CAACZ,OACT,CAAC;IACL,CAAC,CAAC,OAAOa,KAAK,EAAE;MACZ,MAAMpB,WAAW,CAACqB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGvB,2BAA2B,CAACwB,oBAAoB,CAAC;EAC3FC,cAAc,EAAErB,kCAAkC;EAClDsB,YAAY,EAAE,CAACzB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","TeamAfterUpdateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterUpdateHandlerImpl","constructor","context","handle","event","updated","original","payload","createAuditLog","SECURITY","TEAM","UPDATE","before","after","id","error","from","message","code","AuditLogTeamAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterUpdateEventHandler } from \"@webiny/api-core/features/security/teams/UpdateTeam/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterUpdateHandlerImpl implements TeamAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.UPDATE);\n\n await createAuditLog(\n \"Team updated\",\n { before: original, after: updated },\n updated.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterUpdateHandler = TeamAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogTeamAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,2BAA2B,QAAQ,8DAA8D;AAC1G,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAAkD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC,OAAO;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC3C,MAAMC,cAAc,GAAGT,cAAc,CAACD,KAAK,CAACW,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAChB,cAAc,EACd;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAQ,CAAC,EACpCA,OAAO,CAACS,EAAE,EACV,IAAI,CAACZ,OACT,CAAC;IACL,CAAC,CAAC,OAAOa,KAAK,EAAE;MACZ,MAAMpB,WAAW,CAACqB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGvB,2BAA2B,CAACwB,oBAAoB,CAAC;EAC3FC,cAAc,EAAErB,kCAAkC;EAClDsB,YAAY,EAAE,CAACzB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { UserAfterCreateEventHandler } from "@webiny/api-core/features/CreateUser";
1
+ import { UserAfterCreateEventHandler } from "@webiny/api-core/features/users/CreateUser/index.js";
2
2
  import { AuditLogsContext } from "../../../abstractions.js";
3
3
  declare class AuditLogUserAfterCreateHandlerImpl implements UserAfterCreateEventHandler.Interface {
4
4
  private context;
@@ -6,6 +6,6 @@ declare class AuditLogUserAfterCreateHandlerImpl implements UserAfterCreateEvent
6
6
  handle(event: UserAfterCreateEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogUserAfterCreateHandler: typeof AuditLogUserAfterCreateHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/CreateUser").UserAfterCreateEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/users/CreateUser/events").UserAfterCreateEvent>>;
10
10
  };
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import WebinyError from "@webiny/error";
2
- import { UserAfterCreateEventHandler } from "@webiny/api-core/features/CreateUser";
2
+ import { UserAfterCreateEventHandler } from "@webiny/api-core/features/users/CreateUser/index.js";
3
3
  import { AuditLogsContext } from "../../../abstractions.js";
4
4
  import { AUDIT } from "../../../config.js";
5
5
  import { getAuditConfig } from "../../../utils/getAuditConfig.js";
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","UserAfterCreateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogUserAfterCreateHandlerImpl","constructor","context","handle","event","user","payload","createAuditLog","SECURITY","USER","CREATE","id","error","from","message","code","AuditLogUserAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogUserAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { UserAfterCreateEventHandler } from \"@webiny/api-core/features/CreateUser\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogUserAfterCreateHandlerImpl implements UserAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: UserAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { user } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.USER.CREATE);\n\n await createAuditLog(\"User created\", user, user.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogUserAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_USER_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogUserAfterCreateHandler = UserAfterCreateEventHandler.createImplementation({\n implementation: AuditLogUserAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,2BAA2B,QAAQ,sCAAsC;AAClF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAAkD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGR,cAAc,CAACD,KAAK,CAACU,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAAC,cAAc,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACrE,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGpB,2BAA2B,CAACqB,oBAAoB,CAAC;EAC3FC,cAAc,EAAElB,kCAAkC;EAClDmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","UserAfterCreateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogUserAfterCreateHandlerImpl","constructor","context","handle","event","user","payload","createAuditLog","SECURITY","USER","CREATE","id","error","from","message","code","AuditLogUserAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogUserAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { UserAfterCreateEventHandler } from \"@webiny/api-core/features/users/CreateUser/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogUserAfterCreateHandlerImpl implements UserAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: UserAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { user } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.USER.CREATE);\n\n await createAuditLog(\"User created\", user, user.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogUserAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_USER_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogUserAfterCreateHandler = UserAfterCreateEventHandler.createImplementation({\n implementation: AuditLogUserAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,2BAA2B,QAAQ,qDAAqD;AACjG,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAAkD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGR,cAAc,CAACD,KAAK,CAACU,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAAC,cAAc,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACrE,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGpB,2BAA2B,CAACqB,oBAAoB,CAAC;EAC3FC,cAAc,EAAElB,kCAAkC;EAClDmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { UserAfterDeleteEventHandler } from "@webiny/api-core/features/DeleteUser";
1
+ import { UserAfterDeleteEventHandler } from "@webiny/api-core/features/users/DeleteUser/index.js";
2
2
  import { AuditLogsContext } from "../../../abstractions.js";
3
3
  declare class AuditLogUserAfterDeleteHandlerImpl implements UserAfterDeleteEventHandler.Interface {
4
4
  private context;
@@ -6,6 +6,6 @@ declare class AuditLogUserAfterDeleteHandlerImpl implements UserAfterDeleteEvent
6
6
  handle(event: UserAfterDeleteEventHandler.Event): Promise<void>;
7
7
  }
8
8
  export declare const AuditLogUserAfterDeleteHandler: typeof AuditLogUserAfterDeleteHandlerImpl & {
9
- __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/DeleteUser").UserAfterDeleteEvent>>;
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/users/DeleteUser/events").UserAfterDeleteEvent>>;
10
10
  };
11
11
  export {};
@@ -1,5 +1,5 @@
1
1
  import WebinyError from "@webiny/error";
2
- import { UserAfterDeleteEventHandler } from "@webiny/api-core/features/DeleteUser";
2
+ import { UserAfterDeleteEventHandler } from "@webiny/api-core/features/users/DeleteUser/index.js";
3
3
  import { AuditLogsContext } from "../../../abstractions.js";
4
4
  import { AUDIT } from "../../../config.js";
5
5
  import { getAuditConfig } from "../../../utils/getAuditConfig.js";