@webiny/api-audit-logs 0.0.0-unstable.7be00a75a9 → 0.0.0-unstable.7c2def32a7
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 -2
- package/abstractions.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/abstractions.d.ts +0 -5
- package/events/abstractions.js.map +1 -1
- 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/index.d.ts +2 -8
- package/index.js +1 -25
- package/package.json +26 -25
- package/storage/types.d.ts +0 -35
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +18 -9
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +35 -13
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +24 -15
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -1
- package/subscriptions/aco/index.d.ts +2 -2
- package/subscriptions/aco/index.js +4 -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 +11 -7
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +11 -7
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +14 -10
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +14 -10
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/index.d.ts +2 -2
- package/subscriptions/fileManager/index.js +5 -5
- package/subscriptions/fileManager/index.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +18 -9
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +14 -10
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +14 -10
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +11 -7
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js +14 -10
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/index.d.ts +2 -2
- package/subscriptions/headlessCms/index.js +15 -15
- package/subscriptions/headlessCms/index.js.map +1 -1
- package/subscriptions/index.d.ts +2 -2
- package/subscriptions/index.js +9 -7
- package/subscriptions/index.js.map +1 -1
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +3 -3
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +13 -9
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -1
- package/subscriptions/mailer/index.d.ts +2 -2
- package/subscriptions/mailer/index.js +2 -2
- package/subscriptions/mailer/index.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +11 -7
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +11 -7
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +14 -10
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +11 -7
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +11 -7
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +14 -10
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +11 -7
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +11 -7
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +14 -10
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +11 -7
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +11 -7
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +14 -10
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/index.d.ts +2 -2
- package/subscriptions/security/index.js +13 -13
- package/subscriptions/security/index.js.map +1 -1
- package/subscriptions/websiteBuilder/index.d.ts +2 -2
- package/subscriptions/websiteBuilder/index.js +13 -13
- package/subscriptions/websiteBuilder/index.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +11 -7
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +11 -7
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +11 -7
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +14 -10
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +11 -7
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +11 -7
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +11 -7
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +14 -10
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +11 -7
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +11 -7
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +11 -7
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +14 -10
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -1
- package/types.d.ts +0 -23
- package/context/AuditLogsContextValue.d.ts +0 -10
- package/context/AuditLogsContextValue.js +0 -129
- package/context/AuditLogsContextValue.js.map +0 -1
- package/context/index.d.ts +0 -9
- package/context/index.js +0 -31
- package/context/index.js.map +0 -1
- package/graphql/schema.d.ts +0 -3
- package/graphql/schema.js +0 -115
- 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 -39
- package/storage/AccessPatternHandler.js.map +0 -1
- package/storage/Converter.d.ts +0 -16
- package/storage/Converter.js +0 -49
- package/storage/Converter.js.map +0 -1
- package/storage/Storage.d.ts +0 -18
- package/storage/Storage.js +0 -81
- package/storage/Storage.js.map +0 -1
- package/storage/abstractions/AccessPattern.d.ts +0 -24
- package/storage/abstractions/AccessPattern.js +0 -0
- package/storage/abstractions/AccessPatternHandler.d.ts +0 -13
- package/storage/abstractions/AccessPatternHandler.js +0 -0
- package/storage/abstractions/Converter.d.ts +0 -6
- package/storage/abstractions/Converter.js +0 -0
- package/storage/accessPatterns/AppAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppAccessPattern.js +0 -35
- package/storage/accessPatterns/AppAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppCreatedByAccessPattern.js +0 -38
- package/storage/accessPatterns/AppCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityAccessPattern.js +0 -35
- package/storage/accessPatterns/AppEntityAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityActionAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityActionAccessPattern.js +0 -35
- package/storage/accessPatterns/AppEntityActionAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js +0 -38
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js +0 -38
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/BaseAccessPattern.d.ts +0 -32
- package/storage/accessPatterns/BaseAccessPattern.js +0 -60
- package/storage/accessPatterns/BaseAccessPattern.js.map +0 -1
- package/storage/accessPatterns/CreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/CreatedByAccessPattern.js +0 -38
- package/storage/accessPatterns/CreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/CreatedOnAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/CreatedOnAccessPattern.js +0 -38
- package/storage/accessPatterns/CreatedOnAccessPattern.js.map +0 -1
- package/storage/accessPatterns/DefaultAccessPattern.d.ts +0 -15
- package/storage/accessPatterns/DefaultAccessPattern.js +0 -35
- package/storage/accessPatterns/DefaultAccessPattern.js.map +0 -1
- package/storage/accessPatterns/EntityIdAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/EntityIdAccessPattern.js +0 -38
- package/storage/accessPatterns/EntityIdAccessPattern.js.map +0 -1
- package/storage/accessPatterns/index.d.ts +0 -6
- package/storage/accessPatterns/index.js +0 -57
- package/storage/accessPatterns/index.js.map +0 -1
- package/storage/cursorSchema.d.ts +0 -4
- package/storage/cursorSchema.js +0 -22
- package/storage/cursorSchema.js.map +0 -1
- package/storage/entity.d.ts +0 -36
- package/storage/entity.js +0 -120
- package/storage/entity.js.map +0 -1
- package/storage/results/ListErrorResult.d.ts +0 -10
- package/storage/results/ListErrorResult.js +0 -12
- package/storage/results/ListErrorResult.js.map +0 -1
- package/storage/results/ListSuccessResult.d.ts +0 -14
- package/storage/results/ListSuccessResult.js +0 -17
- package/storage/results/ListSuccessResult.js.map +0 -1
- package/storage/results/index.d.ts +0 -2
- package/storage/results/index.js +0 -2
- package/storage/startKey.d.ts +0 -6
- package/storage/startKey.js +0 -8
- package/storage/startKey.js.map +0 -1
- package/utils/getAuditConfig.d.ts +0 -4
- package/utils/getAuditConfig.js +0 -86
- package/utils/getAuditConfig.js.map +0 -1
|
@@ -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,18 +1,22 @@
|
|
|
1
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
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
9
8
|
}
|
|
10
9
|
async handle(event) {
|
|
11
10
|
const { model, entry } = event.payload;
|
|
12
11
|
if (model.isPrivate) return;
|
|
13
12
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
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;
|
|
16
20
|
} catch (error) {
|
|
17
21
|
throw _webiny_error.from(error, {
|
|
18
22
|
message: "Error while executing AuditLogEntryAfterUnpublishEventHandler",
|
|
@@ -24,7 +28,7 @@ class AuditLogEntryAfterUnpublishEventHandlerImpl {
|
|
|
24
28
|
const AuditLogEntryAfterUnpublishEventHandler = EntryAfterUnpublishEventHandler.createImplementation({
|
|
25
29
|
implementation: AuditLogEntryAfterUnpublishEventHandlerImpl,
|
|
26
30
|
dependencies: [
|
|
27
|
-
|
|
31
|
+
RecordAuditLogUseCase
|
|
28
32
|
]
|
|
29
33
|
});
|
|
30
34
|
export { AuditLogEntryAfterUnpublishEventHandler };
|
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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,21 +1,25 @@
|
|
|
1
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
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
9
8
|
}
|
|
10
9
|
async handle(event) {
|
|
11
10
|
const { model, entry, original } = event.payload;
|
|
12
11
|
if (model.isPrivate) return;
|
|
13
12
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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;
|
|
19
23
|
} catch (error) {
|
|
20
24
|
throw _webiny_error.from(error, {
|
|
21
25
|
message: "Error while executing AuditLogEntryAfterUpdateEventHandler",
|
|
@@ -27,7 +31,7 @@ class AuditLogEntryAfterUpdateEventHandlerImpl {
|
|
|
27
31
|
const AuditLogEntryAfterUpdateEventHandler = EntryAfterUpdateEventHandler.createImplementation({
|
|
28
32
|
implementation: AuditLogEntryAfterUpdateEventHandlerImpl,
|
|
29
33
|
dependencies: [
|
|
30
|
-
|
|
34
|
+
RecordAuditLogUseCase
|
|
31
35
|
]
|
|
32
36
|
});
|
|
33
37
|
export { AuditLogEntryAfterUpdateEventHandler };
|
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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,18 +1,22 @@
|
|
|
1
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
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
9
8
|
}
|
|
10
9
|
async handle(event) {
|
|
11
10
|
const { model, entry } = event.payload;
|
|
12
11
|
if (model.isPrivate) return;
|
|
13
12
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
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;
|
|
16
20
|
} catch (error) {
|
|
17
21
|
throw _webiny_error.from(error, {
|
|
18
22
|
message: "Error while executing AuditLogEntryRevisionAfterCreateHandler",
|
|
@@ -24,7 +28,7 @@ class AuditLogEntryRevisionAfterCreateHandlerImpl {
|
|
|
24
28
|
const AuditLogEntryRevisionAfterCreateEventHandler = EntryRevisionAfterCreateEventHandler.createImplementation({
|
|
25
29
|
implementation: AuditLogEntryRevisionAfterCreateHandlerImpl,
|
|
26
30
|
dependencies: [
|
|
27
|
-
|
|
31
|
+
RecordAuditLogUseCase
|
|
28
32
|
]
|
|
29
33
|
});
|
|
30
34
|
export { AuditLogEntryRevisionAfterCreateEventHandler };
|
package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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,18 +1,22 @@
|
|
|
1
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
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
9
8
|
}
|
|
10
9
|
async handle(event) {
|
|
11
10
|
const { model, entry } = event.payload;
|
|
12
11
|
if (model.isPrivate) return;
|
|
13
12
|
try {
|
|
14
|
-
const
|
|
15
|
-
|
|
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;
|
|
16
20
|
} catch (error) {
|
|
17
21
|
throw _webiny_error.from(error, {
|
|
18
22
|
message: "Error while executing AuditLogEntryRevisionAfterDeleteEventHandler",
|
|
@@ -24,7 +28,7 @@ class AuditLogEntryRevisionAfterDeleteEventHandlerImpl {
|
|
|
24
28
|
const AuditLogEntryRevisionAfterDeleteEventHandler = EntryRevisionAfterDeleteEventHandler.createImplementation({
|
|
25
29
|
implementation: AuditLogEntryRevisionAfterDeleteEventHandlerImpl,
|
|
26
30
|
dependencies: [
|
|
27
|
-
|
|
31
|
+
RecordAuditLogUseCase
|
|
28
32
|
]
|
|
29
33
|
});
|
|
30
34
|
export { AuditLogEntryRevisionAfterDeleteEventHandler };
|
package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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,17 +1,21 @@
|
|
|
1
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
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
9
8
|
}
|
|
10
9
|
async handle(event) {
|
|
11
10
|
const { group } = event.payload;
|
|
12
11
|
try {
|
|
13
|
-
const
|
|
14
|
-
|
|
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;
|
|
15
19
|
} catch (error) {
|
|
16
20
|
throw _webiny_error.from(error, {
|
|
17
21
|
message: "Error while executing AuditLogGroupAfterCreateEventHandler",
|
|
@@ -23,7 +27,7 @@ class AuditLogGroupAfterCreateEventHandlerImpl {
|
|
|
23
27
|
const AuditLogGroupAfterCreateEventHandler = GroupAfterCreateEventHandler.createImplementation({
|
|
24
28
|
implementation: AuditLogGroupAfterCreateEventHandlerImpl,
|
|
25
29
|
dependencies: [
|
|
26
|
-
|
|
30
|
+
RecordAuditLogUseCase
|
|
27
31
|
]
|
|
28
32
|
});
|
|
29
33
|
export { AuditLogGroupAfterCreateEventHandler };
|
|
@@ -1 +1 @@
|
|
|
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 {
|
|
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 & {
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { GroupAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentModelGroup/DeleteGroup/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 AuditLogGroupAfterDeleteHandlerEventImpl {
|
|
7
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
9
8
|
}
|
|
10
9
|
async handle(event) {
|
|
11
10
|
const { group } = event.payload;
|
|
12
11
|
try {
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
13
|
+
audit: AUDIT.HEADLESS_CMS.GROUP.DELETE,
|
|
14
|
+
message: "Group deleted",
|
|
15
|
+
content: group,
|
|
16
|
+
entityId: group.id
|
|
17
|
+
});
|
|
18
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
15
19
|
} catch (error) {
|
|
16
20
|
throw _webiny_error.from(error, {
|
|
17
21
|
message: "Error while executing AuditLogGroupAfterDeleteHandlerEvent",
|
|
@@ -23,7 +27,7 @@ class AuditLogGroupAfterDeleteHandlerEventImpl {
|
|
|
23
27
|
const AuditLogGroupAfterDeleteEventHandler = GroupAfterDeleteEventHandler.createImplementation({
|
|
24
28
|
implementation: AuditLogGroupAfterDeleteHandlerEventImpl,
|
|
25
29
|
dependencies: [
|
|
26
|
-
|
|
30
|
+
RecordAuditLogUseCase
|
|
27
31
|
]
|
|
28
32
|
});
|
|
29
33
|
export { AuditLogGroupAfterDeleteEventHandler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { GroupAfterDeleteEventHandler } from \"@webiny/api-headless-cms/features/contentModelGroup/DeleteGroup/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { GroupAfterDeleteEventHandler } from \"@webiny/api-headless-cms/features/contentModelGroup/DeleteGroup/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\n\nclass AuditLogGroupAfterDeleteHandlerEventImpl implements GroupAfterDeleteEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: GroupAfterDeleteEventHandler.Event): Promise<void> {\n const { group } = event.payload;\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.GROUP.DELETE,\n message: \"Group deleted\",\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 AuditLogGroupAfterDeleteHandlerEvent\",\n code: \"AUDIT_LOGS_AFTER_GROUP_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogGroupAfterDeleteEventHandler =\n GroupAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogGroupAfterDeleteHandlerEventImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogGroupAfterDeleteHandlerEventImpl","recordAuditLog","event","group","recordResult","AUDIT","error","WebinyError","AuditLogGroupAfterDeleteEventHandler","GroupAfterDeleteEventHandler","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 { GroupAfterUpdateEventHandler } from "@webiny/api-headless-cms/features/contentModelGroup/UpdateGroup/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogGroupAfterUpdateEventHandlerImpl implements GroupAfterUpdateEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: GroupAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogGroupAfterUpdateEventHandler: typeof AuditLogGroupAfterUpdateEventHandlerImpl & {
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { GroupAfterUpdateEventHandler } from "@webiny/api-headless-cms/features/contentModelGroup/UpdateGroup/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 AuditLogGroupAfterUpdateEventHandlerImpl {
|
|
7
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
9
8
|
}
|
|
10
9
|
async handle(event) {
|
|
11
10
|
const { group, original } = event.payload;
|
|
12
11
|
try {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
13
|
+
audit: AUDIT.HEADLESS_CMS.GROUP.UPDATE,
|
|
14
|
+
message: "Group updated",
|
|
15
|
+
content: {
|
|
16
|
+
before: original,
|
|
17
|
+
after: group
|
|
18
|
+
},
|
|
19
|
+
entityId: group.id
|
|
20
|
+
});
|
|
21
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
18
22
|
} catch (error) {
|
|
19
23
|
throw _webiny_error.from(error, {
|
|
20
24
|
message: "Error while executing AuditLogGroupAfterUpdateEventHandler",
|
|
@@ -26,7 +30,7 @@ class AuditLogGroupAfterUpdateEventHandlerImpl {
|
|
|
26
30
|
const AuditLogGroupAfterUpdateEventHandler = GroupAfterUpdateEventHandler.createImplementation({
|
|
27
31
|
implementation: AuditLogGroupAfterUpdateEventHandlerImpl,
|
|
28
32
|
dependencies: [
|
|
29
|
-
|
|
33
|
+
RecordAuditLogUseCase
|
|
30
34
|
]
|
|
31
35
|
});
|
|
32
36
|
export { AuditLogGroupAfterUpdateEventHandler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { GroupAfterUpdateEventHandler } from \"@webiny/api-headless-cms/features/contentModelGroup/UpdateGroup/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { GroupAfterUpdateEventHandler } from \"@webiny/api-headless-cms/features/contentModelGroup/UpdateGroup/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\n\nclass AuditLogGroupAfterUpdateEventHandlerImpl implements GroupAfterUpdateEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: GroupAfterUpdateEventHandler.Event): Promise<void> {\n const { group, original } = event.payload;\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.GROUP.UPDATE,\n message: \"Group updated\",\n content: { before: original, after: 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 AuditLogGroupAfterUpdateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_GROUP_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogGroupAfterUpdateEventHandler =\n GroupAfterUpdateEventHandler.createImplementation({\n implementation: AuditLogGroupAfterUpdateEventHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogGroupAfterUpdateEventHandlerImpl","recordAuditLog","event","group","original","recordResult","AUDIT","error","WebinyError","AuditLogGroupAfterUpdateEventHandler","GroupAfterUpdateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAAyC,EAAiB;QACnE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF,MAAM,OAAO;QAEzC,IAAI;YACA,MAAMG,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBACnD,OAAOC,MAAM,YAAY,CAAC,KAAK,CAAC,MAAM;gBACtC,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,gBAAgBV;IAChB,cAAc;QAACW;KAAsB;AACzC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModelAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentModel/CreateModel/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogModelAfterCreateEventHandlerImpl implements ModelAfterCreateEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: ModelAfterCreateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogModelAfterCreateEventHandler: typeof AuditLogModelAfterCreateEventHandlerImpl & {
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { ModelAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentModel/CreateModel/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 AuditLogModelAfterCreateEventHandlerImpl {
|
|
7
|
-
constructor(
|
|
8
|
-
this.
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
9
8
|
}
|
|
10
9
|
async handle(event) {
|
|
11
10
|
const { model } = event.payload;
|
|
12
11
|
try {
|
|
13
|
-
const
|
|
14
|
-
|
|
12
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
13
|
+
audit: AUDIT.HEADLESS_CMS.MODEL.CREATE,
|
|
14
|
+
message: "Model created",
|
|
15
|
+
content: model,
|
|
16
|
+
entityId: model.modelId
|
|
17
|
+
});
|
|
18
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
15
19
|
} catch (error) {
|
|
16
20
|
throw _webiny_error.from(error, {
|
|
17
21
|
message: "Error while executing AuditLogModelAfterCreateEventHandler",
|
|
@@ -23,7 +27,7 @@ class AuditLogModelAfterCreateEventHandlerImpl {
|
|
|
23
27
|
const AuditLogModelAfterCreateEventHandler = ModelAfterCreateEventHandler.createImplementation({
|
|
24
28
|
implementation: AuditLogModelAfterCreateEventHandlerImpl,
|
|
25
29
|
dependencies: [
|
|
26
|
-
|
|
30
|
+
RecordAuditLogUseCase
|
|
27
31
|
]
|
|
28
32
|
});
|
|
29
33
|
export { AuditLogModelAfterCreateEventHandler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ModelAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModel/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport {
|
|
1
|
+
{"version":3,"file":"subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js","sources":["../../../../src/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ModelAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentModel/CreateModel/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\n\nclass AuditLogModelAfterCreateEventHandlerImpl implements ModelAfterCreateEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: ModelAfterCreateEventHandler.Event): Promise<void> {\n const { model } = event.payload;\n\n try {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.MODEL.CREATE,\n message: \"Model created\",\n content: model,\n entityId: model.modelId\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogModelAfterCreateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_MODEL_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogModelAfterCreateEventHandler =\n ModelAfterCreateEventHandler.createImplementation({\n implementation: AuditLogModelAfterCreateEventHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n });\n"],"names":["AuditLogModelAfterCreateEventHandlerImpl","recordAuditLog","event","model","recordResult","AUDIT","error","WebinyError","AuditLogModelAfterCreateEventHandler","ModelAfterCreateEventHandler","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,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,uCACTC,6BAA6B,oBAAoB,CAAC;IAC9C,gBAAgBT;IAChB,cAAc;QAACU;KAAsB;AACzC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModelAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentModel/DeleteModel/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogModelAfterDeleteEventHandlerImpl implements ModelAfterDeleteEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: ModelAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogModelAfterDeleteEventHandler: typeof AuditLogModelAfterDeleteEventHandlerImpl & {
|