@webiny/api-audit-logs 0.0.0-unstable.e6f0dc8ca7 → 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/abstractions.d.ts +14 -4
- package/abstractions.js +3 -3
- package/abstractions.js.map +1 -1
- package/config.js +2 -1
- 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.js +8 -5
- package/events/AuditLogAfterCreateEvent.js.map +1 -1
- package/events/AuditLogAfterUpdateEvent.js +8 -5
- package/events/AuditLogAfterUpdateEvent.js.map +1 -1
- package/events/AuditLogBeforeCreateEvent.js +8 -5
- package/events/AuditLogBeforeCreateEvent.js.map +1 -1
- package/events/AuditLogBeforeUpdateEvent.js +8 -5
- package/events/AuditLogBeforeUpdateEvent.js.map +1 -1
- package/events/abstractions.d.ts +0 -5
- package/events/abstractions.js +5 -24
- package/events/abstractions.js.map +1 -1
- package/events/index.js +0 -2
- 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.js +26 -30
- package/graphql/validation.js.map +1 -1
- package/index.d.ts +2 -8
- package/index.js +1 -22
- package/package.json +28 -28
- package/storage/abstractions/Storage.js +0 -3
- package/storage/types.d.ts +0 -35
- package/storage/types.js +0 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +37 -27
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +45 -30
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +43 -34
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -1
- package/subscriptions/aco/index.d.ts +2 -2
- package/subscriptions/aco/index.js +5 -4
- 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 +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +27 -22
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +27 -22
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +30 -26
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +30 -26
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/index.d.ts +2 -2
- package/subscriptions/fileManager/index.js +6 -8
- package/subscriptions/fileManager/index.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +37 -31
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +30 -29
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +30 -26
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js +30 -26
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/index.d.ts +2 -2
- package/subscriptions/headlessCms/index.js +16 -20
- package/subscriptions/headlessCms/index.js.map +1 -1
- package/subscriptions/index.d.ts +2 -2
- package/subscriptions/index.js +10 -7
- package/subscriptions/index.js.map +1 -1
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +3 -3
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +29 -24
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -1
- package/subscriptions/mailer/index.d.ts +2 -2
- package/subscriptions/mailer/index.js +3 -3
- package/subscriptions/mailer/index.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +37 -39
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +37 -39
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +41 -44
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +30 -26
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +30 -26
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +30 -26
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/cleanupApiKey.js +10 -16
- package/subscriptions/security/handlers/cleanupApiKey.js.map +1 -1
- package/subscriptions/security/index.d.ts +2 -2
- package/subscriptions/security/index.js +14 -20
- package/subscriptions/security/index.js.map +1 -1
- package/subscriptions/websiteBuilder/index.d.ts +2 -2
- package/subscriptions/websiteBuilder/index.js +14 -16
- package/subscriptions/websiteBuilder/index.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +29 -25
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +29 -25
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +26 -21
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +26 -21
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +26 -21
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +29 -25
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -1
- package/types.d.ts +0 -23
- package/types.js +0 -3
- package/utils/expiresAt.js +14 -19
- package/utils/expiresAt.js.map +1 -1
- package/utils/getAuditObject.js +14 -15
- package/utils/getAuditObject.js.map +1 -1
- package/context/AuditLogsContextValue.d.ts +0 -10
- package/context/AuditLogsContextValue.js +0 -139
- package/context/AuditLogsContextValue.js.map +0 -1
- package/context/index.d.ts +0 -9
- package/context/index.js +0 -37
- package/context/index.js.map +0 -1
- package/events/index.js.map +0 -1
- package/graphql/schema.d.ts +0 -3
- package/graphql/schema.js +0 -126
- package/graphql/schema.js.map +0 -1
- package/index.js.map +0 -1
- package/storage/AccessPatternHandler.d.ts +0 -14
- package/storage/AccessPatternHandler.js +0 -60
- package/storage/AccessPatternHandler.js.map +0 -1
- package/storage/Converter.d.ts +0 -16
- package/storage/Converter.js +0 -52
- package/storage/Converter.js.map +0 -1
- package/storage/Storage.d.ts +0 -18
- package/storage/Storage.js +0 -89
- package/storage/Storage.js.map +0 -1
- package/storage/abstractions/AccessPattern.d.ts +0 -24
- package/storage/abstractions/AccessPattern.js +0 -3
- package/storage/abstractions/AccessPattern.js.map +0 -1
- package/storage/abstractions/AccessPatternHandler.d.ts +0 -13
- package/storage/abstractions/AccessPatternHandler.js +0 -3
- package/storage/abstractions/AccessPatternHandler.js.map +0 -1
- package/storage/abstractions/Converter.d.ts +0 -6
- package/storage/abstractions/Converter.js +0 -3
- package/storage/abstractions/Converter.js.map +0 -1
- package/storage/abstractions/Storage.js.map +0 -1
- package/storage/accessPatterns/AppAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppAccessPattern.js +0 -29
- package/storage/accessPatterns/AppAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppCreatedByAccessPattern.js +0 -32
- package/storage/accessPatterns/AppCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityAccessPattern.js +0 -29
- package/storage/accessPatterns/AppEntityAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityActionAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityActionAccessPattern.js +0 -29
- package/storage/accessPatterns/AppEntityActionAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js +0 -32
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js +0 -32
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/BaseAccessPattern.d.ts +0 -32
- package/storage/accessPatterns/BaseAccessPattern.js +0 -83
- package/storage/accessPatterns/BaseAccessPattern.js.map +0 -1
- package/storage/accessPatterns/CreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/CreatedByAccessPattern.js +0 -32
- package/storage/accessPatterns/CreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/CreatedOnAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/CreatedOnAccessPattern.js +0 -30
- package/storage/accessPatterns/CreatedOnAccessPattern.js.map +0 -1
- package/storage/accessPatterns/DefaultAccessPattern.d.ts +0 -15
- package/storage/accessPatterns/DefaultAccessPattern.js +0 -36
- package/storage/accessPatterns/DefaultAccessPattern.js.map +0 -1
- package/storage/accessPatterns/EntityIdAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/EntityIdAccessPattern.js +0 -33
- package/storage/accessPatterns/EntityIdAccessPattern.js.map +0 -1
- package/storage/accessPatterns/index.d.ts +0 -6
- package/storage/accessPatterns/index.js +0 -47
- package/storage/accessPatterns/index.js.map +0 -1
- package/storage/cursorSchema.d.ts +0 -4
- package/storage/cursorSchema.js +0 -25
- package/storage/cursorSchema.js.map +0 -1
- package/storage/entity.d.ts +0 -36
- package/storage/entity.js +0 -127
- package/storage/entity.js.map +0 -1
- package/storage/results/ListErrorResult.d.ts +0 -10
- package/storage/results/ListErrorResult.js +0 -11
- package/storage/results/ListErrorResult.js.map +0 -1
- package/storage/results/ListSuccessResult.d.ts +0 -14
- package/storage/results/ListSuccessResult.js +0 -16
- package/storage/results/ListSuccessResult.js.map +0 -1
- package/storage/results/index.d.ts +0 -2
- package/storage/results/index.js +0 -4
- package/storage/results/index.js.map +0 -1
- package/storage/startKey.d.ts +0 -6
- package/storage/startKey.js +0 -9
- package/storage/startKey.js.map +0 -1
- package/storage/types.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/getAuditConfig.d.ts +0 -4
- package/utils/getAuditConfig.js +0 -105
- package/utils/getAuditConfig.js.map +0 -1
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { EntryAfterRestoreFromBinEventHandler } from "@webiny/api-headless-cms/features/contentEntry/RestoreEntryFromBin/index.js";
|
|
3
3
|
import { AUDIT } from "../../../config.js";
|
|
4
|
-
import {
|
|
5
|
-
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
6
5
|
class AuditLogEntryAfterRestoreFromBinEventHandlerImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
async handle(event) {
|
|
11
|
-
const {
|
|
12
|
-
model,
|
|
13
|
-
entry
|
|
14
|
-
} = event.payload;
|
|
15
|
-
if (model.isPrivate) {
|
|
16
|
-
return;
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
17
8
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
async handle(event) {
|
|
10
|
+
const { model, entry } = event.payload;
|
|
11
|
+
if (model.isPrivate) return;
|
|
12
|
+
try {
|
|
13
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
14
|
+
audit: AUDIT.HEADLESS_CMS.ENTRY.RESTORE_FROM_TRASH,
|
|
15
|
+
message: "Entry restored from trash",
|
|
16
|
+
content: entry,
|
|
17
|
+
entityId: entry.entryId
|
|
18
|
+
});
|
|
19
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
throw _webiny_error.from(error, {
|
|
22
|
+
message: "Error while executing AuditLogEntryAfterRestoreFromBinEventHandler",
|
|
23
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_RESTORE_FROM_TRASH_HANDLER"
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
|
-
}
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const AuditLogEntryAfterRestoreFromBinEventHandler = EntryAfterRestoreFromBinEventHandler.createImplementation({
|
|
29
|
+
implementation: AuditLogEntryAfterRestoreFromBinEventHandlerImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
RecordAuditLogUseCase
|
|
32
|
+
]
|
|
32
33
|
});
|
|
34
|
+
export { AuditLogEntryAfterRestoreFromBinEventHandler };
|
|
33
35
|
|
|
34
36
|
//# sourceMappingURL=AuditLogEntryAfterRestoreFromBinEventHandler.js.map
|
package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryAfterRestoreFromBinEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/RestoreEntryFromBin/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\n\nclass AuditLogEntryAfterRestoreFromBinEventHandlerImpl\n implements EntryAfterRestoreFromBinEventHandler.Interface\n{\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: EntryAfterRestoreFromBinEventHandler.Event): Promise<void> {\n const { model, entry } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.ENTRY.RESTORE_FROM_TRASH,\n message: \"Entry restored from trash\",\n content: entry,\n entityId: entry.entryId\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryAfterRestoreFromBinEventHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_RESTORE_FROM_TRASH_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryAfterRestoreFromBinEventHandler =\n EntryAfterRestoreFromBinEventHandler.createImplementation({\n implementation: AuditLogEntryAfterRestoreFromBinEventHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogEntryAfterRestoreFromBinEventHandlerImpl","recordAuditLog","event","model","entry","recordResult","AUDIT","error","WebinyError","AuditLogEntryAfterRestoreFromBinEventHandler","EntryAfterRestoreFromBinEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IAGF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAiD,EAAiB;QAC3E,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF,MAAM,OAAO;QAEtC,IAAIC,MAAM,SAAS,EACf;QAGJ,IAAI;YACA,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,YAAY,CAAC,KAAK,CAAC,kBAAkB;gBAClD,SAAS;gBACT,SAASF;gBACT,UAAUA,MAAM,OAAO;YAC3B;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,+CACTC,qCAAqC,oBAAoB,CAAC;IACtD,gBAAgBV;IAChB,cAAc;QAACW;KAAsB;AACzC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EntryAfterUnpublishEventHandler } from "@webiny/api-headless-cms/features/contentEntry/UnpublishEntry/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogEntryAfterUnpublishEventHandlerImpl implements EntryAfterUnpublishEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: EntryAfterUnpublishEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogEntryAfterUnpublishEventHandler: typeof AuditLogEntryAfterUnpublishEventHandlerImpl & {
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { EntryAfterUnpublishEventHandler } from "@webiny/api-headless-cms/features/contentEntry/UnpublishEntry/index.js";
|
|
3
3
|
import { AUDIT } from "../../../config.js";
|
|
4
|
-
import {
|
|
5
|
-
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
6
5
|
class AuditLogEntryAfterUnpublishEventHandlerImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
async handle(event) {
|
|
11
|
-
const {
|
|
12
|
-
model,
|
|
13
|
-
entry
|
|
14
|
-
} = event.payload;
|
|
15
|
-
if (model.isPrivate) {
|
|
16
|
-
return;
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
17
8
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
async handle(event) {
|
|
10
|
+
const { model, entry } = event.payload;
|
|
11
|
+
if (model.isPrivate) return;
|
|
12
|
+
try {
|
|
13
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
14
|
+
audit: AUDIT.HEADLESS_CMS.ENTRY_REVISION.UNPUBLISH,
|
|
15
|
+
message: "Entry revision unpublished",
|
|
16
|
+
content: entry,
|
|
17
|
+
entityId: entry.id
|
|
18
|
+
});
|
|
19
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
throw _webiny_error.from(error, {
|
|
22
|
+
message: "Error while executing AuditLogEntryAfterUnpublishEventHandler",
|
|
23
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_REVISION_UNPUBLISH_HANDLER"
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
|
-
}
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const AuditLogEntryAfterUnpublishEventHandler = EntryAfterUnpublishEventHandler.createImplementation({
|
|
29
|
+
implementation: AuditLogEntryAfterUnpublishEventHandlerImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
RecordAuditLogUseCase
|
|
32
|
+
]
|
|
32
33
|
});
|
|
34
|
+
export { AuditLogEntryAfterUnpublishEventHandler };
|
|
33
35
|
|
|
34
36
|
//# sourceMappingURL=AuditLogEntryAfterUnpublishEventHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryAfterUnpublishEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/UnpublishEntry/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\n\nclass AuditLogEntryAfterUnpublishEventHandlerImpl\n implements EntryAfterUnpublishEventHandler.Interface\n{\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: EntryAfterUnpublishEventHandler.Event): Promise<void> {\n const { model, entry } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.ENTRY_REVISION.UNPUBLISH,\n message: \"Entry revision unpublished\",\n content: entry,\n entityId: entry.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryAfterUnpublishEventHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_REVISION_UNPUBLISH_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryAfterUnpublishEventHandler =\n EntryAfterUnpublishEventHandler.createImplementation({\n implementation: AuditLogEntryAfterUnpublishEventHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogEntryAfterUnpublishEventHandlerImpl","recordAuditLog","event","model","entry","recordResult","AUDIT","error","WebinyError","AuditLogEntryAfterUnpublishEventHandler","EntryAfterUnpublishEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IAGF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAA4C,EAAiB;QACtE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF,MAAM,OAAO;QAEtC,IAAIC,MAAM,SAAS,EACf;QAGJ,IAAI;YACA,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,YAAY,CAAC,cAAc,CAAC,SAAS;gBAClD,SAAS;gBACT,SAASF;gBACT,UAAUA,MAAM,EAAE;YACtB;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,0CACTC,gCAAgC,oBAAoB,CAAC;IACjD,gBAAgBV;IAChB,cAAc;QAACW;KAAsB;AACzC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EntryAfterUpdateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogEntryAfterUpdateEventHandlerImpl implements EntryAfterUpdateEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: EntryAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogEntryAfterUpdateEventHandler: typeof AuditLogEntryAfterUpdateEventHandlerImpl & {
|
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { EntryAfterUpdateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
4
4
|
import { AUDIT } from "../../../config.js";
|
|
5
|
-
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
5
|
class AuditLogEntryAfterUpdateEventHandlerImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
async handle(event) {
|
|
11
|
-
const {
|
|
12
|
-
model,
|
|
13
|
-
entry,
|
|
14
|
-
original
|
|
15
|
-
} = event.payload;
|
|
16
|
-
if (model.isPrivate) {
|
|
17
|
-
return;
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
18
8
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
async handle(event) {
|
|
10
|
+
const { model, entry, original } = event.payload;
|
|
11
|
+
if (model.isPrivate) return;
|
|
12
|
+
try {
|
|
13
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
14
|
+
audit: AUDIT.HEADLESS_CMS.ENTRY_REVISION.UPDATE,
|
|
15
|
+
message: "Entry revision updated",
|
|
16
|
+
content: {
|
|
17
|
+
before: original,
|
|
18
|
+
after: entry
|
|
19
|
+
},
|
|
20
|
+
entityId: entry.id
|
|
21
|
+
});
|
|
22
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
23
|
+
} catch (error) {
|
|
24
|
+
throw _webiny_error.from(error, {
|
|
25
|
+
message: "Error while executing AuditLogEntryAfterUpdateEventHandler",
|
|
26
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_REVISION_UPDATE_HANDLER"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
30
29
|
}
|
|
31
|
-
}
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const AuditLogEntryAfterUpdateEventHandler = EntryAfterUpdateEventHandler.createImplementation({
|
|
32
|
+
implementation: AuditLogEntryAfterUpdateEventHandlerImpl,
|
|
33
|
+
dependencies: [
|
|
34
|
+
RecordAuditLogUseCase
|
|
35
|
+
]
|
|
36
36
|
});
|
|
37
|
+
export { AuditLogEntryAfterUpdateEventHandler };
|
|
37
38
|
|
|
38
39
|
//# sourceMappingURL=AuditLogEntryAfterUpdateEventHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryAfterUpdateEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass AuditLogEntryAfterUpdateEventHandlerImpl implements EntryAfterUpdateEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: EntryAfterUpdateEventHandler.Event): Promise<void> {\n const { model, entry, original } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.ENTRY_REVISION.UPDATE,\n message: \"Entry revision updated\",\n content: { before: original, after: entry },\n entityId: entry.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryAfterUpdateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_REVISION_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryAfterUpdateEventHandler =\n EntryAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogEntryAfterUpdateEventHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogEntryAfterUpdateEventHandlerImpl","recordAuditLog","event","model","entry","original","recordResult","AUDIT","error","WebinyError","AuditLogEntryAfterUpdateEventHandler","EntryAfterUpdateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAyC,EAAiB;QACnE,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGH,MAAM,OAAO;QAEhD,IAAIC,MAAM,SAAS,EACf;QAGJ,IAAI;YACA,MAAMG,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,YAAY,CAAC,cAAc,CAAC,MAAM;gBAC/C,SAAS;gBACT,SAAS;oBAAE,QAAQF;oBAAU,OAAOD;gBAAM;gBAC1C,UAAUA,MAAM,EAAE;YACtB;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,uCACTC,6BAA6B,oBAAoB,CAAC;IAC9C,gBAAgBX;IAChB,cAAc;QAACY;KAAsB;AACzC"}
|
package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EntryRevisionAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogEntryRevisionAfterCreateHandlerImpl implements EntryRevisionAfterCreateEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: EntryRevisionAfterCreateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogEntryRevisionAfterCreateEventHandler: typeof AuditLogEntryRevisionAfterCreateHandlerImpl & {
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { EntryRevisionAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/index.js";
|
|
3
3
|
import { AUDIT } from "../../../config.js";
|
|
4
|
-
import {
|
|
5
|
-
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
6
5
|
class AuditLogEntryRevisionAfterCreateHandlerImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
async handle(event) {
|
|
11
|
-
const {
|
|
12
|
-
model,
|
|
13
|
-
entry
|
|
14
|
-
} = event.payload;
|
|
15
|
-
if (model.isPrivate) {
|
|
16
|
-
return;
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
17
8
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
async handle(event) {
|
|
10
|
+
const { model, entry } = event.payload;
|
|
11
|
+
if (model.isPrivate) return;
|
|
12
|
+
try {
|
|
13
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
14
|
+
audit: AUDIT.HEADLESS_CMS.ENTRY_REVISION.CREATE,
|
|
15
|
+
message: "Entry revision created",
|
|
16
|
+
content: entry,
|
|
17
|
+
entityId: entry.id
|
|
18
|
+
});
|
|
19
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
throw _webiny_error.from(error, {
|
|
22
|
+
message: "Error while executing AuditLogEntryRevisionAfterCreateHandler",
|
|
23
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_REVISION_CREATE_HANDLER"
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
|
-
}
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const AuditLogEntryRevisionAfterCreateEventHandler = EntryRevisionAfterCreateEventHandler.createImplementation({
|
|
29
|
+
implementation: AuditLogEntryRevisionAfterCreateHandlerImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
RecordAuditLogUseCase
|
|
32
|
+
]
|
|
32
33
|
});
|
|
34
|
+
export { AuditLogEntryRevisionAfterCreateEventHandler };
|
|
33
35
|
|
|
34
36
|
//# sourceMappingURL=AuditLogEntryRevisionAfterCreateEventHandler.js.map
|
package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryRevisionAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\n\nclass AuditLogEntryRevisionAfterCreateHandlerImpl\n implements EntryRevisionAfterCreateEventHandler.Interface\n{\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: EntryRevisionAfterCreateEventHandler.Event): Promise<void> {\n const { model, entry } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.ENTRY_REVISION.CREATE,\n message: \"Entry revision created\",\n content: entry,\n entityId: entry.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryRevisionAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_REVISION_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryRevisionAfterCreateEventHandler =\n EntryRevisionAfterCreateEventHandler.createImplementation({\n implementation: AuditLogEntryRevisionAfterCreateHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogEntryRevisionAfterCreateHandlerImpl","recordAuditLog","event","model","entry","recordResult","AUDIT","error","WebinyError","AuditLogEntryRevisionAfterCreateEventHandler","EntryRevisionAfterCreateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IAGF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAiD,EAAiB;QAC3E,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF,MAAM,OAAO;QAEtC,IAAIC,MAAM,SAAS,EACf;QAGJ,IAAI;YACA,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,YAAY,CAAC,cAAc,CAAC,MAAM;gBAC/C,SAAS;gBACT,SAASF;gBACT,UAAUA,MAAM,EAAE;YACtB;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,+CACTC,qCAAqC,oBAAoB,CAAC;IACtD,gBAAgBV;IAChB,cAAc;QAACW;KAAsB;AACzC"}
|
package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { EntryRevisionAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntryRevision/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogEntryRevisionAfterDeleteEventHandlerImpl implements EntryRevisionAfterDeleteEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: EntryRevisionAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogEntryRevisionAfterDeleteEventHandler: typeof AuditLogEntryRevisionAfterDeleteEventHandlerImpl & {
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { EntryRevisionAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntryRevision/index.js";
|
|
3
3
|
import { AUDIT } from "../../../config.js";
|
|
4
|
-
import {
|
|
5
|
-
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
6
5
|
class AuditLogEntryRevisionAfterDeleteEventHandlerImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
async handle(event) {
|
|
11
|
-
const {
|
|
12
|
-
model,
|
|
13
|
-
entry
|
|
14
|
-
} = event.payload;
|
|
15
|
-
if (model.isPrivate) {
|
|
16
|
-
return;
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
17
8
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
async handle(event) {
|
|
10
|
+
const { model, entry } = event.payload;
|
|
11
|
+
if (model.isPrivate) return;
|
|
12
|
+
try {
|
|
13
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
14
|
+
audit: AUDIT.HEADLESS_CMS.ENTRY_REVISION.DELETE,
|
|
15
|
+
message: "Entry revision deleted",
|
|
16
|
+
content: entry,
|
|
17
|
+
entityId: entry.id
|
|
18
|
+
});
|
|
19
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
20
|
+
} catch (error) {
|
|
21
|
+
throw _webiny_error.from(error, {
|
|
22
|
+
message: "Error while executing AuditLogEntryRevisionAfterDeleteEventHandler",
|
|
23
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_REVISION_DELETE_HANDLER"
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
26
|
}
|
|
27
|
-
}
|
|
28
27
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const AuditLogEntryRevisionAfterDeleteEventHandler = EntryRevisionAfterDeleteEventHandler.createImplementation({
|
|
29
|
+
implementation: AuditLogEntryRevisionAfterDeleteEventHandlerImpl,
|
|
30
|
+
dependencies: [
|
|
31
|
+
RecordAuditLogUseCase
|
|
32
|
+
]
|
|
32
33
|
});
|
|
34
|
+
export { AuditLogEntryRevisionAfterDeleteEventHandler };
|
|
33
35
|
|
|
34
36
|
//# sourceMappingURL=AuditLogEntryRevisionAfterDeleteEventHandler.js.map
|
package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryRevisionAfterDeleteEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/DeleteEntryRevision/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\n\nclass AuditLogEntryRevisionAfterDeleteEventHandlerImpl\n implements EntryRevisionAfterDeleteEventHandler.Interface\n{\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: EntryRevisionAfterDeleteEventHandler.Event): Promise<void> {\n const { model, entry } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.ENTRY_REVISION.DELETE,\n message: \"Entry revision deleted\",\n content: entry,\n entityId: entry.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryRevisionAfterDeleteEventHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_REVISION_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryRevisionAfterDeleteEventHandler =\n EntryRevisionAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogEntryRevisionAfterDeleteEventHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogEntryRevisionAfterDeleteEventHandlerImpl","recordAuditLog","event","model","entry","recordResult","AUDIT","error","WebinyError","AuditLogEntryRevisionAfterDeleteEventHandler","EntryRevisionAfterDeleteEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IAGF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAiD,EAAiB;QAC3E,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGF,MAAM,OAAO;QAEtC,IAAIC,MAAM,SAAS,EACf;QAGJ,IAAI;YACA,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,YAAY,CAAC,cAAc,CAAC,MAAM;gBAC/C,SAAS;gBACT,SAASF;gBACT,UAAUA,MAAM,EAAE;YACtB;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,+CACTC,qCAAqC,oBAAoB,CAAC;IACtD,gBAAgBV;IAChB,cAAc;QAACW;KAAsB;AACzC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GroupAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentModelGroup/CreateGroup/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogGroupAfterCreateEventHandlerImpl implements GroupAfterCreateEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: GroupAfterCreateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogGroupAfterCreateEventHandler: typeof AuditLogGroupAfterCreateEventHandlerImpl & {
|
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { GroupAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentModelGroup/CreateGroup/index.js";
|
|
3
3
|
import { AUDIT } from "../../../config.js";
|
|
4
|
-
import {
|
|
5
|
-
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
6
5
|
class AuditLogGroupAfterCreateEventHandlerImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
8
|
+
}
|
|
9
|
+
async handle(event) {
|
|
10
|
+
const { group } = event.payload;
|
|
11
|
+
try {
|
|
12
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
13
|
+
audit: AUDIT.HEADLESS_CMS.GROUP.CREATE,
|
|
14
|
+
message: "Group created",
|
|
15
|
+
content: group,
|
|
16
|
+
entityId: group.id
|
|
17
|
+
});
|
|
18
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
throw _webiny_error.from(error, {
|
|
21
|
+
message: "Error while executing AuditLogGroupAfterCreateEventHandler",
|
|
22
|
+
code: "AUDIT_LOGS_AFTER_GROUP_CREATE_HANDLER"
|
|
23
|
+
});
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
|
-
}
|
|
24
26
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
const AuditLogGroupAfterCreateEventHandler = GroupAfterCreateEventHandler.createImplementation({
|
|
28
|
+
implementation: AuditLogGroupAfterCreateEventHandlerImpl,
|
|
29
|
+
dependencies: [
|
|
30
|
+
RecordAuditLogUseCase
|
|
31
|
+
]
|
|
28
32
|
});
|
|
33
|
+
export { AuditLogGroupAfterCreateEventHandler };
|
|
29
34
|
|
|
30
35
|
//# sourceMappingURL=AuditLogGroupAfterCreateEventHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { GroupAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentModelGroup/CreateGroup/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\n\nclass AuditLogGroupAfterCreateEventHandlerImpl implements GroupAfterCreateEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: GroupAfterCreateEventHandler.Event): Promise<void> {\n const { group } = event.payload;\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.GROUP.CREATE,\n message: \"Group created\",\n content: group,\n entityId: group.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogGroupAfterCreateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_GROUP_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogGroupAfterCreateEventHandler =\n GroupAfterCreateEventHandler.createImplementation({\n implementation: AuditLogGroupAfterCreateEventHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogGroupAfterCreateEventHandlerImpl","recordAuditLog","event","group","recordResult","AUDIT","error","WebinyError","AuditLogGroupAfterCreateEventHandler","GroupAfterCreateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAyC,EAAiB;QACnE,MAAM,EAAEC,KAAK,EAAE,GAAGD,MAAM,OAAO;QAE/B,IAAI;YACA,MAAME,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,YAAY,CAAC,KAAK,CAAC,MAAM;gBACtC,SAAS;gBACT,SAASF;gBACT,UAAUA,MAAM,EAAE;YACtB;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,uCACTC,6BAA6B,oBAAoB,CAAC;IAC9C,gBAAgBT;IAChB,cAAc;QAACU;KAAsB;AACzC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GroupAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentModelGroup/DeleteGroup/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogGroupAfterDeleteHandlerEventImpl implements GroupAfterDeleteEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: GroupAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogGroupAfterDeleteEventHandler: typeof AuditLogGroupAfterDeleteHandlerEventImpl & {
|