@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
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { resolve, resolveList } from "@webiny/api-graphql";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
4
|
+
import { createZodError } from "@webiny/utils";
|
|
5
|
+
import { GetAuditLogUseCase } from "../features/GetAuditLog/abstractions.js";
|
|
6
|
+
import { ListAuditLogsUseCase } from "../features/ListAuditLogs/abstractions.js";
|
|
7
|
+
import { getValidationSchema, listValidationSchema } from "./validation.js";
|
|
8
|
+
const TYPE_DEFS = `
|
|
9
|
+
type AuditLogCreatedBy {
|
|
10
|
+
id: ID!
|
|
11
|
+
displayName: String
|
|
12
|
+
type: String
|
|
13
|
+
}
|
|
14
|
+
type AuditLog {
|
|
15
|
+
id: ID!
|
|
16
|
+
createdBy: AuditLogCreatedBy!
|
|
17
|
+
createdOn: DateTime!
|
|
18
|
+
app: String!
|
|
19
|
+
action: String!
|
|
20
|
+
message: String!
|
|
21
|
+
entity: String!
|
|
22
|
+
entityId: String!
|
|
23
|
+
tags: [String!]!
|
|
24
|
+
expiresAt: DateTime!
|
|
25
|
+
content: String
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
type AuditLogListMeta {
|
|
29
|
+
cursor: String
|
|
30
|
+
hasMoreItems: Boolean!
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type AuditLogError {
|
|
34
|
+
code: String
|
|
35
|
+
message: String!
|
|
36
|
+
data: JSON
|
|
37
|
+
stack: String
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
type AuditLogListResponse {
|
|
41
|
+
data: [AuditLog!]
|
|
42
|
+
meta: AuditLogListMeta
|
|
43
|
+
error: AuditLogError
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type AuditLogGetResponse {
|
|
47
|
+
data: AuditLog
|
|
48
|
+
error: AuditLogError
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
enum AuditLogsSort {
|
|
52
|
+
ASC
|
|
53
|
+
DESC
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
input ListAuditLogsWhere {
|
|
57
|
+
app: String
|
|
58
|
+
action: String
|
|
59
|
+
createdBy: String
|
|
60
|
+
entity: String
|
|
61
|
+
entityId: String
|
|
62
|
+
createdOn_gte: DateTime
|
|
63
|
+
createdOn_lte: DateTime
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
type AuditLogsQuery {
|
|
67
|
+
getAuditLog(id: ID!): AuditLogGetResponse
|
|
68
|
+
listAuditLogs(
|
|
69
|
+
where: ListAuditLogsWhere
|
|
70
|
+
sort: AuditLogsSort
|
|
71
|
+
limit: Number
|
|
72
|
+
after: String
|
|
73
|
+
): AuditLogListResponse!
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
extend type Query {
|
|
77
|
+
auditLogs: AuditLogsQuery
|
|
78
|
+
}
|
|
79
|
+
`;
|
|
80
|
+
class AuditLogsGraphQLSchemaImpl {
|
|
81
|
+
async execute(builder) {
|
|
82
|
+
builder.addTypeDefs(TYPE_DEFS);
|
|
83
|
+
builder.addResolver({
|
|
84
|
+
path: "Query.auditLogs",
|
|
85
|
+
dependencies: [],
|
|
86
|
+
resolver: ()=>()=>({})
|
|
87
|
+
});
|
|
88
|
+
builder.addResolver({
|
|
89
|
+
path: "AuditLogsQuery.getAuditLog",
|
|
90
|
+
dependencies: [
|
|
91
|
+
GetAuditLogUseCase
|
|
92
|
+
],
|
|
93
|
+
resolver (getAuditLog) {
|
|
94
|
+
return async ({ args })=>resolve(async ()=>{
|
|
95
|
+
const validation = await getValidationSchema.safeParseAsync(args);
|
|
96
|
+
if (!validation.success) throw createZodError(validation.error);
|
|
97
|
+
const result = await getAuditLog.execute(validation.data.id);
|
|
98
|
+
if (result.isFail()) throw result.error;
|
|
99
|
+
return result.value;
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
builder.addResolver({
|
|
104
|
+
path: "AuditLogsQuery.listAuditLogs",
|
|
105
|
+
dependencies: [
|
|
106
|
+
ListAuditLogsUseCase
|
|
107
|
+
],
|
|
108
|
+
resolver (listAuditLogs) {
|
|
109
|
+
return async ({ args })=>resolveList(async ()=>{
|
|
110
|
+
const validation = await listValidationSchema.safeParseAsync(args);
|
|
111
|
+
if (!validation.success) throw createZodError(validation.error);
|
|
112
|
+
const result = await listAuditLogs.execute({
|
|
113
|
+
...validation.data,
|
|
114
|
+
...validation.data.where
|
|
115
|
+
});
|
|
116
|
+
if (result.isFail()) throw result.error;
|
|
117
|
+
return {
|
|
118
|
+
items: result.value.items,
|
|
119
|
+
meta: {
|
|
120
|
+
...result.value.meta,
|
|
121
|
+
totalCount: 0
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
return builder;
|
|
128
|
+
}
|
|
129
|
+
constructor(){
|
|
130
|
+
this.getSchemaKey = staticSchemaKey("api-audit-logs/AuditLogsGraphQLSchemaImpl");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
const AuditLogsGraphQLSchema = CoreGraphQLSchemaFactory.createImplementation({
|
|
134
|
+
implementation: AuditLogsGraphQLSchemaImpl,
|
|
135
|
+
dependencies: []
|
|
136
|
+
});
|
|
137
|
+
export { AuditLogsGraphQLSchema };
|
|
138
|
+
|
|
139
|
+
//# sourceMappingURL=AuditLogsGraphQLSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/AuditLogsGraphQLSchema.js","sources":["../../src/graphql/AuditLogsGraphQLSchema.ts"],"sourcesContent":["import { resolve } from \"@webiny/api-graphql\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport { resolveList } from \"@webiny/api-graphql\";\nimport { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { GraphQLSchemaBuilder } from \"@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js\";\nimport { createZodError } from \"@webiny/utils\";\nimport { GetAuditLogUseCase } from \"~/features/GetAuditLog/abstractions.js\";\nimport { ListAuditLogsUseCase } from \"~/features/ListAuditLogs/abstractions.js\";\nimport { getValidationSchema, listValidationSchema } from \"./validation.js\";\n\ninterface IListAuditLogsWhere {\n app?: string;\n action?: string;\n createdBy?: string;\n entity?: string;\n entityId?: string;\n createdOn_gte?: Date;\n createdOn_lte?: Date;\n}\n\ninterface IListAuditLogsArgs {\n where?: IListAuditLogsWhere;\n sort?: \"ASC\" | \"DESC\";\n limit?: number;\n after?: string;\n}\n\nconst TYPE_DEFS = /* GraphQL */ `\n type AuditLogCreatedBy {\n id: ID!\n displayName: String\n type: String\n }\n type AuditLog {\n id: ID!\n createdBy: AuditLogCreatedBy!\n createdOn: DateTime!\n app: String!\n action: String!\n message: String!\n entity: String!\n entityId: String!\n tags: [String!]!\n expiresAt: DateTime!\n content: String\n }\n\n type AuditLogListMeta {\n cursor: String\n hasMoreItems: Boolean!\n }\n\n type AuditLogError {\n code: String\n message: String!\n data: JSON\n stack: String\n }\n\n type AuditLogListResponse {\n data: [AuditLog!]\n meta: AuditLogListMeta\n error: AuditLogError\n }\n\n type AuditLogGetResponse {\n data: AuditLog\n error: AuditLogError\n }\n\n enum AuditLogsSort {\n ASC\n DESC\n }\n\n input ListAuditLogsWhere {\n app: String\n action: String\n createdBy: String\n entity: String\n entityId: String\n createdOn_gte: DateTime\n createdOn_lte: DateTime\n }\n\n type AuditLogsQuery {\n getAuditLog(id: ID!): AuditLogGetResponse\n listAuditLogs(\n where: ListAuditLogsWhere\n sort: AuditLogsSort\n limit: Number\n after: String\n ): AuditLogListResponse!\n }\n\n extend type Query {\n auditLogs: AuditLogsQuery\n }\n`;\n\nclass AuditLogsGraphQLSchemaImpl implements CoreGraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"api-audit-logs/AuditLogsGraphQLSchemaImpl\");\n\n public async execute(builder: GraphQLSchemaBuilder.Interface): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(TYPE_DEFS);\n\n builder.addResolver({\n path: \"Query.auditLogs\",\n dependencies: [],\n resolver: () => () => ({})\n });\n\n builder.addResolver<{ id: string }>({\n path: \"AuditLogsQuery.getAuditLog\",\n dependencies: [GetAuditLogUseCase],\n resolver(getAuditLog: GetAuditLogUseCase.Interface) {\n return async ({ args }) => {\n return resolve(async () => {\n const validation = await getValidationSchema.safeParseAsync(args);\n\n if (!validation.success) {\n throw createZodError(validation.error);\n }\n\n const result = await getAuditLog.execute(validation.data.id);\n if (result.isFail()) {\n throw result.error;\n }\n return result.value;\n });\n };\n }\n });\n\n builder.addResolver<IListAuditLogsArgs>({\n path: \"AuditLogsQuery.listAuditLogs\",\n dependencies: [ListAuditLogsUseCase],\n resolver(listAuditLogs: ListAuditLogsUseCase.Interface) {\n return async ({ args }) => {\n return resolveList(async () => {\n const validation = await listValidationSchema.safeParseAsync(args);\n if (!validation.success) {\n throw createZodError(validation.error);\n }\n const result = await listAuditLogs.execute({\n ...validation.data,\n ...validation.data.where\n });\n if (result.isFail()) {\n throw result.error;\n }\n return {\n items: result.value.items,\n meta: {\n ...result.value.meta,\n totalCount: 0\n }\n };\n });\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const AuditLogsGraphQLSchema = CoreGraphQLSchemaFactory.createImplementation({\n implementation: AuditLogsGraphQLSchemaImpl,\n dependencies: []\n});\n"],"names":["TYPE_DEFS","AuditLogsGraphQLSchemaImpl","builder","GetAuditLogUseCase","getAuditLog","args","resolve","validation","getValidationSchema","createZodError","result","ListAuditLogsUseCase","listAuditLogs","resolveList","listValidationSchema","staticSchemaKey","AuditLogsGraphQLSchema","CoreGraphQLSchemaFactory"],"mappings":";;;;;;;AA2BA,MAAMA,YAA0B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEjC,CAAC;AAED,MAAMC;IAGF,MAAa,QAAQC,OAAuC,EAAmC;QAC3FA,QAAQ,WAAW,CAACF;QAEpBE,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc,EAAE;YAChB,UAAU,IAAM,IAAO,EAAC;QAC5B;QAEAA,QAAQ,WAAW,CAAiB;YAChC,MAAM;YACN,cAAc;gBAACC;aAAmB;YAClC,UAASC,WAAyC;gBAC9C,OAAO,OAAO,EAAEC,IAAI,EAAE,GACXC,QAAQ;wBACX,MAAMC,aAAa,MAAMC,oBAAoB,cAAc,CAACH;wBAE5D,IAAI,CAACE,WAAW,OAAO,EACnB,MAAME,eAAeF,WAAW,KAAK;wBAGzC,MAAMG,SAAS,MAAMN,YAAY,OAAO,CAACG,WAAW,IAAI,CAAC,EAAE;wBAC3D,IAAIG,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;wBAEtB,OAAOA,OAAO,KAAK;oBACvB;YAER;QACJ;QAEAR,QAAQ,WAAW,CAAqB;YACpC,MAAM;YACN,cAAc;gBAACS;aAAqB;YACpC,UAASC,aAA6C;gBAClD,OAAO,OAAO,EAAEP,IAAI,EAAE,GACXQ,YAAY;wBACf,MAAMN,aAAa,MAAMO,qBAAqB,cAAc,CAACT;wBAC7D,IAAI,CAACE,WAAW,OAAO,EACnB,MAAME,eAAeF,WAAW,KAAK;wBAEzC,MAAMG,SAAS,MAAME,cAAc,OAAO,CAAC;4BACvC,GAAGL,WAAW,IAAI;4BAClB,GAAGA,WAAW,IAAI,CAAC,KAAK;wBAC5B;wBACA,IAAIG,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;wBAEtB,OAAO;4BACH,OAAOA,OAAO,KAAK,CAAC,KAAK;4BACzB,MAAM;gCACF,GAAGA,OAAO,KAAK,CAAC,IAAI;gCACpB,YAAY;4BAChB;wBACJ;oBACJ;YAER;QACJ;QAEA,OAAOR;IACX;;aA/DO,YAAY,GAAGa,gBAAgB;;AAgE1C;AAEO,MAAMC,yBAAyBC,yBAAyB,oBAAoB,CAAC;IAChF,gBAAgBhB;IAChB,cAAc,EAAE;AACpB"}
|
package/graphql/validation.js
CHANGED
|
@@ -1,35 +1,31 @@
|
|
|
1
1
|
import zod from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
const getValidationSchema = zod.object({
|
|
3
|
+
id: zod.string().min(1, "ID is required.")
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (typeof input == "string") {
|
|
29
|
-
return parseInt(input);
|
|
30
|
-
}
|
|
31
|
-
return input;
|
|
32
|
-
}, zod.number().min(1).max(100).optional()).default(25)
|
|
5
|
+
const listValidationSchema = zod.object({
|
|
6
|
+
where: zod.object({
|
|
7
|
+
app: zod.string().min(1, "App is required.").optional(),
|
|
8
|
+
entity: zod.string().optional(),
|
|
9
|
+
entityId: zod.string().min(1, "Entity ID is required.").optional(),
|
|
10
|
+
createdOn_gte: zod.preprocess((input)=>{
|
|
11
|
+
if ("string" == typeof input || input instanceof Date) return new Date(input);
|
|
12
|
+
}, zod.date().optional()),
|
|
13
|
+
createdOn_lte: zod.preprocess((input)=>{
|
|
14
|
+
if ("string" == typeof input || input instanceof Date) return new Date(input);
|
|
15
|
+
}, zod.date().optional()),
|
|
16
|
+
createdBy: zod.string().optional(),
|
|
17
|
+
action: zod.string().optional()
|
|
18
|
+
}),
|
|
19
|
+
after: zod.string().optional(),
|
|
20
|
+
sort: zod["enum"]([
|
|
21
|
+
"ASC",
|
|
22
|
+
"DESC"
|
|
23
|
+
]).optional(),
|
|
24
|
+
limit: zod.preprocess((input)=>{
|
|
25
|
+
if ("string" == typeof input) return parseInt(input);
|
|
26
|
+
return input;
|
|
27
|
+
}, zod.number().min(1).max(100).optional()).default(25)
|
|
33
28
|
});
|
|
29
|
+
export { getValidationSchema, listValidationSchema };
|
|
34
30
|
|
|
35
31
|
//# sourceMappingURL=validation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"graphql/validation.js","sources":["../../src/graphql/validation.ts"],"sourcesContent":["import zod from \"zod\";\n\nexport const getValidationSchema = zod.object({\n id: zod.string().min(1, \"ID is required.\")\n});\n\nexport const listValidationSchema = zod.object({\n where: zod.object({\n app: zod.string().min(1, \"App is required.\").optional(),\n entity: zod.string().optional(),\n entityId: zod.string().min(1, \"Entity ID is required.\").optional(),\n createdOn_gte: zod.preprocess(input => {\n if (typeof input == \"string\" || input instanceof Date) {\n return new Date(input);\n }\n return undefined;\n }, zod.date().optional()),\n createdOn_lte: zod.preprocess(input => {\n if (typeof input == \"string\" || input instanceof Date) {\n return new Date(input);\n }\n return undefined;\n }, zod.date().optional()),\n createdBy: zod.string().optional(),\n action: zod.string().optional()\n }),\n after: zod.string().optional(),\n sort: zod.enum([\"ASC\", \"DESC\"]).optional(),\n limit: zod\n .preprocess(input => {\n if (typeof input == \"string\") {\n return parseInt(input);\n }\n return input;\n }, zod.number().min(1).max(100).optional())\n .default(25)\n});\n"],"names":["getValidationSchema","zod","listValidationSchema","input","Date","parseInt"],"mappings":";AAEO,MAAMA,sBAAsBC,IAAI,MAAM,CAAC;IAC1C,IAAIA,IAAI,MAAM,GAAG,GAAG,CAAC,GAAG;AAC5B;AAEO,MAAMC,uBAAuBD,IAAI,MAAM,CAAC;IAC3C,OAAOA,IAAI,MAAM,CAAC;QACd,KAAKA,IAAI,MAAM,GAAG,GAAG,CAAC,GAAG,oBAAoB,QAAQ;QACrD,QAAQA,IAAI,MAAM,GAAG,QAAQ;QAC7B,UAAUA,IAAI,MAAM,GAAG,GAAG,CAAC,GAAG,0BAA0B,QAAQ;QAChE,eAAeA,IAAI,UAAU,CAACE,CAAAA;YAC1B,IAAI,AAAgB,YAAhB,OAAOA,SAAqBA,iBAAiBC,MAC7C,OAAO,IAAIA,KAAKD;QAGxB,GAAGF,IAAI,IAAI,GAAG,QAAQ;QACtB,eAAeA,IAAI,UAAU,CAACE,CAAAA;YAC1B,IAAI,AAAgB,YAAhB,OAAOA,SAAqBA,iBAAiBC,MAC7C,OAAO,IAAIA,KAAKD;QAGxB,GAAGF,IAAI,IAAI,GAAG,QAAQ;QACtB,WAAWA,IAAI,MAAM,GAAG,QAAQ;QAChC,QAAQA,IAAI,MAAM,GAAG,QAAQ;IACjC;IACA,OAAOA,IAAI,MAAM,GAAG,QAAQ;IAC5B,MAAMA,GAAG,CAAHA,OAAQ,CAAC;QAAC;QAAO;KAAO,EAAE,QAAQ;IACxC,OAAOA,IAAAA,UACQ,CAACE,CAAAA;QACR,IAAI,AAAgB,YAAhB,OAAOA,OACP,OAAOE,SAASF;QAEpB,OAAOA;IACX,GAAGF,IAAI,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,QAAQ,IACvC,OAAO,CAAC;AACjB"}
|
package/index.d.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import { ContextPlugin } from "@webiny/api";
|
|
2
|
-
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
3
|
-
export interface ICreateAuditLogsParams {
|
|
4
|
-
deleteLogsAfterDays: number | undefined;
|
|
5
|
-
tableName?: string;
|
|
6
|
-
documentClient?: DynamoDBDocument;
|
|
7
|
-
}
|
|
8
|
-
export declare const createAuditLogs: (params?: ICreateAuditLogsParams) => (ContextPlugin<import("./types.js").AuditLogsContext> | import("@webiny/handler-graphql/index.js").GraphQLSchemaPlugin<import("./types.js").AuditLogsContext>)[];
|
|
9
1
|
export * from "./config.js";
|
|
2
|
+
export { AuditLogsFeature } from "./AuditLogsFeature.js";
|
|
3
|
+
export type { AuditLogsFeatureConfig } from "./AuditLogsFeature.js";
|
package/index.js
CHANGED
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
import { ContextPlugin } from "@webiny/api";
|
|
2
|
-
import { createSubscriptionHooks } from "./subscriptions/index.js";
|
|
3
|
-
import { createAuditLogsContext } from "./context/index.js";
|
|
4
|
-
import { createGraphQLSchema } from "./graphql/schema.js";
|
|
5
|
-
import { AuditLogsContext } from "./abstractions.js";
|
|
6
|
-
export const createAuditLogs = params => {
|
|
7
|
-
const subscriptionsPlugin = new ContextPlugin(context => {
|
|
8
|
-
if (!context.wcp.canUseFeature("auditLogs")) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
context.container.registerInstance(AuditLogsContext, context);
|
|
12
|
-
createSubscriptionHooks(context);
|
|
13
|
-
});
|
|
14
|
-
subscriptionsPlugin.name = "auditLogs.context.subscriptions";
|
|
15
|
-
return [subscriptionsPlugin, createGraphQLSchema(), createAuditLogsContext({
|
|
16
|
-
tableName: params?.tableName,
|
|
17
|
-
deleteLogsAfterDays: params?.deleteLogsAfterDays,
|
|
18
|
-
documentClient: params?.documentClient
|
|
19
|
-
})];
|
|
20
|
-
};
|
|
21
1
|
export * from "./config.js";
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
2
|
+
export { AuditLogsFeature } from "./AuditLogsFeature.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-audit-logs",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.eb81deee7e",
|
|
4
4
|
"exports": {
|
|
5
5
|
".": "./index.js",
|
|
6
6
|
"./*": "./*"
|
|
@@ -19,37 +19,37 @@
|
|
|
19
19
|
"watch": "node ../cli/bin.js run watch"
|
|
20
20
|
},
|
|
21
21
|
"publishConfig": {
|
|
22
|
-
"access": "public"
|
|
23
|
-
"directory": "dist"
|
|
22
|
+
"access": "public"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
25
|
+
"@webiny/api-headless-cms-testing": "0.0.0-unstable.eb81deee7e",
|
|
26
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.eb81deee7e",
|
|
27
|
+
"@webiny/di": "1.1.0",
|
|
28
|
+
"@webiny/event-handler-core": "0.0.0-unstable.eb81deee7e",
|
|
29
|
+
"@webiny/handler": "0.0.0-unstable.eb81deee7e",
|
|
30
|
+
"@webiny/plugins": "0.0.0-unstable.eb81deee7e",
|
|
31
|
+
"graphql": "16.14.2",
|
|
32
|
+
"typescript": "7.0.2",
|
|
33
|
+
"vitest": "4.1.11"
|
|
32
34
|
},
|
|
33
35
|
"dependencies": {
|
|
34
|
-
"@webiny/api": "0.0.0-unstable.
|
|
35
|
-
"@webiny/api-aco": "0.0.0-unstable.
|
|
36
|
-
"@webiny/api-core": "0.0.0-unstable.
|
|
37
|
-
"@webiny/api-file-manager": "0.0.0-unstable.
|
|
38
|
-
"@webiny/api-
|
|
39
|
-
"@webiny/api-
|
|
40
|
-
"@webiny/api-
|
|
41
|
-
"@webiny/
|
|
42
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
43
|
-
"@webiny/common-audit-logs": "0.0.0-unstable.
|
|
44
|
-
"@webiny/
|
|
45
|
-
"@webiny/
|
|
46
|
-
"@webiny/
|
|
47
|
-
"@webiny/
|
|
48
|
-
"@webiny/handler-db": "0.0.0-unstable.e6f0dc8ca7",
|
|
49
|
-
"@webiny/handler-graphql": "0.0.0-unstable.e6f0dc8ca7",
|
|
50
|
-
"@webiny/utils": "0.0.0-unstable.e6f0dc8ca7",
|
|
51
|
-
"@webiny/wcp": "0.0.0-unstable.e6f0dc8ca7",
|
|
36
|
+
"@webiny/api": "0.0.0-unstable.eb81deee7e",
|
|
37
|
+
"@webiny/api-aco": "0.0.0-unstable.eb81deee7e",
|
|
38
|
+
"@webiny/api-core": "0.0.0-unstable.eb81deee7e",
|
|
39
|
+
"@webiny/api-file-manager": "0.0.0-unstable.eb81deee7e",
|
|
40
|
+
"@webiny/api-graphql": "0.0.0-unstable.eb81deee7e",
|
|
41
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.eb81deee7e",
|
|
42
|
+
"@webiny/api-mailer": "0.0.0-unstable.eb81deee7e",
|
|
43
|
+
"@webiny/api-website-builder": "0.0.0-unstable.eb81deee7e",
|
|
44
|
+
"@webiny/build-tools": "0.0.0-unstable.eb81deee7e",
|
|
45
|
+
"@webiny/common-audit-logs": "0.0.0-unstable.eb81deee7e",
|
|
46
|
+
"@webiny/error": "0.0.0-unstable.eb81deee7e",
|
|
47
|
+
"@webiny/feature": "0.0.0-unstable.eb81deee7e",
|
|
48
|
+
"@webiny/utils": "0.0.0-unstable.eb81deee7e",
|
|
49
|
+
"@webiny/wcp": "0.0.0-unstable.eb81deee7e",
|
|
52
50
|
"zod": "4.4.3"
|
|
53
51
|
},
|
|
54
|
-
"
|
|
52
|
+
"webiny": {
|
|
53
|
+
"publishFrom": "dist"
|
|
54
|
+
}
|
|
55
55
|
}
|
package/storage/types.d.ts
CHANGED
|
@@ -17,38 +17,3 @@ export interface IAuditLog {
|
|
|
17
17
|
expiresAt: Date;
|
|
18
18
|
content: string;
|
|
19
19
|
}
|
|
20
|
-
export interface IStorageAuditLog extends Omit<IAuditLog, "createdOn" | "content" | "expiresAt"> {
|
|
21
|
-
expiresAt: string;
|
|
22
|
-
createdOn: string;
|
|
23
|
-
content: string;
|
|
24
|
-
}
|
|
25
|
-
export interface IStorageItem {
|
|
26
|
-
PK: string;
|
|
27
|
-
SK: string;
|
|
28
|
-
TYPE: string;
|
|
29
|
-
GSI_TENANT: string;
|
|
30
|
-
GSI1_PK: string;
|
|
31
|
-
GSI1_SK: number;
|
|
32
|
-
GSI2_PK: string;
|
|
33
|
-
GSI2_SK: number;
|
|
34
|
-
GSI3_PK: string;
|
|
35
|
-
GSI3_SK: number;
|
|
36
|
-
GSI4_PK: string;
|
|
37
|
-
GSI4_SK: number;
|
|
38
|
-
GSI5_PK: string;
|
|
39
|
-
GSI5_SK: number;
|
|
40
|
-
GSI6_PK: string;
|
|
41
|
-
GSI6_SK: number;
|
|
42
|
-
GSI7_PK: string;
|
|
43
|
-
GSI7_SK: number;
|
|
44
|
-
GSI8_PK: string;
|
|
45
|
-
GSI8_SK: number;
|
|
46
|
-
GSI9_PK: string;
|
|
47
|
-
GSI9_SK: number;
|
|
48
|
-
data: IStorageAuditLog;
|
|
49
|
-
expiresAt: number;
|
|
50
|
-
}
|
|
51
|
-
export interface IIndexStorageItem {
|
|
52
|
-
PK: string;
|
|
53
|
-
SK: string;
|
|
54
|
-
}
|
package/storage/types.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FolderAfterCreateEventHandler } from "@webiny/api-aco/features/folder/CreateFolder/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogFolderAfterCreateHandlerImpl implements FolderAfterCreateEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: FolderAfterCreateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogFolderAfterCreateHandler: typeof AuditLogFolderAfterCreateHandlerImpl & {
|
|
@@ -1,35 +1,45 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { FolderAfterCreateEventHandler } from "@webiny/api-aco/features/folder/CreateFolder/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 AuditLogFolderAfterCreateHandlerImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
8
|
+
}
|
|
9
|
+
async handle(event) {
|
|
10
|
+
try {
|
|
11
|
+
const { folder } = event.payload;
|
|
12
|
+
if ("FmFile" === folder.type) {
|
|
13
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
14
|
+
audit: AUDIT.FILE_MANAGER.FILE_FOLDER.CREATE,
|
|
15
|
+
message: "Folder created",
|
|
16
|
+
content: folder,
|
|
17
|
+
entityId: folder.id
|
|
18
|
+
});
|
|
19
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
20
|
+
} else if (folder.type.startsWith("cms:")) {
|
|
21
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
22
|
+
audit: AUDIT.HEADLESS_CMS.MODEL_FOLDER.CREATE,
|
|
23
|
+
message: "Folder created",
|
|
24
|
+
content: folder,
|
|
25
|
+
entityId: folder.id
|
|
26
|
+
});
|
|
27
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
28
|
+
}
|
|
29
|
+
} catch (error) {
|
|
30
|
+
throw _webiny_error.from(error, {
|
|
31
|
+
message: "Error while executing AuditLogFolderAfterCreateHandler",
|
|
32
|
+
code: "AUDIT_LOGS_AFTER_FOLDER_CREATE_HANDLER"
|
|
33
|
+
});
|
|
34
|
+
}
|
|
27
35
|
}
|
|
28
|
-
}
|
|
29
36
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
const AuditLogFolderAfterCreateHandler = FolderAfterCreateEventHandler.createImplementation({
|
|
38
|
+
implementation: AuditLogFolderAfterCreateHandlerImpl,
|
|
39
|
+
dependencies: [
|
|
40
|
+
RecordAuditLogUseCase
|
|
41
|
+
]
|
|
33
42
|
});
|
|
43
|
+
export { AuditLogFolderAfterCreateHandler };
|
|
34
44
|
|
|
35
45
|
//# sourceMappingURL=AuditLogFolderAfterCreateHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js","sources":["../../../../src/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { FolderAfterCreateEventHandler } from \"@webiny/api-aco/features/folder/CreateFolder/index.js\";\nimport { RecordAuditLogUseCase } from \"~/features/RecordAuditLog/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass AuditLogFolderAfterCreateHandlerImpl implements FolderAfterCreateEventHandler.Interface {\n constructor(private recordAuditLog: RecordAuditLogUseCase.Interface) {}\n\n async handle(event: FolderAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { folder } = event.payload;\n if (folder.type === \"FmFile\") {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.FILE_MANAGER.FILE_FOLDER.CREATE,\n message: \"Folder created\",\n content: folder,\n entityId: folder.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n } else if (folder.type.startsWith(\"cms:\")) {\n const recordResult = await this.recordAuditLog.execute({\n audit: AUDIT.HEADLESS_CMS.MODEL_FOLDER.CREATE,\n message: \"Folder created\",\n content: folder,\n entityId: folder.id\n });\n if (recordResult.isFail()) {\n throw recordResult.error;\n }\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogFolderAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_FOLDER_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogFolderAfterCreateHandler = FolderAfterCreateEventHandler.createImplementation({\n implementation: AuditLogFolderAfterCreateHandlerImpl,\n dependencies: [RecordAuditLogUseCase]\n});\n"],"names":["AuditLogFolderAfterCreateHandlerImpl","recordAuditLog","event","folder","recordResult","AUDIT","error","WebinyError","AuditLogFolderAfterCreateHandler","FolderAfterCreateEventHandler","RecordAuditLogUseCase"],"mappings":";;;;AAKA,MAAMA;IACF,YAAoBC,cAA+C,CAAE;aAAjDA,cAAc,GAAdA;IAAkD;IAEtE,MAAM,OAAOC,KAA0C,EAAiB;QACpE,IAAI;YACA,MAAM,EAAEC,MAAM,EAAE,GAAGD,MAAM,OAAO;YAChC,IAAIC,AAAgB,aAAhBA,OAAO,IAAI,EAAe;gBAC1B,MAAMC,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACnD,OAAOC,MAAM,YAAY,CAAC,WAAW,CAAC,MAAM;oBAC5C,SAAS;oBACT,SAASF;oBACT,UAAUA,OAAO,EAAE;gBACvB;gBACA,IAAIC,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;YAEhC,OAAO,IAAID,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS;gBACvC,MAAMC,eAAe,MAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;oBACnD,OAAOC,MAAM,YAAY,CAAC,YAAY,CAAC,MAAM;oBAC7C,SAAS;oBACT,SAASF;oBACT,UAAUA,OAAO,EAAE;gBACvB;gBACA,IAAIC,aAAa,MAAM,IACnB,MAAMA,aAAa,KAAK;YAEhC;QACJ,EAAE,OAAOE,OAAO;YACZ,MAAMC,cAAAA,IAAgB,CAACD,OAAO;gBAC1B,SAAS;gBACT,MAAM;YACV;QACJ;IACJ;AACJ;AAEO,MAAME,mCAAmCC,8BAA8B,oBAAoB,CAAC;IAC/F,gBAAgBT;IAChB,cAAc;QAACU;KAAsB;AACzC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FolderAfterDeleteEventHandler } from "@webiny/api-aco/features/folder/DeleteFolder/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { RecordAuditLogUseCase } from "../../../features/RecordAuditLog/abstractions.js";
|
|
3
3
|
declare class AuditLogFolderAfterDeleteHandlerImpl implements FolderAfterDeleteEventHandler.Interface {
|
|
4
|
-
private
|
|
5
|
-
constructor(
|
|
4
|
+
private recordAuditLog;
|
|
5
|
+
constructor(recordAuditLog: RecordAuditLogUseCase.Interface);
|
|
6
6
|
handle(event: FolderAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const AuditLogFolderAfterDeleteHandler: typeof AuditLogFolderAfterDeleteHandlerImpl & {
|
|
@@ -1,38 +1,53 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _webiny_error from "@webiny/error";
|
|
2
2
|
import { FolderAfterDeleteEventHandler } from "@webiny/api-aco/features/folder/DeleteFolder/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 AuditLogFolderAfterDeleteHandlerImpl {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
6
|
+
constructor(recordAuditLog){
|
|
7
|
+
this.recordAuditLog = recordAuditLog;
|
|
8
|
+
}
|
|
9
|
+
async handle(event) {
|
|
10
|
+
try {
|
|
11
|
+
const { folder } = event.payload;
|
|
12
|
+
if ("PbPage" === folder.type) {
|
|
13
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
14
|
+
audit: AUDIT.PAGE_BUILDER.PAGE_FOLDER.DELETE,
|
|
15
|
+
message: "Folder deleted",
|
|
16
|
+
content: folder,
|
|
17
|
+
entityId: folder.id
|
|
18
|
+
});
|
|
19
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
20
|
+
} else if ("FmFile" === folder.type) {
|
|
21
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
22
|
+
audit: AUDIT.FILE_MANAGER.FILE_FOLDER.DELETE,
|
|
23
|
+
message: "Folder deleted",
|
|
24
|
+
content: folder,
|
|
25
|
+
entityId: folder.id
|
|
26
|
+
});
|
|
27
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
28
|
+
} else if (folder.type.startsWith("cms:")) {
|
|
29
|
+
const recordResult = await this.recordAuditLog.execute({
|
|
30
|
+
audit: AUDIT.HEADLESS_CMS.MODEL_FOLDER.DELETE,
|
|
31
|
+
message: "Folder deleted",
|
|
32
|
+
content: folder,
|
|
33
|
+
entityId: folder.id
|
|
34
|
+
});
|
|
35
|
+
if (recordResult.isFail()) throw recordResult.error;
|
|
36
|
+
}
|
|
37
|
+
} catch (error) {
|
|
38
|
+
throw _webiny_error.from(error, {
|
|
39
|
+
message: "Error while executing AuditLogFolderAfterDeleteHandler",
|
|
40
|
+
code: "AUDIT_LOGS_AFTER_FOLDER_DELETE_HANDLER"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
30
43
|
}
|
|
31
|
-
}
|
|
32
44
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
45
|
+
const AuditLogFolderAfterDeleteHandler = FolderAfterDeleteEventHandler.createImplementation({
|
|
46
|
+
implementation: AuditLogFolderAfterDeleteHandlerImpl,
|
|
47
|
+
dependencies: [
|
|
48
|
+
RecordAuditLogUseCase
|
|
49
|
+
]
|
|
36
50
|
});
|
|
51
|
+
export { AuditLogFolderAfterDeleteHandler };
|
|
37
52
|
|
|
38
53
|
//# sourceMappingURL=AuditLogFolderAfterDeleteHandler.js.map
|