@webiny/api-audit-logs 6.0.0-beta.0 → 6.0.0-rc.1
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/README.md +11 -1
- package/abstractions.d.ts +5 -0
- package/abstractions.js +6 -0
- package/abstractions.js.map +1 -0
- package/config.d.ts +0 -13
- package/config.js +3 -291
- package/config.js.map +1 -1
- package/context/AuditLogsContextValue.d.ts +10 -0
- package/context/AuditLogsContextValue.js +139 -0
- package/context/AuditLogsContextValue.js.map +1 -0
- package/context/index.d.ts +9 -0
- package/context/index.js +35 -0
- package/context/index.js.map +1 -0
- package/events/AuditLogAfterCreateEvent.d.ts +6 -0
- package/events/AuditLogAfterCreateEvent.js +10 -0
- package/events/AuditLogAfterCreateEvent.js.map +1 -0
- package/events/AuditLogAfterUpdateEvent.d.ts +6 -0
- package/events/AuditLogAfterUpdateEvent.js +10 -0
- package/events/AuditLogAfterUpdateEvent.js.map +1 -0
- package/events/AuditLogBeforeCreateEvent.d.ts +6 -0
- package/events/AuditLogBeforeCreateEvent.js +10 -0
- package/events/AuditLogBeforeCreateEvent.js.map +1 -0
- package/events/AuditLogBeforeUpdateEvent.d.ts +6 -0
- package/events/AuditLogBeforeUpdateEvent.js +10 -0
- package/events/AuditLogBeforeUpdateEvent.js.map +1 -0
- package/events/abstractions.d.ts +43 -0
- package/events/abstractions.js +27 -0
- package/events/abstractions.js.map +1 -0
- package/events/index.d.ts +5 -0
- package/events/index.js +7 -0
- package/events/index.js.map +1 -0
- package/graphql/schema.d.ts +3 -0
- package/graphql/schema.js +126 -0
- package/graphql/schema.js.map +1 -0
- package/graphql/validation.d.ts +64 -0
- package/graphql/validation.js +35 -0
- package/graphql/validation.js.map +1 -0
- package/index.d.ts +8 -4
- package/index.js +15 -41
- package/index.js.map +1 -1
- package/package.json +30 -34
- package/storage/AccessPatternHandler.d.ts +14 -0
- package/storage/AccessPatternHandler.js +60 -0
- package/storage/AccessPatternHandler.js.map +1 -0
- package/storage/Converter.d.ts +16 -0
- package/storage/Converter.js +52 -0
- package/storage/Converter.js.map +1 -0
- package/storage/Storage.d.ts +18 -0
- package/storage/Storage.js +89 -0
- package/storage/Storage.js.map +1 -0
- package/storage/abstractions/AccessPattern.d.ts +24 -0
- package/storage/abstractions/AccessPattern.js +3 -0
- package/storage/abstractions/AccessPattern.js.map +1 -0
- package/storage/abstractions/AccessPatternHandler.d.ts +13 -0
- package/storage/abstractions/AccessPatternHandler.js +3 -0
- package/storage/abstractions/AccessPatternHandler.js.map +1 -0
- package/storage/abstractions/Converter.d.ts +6 -0
- package/storage/abstractions/Converter.js +3 -0
- package/storage/abstractions/Converter.js.map +1 -0
- package/storage/abstractions/Storage.d.ts +108 -0
- package/storage/abstractions/Storage.js +3 -0
- package/storage/abstractions/Storage.js.map +1 -0
- package/storage/accessPatterns/AppAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppAccessPattern.js +29 -0
- package/storage/accessPatterns/AppAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppCreatedByAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppCreatedByAccessPattern.js +32 -0
- package/storage/accessPatterns/AppCreatedByAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppEntityAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppEntityAccessPattern.js +29 -0
- package/storage/accessPatterns/AppEntityAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppEntityActionAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppEntityActionAccessPattern.js +29 -0
- package/storage/accessPatterns/AppEntityActionAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js +32 -0
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js +32 -0
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js.map +1 -0
- package/storage/accessPatterns/BaseAccessPattern.d.ts +32 -0
- package/storage/accessPatterns/BaseAccessPattern.js +82 -0
- package/storage/accessPatterns/BaseAccessPattern.js.map +1 -0
- package/storage/accessPatterns/CreatedByAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/CreatedByAccessPattern.js +32 -0
- package/storage/accessPatterns/CreatedByAccessPattern.js.map +1 -0
- package/storage/accessPatterns/CreatedOnAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/CreatedOnAccessPattern.js +30 -0
- package/storage/accessPatterns/CreatedOnAccessPattern.js.map +1 -0
- package/storage/accessPatterns/DefaultAccessPattern.d.ts +15 -0
- package/storage/accessPatterns/DefaultAccessPattern.js +36 -0
- package/storage/accessPatterns/DefaultAccessPattern.js.map +1 -0
- package/storage/accessPatterns/EntityIdAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/EntityIdAccessPattern.js +33 -0
- package/storage/accessPatterns/EntityIdAccessPattern.js.map +1 -0
- package/storage/accessPatterns/index.d.ts +6 -0
- package/storage/accessPatterns/index.js +47 -0
- package/storage/accessPatterns/index.js.map +1 -0
- package/storage/cursorSchema.d.ts +4 -0
- package/storage/cursorSchema.js +25 -0
- package/storage/cursorSchema.js.map +1 -0
- package/storage/entity.d.ts +36 -0
- package/storage/entity.js +127 -0
- package/storage/entity.js.map +1 -0
- package/storage/results/ListErrorResult.d.ts +10 -0
- package/storage/results/ListErrorResult.js +11 -0
- package/storage/results/ListErrorResult.js.map +1 -0
- package/storage/results/ListSuccessResult.d.ts +14 -0
- package/storage/results/ListSuccessResult.js +16 -0
- package/storage/results/ListSuccessResult.js.map +1 -0
- package/storage/results/index.d.ts +2 -0
- package/storage/results/index.js +4 -0
- package/storage/results/index.js.map +1 -0
- package/storage/startKey.d.ts +6 -0
- package/storage/startKey.js +9 -0
- package/storage/startKey.js.map +1 -0
- package/storage/types.d.ts +54 -0
- package/storage/types.js +3 -0
- package/storage/types.js.map +1 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +35 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +38 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +42 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -0
- package/subscriptions/aco/index.d.ts +1 -1
- package/subscriptions/aco/index.js +7 -15
- package/subscriptions/aco/index.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +30 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +30 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +34 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +34 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -0
- package/subscriptions/fileManager/index.d.ts +2 -2
- package/subscriptions/fileManager/index.js +11 -13
- package/subscriptions/fileManager/index.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +40 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +38 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +30 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +30 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +30 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +30 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/index.d.ts +1 -1
- package/subscriptions/headlessCms/index.js +33 -27
- package/subscriptions/headlessCms/index.js.map +1 -1
- package/subscriptions/index.d.ts +1 -1
- package/subscriptions/index.js +13 -26
- package/subscriptions/index.js.map +1 -1
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +11 -0
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +32 -0
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -0
- package/subscriptions/mailer/index.d.ts +2 -2
- package/subscriptions/mailer/index.js +4 -10
- package/subscriptions/mailer/index.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +47 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +47 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +52 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +34 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +34 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +34 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/cleanupApiKey.d.ts +7 -0
- package/subscriptions/security/handlers/cleanupApiKey.js +18 -0
- package/subscriptions/security/handlers/cleanupApiKey.js.map +1 -0
- package/subscriptions/security/index.d.ts +2 -2
- package/subscriptions/security/index.js +31 -23
- package/subscriptions/security/index.js.map +1 -1
- package/subscriptions/websiteBuilder/index.d.ts +2 -0
- package/subscriptions/websiteBuilder/index.js +31 -0
- package/subscriptions/websiteBuilder/index.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +34 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +34 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +30 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +30 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +30 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +34 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -0
- package/types.d.ts +37 -43
- package/types.js +1 -16
- package/types.js.map +1 -1
- package/utils/expiresAt.d.ts +4 -0
- package/utils/expiresAt.js +25 -0
- package/utils/expiresAt.js.map +1 -0
- package/utils/getAuditConfig.d.ts +4 -36
- package/utils/getAuditConfig.js +77 -113
- package/utils/getAuditConfig.js.map +1 -1
- package/utils/getAuditObject.d.ts +2 -1
- package/utils/getAuditObject.js +1 -8
- package/utils/getAuditObject.js.map +1 -1
- package/app/app.d.ts +0 -2
- package/app/app.js +0 -120
- package/app/app.js.map +0 -1
- package/app/contants.d.ts +0 -2
- package/app/contants.js +0 -10
- package/app/contants.js.map +0 -1
- package/app/createAppModifier.d.ts +0 -4
- package/app/createAppModifier.js +0 -14
- package/app/createAppModifier.js.map +0 -1
- package/app/index.d.ts +0 -4
- package/app/index.js +0 -43
- package/app/index.js.map +0 -1
- package/app/types.d.ts +0 -7
- package/app/types.js +0 -7
- package/app/types.js.map +0 -1
- package/subscriptions/aco/folders.d.ts +0 -4
- package/subscriptions/aco/folders.js +0 -94
- package/subscriptions/aco/folders.js.map +0 -1
- package/subscriptions/apw/changeRequests.d.ts +0 -4
- package/subscriptions/apw/changeRequests.js +0 -80
- package/subscriptions/apw/changeRequests.js.map +0 -1
- package/subscriptions/apw/comments.d.ts +0 -2
- package/subscriptions/apw/comments.js +0 -28
- package/subscriptions/apw/comments.js.map +0 -1
- package/subscriptions/apw/contentReviews.d.ts +0 -2
- package/subscriptions/apw/contentReviews.js +0 -28
- package/subscriptions/apw/contentReviews.js.map +0 -1
- package/subscriptions/apw/index.d.ts +0 -2
- package/subscriptions/apw/index.js +0 -26
- package/subscriptions/apw/index.js.map +0 -1
- package/subscriptions/apw/workflows.d.ts +0 -4
- package/subscriptions/apw/workflows.js +0 -64
- package/subscriptions/apw/workflows.js.map +0 -1
- package/subscriptions/fileManager/files.d.ts +0 -4
- package/subscriptions/fileManager/files.js +0 -64
- package/subscriptions/fileManager/files.js.map +0 -1
- package/subscriptions/fileManager/settings.d.ts +0 -2
- package/subscriptions/fileManager/settings.js +0 -32
- package/subscriptions/fileManager/settings.js.map +0 -1
- package/subscriptions/formBuilder/formRevisions.d.ts +0 -6
- package/subscriptions/formBuilder/formRevisions.js +0 -96
- package/subscriptions/formBuilder/formRevisions.js.map +0 -1
- package/subscriptions/formBuilder/formSubmissions.d.ts +0 -2
- package/subscriptions/formBuilder/formSubmissions.js +0 -28
- package/subscriptions/formBuilder/formSubmissions.js.map +0 -1
- package/subscriptions/formBuilder/forms.d.ts +0 -5
- package/subscriptions/formBuilder/forms.js +0 -76
- package/subscriptions/formBuilder/forms.js.map +0 -1
- package/subscriptions/formBuilder/index.d.ts +0 -2
- package/subscriptions/formBuilder/index.js +0 -26
- package/subscriptions/formBuilder/index.js.map +0 -1
- package/subscriptions/formBuilder/settings.d.ts +0 -2
- package/subscriptions/formBuilder/settings.js +0 -32
- package/subscriptions/formBuilder/settings.js.map +0 -1
- package/subscriptions/headlessCms/entries.d.ts +0 -9
- package/subscriptions/headlessCms/entries.js +0 -183
- package/subscriptions/headlessCms/entries.js.map +0 -1
- package/subscriptions/headlessCms/groups.d.ts +0 -4
- package/subscriptions/headlessCms/groups.js +0 -64
- package/subscriptions/headlessCms/groups.js.map +0 -1
- package/subscriptions/headlessCms/models.d.ts +0 -4
- package/subscriptions/headlessCms/models.js +0 -64
- package/subscriptions/headlessCms/models.js.map +0 -1
- package/subscriptions/headlessCms/utils/isSearchModelEntry.d.ts +0 -1
- package/subscriptions/headlessCms/utils/isSearchModelEntry.js +0 -13
- package/subscriptions/headlessCms/utils/isSearchModelEntry.js.map +0 -1
- package/subscriptions/i18n/index.d.ts +0 -2
- package/subscriptions/i18n/index.js +0 -15
- package/subscriptions/i18n/index.js.map +0 -1
- package/subscriptions/i18n/locales.d.ts +0 -4
- package/subscriptions/i18n/locales.js +0 -64
- package/subscriptions/i18n/locales.js.map +0 -1
- package/subscriptions/mailer/settings.d.ts +0 -2
- package/subscriptions/mailer/settings.js +0 -32
- package/subscriptions/mailer/settings.js.map +0 -1
- package/subscriptions/pageBuilder/blockCategories.d.ts +0 -4
- package/subscriptions/pageBuilder/blockCategories.js +0 -64
- package/subscriptions/pageBuilder/blockCategories.js.map +0 -1
- package/subscriptions/pageBuilder/blocks.d.ts +0 -6
- package/subscriptions/pageBuilder/blocks.js +0 -96
- package/subscriptions/pageBuilder/blocks.js.map +0 -1
- package/subscriptions/pageBuilder/categories.d.ts +0 -4
- package/subscriptions/pageBuilder/categories.js +0 -64
- package/subscriptions/pageBuilder/categories.js.map +0 -1
- package/subscriptions/pageBuilder/index.d.ts +0 -2
- package/subscriptions/pageBuilder/index.js +0 -51
- package/subscriptions/pageBuilder/index.js.map +0 -1
- package/subscriptions/pageBuilder/menus.d.ts +0 -4
- package/subscriptions/pageBuilder/menus.js +0 -64
- package/subscriptions/pageBuilder/menus.js.map +0 -1
- package/subscriptions/pageBuilder/pageElements.d.ts +0 -4
- package/subscriptions/pageBuilder/pageElements.js +0 -64
- package/subscriptions/pageBuilder/pageElements.js.map +0 -1
- package/subscriptions/pageBuilder/pageRevisions.d.ts +0 -6
- package/subscriptions/pageBuilder/pageRevisions.js +0 -101
- package/subscriptions/pageBuilder/pageRevisions.js.map +0 -1
- package/subscriptions/pageBuilder/pages.d.ts +0 -4
- package/subscriptions/pageBuilder/pages.js +0 -60
- package/subscriptions/pageBuilder/pages.js.map +0 -1
- package/subscriptions/pageBuilder/settings.d.ts +0 -2
- package/subscriptions/pageBuilder/settings.js +0 -32
- package/subscriptions/pageBuilder/settings.js.map +0 -1
- package/subscriptions/pageBuilder/templates.d.ts +0 -6
- package/subscriptions/pageBuilder/templates.js +0 -96
- package/subscriptions/pageBuilder/templates.js.map +0 -1
- package/subscriptions/security/apiKeys.d.ts +0 -4
- package/subscriptions/security/apiKeys.js +0 -85
- package/subscriptions/security/apiKeys.js.map +0 -1
- package/subscriptions/security/roles.d.ts +0 -4
- package/subscriptions/security/roles.js +0 -64
- package/subscriptions/security/roles.js.map +0 -1
- package/subscriptions/security/teams.d.ts +0 -4
- package/subscriptions/security/teams.js +0 -64
- package/subscriptions/security/teams.js.map +0 -1
- package/subscriptions/security/users.d.ts +0 -4
- package/subscriptions/security/users.js +0 -64
- package/subscriptions/security/users.js.map +0 -1
- package/utils/compressor.d.ts +0 -11
- package/utils/compressor.js +0 -109
- package/utils/compressor.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FileAfterDeleteHandler } from "@webiny/api-file-manager/features/file/DeleteFile/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogFileAfterDeleteHandlerImpl implements FileAfterDeleteHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: FileAfterDeleteHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogFileAfterDeleteHandler: typeof AuditLogFileAfterDeleteHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-file-manager/features/file/DeleteFile/events").FileAfterDeleteEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { FileAfterDeleteHandler } from "@webiny/api-file-manager/features/file/DeleteFile/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogFileAfterDeleteHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
file
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.FILE_MANAGER.FILE.DELETE);
|
|
16
|
+
await createAuditLog("File deleted", file, file.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing AuditLogFileAfterDeleteHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_FILE_DELETE_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const AuditLogFileAfterDeleteHandler = FileAfterDeleteHandler.createImplementation({
|
|
26
|
+
implementation: AuditLogFileAfterDeleteHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=AuditLogFileAfterDeleteHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","FileAfterDeleteHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogFileAfterDeleteHandlerImpl","constructor","context","handle","event","file","payload","createAuditLog","FILE_MANAGER","FILE","DELETE","id","error","from","message","code","AuditLogFileAfterDeleteHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogFileAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { FileAfterDeleteHandler } from \"@webiny/api-file-manager/features/file/DeleteFile/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogFileAfterDeleteHandlerImpl implements FileAfterDeleteHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: FileAfterDeleteHandler.Event): Promise<void> {\n try {\n const { file } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.FILE_MANAGER.FILE.DELETE);\n\n await createAuditLog(\"File deleted\", file, file.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogFileAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_FILE_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogFileAfterDeleteHandler = FileAfterDeleteHandler.createImplementation({\n implementation: AuditLogFileAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,4DAA4D;AACnG,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAA6C;EACjFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAmC,EAAiB;IAC7D,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGR,cAAc,CAACD,KAAK,CAACU,YAAY,CAACC,IAAI,CAACC,MAAM,CAAC;MAErE,MAAMH,cAAc,CAAC,cAAc,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACrE,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGpB,sBAAsB,CAACqB,oBAAoB,CAAC;EACtFC,cAAc,EAAElB,kCAAkC;EAClDmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FileAfterUpdateHandler } from "@webiny/api-file-manager/features/file/UpdateFile/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogFileAfterUpdateHandlerImpl implements FileAfterUpdateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: FileAfterUpdateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogFileAfterUpdateHandler: typeof AuditLogFileAfterUpdateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-file-manager/features/file/UpdateFile/events").FileAfterUpdateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { FileAfterUpdateHandler } from "@webiny/api-file-manager/features/file/UpdateFile/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogFileAfterUpdateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
file,
|
|
14
|
+
original
|
|
15
|
+
} = event.payload;
|
|
16
|
+
const createAuditLog = getAuditConfig(AUDIT.FILE_MANAGER.FILE.UPDATE);
|
|
17
|
+
await createAuditLog("File updated", {
|
|
18
|
+
before: original,
|
|
19
|
+
after: file
|
|
20
|
+
}, file.id, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogFileAfterUpdateHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_FILE_UPDATE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogFileAfterUpdateHandler = FileAfterUpdateHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogFileAfterUpdateHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogFileAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","FileAfterUpdateHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogFileAfterUpdateHandlerImpl","constructor","context","handle","event","file","original","payload","createAuditLog","FILE_MANAGER","FILE","UPDATE","before","after","id","error","from","message","code","AuditLogFileAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogFileAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { FileAfterUpdateHandler } from \"@webiny/api-file-manager/features/file/UpdateFile/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogFileAfterUpdateHandlerImpl implements FileAfterUpdateHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: FileAfterUpdateHandler.Event): Promise<void> {\n try {\n const { file, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.FILE_MANAGER.FILE.UPDATE);\n\n await createAuditLog(\n \"File updated\",\n { before: original, after: file },\n file.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogFileAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_FILE_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogFileAfterUpdateHandler = FileAfterUpdateHandler.createImplementation({\n implementation: AuditLogFileAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,4DAA4D;AACnG,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,kCAAkC,CAA6C;EACjFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAmC,EAAiB;IAC7D,IAAI;MACA,MAAM;QAAEC,IAAI;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MACxC,MAAMC,cAAc,GAAGT,cAAc,CAACD,KAAK,CAACW,YAAY,CAACC,IAAI,CAACC,MAAM,CAAC;MAErE,MAAMH,cAAc,CAChB,cAAc,EACd;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAK,CAAC,EACjCA,IAAI,CAACS,EAAE,EACP,IAAI,CAACZ,OACT,CAAC;IACL,CAAC,CAAC,OAAOa,KAAK,EAAE;MACZ,MAAMpB,WAAW,CAACqB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGvB,sBAAsB,CAACwB,oBAAoB,CAAC;EACtFC,cAAc,EAAErB,kCAAkC;EAClDsB,YAAY,EAAE,CAACzB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SettingsAfterUpdateHandler } from "@webiny/api-file-manager/features/settings/UpdateSettings/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogSettingsAfterUpdateHandlerImpl implements SettingsAfterUpdateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: SettingsAfterUpdateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogSettingsAfterUpdateHandler: typeof AuditLogSettingsAfterUpdateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-file-manager/features/settings/UpdateSettings/events").SettingsAfterUpdateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { SettingsAfterUpdateHandler } from "@webiny/api-file-manager/features/settings/UpdateSettings/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogSettingsAfterUpdateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
settings,
|
|
14
|
+
original
|
|
15
|
+
} = event.payload;
|
|
16
|
+
const createAuditLog = getAuditConfig(AUDIT.FILE_MANAGER.SETTINGS.UPDATE);
|
|
17
|
+
await createAuditLog("Settings updated", {
|
|
18
|
+
before: original,
|
|
19
|
+
after: settings
|
|
20
|
+
}, "-", this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogSettingsAfterUpdateHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_SETTINGS_UPDATE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogSettingsAfterUpdateHandler = SettingsAfterUpdateHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogSettingsAfterUpdateHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogSettingsAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","SettingsAfterUpdateHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogSettingsAfterUpdateHandlerImpl","constructor","context","handle","event","settings","original","payload","createAuditLog","FILE_MANAGER","SETTINGS","UPDATE","before","after","error","from","message","code","AuditLogSettingsAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogSettingsAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { SettingsAfterUpdateHandler } from \"@webiny/api-file-manager/features/settings/UpdateSettings/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogSettingsAfterUpdateHandlerImpl implements SettingsAfterUpdateHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: SettingsAfterUpdateHandler.Event): Promise<void> {\n try {\n const { settings, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.FILE_MANAGER.SETTINGS.UPDATE);\n\n await createAuditLog(\n \"Settings updated\",\n { before: original, after: settings },\n \"-\",\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogSettingsAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_SETTINGS_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogSettingsAfterUpdateHandler = SettingsAfterUpdateHandler.createImplementation({\n implementation: AuditLogSettingsAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,0BAA0B,QAAQ,oEAAoE;AAC/G,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,sCAAsC,CAAiD;EACzFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAuC,EAAiB;IACjE,IAAI;MACA,MAAM;QAAEC,QAAQ;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC5C,MAAMC,cAAc,GAAGT,cAAc,CAACD,KAAK,CAACW,YAAY,CAACC,QAAQ,CAACC,MAAM,CAAC;MAEzE,MAAMH,cAAc,CAChB,kBAAkB,EAClB;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAS,CAAC,EACrC,GAAG,EACH,IAAI,CAACH,OACT,CAAC;IACL,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMnB,WAAW,CAACoB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,0DAA0D;QACnEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,kCAAkC,GAAGtB,0BAA0B,CAACuB,oBAAoB,CAAC;EAC9FC,cAAc,EAAEpB,sCAAsC;EACtDqB,YAAY,EAAE,CAACxB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AuditLogsContext } from "../../
|
|
2
|
-
export declare const createFileManagerHooks: (context: AuditLogsContext) => void;
|
|
1
|
+
import { AuditLogsContext } from "../../abstractions.js";
|
|
2
|
+
export declare const createFileManagerHooks: (context: AuditLogsContext.Interface) => void;
|
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { AuditLogFileAfterCreateHandler } from "./handlers/AuditLogFileAfterCreateHandler.js";
|
|
2
|
+
import { AuditLogFileAfterUpdateHandler } from "./handlers/AuditLogFileAfterUpdateHandler.js";
|
|
3
|
+
import { AuditLogFileAfterDeleteHandler } from "./handlers/AuditLogFileAfterDeleteHandler.js";
|
|
4
|
+
import { AuditLogSettingsAfterUpdateHandler } from "./handlers/AuditLogSettingsAfterUpdateHandler.js";
|
|
5
|
+
export const createFileManagerHooks = context => {
|
|
6
|
+
// Register file event handlers
|
|
7
|
+
context.container.register(AuditLogFileAfterCreateHandler);
|
|
8
|
+
context.container.register(AuditLogFileAfterUpdateHandler);
|
|
9
|
+
context.container.register(AuditLogFileAfterDeleteHandler);
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.createFileManagerHooks = void 0;
|
|
7
|
-
var _files = require("./files");
|
|
8
|
-
var _settings = require("./settings");
|
|
9
|
-
const createFileManagerHooks = context => {
|
|
10
|
-
(0, _files.onFileAfterCreateHook)(context);
|
|
11
|
-
(0, _files.onFileAfterUpdateHook)(context);
|
|
12
|
-
(0, _files.onFileAfterDeleteHook)(context);
|
|
13
|
-
(0, _settings.onSettingsAfterUpdateHook)(context);
|
|
11
|
+
// Register settings event handlers
|
|
12
|
+
context.container.register(AuditLogSettingsAfterUpdateHandler);
|
|
14
13
|
};
|
|
15
|
-
exports.createFileManagerHooks = createFileManagerHooks;
|
|
16
14
|
|
|
17
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["AuditLogFileAfterCreateHandler","AuditLogFileAfterUpdateHandler","AuditLogFileAfterDeleteHandler","AuditLogSettingsAfterUpdateHandler","createFileManagerHooks","context","container","register"],"sources":["index.ts"],"sourcesContent":["import { AuditLogFileAfterCreateHandler } from \"./handlers/AuditLogFileAfterCreateHandler.js\";\nimport { AuditLogFileAfterUpdateHandler } from \"./handlers/AuditLogFileAfterUpdateHandler.js\";\nimport { AuditLogFileAfterDeleteHandler } from \"./handlers/AuditLogFileAfterDeleteHandler.js\";\nimport { AuditLogSettingsAfterUpdateHandler } from \"./handlers/AuditLogSettingsAfterUpdateHandler.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\n\nexport const createFileManagerHooks = (context: AuditLogsContext.Interface) => {\n // Register file event handlers\n context.container.register(AuditLogFileAfterCreateHandler);\n context.container.register(AuditLogFileAfterUpdateHandler);\n context.container.register(AuditLogFileAfterDeleteHandler);\n\n // Register settings event handlers\n context.container.register(AuditLogSettingsAfterUpdateHandler);\n};\n"],"mappings":"AAAA,SAASA,8BAA8B;AACvC,SAASC,8BAA8B;AACvC,SAASC,8BAA8B;AACvC,SAASC,kCAAkC;AAG3C,OAAO,MAAMC,sBAAsB,GAAIC,OAAmC,IAAK;EAC3E;EACAA,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACP,8BAA8B,CAAC;EAC1DK,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACN,8BAA8B,CAAC;EAC1DI,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACL,8BAA8B,CAAC;;EAE1D;EACAG,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACJ,kCAAkC,CAAC;AAClE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntryAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/CreateEntry/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogEntryAfterCreateHandlerImpl implements EntryAfterCreateEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: EntryAfterCreateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogEntryAfterCreateEventHandler: typeof AuditLogEntryAfterCreateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/CreateEntry/events").EntryAfterCreateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { EntryAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/CreateEntry/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogEntryAfterCreateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
const {
|
|
12
|
+
model,
|
|
13
|
+
entry
|
|
14
|
+
} = event.payload;
|
|
15
|
+
if (model.isPrivate) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY.CREATE);
|
|
20
|
+
await createAuditLog("Entry created", entry, entry.entryId, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogEntryAfterCreateHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_CREATE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogEntryAfterCreateEventHandler = EntryAfterCreateEventHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogEntryAfterCreateHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogEntryAfterCreateEventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","EntryAfterCreateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogEntryAfterCreateHandlerImpl","constructor","context","handle","event","model","entry","payload","isPrivate","createAuditLog","HEADLESS_CMS","ENTRY","CREATE","entryId","error","from","message","code","AuditLogEntryAfterCreateEventHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogEntryAfterCreateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryAfterCreateEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/CreateEntry/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogEntryAfterCreateHandlerImpl implements EntryAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: EntryAfterCreateEventHandler.Event): Promise<void> {\n const { model, entry } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY.CREATE);\n\n await createAuditLog(\"Entry created\", entry, entry.entryId, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryAfterCreateEventHandler =\n EntryAfterCreateEventHandler.createImplementation({\n implementation: AuditLogEntryAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n });\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,4BAA4B,QAAQ,qEAAqE;AAClH,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,mCAAmC,CAAmD;EACxFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAyC,EAAiB;IACnE,MAAM;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAGF,KAAK,CAACG,OAAO;IAEtC,IAAIF,KAAK,CAACG,SAAS,EAAE;MACjB;IACJ;IAEA,IAAI;MACA,MAAMC,cAAc,GAAGV,cAAc,CAACD,KAAK,CAACY,YAAY,CAACC,KAAK,CAACC,MAAM,CAAC;MAEtE,MAAMH,cAAc,CAAC,eAAe,EAAEH,KAAK,EAAEA,KAAK,CAACO,OAAO,EAAE,IAAI,CAACX,OAAO,CAAC;IAC7E,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMnB,WAAW,CAACoB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,oCAAoC,GAC7CtB,4BAA4B,CAACuB,oBAAoB,CAAC;EAC9CC,cAAc,EAAEpB,mCAAmC;EACnDqB,YAAY,EAAE,CAACxB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntryAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogEntryAfterDeleteHandlerImpl implements EntryAfterDeleteEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: EntryAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogEntryAfterDeleteEventHandler: typeof AuditLogEntryAfterDeleteHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/DeleteEntry/events").EntryAfterDeleteEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { EntryAfterDeleteEventHandler } from "@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js";
|
|
3
|
+
import { AUDIT } from "../../../config.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
6
|
+
class AuditLogEntryAfterDeleteHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
const {
|
|
12
|
+
model,
|
|
13
|
+
entry,
|
|
14
|
+
permanent
|
|
15
|
+
} = event.payload;
|
|
16
|
+
if (model.isPrivate) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
if (permanent) {
|
|
21
|
+
const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY.DELETE);
|
|
22
|
+
await createAuditLog("Entry deleted", entry, entry.entryId, this.context);
|
|
23
|
+
} else {
|
|
24
|
+
const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY.MOVE_TO_TRASH);
|
|
25
|
+
await createAuditLog("Entry moved to trash", entry, entry.entryId, this.context);
|
|
26
|
+
}
|
|
27
|
+
} catch (error) {
|
|
28
|
+
throw WebinyError.from(error, {
|
|
29
|
+
message: "Error while executing AuditLogEntryAfterDeleteHandler",
|
|
30
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_DELETE_HANDLER"
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const AuditLogEntryAfterDeleteEventHandler = EntryAfterDeleteEventHandler.createImplementation({
|
|
36
|
+
implementation: AuditLogEntryAfterDeleteHandlerImpl,
|
|
37
|
+
dependencies: [AuditLogsContext]
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=AuditLogEntryAfterDeleteEventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","EntryAfterDeleteEventHandler","AUDIT","getAuditConfig","AuditLogsContext","AuditLogEntryAfterDeleteHandlerImpl","constructor","context","handle","event","model","entry","permanent","payload","isPrivate","createAuditLog","HEADLESS_CMS","ENTRY","DELETE","entryId","MOVE_TO_TRASH","error","from","message","code","AuditLogEntryAfterDeleteEventHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogEntryAfterDeleteEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryAfterDeleteEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/DeleteEntry/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\n\nclass AuditLogEntryAfterDeleteHandlerImpl implements EntryAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: EntryAfterDeleteEventHandler.Event): Promise<void> {\n const { model, entry, permanent } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n if (permanent) {\n const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY.DELETE);\n await createAuditLog(\"Entry deleted\", entry, entry.entryId, this.context);\n } else {\n const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY.MOVE_TO_TRASH);\n await createAuditLog(\"Entry moved to trash\", entry, entry.entryId, this.context);\n }\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryAfterDeleteEventHandler =\n EntryAfterDeleteEventHandler.createImplementation({\n implementation: AuditLogEntryAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n });\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,4BAA4B,QAAQ,qEAAqE;AAClH,SAASC,KAAK;AACd,SAASC,cAAc;AACvB,SAASC,gBAAgB;AAEzB,MAAMC,mCAAmC,CAAmD;EACxFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAyC,EAAiB;IACnE,MAAM;MAAEC,KAAK;MAAEC,KAAK;MAAEC;IAAU,CAAC,GAAGH,KAAK,CAACI,OAAO;IAEjD,IAAIH,KAAK,CAACI,SAAS,EAAE;MACjB;IACJ;IAEA,IAAI;MACA,IAAIF,SAAS,EAAE;QACX,MAAMG,cAAc,GAAGZ,cAAc,CAACD,KAAK,CAACc,YAAY,CAACC,KAAK,CAACC,MAAM,CAAC;QACtE,MAAMH,cAAc,CAAC,eAAe,EAAEJ,KAAK,EAAEA,KAAK,CAACQ,OAAO,EAAE,IAAI,CAACZ,OAAO,CAAC;MAC7E,CAAC,MAAM;QACH,MAAMQ,cAAc,GAAGZ,cAAc,CAACD,KAAK,CAACc,YAAY,CAACC,KAAK,CAACG,aAAa,CAAC;QAC7E,MAAML,cAAc,CAAC,sBAAsB,EAAEJ,KAAK,EAAEA,KAAK,CAACQ,OAAO,EAAE,IAAI,CAACZ,OAAO,CAAC;MACpF;IACJ,CAAC,CAAC,OAAOc,KAAK,EAAE;MACZ,MAAMrB,WAAW,CAACsB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,oCAAoC,GAC7CxB,4BAA4B,CAACyB,oBAAoB,CAAC;EAC9CC,cAAc,EAAEtB,mCAAmC;EACnDuB,YAAY,EAAE,CAACxB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntryAfterPublishEventHandler } from "@webiny/api-headless-cms/features/contentEntry/PublishEntry/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogEntryAfterPublishEventHandlerImpl implements EntryAfterPublishEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: EntryAfterPublishEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogEntryAfterPublishEventHandler: typeof AuditLogEntryAfterPublishEventHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/PublishEntry/events").EntryAfterPublishEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { EntryAfterPublishEventHandler } from "@webiny/api-headless-cms/features/contentEntry/PublishEntry/index.js";
|
|
3
|
+
import { AUDIT } from "../../../config.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
6
|
+
class AuditLogEntryAfterPublishEventHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
const {
|
|
12
|
+
model,
|
|
13
|
+
entry
|
|
14
|
+
} = event.payload;
|
|
15
|
+
if (model.isPrivate) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY_REVISION.PUBLISH);
|
|
20
|
+
await createAuditLog("Entry revision published", entry, entry.id, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogEntryAfterPublishEventHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_REVISION_PUBLISH_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogEntryAfterPublishEventHandler = EntryAfterPublishEventHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogEntryAfterPublishEventHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogEntryAfterPublishEventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","EntryAfterPublishEventHandler","AUDIT","getAuditConfig","AuditLogsContext","AuditLogEntryAfterPublishEventHandlerImpl","constructor","context","handle","event","model","entry","payload","isPrivate","createAuditLog","HEADLESS_CMS","ENTRY_REVISION","PUBLISH","id","error","from","message","code","AuditLogEntryAfterPublishEventHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogEntryAfterPublishEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryAfterPublishEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/PublishEntry/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\n\nclass AuditLogEntryAfterPublishEventHandlerImpl implements EntryAfterPublishEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: EntryAfterPublishEventHandler.Event): Promise<void> {\n const { model, entry } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY_REVISION.PUBLISH);\n\n await createAuditLog(\"Entry revision published\", entry, entry.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryAfterPublishEventHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_REVISION_PUBLISH_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryAfterPublishEventHandler =\n EntryAfterPublishEventHandler.createImplementation({\n implementation: AuditLogEntryAfterPublishEventHandlerImpl,\n dependencies: [AuditLogsContext]\n });\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,6BAA6B,QAAQ,sEAAsE;AACpH,SAASC,KAAK;AACd,SAASC,cAAc;AACvB,SAASC,gBAAgB;AAEzB,MAAMC,yCAAyC,CAAoD;EAC/FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,MAAM;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAGF,KAAK,CAACG,OAAO;IAEtC,IAAIF,KAAK,CAACG,SAAS,EAAE;MACjB;IACJ;IAEA,IAAI;MACA,MAAMC,cAAc,GAAGX,cAAc,CAACD,KAAK,CAACa,YAAY,CAACC,cAAc,CAACC,OAAO,CAAC;MAEhF,MAAMH,cAAc,CAAC,0BAA0B,EAAEH,KAAK,EAAEA,KAAK,CAACO,EAAE,EAAE,IAAI,CAACX,OAAO,CAAC;IACnF,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMnB,WAAW,CAACoB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,6DAA6D;QACtEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,qCAAqC,GAC9CtB,6BAA6B,CAACuB,oBAAoB,CAAC;EAC/CC,cAAc,EAAEpB,yCAAyC;EACzDqB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntryAfterRestoreFromBinEventHandler } from "@webiny/api-headless-cms/features/contentEntry/RestoreEntryFromBin/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogEntryAfterRestoreFromBinEventHandlerImpl implements EntryAfterRestoreFromBinEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: EntryAfterRestoreFromBinEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogEntryAfterRestoreFromBinEventHandler: typeof AuditLogEntryAfterRestoreFromBinEventHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/RestoreEntryFromBin/events").EntryAfterRestoreFromBinEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { EntryAfterRestoreFromBinEventHandler } from "@webiny/api-headless-cms/features/contentEntry/RestoreEntryFromBin/index.js";
|
|
3
|
+
import { AUDIT } from "../../../config.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
6
|
+
class AuditLogEntryAfterRestoreFromBinEventHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
const {
|
|
12
|
+
model,
|
|
13
|
+
entry
|
|
14
|
+
} = event.payload;
|
|
15
|
+
if (model.isPrivate) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY.RESTORE_FROM_TRASH);
|
|
20
|
+
await createAuditLog("Entry restored from trash", entry, entry.entryId, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogEntryAfterRestoreFromBinEventHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_RESTORE_FROM_TRASH_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogEntryAfterRestoreFromBinEventHandler = EntryAfterRestoreFromBinEventHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogEntryAfterRestoreFromBinEventHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogEntryAfterRestoreFromBinEventHandler.js.map
|
package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","EntryAfterRestoreFromBinEventHandler","AUDIT","getAuditConfig","AuditLogsContext","AuditLogEntryAfterRestoreFromBinEventHandlerImpl","constructor","context","handle","event","model","entry","payload","isPrivate","createAuditLog","HEADLESS_CMS","ENTRY","RESTORE_FROM_TRASH","entryId","error","from","message","code","AuditLogEntryAfterRestoreFromBinEventHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogEntryAfterRestoreFromBinEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryAfterRestoreFromBinEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/RestoreEntryFromBin/index.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\n\nclass AuditLogEntryAfterRestoreFromBinEventHandlerImpl\n implements EntryAfterRestoreFromBinEventHandler.Interface\n{\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: EntryAfterRestoreFromBinEventHandler.Event): Promise<void> {\n const { model, entry } = event.payload;\n\n if (model.isPrivate) {\n return;\n }\n\n try {\n const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY.RESTORE_FROM_TRASH);\n await createAuditLog(\"Entry restored from trash\", entry, entry.entryId, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogEntryAfterRestoreFromBinEventHandler\",\n code: \"AUDIT_LOGS_AFTER_ENTRY_RESTORE_FROM_TRASH_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogEntryAfterRestoreFromBinEventHandler =\n EntryAfterRestoreFromBinEventHandler.createImplementation({\n implementation: AuditLogEntryAfterRestoreFromBinEventHandlerImpl,\n dependencies: [AuditLogsContext]\n });\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,oCAAoC,QAAQ,6EAA6E;AAClI,SAASC,KAAK;AACd,SAASC,cAAc;AACvB,SAASC,gBAAgB;AAEzB,MAAMC,gDAAgD,CAEtD;EACIC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAiD,EAAiB;IAC3E,MAAM;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAGF,KAAK,CAACG,OAAO;IAEtC,IAAIF,KAAK,CAACG,SAAS,EAAE;MACjB;IACJ;IAEA,IAAI;MACA,MAAMC,cAAc,GAAGX,cAAc,CAACD,KAAK,CAACa,YAAY,CAACC,KAAK,CAACC,kBAAkB,CAAC;MAClF,MAAMH,cAAc,CAAC,2BAA2B,EAAEH,KAAK,EAAEA,KAAK,CAACO,OAAO,EAAE,IAAI,CAACX,OAAO,CAAC;IACzF,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMnB,WAAW,CAACoB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,oEAAoE;QAC7EC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,4CAA4C,GACrDtB,oCAAoC,CAACuB,oBAAoB,CAAC;EACtDC,cAAc,EAAEpB,gDAAgD;EAChEqB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntryAfterUnpublishEventHandler } from "@webiny/api-headless-cms/features/contentEntry/UnpublishEntry/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogEntryAfterUnpublishEventHandlerImpl implements EntryAfterUnpublishEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: EntryAfterUnpublishEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogEntryAfterUnpublishEventHandler: typeof AuditLogEntryAfterUnpublishEventHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/UnpublishEntry/events").EntryAfterUnpublishEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { EntryAfterUnpublishEventHandler } from "@webiny/api-headless-cms/features/contentEntry/UnpublishEntry/index.js";
|
|
3
|
+
import { AUDIT } from "../../../config.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
6
|
+
class AuditLogEntryAfterUnpublishEventHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
const {
|
|
12
|
+
model,
|
|
13
|
+
entry
|
|
14
|
+
} = event.payload;
|
|
15
|
+
if (model.isPrivate) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY_REVISION.UNPUBLISH);
|
|
20
|
+
await createAuditLog("Entry revision unpublished", entry, entry.id, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogEntryAfterUnpublishEventHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_REVISION_UNPUBLISH_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogEntryAfterUnpublishEventHandler = EntryAfterUnpublishEventHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogEntryAfterUnpublishEventHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogEntryAfterUnpublishEventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","EntryAfterUnpublishEventHandler","AUDIT","getAuditConfig","AuditLogsContext","AuditLogEntryAfterUnpublishEventHandlerImpl","constructor","context","handle","event","model","entry","payload","isPrivate","createAuditLog","HEADLESS_CMS","ENTRY_REVISION","UNPUBLISH","id","error","from","message","code","AuditLogEntryAfterUnpublishEventHandler","createImplementation","implementation","dependencies"],"sources":["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 { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\n\nclass AuditLogEntryAfterUnpublishEventHandlerImpl\n implements EntryAfterUnpublishEventHandler.Interface\n{\n constructor(private context: AuditLogsContext.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 createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY_REVISION.UNPUBLISH);\n\n await createAuditLog(\"Entry revision unpublished\", entry, entry.id, this.context);\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: [AuditLogsContext]\n });\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,+BAA+B,QAAQ,wEAAwE;AACxH,SAASC,KAAK;AACd,SAASC,cAAc;AACvB,SAASC,gBAAgB;AAEzB,MAAMC,2CAA2C,CAEjD;EACIC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA4C,EAAiB;IACtE,MAAM;MAAEC,KAAK;MAAEC;IAAM,CAAC,GAAGF,KAAK,CAACG,OAAO;IAEtC,IAAIF,KAAK,CAACG,SAAS,EAAE;MACjB;IACJ;IAEA,IAAI;MACA,MAAMC,cAAc,GAAGX,cAAc,CAACD,KAAK,CAACa,YAAY,CAACC,cAAc,CAACC,SAAS,CAAC;MAElF,MAAMH,cAAc,CAAC,4BAA4B,EAAEH,KAAK,EAAEA,KAAK,CAACO,EAAE,EAAE,IAAI,CAACX,OAAO,CAAC;IACrF,CAAC,CAAC,OAAOY,KAAK,EAAE;MACZ,MAAMnB,WAAW,CAACoB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,+DAA+D;QACxEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,uCAAuC,GAChDtB,+BAA+B,CAACuB,oBAAoB,CAAC;EACjDC,cAAc,EAAEpB,2CAA2C;EAC3DqB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntryAfterUpdateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogEntryAfterUpdateEventHandlerImpl implements EntryAfterUpdateEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: EntryAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogEntryAfterUpdateEventHandler: typeof AuditLogEntryAfterUpdateEventHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/UpdateEntry/events").EntryAfterUpdateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { EntryAfterUpdateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogEntryAfterUpdateEventHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
const {
|
|
12
|
+
model,
|
|
13
|
+
entry,
|
|
14
|
+
original
|
|
15
|
+
} = event.payload;
|
|
16
|
+
if (model.isPrivate) {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY_REVISION.UPDATE);
|
|
21
|
+
await createAuditLog("Entry revision updated", {
|
|
22
|
+
before: original,
|
|
23
|
+
after: entry
|
|
24
|
+
}, entry.id, this.context);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
throw WebinyError.from(error, {
|
|
27
|
+
message: "Error while executing AuditLogEntryAfterUpdateEventHandler",
|
|
28
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_REVISION_UPDATE_HANDLER"
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export const AuditLogEntryAfterUpdateEventHandler = EntryAfterUpdateEventHandler.createImplementation({
|
|
34
|
+
implementation: AuditLogEntryAfterUpdateEventHandlerImpl,
|
|
35
|
+
dependencies: [AuditLogsContext]
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=AuditLogEntryAfterUpdateEventHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","EntryAfterUpdateEventHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogEntryAfterUpdateEventHandlerImpl","constructor","context","handle","event","model","entry","original","payload","isPrivate","createAuditLog","HEADLESS_CMS","ENTRY_REVISION","UPDATE","before","after","id","error","from","message","code","AuditLogEntryAfterUpdateEventHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogEntryAfterUpdateEventHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { EntryAfterUpdateEventHandler } from \"@webiny/api-headless-cms/features/contentEntry/UpdateEntry/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogEntryAfterUpdateEventHandlerImpl implements EntryAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.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 createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY_REVISION.UPDATE);\n\n await createAuditLog(\n \"Entry revision updated\",\n { before: original, after: entry },\n entry.id,\n this.context\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: [AuditLogsContext]\n });\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,4BAA4B,QAAQ,qEAAqE;AAClH,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,wCAAwC,CAAmD;EAC7FC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAyC,EAAiB;IACnE,MAAM;MAAEC,KAAK;MAAEC,KAAK;MAAEC;IAAS,CAAC,GAAGH,KAAK,CAACI,OAAO;IAEhD,IAAIH,KAAK,CAACI,SAAS,EAAE;MACjB;IACJ;IAEA,IAAI;MACA,MAAMC,cAAc,GAAGX,cAAc,CAACD,KAAK,CAACa,YAAY,CAACC,cAAc,CAACC,MAAM,CAAC;MAE/E,MAAMH,cAAc,CAChB,wBAAwB,EACxB;QAAEI,MAAM,EAAEP,QAAQ;QAAEQ,KAAK,EAAET;MAAM,CAAC,EAClCA,KAAK,CAACU,EAAE,EACR,IAAI,CAACd,OACT,CAAC;IACL,CAAC,CAAC,OAAOe,KAAK,EAAE;MACZ,MAAMtB,WAAW,CAACuB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,4DAA4D;QACrEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,oCAAoC,GAC7CzB,4BAA4B,CAAC0B,oBAAoB,CAAC;EAC9CC,cAAc,EAAEvB,wCAAwC;EACxDwB,YAAY,EAAE,CAAC3B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EntryRevisionAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogEntryRevisionAfterCreateHandlerImpl implements EntryRevisionAfterCreateEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: EntryRevisionAfterCreateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogEntryRevisionAfterCreateEventHandler: typeof AuditLogEntryRevisionAfterCreateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/events").EntryRevisionAfterCreateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { EntryRevisionAfterCreateEventHandler } from "@webiny/api-headless-cms/features/contentEntry/CreateEntryRevisionFrom/index.js";
|
|
3
|
+
import { AUDIT } from "../../../config.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
6
|
+
class AuditLogEntryRevisionAfterCreateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
const {
|
|
12
|
+
model,
|
|
13
|
+
entry
|
|
14
|
+
} = event.payload;
|
|
15
|
+
if (model.isPrivate) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
try {
|
|
19
|
+
const createAuditLog = getAuditConfig(AUDIT.HEADLESS_CMS.ENTRY_REVISION.CREATE);
|
|
20
|
+
await createAuditLog("Entry revision created", entry, entry.id, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogEntryRevisionAfterCreateHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_ENTRY_REVISION_CREATE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogEntryRevisionAfterCreateEventHandler = EntryRevisionAfterCreateEventHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogEntryRevisionAfterCreateHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogEntryRevisionAfterCreateEventHandler.js.map
|