@webiny/api-audit-logs 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.eb81deee7e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AuditLogsFeature.d.ts +8 -0
- package/AuditLogsFeature.js +32 -0
- package/AuditLogsFeature.js.map +1 -0
- package/README.md +11 -1
- package/abstractions.d.ts +15 -0
- package/abstractions.js +6 -0
- package/abstractions.js.map +1 -0
- package/config.d.ts +0 -13
- package/config.js +4 -291
- package/config.js.map +1 -1
- package/domain/errors.d.ts +5 -0
- package/domain/errors.js +11 -0
- package/domain/errors.js.map +1 -0
- package/events/AuditLogAfterCreateEvent.d.ts +6 -0
- package/events/AuditLogAfterCreateEvent.js +13 -0
- package/events/AuditLogAfterCreateEvent.js.map +1 -0
- package/events/AuditLogAfterUpdateEvent.d.ts +6 -0
- package/events/AuditLogAfterUpdateEvent.js +13 -0
- package/events/AuditLogAfterUpdateEvent.js.map +1 -0
- package/events/AuditLogBeforeCreateEvent.d.ts +6 -0
- package/events/AuditLogBeforeCreateEvent.js +13 -0
- package/events/AuditLogBeforeCreateEvent.js.map +1 -0
- package/events/AuditLogBeforeUpdateEvent.d.ts +6 -0
- package/events/AuditLogBeforeUpdateEvent.js +13 -0
- package/events/AuditLogBeforeUpdateEvent.js.map +1 -0
- package/events/abstractions.d.ts +38 -0
- package/events/abstractions.js +8 -0
- package/events/abstractions.js.map +1 -0
- package/events/index.d.ts +5 -0
- package/events/index.js +5 -0
- package/features/AuditLogPermissions/AuditLogPermissions.d.ts +15 -0
- package/features/AuditLogPermissions/AuditLogPermissions.js +24 -0
- package/features/AuditLogPermissions/AuditLogPermissions.js.map +1 -0
- package/features/AuditLogPermissions/abstractions.d.ts +11 -0
- package/features/AuditLogPermissions/abstractions.js +5 -0
- package/features/AuditLogPermissions/abstractions.js.map +1 -0
- package/features/AuditLogPermissions/feature.d.ts +4 -0
- package/features/AuditLogPermissions/feature.js +11 -0
- package/features/AuditLogPermissions/feature.js.map +1 -0
- package/features/CreateAuditLog/CreateAuditLogGateway.d.ts +12 -0
- package/features/CreateAuditLog/CreateAuditLogGateway.js +23 -0
- package/features/CreateAuditLog/CreateAuditLogGateway.js.map +1 -0
- package/features/CreateAuditLog/CreateAuditLogRepository.d.ts +14 -0
- package/features/CreateAuditLog/CreateAuditLogRepository.js +25 -0
- package/features/CreateAuditLog/CreateAuditLogRepository.js.map +1 -0
- package/features/CreateAuditLog/CreateAuditLogUseCase.d.ts +24 -0
- package/features/CreateAuditLog/CreateAuditLogUseCase.js +70 -0
- package/features/CreateAuditLog/CreateAuditLogUseCase.js.map +1 -0
- package/features/CreateAuditLog/abstractions.d.ts +42 -0
- package/features/CreateAuditLog/abstractions.js +7 -0
- package/features/CreateAuditLog/abstractions.js.map +1 -0
- package/features/CreateAuditLog/feature.d.ts +4 -0
- package/features/CreateAuditLog/feature.js +15 -0
- package/features/CreateAuditLog/feature.js.map +1 -0
- package/features/GetAuditLog/GetAuditLogGateway.d.ts +13 -0
- package/features/GetAuditLog/GetAuditLogGateway.js +21 -0
- package/features/GetAuditLog/GetAuditLogGateway.js.map +1 -0
- package/features/GetAuditLog/GetAuditLogRepository.d.ts +16 -0
- package/features/GetAuditLog/GetAuditLogRepository.js +32 -0
- package/features/GetAuditLog/GetAuditLogRepository.js.map +1 -0
- package/features/GetAuditLog/GetAuditLogUseCase.d.ts +15 -0
- package/features/GetAuditLog/GetAuditLogUseCase.js +29 -0
- package/features/GetAuditLog/GetAuditLogUseCase.js.map +1 -0
- package/features/GetAuditLog/abstractions.d.ts +42 -0
- package/features/GetAuditLog/abstractions.js +7 -0
- package/features/GetAuditLog/abstractions.js.map +1 -0
- package/features/GetAuditLog/feature.d.ts +4 -0
- package/features/GetAuditLog/feature.js +15 -0
- package/features/GetAuditLog/feature.js.map +1 -0
- package/features/ListAuditLogs/ListAuditLogsGateway.d.ts +12 -0
- package/features/ListAuditLogs/ListAuditLogsGateway.js +24 -0
- package/features/ListAuditLogs/ListAuditLogsGateway.js.map +1 -0
- package/features/ListAuditLogs/ListAuditLogsRepository.d.ts +17 -0
- package/features/ListAuditLogs/ListAuditLogsRepository.js +38 -0
- package/features/ListAuditLogs/ListAuditLogsRepository.js.map +1 -0
- package/features/ListAuditLogs/ListAuditLogsUseCase.d.ts +15 -0
- package/features/ListAuditLogs/ListAuditLogsUseCase.js +27 -0
- package/features/ListAuditLogs/ListAuditLogsUseCase.js.map +1 -0
- package/features/ListAuditLogs/abstractions.d.ts +55 -0
- package/features/ListAuditLogs/abstractions.js +7 -0
- package/features/ListAuditLogs/abstractions.js.map +1 -0
- package/features/ListAuditLogs/feature.d.ts +4 -0
- package/features/ListAuditLogs/feature.js +15 -0
- package/features/ListAuditLogs/feature.js.map +1 -0
- package/features/RecordAuditLog/RecordAuditLogUseCase.d.ts +30 -0
- package/features/RecordAuditLog/RecordAuditLogUseCase.js +108 -0
- package/features/RecordAuditLog/RecordAuditLogUseCase.js.map +1 -0
- package/features/RecordAuditLog/abstractions.d.ts +26 -0
- package/features/RecordAuditLog/abstractions.js +5 -0
- package/features/RecordAuditLog/abstractions.js.map +1 -0
- package/features/RecordAuditLog/feature.d.ts +4 -0
- package/features/RecordAuditLog/feature.js +11 -0
- package/features/RecordAuditLog/feature.js.map +1 -0
- package/features/UpdateAuditLog/UpdateAuditLogGateway.d.ts +12 -0
- package/features/UpdateAuditLog/UpdateAuditLogGateway.js +23 -0
- package/features/UpdateAuditLog/UpdateAuditLogGateway.js.map +1 -0
- package/features/UpdateAuditLog/UpdateAuditLogRepository.d.ts +14 -0
- package/features/UpdateAuditLog/UpdateAuditLogRepository.js +25 -0
- package/features/UpdateAuditLog/UpdateAuditLogRepository.js.map +1 -0
- package/features/UpdateAuditLog/UpdateAuditLogUseCase.d.ts +18 -0
- package/features/UpdateAuditLog/UpdateAuditLogUseCase.js +53 -0
- package/features/UpdateAuditLog/UpdateAuditLogUseCase.js.map +1 -0
- package/features/UpdateAuditLog/abstractions.d.ts +42 -0
- package/features/UpdateAuditLog/abstractions.js +7 -0
- package/features/UpdateAuditLog/abstractions.js.map +1 -0
- package/features/UpdateAuditLog/feature.d.ts +4 -0
- package/features/UpdateAuditLog/feature.js +15 -0
- package/features/UpdateAuditLog/feature.js.map +1 -0
- package/graphql/AuditLogsGraphQLSchema.d.ts +10 -0
- package/graphql/AuditLogsGraphQLSchema.js +139 -0
- package/graphql/AuditLogsGraphQLSchema.js.map +1 -0
- package/graphql/validation.d.ts +21 -0
- package/graphql/validation.js +31 -0
- package/graphql/validation.js.map +1 -0
- package/index.d.ts +3 -5
- package/index.js +2 -49
- package/package.json +34 -26
- package/storage/abstractions/Storage.d.ts +108 -0
- package/storage/abstractions/Storage.js +0 -0
- package/storage/types.d.ts +19 -0
- package/storage/types.js +0 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +45 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +53 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +51 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -0
- package/subscriptions/aco/index.d.ts +2 -2
- package/subscriptions/aco/index.js +8 -15
- package/subscriptions/aco/index.js.map +1 -1
- package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.d.ts +11 -0
- package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.js +45 -0
- package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.js.map +1 -0
- package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.d.ts +11 -0
- package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.js +42 -0
- package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.js.map +1 -0
- package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.d.ts +11 -0
- package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.js +44 -0
- package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.js.map +1 -0
- package/subscriptions/ai/index.d.ts +2 -0
- package/subscriptions/ai/index.js +11 -0
- package/subscriptions/ai/index.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +35 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +35 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +38 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +38 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -0
- package/subscriptions/fileManager/index.d.ts +2 -2
- package/subscriptions/fileManager/index.js +10 -14
- package/subscriptions/fileManager/index.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +36 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +46 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +36 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +36 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +36 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +39 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +36 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +36 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +35 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +35 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +38 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +35 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +35 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js +38 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/index.d.ts +2 -2
- package/subscriptions/headlessCms/index.js +30 -28
- package/subscriptions/headlessCms/index.js.map +1 -1
- package/subscriptions/index.d.ts +2 -2
- package/subscriptions/index.js +16 -22
- package/subscriptions/index.js.map +1 -1
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +11 -0
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +37 -0
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -0
- package/subscriptions/mailer/index.d.ts +2 -2
- package/subscriptions/mailer/index.js +4 -10
- package/subscriptions/mailer/index.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +45 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +45 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +49 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +35 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +35 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +38 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +35 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +35 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +38 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +35 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +35 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +38 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/cleanupApiKey.d.ts +7 -0
- package/subscriptions/security/handlers/cleanupApiKey.js +12 -0
- package/subscriptions/security/handlers/cleanupApiKey.js.map +1 -0
- package/subscriptions/security/index.d.ts +2 -2
- package/subscriptions/security/index.js +26 -24
- package/subscriptions/security/index.js.map +1 -1
- package/subscriptions/websiteBuilder/index.d.ts +2 -0
- package/subscriptions/websiteBuilder/index.js +29 -0
- package/subscriptions/websiteBuilder/index.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +35 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +35 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +35 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +38 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +35 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +35 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +35 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +38 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +35 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +35 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +35 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +38 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -0
- package/types.d.ts +14 -38
- package/types.js +0 -18
- package/utils/expiresAt.d.ts +4 -0
- package/utils/expiresAt.js +20 -0
- package/utils/expiresAt.js.map +1 -0
- package/utils/getAuditObject.d.ts +2 -1
- package/utils/getAuditObject.js +14 -22
- package/utils/getAuditObject.js.map +1 -1
- package/app/app.d.ts +0 -2
- package/app/app.js +0 -119
- package/app/app.js.map +0 -1
- package/app/contants.d.ts +0 -2
- package/app/contants.js +0 -10
- package/app/contants.js.map +0 -1
- package/app/createAppModifier.d.ts +0 -4
- package/app/createAppModifier.js +0 -14
- package/app/createAppModifier.js.map +0 -1
- package/app/index.d.ts +0 -4
- package/app/index.js +0 -43
- package/app/index.js.map +0 -1
- package/app/types.d.ts +0 -7
- package/app/types.js +0 -7
- package/app/types.js.map +0 -1
- package/index.js.map +0 -1
- package/subscriptions/aco/folders.d.ts +0 -4
- package/subscriptions/aco/folders.js +0 -94
- package/subscriptions/aco/folders.js.map +0 -1
- package/subscriptions/apw/changeRequests.d.ts +0 -4
- package/subscriptions/apw/changeRequests.js +0 -80
- package/subscriptions/apw/changeRequests.js.map +0 -1
- package/subscriptions/apw/comments.d.ts +0 -2
- package/subscriptions/apw/comments.js +0 -28
- package/subscriptions/apw/comments.js.map +0 -1
- package/subscriptions/apw/contentReviews.d.ts +0 -2
- package/subscriptions/apw/contentReviews.js +0 -28
- package/subscriptions/apw/contentReviews.js.map +0 -1
- package/subscriptions/apw/index.d.ts +0 -2
- package/subscriptions/apw/index.js +0 -26
- package/subscriptions/apw/index.js.map +0 -1
- package/subscriptions/apw/workflows.d.ts +0 -4
- package/subscriptions/apw/workflows.js +0 -64
- package/subscriptions/apw/workflows.js.map +0 -1
- package/subscriptions/fileManager/files.d.ts +0 -4
- package/subscriptions/fileManager/files.js +0 -64
- package/subscriptions/fileManager/files.js.map +0 -1
- package/subscriptions/fileManager/settings.d.ts +0 -2
- package/subscriptions/fileManager/settings.js +0 -32
- package/subscriptions/fileManager/settings.js.map +0 -1
- package/subscriptions/headlessCms/entries.d.ts +0 -9
- package/subscriptions/headlessCms/entries.js +0 -183
- package/subscriptions/headlessCms/entries.js.map +0 -1
- package/subscriptions/headlessCms/groups.d.ts +0 -4
- package/subscriptions/headlessCms/groups.js +0 -64
- package/subscriptions/headlessCms/groups.js.map +0 -1
- package/subscriptions/headlessCms/models.d.ts +0 -4
- package/subscriptions/headlessCms/models.js +0 -64
- package/subscriptions/headlessCms/models.js.map +0 -1
- package/subscriptions/headlessCms/utils/isSearchModelEntry.d.ts +0 -1
- package/subscriptions/headlessCms/utils/isSearchModelEntry.js +0 -13
- package/subscriptions/headlessCms/utils/isSearchModelEntry.js.map +0 -1
- package/subscriptions/i18n/index.d.ts +0 -2
- package/subscriptions/i18n/index.js +0 -15
- package/subscriptions/i18n/index.js.map +0 -1
- package/subscriptions/i18n/locales.d.ts +0 -4
- package/subscriptions/i18n/locales.js +0 -64
- package/subscriptions/i18n/locales.js.map +0 -1
- package/subscriptions/mailer/settings.d.ts +0 -2
- package/subscriptions/mailer/settings.js +0 -32
- package/subscriptions/mailer/settings.js.map +0 -1
- package/subscriptions/security/apiKeys.d.ts +0 -4
- package/subscriptions/security/apiKeys.js +0 -85
- package/subscriptions/security/apiKeys.js.map +0 -1
- package/subscriptions/security/roles.d.ts +0 -4
- package/subscriptions/security/roles.js +0 -64
- package/subscriptions/security/roles.js.map +0 -1
- package/subscriptions/security/teams.d.ts +0 -4
- package/subscriptions/security/teams.js +0 -64
- package/subscriptions/security/teams.js.map +0 -1
- package/subscriptions/security/users.d.ts +0 -4
- package/subscriptions/security/users.js +0 -64
- package/subscriptions/security/users.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/getAuditConfig.d.ts +0 -36
- package/utils/getAuditConfig.js +0 -149
- package/utils/getAuditConfig.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/index.js","sources":["../../../src/subscriptions/headlessCms/index.ts"],"sourcesContent":["import type { Container } from \"@webiny/di\";\nimport { AuditLogEntryAfterCreateEventHandler } from \"./handlers/AuditLogEntryAfterCreateEventHandler.js\";\nimport { AuditLogEntryAfterUpdateEventHandler } from \"./handlers/AuditLogEntryAfterUpdateEventHandler.js\";\nimport { AuditLogEntryAfterDeleteEventHandler } from \"./handlers/AuditLogEntryAfterDeleteEventHandler.js\";\nimport { AuditLogEntryAfterPublishEventHandler } from \"./handlers/AuditLogEntryAfterPublishEventHandler.js\";\nimport { AuditLogEntryAfterUnpublishEventHandler } from \"./handlers/AuditLogEntryAfterUnpublishEventHandler.js\";\nimport { AuditLogEntryAfterRestoreFromBinEventHandler } from \"./handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js\";\nimport { AuditLogEntryRevisionAfterCreateEventHandler } from \"./handlers/AuditLogEntryRevisionAfterCreateEventHandler.js\";\nimport { AuditLogEntryRevisionAfterDeleteEventHandler } from \"./handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js\";\nimport { AuditLogModelAfterCreateEventHandler } from \"./handlers/AuditLogModelAfterCreateEventHandler.js\";\nimport { AuditLogModelAfterUpdateEventHandler } from \"./handlers/AuditLogModelAfterUpdateEventHandler.js\";\nimport { AuditLogModelAfterDeleteEventHandler } from \"./handlers/AuditLogModelAfterDeleteEventHandler.js\";\nimport { AuditLogGroupAfterCreateEventHandler } from \"./handlers/AuditLogGroupAfterCreateEventHandler.js\";\nimport { AuditLogGroupAfterUpdateEventHandler } from \"./handlers/AuditLogGroupAfterUpdateEventHandler.js\";\nimport { AuditLogGroupAfterDeleteEventHandler } from \"./handlers/AuditLogGroupAfterDeleteEventHandler.js\";\n\nexport const createHeadlessCmsHooks = (container: Container) => {\n // Register entry handlers\n container.register(AuditLogEntryAfterCreateEventHandler);\n container.register(AuditLogEntryAfterUpdateEventHandler);\n container.register(AuditLogEntryAfterDeleteEventHandler);\n container.register(AuditLogEntryAfterPublishEventHandler);\n container.register(AuditLogEntryAfterUnpublishEventHandler);\n container.register(AuditLogEntryAfterRestoreFromBinEventHandler);\n container.register(AuditLogEntryRevisionAfterCreateEventHandler);\n container.register(AuditLogEntryRevisionAfterDeleteEventHandler);\n\n // Register model handlers\n container.register(AuditLogModelAfterCreateEventHandler);\n container.register(AuditLogModelAfterUpdateEventHandler);\n container.register(AuditLogModelAfterDeleteEventHandler);\n\n // Register group handlers\n container.register(AuditLogGroupAfterCreateEventHandler);\n container.register(AuditLogGroupAfterUpdateEventHandler);\n container.register(AuditLogGroupAfterDeleteEventHandler);\n};\n"],"names":["createHeadlessCmsHooks","container","AuditLogEntryAfterCreateEventHandler","AuditLogEntryAfterUpdateEventHandler","AuditLogEntryAfterDeleteEventHandler","AuditLogEntryAfterPublishEventHandler","AuditLogEntryAfterUnpublishEventHandler","AuditLogEntryAfterRestoreFromBinEventHandler","AuditLogEntryRevisionAfterCreateEventHandler","AuditLogEntryRevisionAfterDeleteEventHandler","AuditLogModelAfterCreateEventHandler","AuditLogModelAfterUpdateEventHandler","AuditLogModelAfterDeleteEventHandler","AuditLogGroupAfterCreateEventHandler","AuditLogGroupAfterUpdateEventHandler","AuditLogGroupAfterDeleteEventHandler"],"mappings":";;;;;;;;;;;;;;AAgBO,MAAMA,yBAAyB,CAACC;IAEnCA,UAAU,QAAQ,CAACC;IACnBD,UAAU,QAAQ,CAACE;IACnBF,UAAU,QAAQ,CAACG;IACnBH,UAAU,QAAQ,CAACI;IACnBJ,UAAU,QAAQ,CAACK;IACnBL,UAAU,QAAQ,CAACM;IACnBN,UAAU,QAAQ,CAACO;IACnBP,UAAU,QAAQ,CAACQ;IAGnBR,UAAU,QAAQ,CAACS;IACnBT,UAAU,QAAQ,CAACU;IACnBV,UAAU,QAAQ,CAACW;IAGnBX,UAAU,QAAQ,CAACY;IACnBZ,UAAU,QAAQ,CAACa;IACnBb,UAAU,QAAQ,CAACc;AACvB"}
|
package/subscriptions/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const createSubscriptionHooks: (
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
2
|
+
export declare const createSubscriptionHooks: (container: Container) => void;
|
package/subscriptions/index.js
CHANGED
|
@@ -1,25 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(0, _headlessCms.createHeadlessCmsHooks)(context);
|
|
17
|
-
(0, _security.createSecurityHooks)(context);
|
|
18
|
-
(0, _i18n.createI18NHooks)(context);
|
|
19
|
-
(0, _mailer.createMailerHooks)(context);
|
|
20
|
-
(0, _aco.createAcoHooks)(context);
|
|
21
|
-
context.wcp.canUseFeature("advancedPublishingWorkflow") && (0, _apw.createApwHooks)(context);
|
|
1
|
+
import { createFileManagerHooks } from "./fileManager/index.js";
|
|
2
|
+
import { createHeadlessCmsHooks } from "./headlessCms/index.js";
|
|
3
|
+
import { createSecurityHooks } from "./security/index.js";
|
|
4
|
+
import { createMailerHooks } from "./mailer/index.js";
|
|
5
|
+
import { createAcoHooks } from "./aco/index.js";
|
|
6
|
+
import { createWebsiteBuilderHooks } from "./websiteBuilder/index.js";
|
|
7
|
+
import { createAiHooks } from "./ai/index.js";
|
|
8
|
+
const createSubscriptionHooks = (container)=>{
|
|
9
|
+
createFileManagerHooks(container);
|
|
10
|
+
createHeadlessCmsHooks(container);
|
|
11
|
+
createSecurityHooks(container);
|
|
12
|
+
createMailerHooks(container);
|
|
13
|
+
createAcoHooks(container);
|
|
14
|
+
createWebsiteBuilderHooks(container);
|
|
15
|
+
createAiHooks(container);
|
|
22
16
|
};
|
|
23
|
-
|
|
17
|
+
export { createSubscriptionHooks };
|
|
24
18
|
|
|
25
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/index.js","sources":["../../src/subscriptions/index.ts"],"sourcesContent":["import { createFileManagerHooks } from \"./fileManager/index.js\";\nimport { createHeadlessCmsHooks } from \"./headlessCms/index.js\";\nimport { createSecurityHooks } from \"./security/index.js\";\nimport { createMailerHooks } from \"./mailer/index.js\";\nimport { createAcoHooks } from \"./aco/index.js\";\nimport { createWebsiteBuilderHooks } from \"~/subscriptions/websiteBuilder/index.js\";\nimport { createAiHooks } from \"./ai/index.js\";\nimport type { Container } from \"@webiny/di\";\n\nexport const createSubscriptionHooks = (container: Container) => {\n createFileManagerHooks(container);\n createHeadlessCmsHooks(container);\n createSecurityHooks(container);\n createMailerHooks(container);\n createAcoHooks(container);\n createWebsiteBuilderHooks(container);\n createAiHooks(container);\n};\n"],"names":["createSubscriptionHooks","container","createFileManagerHooks","createHeadlessCmsHooks","createSecurityHooks","createMailerHooks","createAcoHooks","createWebsiteBuilderHooks","createAiHooks"],"mappings":";;;;;;;AASO,MAAMA,0BAA0B,CAACC;IACpCC,uBAAuBD;IACvBE,uBAAuBF;IACvBG,oBAAoBH;IACpBI,kBAAkBJ;IAClBK,eAAeL;IACfM,0BAA0BN;IAC1BO,cAAcP;AAClB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MailerSettingsAfterSaveEventHandler } from "@webiny/api-mailer/features/SaveSettings/index.js";
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
|
+
declare class AuditLogMailerSettingsAfterSaveHandlerImpl implements MailerSettingsAfterSaveEventHandler.Interface {
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
|
+
handle(event: MailerSettingsAfterSaveEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
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>>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { MailerSettingsAfterSaveEventHandler } from "@webiny/api-mailer/features/SaveSettings/index.js";
|
|
3
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
class AuditLogMailerSettingsAfterSaveHandlerImpl {
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
8
|
+
}
|
|
9
|
+
async handle(event) {
|
|
10
|
+
try {
|
|
11
|
+
const { settings } = event.payload;
|
|
12
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
13
|
+
audit: AUDIT.MAILER.SETTINGS.UPDATE,
|
|
14
|
+
message: "Settings updated",
|
|
15
|
+
content: {
|
|
16
|
+
after: settings
|
|
17
|
+
},
|
|
18
|
+
entityId: "-"
|
|
19
|
+
});
|
|
20
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw _webiny_error.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogMailerSettingsAfterSaveHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_MAILER_SETTINGS_SAVE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const AuditLogMailerSettingsAfterSaveHandler = MailerSettingsAfterSaveEventHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogMailerSettingsAfterSaveHandlerImpl,
|
|
31
|
+
dependencies: [
|
|
32
|
+
RecordAuditLogUseCase
|
|
33
|
+
]
|
|
34
|
+
});
|
|
35
|
+
export { AuditLogMailerSettingsAfterSaveHandler };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=AuditLogMailerSettingsAfterSaveHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js","sources":["../../../../src/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { MailerSettingsAfterSaveEventHandler } from \"@webiny/api-mailer/features/SaveSettings/index.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass AuditLogMailerSettingsAfterSaveHandlerImpl\n implements MailerSettingsAfterSaveEventHandler.Interface\n{\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: MailerSettingsAfterSaveEventHandler.Event): Promise<void> {\n try {\n const { settings } = event.payload;\n\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.MAILER.SETTINGS.UPDATE,\n message: \"Settings updated\",\n content: { after: settings },\n entityId: \"-\"\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogMailerSettingsAfterSaveHandler\",\n code: \"AUDIT_LOGS_AFTER_MAILER_SETTINGS_SAVE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogMailerSettingsAfterSaveHandler =\n MailerSettingsAfterSaveEventHandler.createImplementation({\n implementation: AuditLogMailerSettingsAfterSaveHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogMailerSettingsAfterSaveHandlerImpl","recordAuditLog","event","settings","recordResult","AUDIT","error","WebinyError","AuditLogMailerSettingsAfterSaveHandler","MailerSettingsAfterSaveEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IAGF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAgD,EAAiB;QAC1E,IAAI;YACA,MAAM,EAAEC,QAAQ,EAAE,GAAGD,MAAM,OAAO;YAElC,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,MAAM,CAAC,QAAQ,CAAC,MAAM;gBACnC,SAAS;gBACT,SAAS;oBAAE,OAAOF;gBAAS;gBAC3B,UAAU;YACd;YACA,IAAIC,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;QAEhC,EAAE,OAAOE,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,yCACTC,oCAAoC,oBAAoB,CAAC;IACrD,gBAAgBT;IAChB,cAAc;QAACU;KAAsB;AACzC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare const createMailerHooks: (
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
2
|
+
export declare const createMailerHooks: (container: Container) => void;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createMailerHooks = void 0;
|
|
7
|
-
var _settings = require("./settings");
|
|
8
|
-
const createMailerHooks = context => {
|
|
9
|
-
(0, _settings.onSettingsAfterUpdateHook)(context);
|
|
1
|
+
import { AuditLogMailerSettingsAfterSaveHandler } from "./handlers/AuditLogMailerSettingsAfterSaveHandler.js";
|
|
2
|
+
const createMailerHooks = (container)=>{
|
|
3
|
+
container.register(AuditLogMailerSettingsAfterSaveHandler);
|
|
10
4
|
};
|
|
11
|
-
|
|
5
|
+
export { createMailerHooks };
|
|
12
6
|
|
|
13
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/mailer/index.js","sources":["../../../src/subscriptions/mailer/index.ts"],"sourcesContent":["import { AuditLogMailerSettingsAfterSaveHandler } from \"./handlers/AuditLogMailerSettingsAfterSaveHandler.js\";\nimport type { Container } from \"@webiny/di\";\n\nexport const createMailerHooks = (container: Container) => {\n // Register mailer settings event handlers\n container.register(AuditLogMailerSettingsAfterSaveHandler);\n};\n"],"names":["createMailerHooks","container","AuditLogMailerSettingsAfterSaveHandler"],"mappings":";AAGO,MAAMA,oBAAoB,CAACC;IAE9BA,UAAU,QAAQ,CAACC;AACvB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiKeyAfterCreateEventHandler } from "@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js";
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
|
+
declare class AuditLogApiKeyAfterCreateHandlerImpl implements ApiKeyAfterCreateEventHandler.Interface {
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
|
+
handle(event: ApiKeyAfterCreateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
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/security/apiKeys/CreateApiKey/events").ApiKeyAfterCreateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { ApiKeyAfterCreateEventHandler } from "@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js";
|
|
3
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
const cleanupApiKey = (apiKey)=>({
|
|
6
|
+
id: apiKey.id,
|
|
7
|
+
slug: apiKey.slug,
|
|
8
|
+
createdBy: apiKey.createdBy,
|
|
9
|
+
createdOn: apiKey.createdOn,
|
|
10
|
+
description: apiKey.description,
|
|
11
|
+
name: apiKey.name,
|
|
12
|
+
permissions: apiKey.permissions
|
|
13
|
+
});
|
|
14
|
+
class AuditLogApiKeyAfterCreateHandlerImpl {
|
|
15
|
+
constructor(recordAuditLog){
|
|
16
|
+
this.recordAuditLog = recordAuditLog;
|
|
17
|
+
}
|
|
18
|
+
async handle(event) {
|
|
19
|
+
try {
|
|
20
|
+
const { apiKey: initialApiKey } = event.payload;
|
|
21
|
+
const apiKey = cleanupApiKey(initialApiKey);
|
|
22
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
23
|
+
audit: AUDIT.SECURITY.API_KEY.CREATE,
|
|
24
|
+
message: "API key created",
|
|
25
|
+
content: apiKey,
|
|
26
|
+
entityId: apiKey.id
|
|
27
|
+
});
|
|
28
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
throw _webiny_error.from(error, {
|
|
31
|
+
message: "Error while executing AuditLogApiKeyAfterCreateHandler",
|
|
32
|
+
code: "AUDIT_LOGS_AFTER_API_KEY_CREATE_HANDLER"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const AuditLogApiKeyAfterCreateHandler = ApiKeyAfterCreateEventHandler.createImplementation({
|
|
38
|
+
implementation: AuditLogApiKeyAfterCreateHandlerImpl,
|
|
39
|
+
dependencies: [
|
|
40
|
+
RecordAuditLogUseCase
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
export { AuditLogApiKeyAfterCreateHandler };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=AuditLogApiKeyAfterCreateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterCreateEventHandler } from \"@webiny/api-core/features/security/apiKeys/CreateApiKey/index.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.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 recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: ApiKeyAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.SECURITY.API_KEY.CREATE,\n message: \"API key created\",\n content: apiKey,\n entityId: apiKey.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\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: [RecordAuditLogUseCase]\n});\n"],"names":["cleanupApiKey","apiKey","AuditLogApiKeyAfterCreateHandlerImpl","recordAuditLog","event","initialApiKey","recordResult","AUDIT","error","WebinyError","AuditLogApiKeyAfterCreateHandler","ApiKeyAfterCreateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAWA,MAAMA,gBAAgB,CAACC,SACZ;QACH,IAAIA,OAAO,EAAE;QACb,MAAMA,OAAO,IAAI;QACjB,WAAWA,OAAO,SAAS;QAC3B,WAAWA,OAAO,SAAS;QAC3B,aAAaA,OAAO,WAAW;QAC/B,MAAMA,OAAO,IAAI;QACjB,aAAaA,OAAO,WAAW;IACnC;AAGJ,MAAMC;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAA0C,EAAiB;QACpE,IAAI;YACA,MAAM,EAAE,QAAQC,aAAa,EAAE,GAAGD,MAAM,OAAO;YAE/C,MAAMH,SAASD,cAAcK;YAE7B,MAAMC,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM;gBACpC,SAAS;gBACT,SAASN;gBACT,UAAUA,OAAO,EAAE;YACvB;YACA,IAAIK,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;QAEhC,EAAE,OAAOE,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,mCAAmCC,8BAA8B,oBAAoB,CAAC;IAC/F,gBAAgBT;IAChB,cAAc;QAACU;KAAsB;AACzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiKeyAfterDeleteEventHandler } from "@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js";
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
|
+
declare class AuditLogApiKeyAfterDeleteHandlerImpl implements ApiKeyAfterDeleteEventHandler.Interface {
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
|
+
handle(event: ApiKeyAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
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/security/apiKeys/DeleteApiKey/events").ApiKeyAfterDeleteEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { ApiKeyAfterDeleteEventHandler } from "@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js";
|
|
3
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
const cleanupApiKey = (apiKey)=>({
|
|
6
|
+
id: apiKey.id,
|
|
7
|
+
slug: apiKey.slug,
|
|
8
|
+
createdBy: apiKey.createdBy,
|
|
9
|
+
createdOn: apiKey.createdOn,
|
|
10
|
+
description: apiKey.description,
|
|
11
|
+
name: apiKey.name,
|
|
12
|
+
permissions: apiKey.permissions
|
|
13
|
+
});
|
|
14
|
+
class AuditLogApiKeyAfterDeleteHandlerImpl {
|
|
15
|
+
constructor(recordAuditLog){
|
|
16
|
+
this.recordAuditLog = recordAuditLog;
|
|
17
|
+
}
|
|
18
|
+
async handle(event) {
|
|
19
|
+
try {
|
|
20
|
+
const { apiKey: initialApiKey } = event.payload;
|
|
21
|
+
const apiKey = cleanupApiKey(initialApiKey);
|
|
22
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
23
|
+
audit: AUDIT.SECURITY.API_KEY.DELETE,
|
|
24
|
+
message: "API key deleted",
|
|
25
|
+
content: apiKey,
|
|
26
|
+
entityId: apiKey.id
|
|
27
|
+
});
|
|
28
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
29
|
+
} catch (error) {
|
|
30
|
+
throw _webiny_error.from(error, {
|
|
31
|
+
message: "Error while executing AuditLogApiKeyAfterDeleteHandler",
|
|
32
|
+
code: "AUDIT_LOGS_AFTER_API_KEY_DELETE_HANDLER"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const AuditLogApiKeyAfterDeleteHandler = ApiKeyAfterDeleteEventHandler.createImplementation({
|
|
38
|
+
implementation: AuditLogApiKeyAfterDeleteHandlerImpl,
|
|
39
|
+
dependencies: [
|
|
40
|
+
RecordAuditLogUseCase
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
export { AuditLogApiKeyAfterDeleteHandler };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=AuditLogApiKeyAfterDeleteHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterDeleteEventHandler } from \"@webiny/api-core/features/security/apiKeys/DeleteApiKey/index.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.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 recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: ApiKeyAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.SECURITY.API_KEY.DELETE,\n message: \"API key deleted\",\n content: apiKey,\n entityId: apiKey.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\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: [RecordAuditLogUseCase]\n});\n"],"names":["cleanupApiKey","apiKey","AuditLogApiKeyAfterDeleteHandlerImpl","recordAuditLog","event","initialApiKey","recordResult","AUDIT","error","WebinyError","AuditLogApiKeyAfterDeleteHandler","ApiKeyAfterDeleteEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAWA,MAAMA,gBAAgB,CAACC,SACZ;QACH,IAAIA,OAAO,EAAE;QACb,MAAMA,OAAO,IAAI;QACjB,WAAWA,OAAO,SAAS;QAC3B,WAAWA,OAAO,SAAS;QAC3B,aAAaA,OAAO,WAAW;QAC/B,MAAMA,OAAO,IAAI;QACjB,aAAaA,OAAO,WAAW;IACnC;AAGJ,MAAMC;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAA0C,EAAiB;QACpE,IAAI;YACA,MAAM,EAAE,QAAQC,aAAa,EAAE,GAAGD,MAAM,OAAO;YAE/C,MAAMH,SAASD,cAAcK;YAE7B,MAAMC,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM;gBACpC,SAAS;gBACT,SAASN;gBACT,UAAUA,OAAO,EAAE;YACvB;YACA,IAAIK,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;QAEhC,EAAE,OAAOE,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,mCAAmCC,8BAA8B,oBAAoB,CAAC;IAC/F,gBAAgBT;IAChB,cAAc;QAACU;KAAsB;AACzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiKeyAfterUpdateEventHandler } from "@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js";
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
|
+
declare class AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateEventHandler.Interface {
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
|
+
handle(event: ApiKeyAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
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/security/apiKeys/UpdateApiKey/events").ApiKeyAfterUpdateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { ApiKeyAfterUpdateEventHandler } from "@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js";
|
|
3
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
const cleanupApiKey = (apiKey)=>({
|
|
6
|
+
id: apiKey.id,
|
|
7
|
+
slug: apiKey.slug,
|
|
8
|
+
createdBy: apiKey.createdBy,
|
|
9
|
+
createdOn: apiKey.createdOn,
|
|
10
|
+
description: apiKey.description,
|
|
11
|
+
name: apiKey.name,
|
|
12
|
+
permissions: apiKey.permissions
|
|
13
|
+
});
|
|
14
|
+
class AuditLogApiKeyAfterUpdateHandlerImpl {
|
|
15
|
+
constructor(recordAuditLog){
|
|
16
|
+
this.recordAuditLog = recordAuditLog;
|
|
17
|
+
}
|
|
18
|
+
async handle(event) {
|
|
19
|
+
try {
|
|
20
|
+
const { updated: initialApiKey, original: initialOriginalApiKey } = event.payload;
|
|
21
|
+
const apiKey = cleanupApiKey(initialApiKey);
|
|
22
|
+
const original = cleanupApiKey(initialOriginalApiKey);
|
|
23
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
24
|
+
audit: AUDIT.SECURITY.API_KEY.UPDATE,
|
|
25
|
+
message: "API key updated",
|
|
26
|
+
content: {
|
|
27
|
+
before: original,
|
|
28
|
+
after: apiKey
|
|
29
|
+
},
|
|
30
|
+
entityId: apiKey.id
|
|
31
|
+
});
|
|
32
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
33
|
+
} catch (error) {
|
|
34
|
+
throw _webiny_error.from(error, {
|
|
35
|
+
message: "Error while executing AuditLogApiKeyAfterUpdateHandler",
|
|
36
|
+
code: "AUDIT_LOGS_AFTER_API_KEY_UPDATE_HANDLER"
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const AuditLogApiKeyAfterUpdateHandler = ApiKeyAfterUpdateEventHandler.createImplementation({
|
|
42
|
+
implementation: AuditLogApiKeyAfterUpdateHandlerImpl,
|
|
43
|
+
dependencies: [
|
|
44
|
+
RecordAuditLogUseCase
|
|
45
|
+
]
|
|
46
|
+
});
|
|
47
|
+
export { AuditLogApiKeyAfterUpdateHandler };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=AuditLogApiKeyAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterUpdateEventHandler } from \"@webiny/api-core/features/security/apiKeys/UpdateApiKey/index.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.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 recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: ApiKeyAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated: initialApiKey, original: initialOriginalApiKey } = event.payload;\n\n const apiKey = cleanupApiKey(initialApiKey);\n const original = cleanupApiKey(initialOriginalApiKey);\n\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.SECURITY.API_KEY.UPDATE,\n message: \"API key updated\",\n content: {\n before: original,\n after: apiKey\n },\n entityId: apiKey.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\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: [RecordAuditLogUseCase]\n});\n"],"names":["cleanupApiKey","apiKey","AuditLogApiKeyAfterUpdateHandlerImpl","recordAuditLog","event","initialApiKey","initialOriginalApiKey","original","recordResult","AUDIT","error","WebinyError","AuditLogApiKeyAfterUpdateHandler","ApiKeyAfterUpdateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAWA,MAAMA,gBAAgB,CAACC,SACZ;QACH,IAAIA,OAAO,EAAE;QACb,MAAMA,OAAO,IAAI;QACjB,WAAWA,OAAO,SAAS;QAC3B,WAAWA,OAAO,SAAS;QAC3B,aAAaA,OAAO,WAAW;QAC/B,MAAMA,OAAO,IAAI;QACjB,aAAaA,OAAO,WAAW;IACnC;AAGJ,MAAMC;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAA0C,EAAiB;QACpE,IAAI;YACA,MAAM,EAAE,SAASC,aAAa,EAAE,UAAUC,qBAAqB,EAAE,GAAGF,MAAM,OAAO;YAEjF,MAAMH,SAASD,cAAcK;YAC7B,MAAME,WAAWP,cAAcM;YAE/B,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,QAAQ,CAAC,OAAO,CAAC,MAAM;gBACpC,SAAS;gBACT,SAAS;oBACL,QAAQF;oBACR,OAAON;gBACX;gBACA,UAAUA,OAAO,EAAE;YACvB;YACA,IAAIO,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;QAEhC,EAAE,OAAOE,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,mCAAmCC,8BAA8B,oBAAoB,CAAC;IAC/F,gBAAgBX;IAChB,cAAc;QAACY;KAAsB;AACzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
2
|
+
import { RoleAfterCreateEventHandler } from "@webiny/api-core/features/security/roles/CreateRole/index.js";
|
|
3
|
+
declare class AuditLogRoleAfterCreateHandlerImpl implements RoleAfterCreateEventHandler.Interface {
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
|
+
handle(event: RoleAfterCreateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
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>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
|
+
import { AUDIT } from "../../../config.js";
|
|
4
|
+
import { RoleAfterCreateEventHandler } from "@webiny/api-core/features/security/roles/CreateRole/index.js";
|
|
5
|
+
class AuditLogRoleAfterCreateHandlerImpl {
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
8
|
+
}
|
|
9
|
+
async handle(event) {
|
|
10
|
+
try {
|
|
11
|
+
const { role } = event.payload;
|
|
12
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
13
|
+
audit: AUDIT.SECURITY.ROLE.CREATE,
|
|
14
|
+
message: "Role created",
|
|
15
|
+
content: role,
|
|
16
|
+
entityId: role.id
|
|
17
|
+
});
|
|
18
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw _webiny_error.from(error, {
|
|
21
|
+
message: "Error while executing AuditLogRoleAfterCreateHandler",
|
|
22
|
+
code: "AUDIT_LOGS_AFTER_ROLE_CREATE_HANDLER"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const AuditLogRoleAfterCreateHandler = RoleAfterCreateEventHandler.createImplementation({
|
|
28
|
+
implementation: AuditLogRoleAfterCreateHandlerImpl,
|
|
29
|
+
dependencies: [
|
|
30
|
+
RecordAuditLogUseCase
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
export { AuditLogRoleAfterCreateHandler };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=AuditLogRoleAfterCreateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RoleAfterCreateEventHandler } from \"@webiny/api-core/features/security/roles/CreateRole/index.js\";\n\nclass AuditLogRoleAfterCreateHandlerImpl implements RoleAfterCreateEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: RoleAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { role } = event.payload;\n\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.SECURITY.ROLE.CREATE,\n message: \"Role created\",\n content: role,\n entityId: role.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterCreateHandler = RoleAfterCreateEventHandler.createImplementation({\n implementation: AuditLogRoleAfterCreateHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n});\n"],"names":["AuditLogRoleAfterCreateHandlerImpl","recordAuditLog","event","role","recordResult","AUDIT","error","WebinyError","AuditLogRoleAfterCreateHandler","RoleAfterCreateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,OAAO;YAE9B,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;gBACjC,SAAS;gBACT,SAASF;gBACT,UAAUA,KAAK,EAAE;YACrB;YACA,IAAIC,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;QAEhC,EAAE,OAAOE,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBT;IAChB,cAAc;QAACU;KAAsB;AACzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RoleAfterDeleteEventHandler } from "@webiny/api-core/features/security/roles/DeleteRole/index.js";
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
|
+
declare class AuditLogRoleAfterDeleteHandlerImpl implements RoleAfterDeleteEventHandler.Interface {
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
|
+
handle(event: RoleAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
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>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { RoleAfterDeleteEventHandler } from "@webiny/api-core/features/security/roles/DeleteRole/index.js";
|
|
3
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
class AuditLogRoleAfterDeleteHandlerImpl {
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
8
|
+
}
|
|
9
|
+
async handle(event) {
|
|
10
|
+
try {
|
|
11
|
+
const { role } = event.payload;
|
|
12
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
13
|
+
audit: AUDIT.SECURITY.ROLE.DELETE,
|
|
14
|
+
message: "Role deleted",
|
|
15
|
+
content: role,
|
|
16
|
+
entityId: role.id
|
|
17
|
+
});
|
|
18
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw _webiny_error.from(error, {
|
|
21
|
+
message: "Error while executing AuditLogRoleAfterDeleteHandler",
|
|
22
|
+
code: "AUDIT_LOGS_AFTER_ROLE_DELETE_HANDLER"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const AuditLogRoleAfterDeleteHandler = RoleAfterDeleteEventHandler.createImplementation({
|
|
28
|
+
implementation: AuditLogRoleAfterDeleteHandlerImpl,
|
|
29
|
+
dependencies: [
|
|
30
|
+
RecordAuditLogUseCase
|
|
31
|
+
]
|
|
32
|
+
});
|
|
33
|
+
export { AuditLogRoleAfterDeleteHandler };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=AuditLogRoleAfterDeleteHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { RoleAfterDeleteEventHandler } from \"@webiny/api-core/features/security/roles/DeleteRole/index.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass AuditLogRoleAfterDeleteHandlerImpl implements RoleAfterDeleteEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: RoleAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { role } = event.payload;\n\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.SECURITY.ROLE.DELETE,\n message: \"Role deleted\",\n content: role,\n entityId: role.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterDeleteHandler = RoleAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogRoleAfterDeleteHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n});\n"],"names":["AuditLogRoleAfterDeleteHandlerImpl","recordAuditLog","event","role","recordResult","AUDIT","error","WebinyError","AuditLogRoleAfterDeleteHandler","RoleAfterDeleteEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,OAAO;YAE9B,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;gBACjC,SAAS;gBACT,SAASF;gBACT,UAAUA,KAAK,EAAE;YACrB;YACA,IAAIC,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;QAEhC,EAAE,OAAOE,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBT;IAChB,cAAc;QAACU;KAAsB;AACzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RoleAfterUpdateEventHandler } from "@webiny/api-core/features/security/roles/UpdateRole/index.js";
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
|
+
declare class AuditLogRoleAfterUpdateHandlerImpl implements RoleAfterUpdateEventHandler.Interface {
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
|
+
handle(event: RoleAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
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>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
|
+
import { RoleAfterUpdateEventHandler } from "@webiny/api-core/features/security/roles/UpdateRole/index.js";
|
|
3
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
class AuditLogRoleAfterUpdateHandlerImpl {
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
8
|
+
}
|
|
9
|
+
async handle(event) {
|
|
10
|
+
try {
|
|
11
|
+
const { updated, original } = event.payload;
|
|
12
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
13
|
+
audit: AUDIT.SECURITY.ROLE.UPDATE,
|
|
14
|
+
message: "Role updated",
|
|
15
|
+
content: {
|
|
16
|
+
before: original,
|
|
17
|
+
after: updated
|
|
18
|
+
},
|
|
19
|
+
entityId: updated.id
|
|
20
|
+
});
|
|
21
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
throw _webiny_error.from(error, {
|
|
24
|
+
message: "Error while executing AuditLogRoleAfterUpdateHandler",
|
|
25
|
+
code: "AUDIT_LOGS_AFTER_ROLE_UPDATE_HANDLER"
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const AuditLogRoleAfterUpdateHandler = RoleAfterUpdateEventHandler.createImplementation({
|
|
31
|
+
implementation: AuditLogRoleAfterUpdateHandlerImpl,
|
|
32
|
+
dependencies: [
|
|
33
|
+
RecordAuditLogUseCase
|
|
34
|
+
]
|
|
35
|
+
});
|
|
36
|
+
export { AuditLogRoleAfterUpdateHandler };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=AuditLogRoleAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js","sources":["../../../../src/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { RoleAfterUpdateEventHandler } from \"@webiny/api-core/features/security/roles/UpdateRole/index.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass AuditLogRoleAfterUpdateHandlerImpl implements RoleAfterUpdateEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: RoleAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { updated, original } = event.payload;\n\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.SECURITY.ROLE.UPDATE,\n message: \"Role updated\",\n content: { before: original, after: updated },\n entityId: updated.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterUpdateHandler = RoleAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogRoleAfterUpdateHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n});\n"],"names":["AuditLogRoleAfterUpdateHandlerImpl","recordAuditLog","event","updated","original","recordResult","AUDIT","error","WebinyError","AuditLogRoleAfterUpdateHandler","RoleAfterUpdateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAwC,EAAiB;QAClE,IAAI;YACA,MAAM,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGF,MAAM,OAAO;YAE3C,MAAMG,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,QAAQ,CAAC,IAAI,CAAC,MAAM;gBACjC,SAAS;gBACT,SAAS;oBAAE,QAAQF;oBAAU,OAAOD;gBAAQ;gBAC5C,UAAUA,QAAQ,EAAE;YACxB;YACA,IAAIE,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;QAEhC,EAAE,OAAOE,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,iCAAiCC,4BAA4B,oBAAoB,CAAC;IAC3F,gBAAgBV;IAChB,cAAc;QAACW;KAAsB;AACzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TeamAfterCreateEventHandler } from "@webiny/api-core/features/security/teams/CreateTeam/index.js";
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
|
+
declare class AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateEventHandler.Interface {
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
|
+
handle(event: TeamAfterCreateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
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>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|