@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 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","MailerSettingsAfterSaveHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogMailerSettingsAfterSaveHandlerImpl","constructor","context","handle","event","settings","payload","createAuditLog","MAILER","SETTINGS","UPDATE","after","error","from","message","code","AuditLogMailerSettingsAfterSaveHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogMailerSettingsAfterSaveHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { MailerSettingsAfterSaveHandler } from \"@webiny/api-mailer/features/SaveSettings/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogMailerSettingsAfterSaveHandlerImpl\n implements MailerSettingsAfterSaveHandler.Interface\n{\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: MailerSettingsAfterSaveHandler.Event): Promise<void> {\n try {\n const { settings } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.MAILER.SETTINGS.UPDATE);\n\n await createAuditLog(\"Settings updated\", { after: settings }, \"-\", this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogMailerSettingsAfterSaveHandler\",\n code: \"AUDIT_LOGS_AFTER_MAILER_SETTINGS_SAVE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogMailerSettingsAfterSaveHandler =\n MailerSettingsAfterSaveHandler.createImplementation({\n implementation: AuditLogMailerSettingsAfterSaveHandlerImpl,\n dependencies: [AuditLogsContext]\n });\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,8BAA8B,QAAQ,mDAAmD;AAClG,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAEvB,MAAMC,0CAA0C,CAEhD;EACIC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA2C,EAAiB;IACrE,IAAI;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGD,KAAK,CAACE,OAAO;MAClC,MAAMC,cAAc,GAAGR,cAAc,CAACD,KAAK,CAACU,MAAM,CAACC,QAAQ,CAACC,MAAM,CAAC;MAEnE,MAAMH,cAAc,CAAC,kBAAkB,EAAE;QAAEI,KAAK,EAAEN;MAAS,CAAC,EAAE,GAAG,EAAE,IAAI,CAACH,OAAO,CAAC;IACpF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,8DAA8D;QACvEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,sCAAsC,GAC/CpB,8BAA8B,CAACqB,oBAAoB,CAAC;EAChDC,cAAc,EAAElB,0CAA0C;EAC1DmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AuditLogsContext } from "../../
|
|
2
|
-
export declare const createMailerHooks: (context: AuditLogsContext) => void;
|
|
1
|
+
import { AuditLogsContext } from "../../abstractions.js";
|
|
2
|
+
export declare const createMailerHooks: (context: AuditLogsContext.Interface) => void;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.createMailerHooks = void 0;
|
|
7
|
-
var _settings = require("./settings");
|
|
8
|
-
const createMailerHooks = context => {
|
|
9
|
-
(0, _settings.onSettingsAfterUpdateHook)(context);
|
|
1
|
+
import { AuditLogMailerSettingsAfterSaveHandler } from "./handlers/AuditLogMailerSettingsAfterSaveHandler.js";
|
|
2
|
+
export const createMailerHooks = context => {
|
|
3
|
+
// Register mailer settings event handlers
|
|
4
|
+
context.container.register(AuditLogMailerSettingsAfterSaveHandler);
|
|
10
5
|
};
|
|
11
|
-
exports.createMailerHooks = createMailerHooks;
|
|
12
6
|
|
|
13
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["AuditLogMailerSettingsAfterSaveHandler","createMailerHooks","context","container","register"],"sources":["index.ts"],"sourcesContent":["import { AuditLogMailerSettingsAfterSaveHandler } from \"./handlers/AuditLogMailerSettingsAfterSaveHandler.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\n\nexport const createMailerHooks = (context: AuditLogsContext.Interface) => {\n // Register mailer settings event handlers\n context.container.register(AuditLogMailerSettingsAfterSaveHandler);\n};\n"],"mappings":"AAAA,SAASA,sCAAsC;AAG/C,OAAO,MAAMC,iBAAiB,GAAIC,OAAmC,IAAK;EACtE;EACAA,OAAO,CAACC,SAAS,CAACC,QAAQ,CAACJ,sCAAsC,CAAC;AACtE,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiKeyAfterCreateHandler } from "@webiny/api-core/features/CreateApiKey";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogApiKeyAfterCreateHandlerImpl implements ApiKeyAfterCreateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: ApiKeyAfterCreateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogApiKeyAfterCreateHandler: typeof AuditLogApiKeyAfterCreateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/CreateApiKey").ApiKeyAfterCreateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { ApiKeyAfterCreateHandler } from "@webiny/api-core/features/CreateApiKey";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
/**
|
|
7
|
+
* We need to remove the token from the API Key object, as it is a security risk.
|
|
8
|
+
*
|
|
9
|
+
* We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.
|
|
10
|
+
*/
|
|
11
|
+
const cleanupApiKey = apiKey => {
|
|
12
|
+
return {
|
|
13
|
+
id: apiKey.id,
|
|
14
|
+
slug: apiKey.slug,
|
|
15
|
+
createdBy: apiKey.createdBy,
|
|
16
|
+
createdOn: apiKey.createdOn,
|
|
17
|
+
description: apiKey.description,
|
|
18
|
+
name: apiKey.name,
|
|
19
|
+
permissions: apiKey.permissions
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
class AuditLogApiKeyAfterCreateHandlerImpl {
|
|
23
|
+
constructor(context) {
|
|
24
|
+
this.context = context;
|
|
25
|
+
}
|
|
26
|
+
async handle(event) {
|
|
27
|
+
try {
|
|
28
|
+
const {
|
|
29
|
+
apiKey: initialApiKey
|
|
30
|
+
} = event.payload;
|
|
31
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.CREATE);
|
|
32
|
+
const apiKey = cleanupApiKey(initialApiKey);
|
|
33
|
+
await createAuditLog("API key created", apiKey, apiKey.id, this.context);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
throw WebinyError.from(error, {
|
|
36
|
+
message: "Error while executing AuditLogApiKeyAfterCreateHandler",
|
|
37
|
+
code: "AUDIT_LOGS_AFTER_API_KEY_CREATE_HANDLER"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export const AuditLogApiKeyAfterCreateHandler = ApiKeyAfterCreateHandler.createImplementation({
|
|
43
|
+
implementation: AuditLogApiKeyAfterCreateHandlerImpl,
|
|
44
|
+
dependencies: [AuditLogsContext]
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=AuditLogApiKeyAfterCreateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","ApiKeyAfterCreateHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterCreateHandlerImpl","constructor","context","handle","event","initialApiKey","payload","createAuditLog","SECURITY","API_KEY","CREATE","error","from","message","code","AuditLogApiKeyAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterCreateHandler } from \"@webiny/api-core/features/CreateApiKey\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterCreateHandlerImpl implements ApiKeyAfterCreateHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterCreateHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.CREATE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n await createAuditLog(\"API key created\", apiKey, apiKey.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterCreateHandler = ApiKeyAfterCreateHandler.createImplementation({\n implementation: AuditLogApiKeyAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,wBAAwB,QAAQ,wCAAwC;AACjF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAA+C;EACrFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAqC,EAAiB;IAC/D,IAAI;MACA,MAAM;QAAEZ,MAAM,EAAEa;MAAc,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC/C,MAAMC,cAAc,GAAGjB,cAAc,CAACD,KAAK,CAACmB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMlB,MAAM,GAAGD,aAAa,CAACc,aAAa,CAAC;MAE3C,MAAME,cAAc,CAAC,iBAAiB,EAAEf,MAAM,EAAEA,MAAM,CAACC,EAAE,EAAE,IAAI,CAACS,OAAO,CAAC;IAC5E,CAAC,CAAC,OAAOS,KAAK,EAAE;MACZ,MAAMzB,WAAW,CAAC0B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAG5B,wBAAwB,CAAC6B,oBAAoB,CAAC;EAC1FC,cAAc,EAAEjB,oCAAoC;EACpDkB,YAAY,EAAE,CAAC9B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiKeyAfterDeleteHandler } from "@webiny/api-core/features/DeleteApiKey";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogApiKeyAfterDeleteHandlerImpl implements ApiKeyAfterDeleteHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: ApiKeyAfterDeleteHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogApiKeyAfterDeleteHandler: typeof AuditLogApiKeyAfterDeleteHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/DeleteApiKey").ApiKeyAfterDeleteEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { ApiKeyAfterDeleteHandler } from "@webiny/api-core/features/DeleteApiKey";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
/**
|
|
7
|
+
* We need to remove the token from the API Key object, as it is a security risk.
|
|
8
|
+
*
|
|
9
|
+
* We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.
|
|
10
|
+
*/
|
|
11
|
+
const cleanupApiKey = apiKey => {
|
|
12
|
+
return {
|
|
13
|
+
id: apiKey.id,
|
|
14
|
+
slug: apiKey.slug,
|
|
15
|
+
createdBy: apiKey.createdBy,
|
|
16
|
+
createdOn: apiKey.createdOn,
|
|
17
|
+
description: apiKey.description,
|
|
18
|
+
name: apiKey.name,
|
|
19
|
+
permissions: apiKey.permissions
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
class AuditLogApiKeyAfterDeleteHandlerImpl {
|
|
23
|
+
constructor(context) {
|
|
24
|
+
this.context = context;
|
|
25
|
+
}
|
|
26
|
+
async handle(event) {
|
|
27
|
+
try {
|
|
28
|
+
const {
|
|
29
|
+
apiKey: initialApiKey
|
|
30
|
+
} = event.payload;
|
|
31
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.DELETE);
|
|
32
|
+
const apiKey = cleanupApiKey(initialApiKey);
|
|
33
|
+
await createAuditLog("API key deleted", apiKey, apiKey.id, this.context);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
throw WebinyError.from(error, {
|
|
36
|
+
message: "Error while executing AuditLogApiKeyAfterDeleteHandler",
|
|
37
|
+
code: "AUDIT_LOGS_AFTER_API_KEY_DELETE_HANDLER"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export const AuditLogApiKeyAfterDeleteHandler = ApiKeyAfterDeleteHandler.createImplementation({
|
|
43
|
+
implementation: AuditLogApiKeyAfterDeleteHandlerImpl,
|
|
44
|
+
dependencies: [AuditLogsContext]
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=AuditLogApiKeyAfterDeleteHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","ApiKeyAfterDeleteHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterDeleteHandlerImpl","constructor","context","handle","event","initialApiKey","payload","createAuditLog","SECURITY","API_KEY","DELETE","error","from","message","code","AuditLogApiKeyAfterDeleteHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterDeleteHandler } from \"@webiny/api-core/features/DeleteApiKey\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterDeleteHandlerImpl implements ApiKeyAfterDeleteHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterDeleteHandler.Event): Promise<void> {\n try {\n const { apiKey: initialApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.DELETE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n\n await createAuditLog(\"API key deleted\", apiKey, apiKey.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterDeleteHandler = ApiKeyAfterDeleteHandler.createImplementation({\n implementation: AuditLogApiKeyAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,wBAAwB,QAAQ,wCAAwC;AACjF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAA+C;EACrFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAqC,EAAiB;IAC/D,IAAI;MACA,MAAM;QAAEZ,MAAM,EAAEa;MAAc,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC/C,MAAMC,cAAc,GAAGjB,cAAc,CAACD,KAAK,CAACmB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMlB,MAAM,GAAGD,aAAa,CAACc,aAAa,CAAC;MAE3C,MAAME,cAAc,CAAC,iBAAiB,EAAEf,MAAM,EAAEA,MAAM,CAACC,EAAE,EAAE,IAAI,CAACS,OAAO,CAAC;IAC5E,CAAC,CAAC,OAAOS,KAAK,EAAE;MACZ,MAAMzB,WAAW,CAAC0B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAG5B,wBAAwB,CAAC6B,oBAAoB,CAAC;EAC1FC,cAAc,EAAEjB,oCAAoC;EACpDkB,YAAY,EAAE,CAAC9B,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ApiKeyAfterUpdateHandler } from "@webiny/api-core/features/UpdateApiKey";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: ApiKeyAfterUpdateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogApiKeyAfterUpdateHandler: typeof AuditLogApiKeyAfterUpdateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/UpdateApiKey").ApiKeyAfterUpdateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { ApiKeyAfterUpdateHandler } from "@webiny/api-core/features/UpdateApiKey";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
/**
|
|
7
|
+
* We need to remove the token from the API Key object, as it is a security risk.
|
|
8
|
+
*
|
|
9
|
+
* We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.
|
|
10
|
+
*/
|
|
11
|
+
const cleanupApiKey = apiKey => {
|
|
12
|
+
return {
|
|
13
|
+
id: apiKey.id,
|
|
14
|
+
slug: apiKey.slug,
|
|
15
|
+
createdBy: apiKey.createdBy,
|
|
16
|
+
createdOn: apiKey.createdOn,
|
|
17
|
+
description: apiKey.description,
|
|
18
|
+
name: apiKey.name,
|
|
19
|
+
permissions: apiKey.permissions
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
class AuditLogApiKeyAfterUpdateHandlerImpl {
|
|
23
|
+
constructor(context) {
|
|
24
|
+
this.context = context;
|
|
25
|
+
}
|
|
26
|
+
async handle(event) {
|
|
27
|
+
try {
|
|
28
|
+
const {
|
|
29
|
+
updated: initialApiKey,
|
|
30
|
+
original: initialOriginalApiKey
|
|
31
|
+
} = event.payload;
|
|
32
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.UPDATE);
|
|
33
|
+
const apiKey = cleanupApiKey(initialApiKey);
|
|
34
|
+
const original = cleanupApiKey(initialOriginalApiKey);
|
|
35
|
+
await createAuditLog("API key updated", {
|
|
36
|
+
before: original,
|
|
37
|
+
after: apiKey
|
|
38
|
+
}, apiKey.id, this.context);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
throw WebinyError.from(error, {
|
|
41
|
+
message: "Error while executing AuditLogApiKeyAfterUpdateHandler",
|
|
42
|
+
code: "AUDIT_LOGS_AFTER_API_KEY_UPDATE_HANDLER"
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export const AuditLogApiKeyAfterUpdateHandler = ApiKeyAfterUpdateHandler.createImplementation({
|
|
48
|
+
implementation: AuditLogApiKeyAfterUpdateHandlerImpl,
|
|
49
|
+
dependencies: [AuditLogsContext]
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=AuditLogApiKeyAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","ApiKeyAfterUpdateHandler","AuditLogsContext","AUDIT","getAuditConfig","cleanupApiKey","apiKey","id","slug","createdBy","createdOn","description","name","permissions","AuditLogApiKeyAfterUpdateHandlerImpl","constructor","context","handle","event","updated","initialApiKey","original","initialOriginalApiKey","payload","createAuditLog","SECURITY","API_KEY","UPDATE","before","after","error","from","message","code","AuditLogApiKeyAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogApiKeyAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { ApiKeyAfterUpdateHandler } from \"@webiny/api-core/features/UpdateApiKey\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport type { ApiKey } from \"@webiny/api-core/types/security.js\";\n\n/**\n * We need to remove the token from the API Key object, as it is a security risk.\n *\n * We assign the API Key object explicitly, so we do not miss any new properties that might be added in the future - and they should not be in the log.\n */\nconst cleanupApiKey = (apiKey: ApiKey): Omit<ApiKey, \"token\"> => {\n return {\n id: apiKey.id,\n slug: apiKey.slug,\n createdBy: apiKey.createdBy,\n createdOn: apiKey.createdOn,\n description: apiKey.description,\n name: apiKey.name,\n permissions: apiKey.permissions\n };\n};\n\nclass AuditLogApiKeyAfterUpdateHandlerImpl implements ApiKeyAfterUpdateHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: ApiKeyAfterUpdateHandler.Event): Promise<void> {\n try {\n const { updated: initialApiKey, original: initialOriginalApiKey } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.API_KEY.UPDATE);\n\n const apiKey = cleanupApiKey(initialApiKey);\n const original = cleanupApiKey(initialOriginalApiKey);\n\n await createAuditLog(\n \"API key updated\",\n {\n before: original,\n after: apiKey\n },\n apiKey.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogApiKeyAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_API_KEY_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogApiKeyAfterUpdateHandler = ApiKeyAfterUpdateHandler.createImplementation({\n implementation: AuditLogApiKeyAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,wBAAwB,QAAQ,wCAAwC;AACjF,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AAGvB;AACA;AACA;AACA;AACA;AACA,MAAMC,aAAa,GAAIC,MAAc,IAA4B;EAC7D,OAAO;IACHC,EAAE,EAAED,MAAM,CAACC,EAAE;IACbC,IAAI,EAAEF,MAAM,CAACE,IAAI;IACjBC,SAAS,EAAEH,MAAM,CAACG,SAAS;IAC3BC,SAAS,EAAEJ,MAAM,CAACI,SAAS;IAC3BC,WAAW,EAAEL,MAAM,CAACK,WAAW;IAC/BC,IAAI,EAAEN,MAAM,CAACM,IAAI;IACjBC,WAAW,EAAEP,MAAM,CAACO;EACxB,CAAC;AACL,CAAC;AAED,MAAMC,oCAAoC,CAA+C;EACrFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAqC,EAAiB;IAC/D,IAAI;MACA,MAAM;QAAEC,OAAO,EAAEC,aAAa;QAAEC,QAAQ,EAAEC;MAAsB,CAAC,GAAGJ,KAAK,CAACK,OAAO;MACjF,MAAMC,cAAc,GAAGpB,cAAc,CAACD,KAAK,CAACsB,QAAQ,CAACC,OAAO,CAACC,MAAM,CAAC;MAEpE,MAAMrB,MAAM,GAAGD,aAAa,CAACe,aAAa,CAAC;MAC3C,MAAMC,QAAQ,GAAGhB,aAAa,CAACiB,qBAAqB,CAAC;MAErD,MAAME,cAAc,CAChB,iBAAiB,EACjB;QACII,MAAM,EAAEP,QAAQ;QAChBQ,KAAK,EAAEvB;MACX,CAAC,EACDA,MAAM,CAACC,EAAE,EACT,IAAI,CAACS,OACT,CAAC;IACL,CAAC,CAAC,OAAOc,KAAK,EAAE;MACZ,MAAM9B,WAAW,CAAC+B,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,wDAAwD;QACjEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,gCAAgC,GAAGjC,wBAAwB,CAACkC,oBAAoB,CAAC;EAC1FC,cAAc,EAAEtB,oCAAoC;EACpDuB,YAAY,EAAE,CAACnC,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
2
|
+
import { RoleAfterCreateHandler } from "@webiny/api-core/features/security/roles/CreateRole/index.js";
|
|
3
|
+
declare class AuditLogRoleAfterCreateHandlerImpl implements RoleAfterCreateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: RoleAfterCreateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogRoleAfterCreateHandler: typeof AuditLogRoleAfterCreateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/CreateRole/events").RoleAfterCreateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
import { AUDIT } from "../../../config.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { RoleAfterCreateHandler } from "@webiny/api-core/features/security/roles/CreateRole/index.js";
|
|
6
|
+
class AuditLogRoleAfterCreateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
role
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.CREATE);
|
|
16
|
+
await createAuditLog("Role created", role, role.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing AuditLogRoleAfterCreateHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_ROLE_CREATE_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const AuditLogRoleAfterCreateHandler = RoleAfterCreateHandler.createImplementation({
|
|
26
|
+
implementation: AuditLogRoleAfterCreateHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=AuditLogRoleAfterCreateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","AuditLogsContext","AUDIT","getAuditConfig","RoleAfterCreateHandler","AuditLogRoleAfterCreateHandlerImpl","constructor","context","handle","event","role","payload","createAuditLog","SECURITY","ROLE","CREATE","id","error","from","message","code","AuditLogRoleAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogRoleAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { RoleAfterCreateHandler } from \"@webiny/api-core/features/security/roles/CreateRole/index.js\";\n\nclass AuditLogRoleAfterCreateHandlerImpl implements RoleAfterCreateHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RoleAfterCreateHandler.Event): Promise<void> {\n try {\n const { role } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.CREATE);\n\n await createAuditLog(\"Role created\", role, role.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterCreateHandler = RoleAfterCreateHandler.createImplementation({\n implementation: AuditLogRoleAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,gBAAgB;AACzB,SAASC,KAAK;AACd,SAASC,cAAc;AACvB,SAASC,sBAAsB,QAAQ,8DAA8D;AAErG,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,GAAGT,cAAc,CAACD,KAAK,CAACW,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,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,GAAGjB,sBAAsB,CAACkB,oBAAoB,CAAC;EACtFC,cAAc,EAAElB,kCAAkC;EAClDmB,YAAY,EAAE,CAACvB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RoleAfterDeleteHandler } from "@webiny/api-core/features/security/roles/DeleteRole/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogRoleAfterDeleteHandlerImpl implements RoleAfterDeleteHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: RoleAfterDeleteHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogRoleAfterDeleteHandler: typeof AuditLogRoleAfterDeleteHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/DeleteRole/events").RoleAfterDeleteEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { RoleAfterDeleteHandler } from "@webiny/api-core/features/security/roles/DeleteRole/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogRoleAfterDeleteHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
role
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.DELETE);
|
|
16
|
+
await createAuditLog("Role deleted", role, role.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing AuditLogRoleAfterDeleteHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_ROLE_DELETE_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const AuditLogRoleAfterDeleteHandler = RoleAfterDeleteHandler.createImplementation({
|
|
26
|
+
implementation: AuditLogRoleAfterDeleteHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=AuditLogRoleAfterDeleteHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","RoleAfterDeleteHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogRoleAfterDeleteHandlerImpl","constructor","context","handle","event","role","payload","createAuditLog","SECURITY","ROLE","DELETE","id","error","from","message","code","AuditLogRoleAfterDeleteHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogRoleAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { RoleAfterDeleteHandler } from \"@webiny/api-core/features/security/roles/DeleteRole/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogRoleAfterDeleteHandlerImpl implements RoleAfterDeleteHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RoleAfterDeleteHandler.Event): Promise<void> {\n try {\n const { role } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.DELETE);\n\n await createAuditLog(\"Role deleted\", role, role.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterDeleteHandler = RoleAfterDeleteHandler.createImplementation({\n implementation: AuditLogRoleAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,8DAA8D;AACrG,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,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,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 { RoleAfterUpdateHandler } from "@webiny/api-core/features/security/roles/UpdateRole/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogRoleAfterUpdateHandlerImpl implements RoleAfterUpdateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: RoleAfterUpdateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogRoleAfterUpdateHandler: typeof AuditLogRoleAfterUpdateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/security/roles/UpdateRole/events").RoleAfterUpdateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { RoleAfterUpdateHandler } from "@webiny/api-core/features/security/roles/UpdateRole/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogRoleAfterUpdateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
updated,
|
|
14
|
+
original
|
|
15
|
+
} = event.payload;
|
|
16
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.UPDATE);
|
|
17
|
+
await createAuditLog("Role updated", {
|
|
18
|
+
before: original,
|
|
19
|
+
after: updated
|
|
20
|
+
}, updated.id, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogRoleAfterUpdateHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_ROLE_UPDATE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogRoleAfterUpdateHandler = RoleAfterUpdateHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogRoleAfterUpdateHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogRoleAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","RoleAfterUpdateHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogRoleAfterUpdateHandlerImpl","constructor","context","handle","event","updated","original","payload","createAuditLog","SECURITY","ROLE","UPDATE","before","after","id","error","from","message","code","AuditLogRoleAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogRoleAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { RoleAfterUpdateHandler } from \"@webiny/api-core/features/security/roles/UpdateRole/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogRoleAfterUpdateHandlerImpl implements RoleAfterUpdateHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RoleAfterUpdateHandler.Event): Promise<void> {\n try {\n const { updated, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.ROLE.UPDATE);\n\n await createAuditLog(\n \"Role updated\",\n { before: original, after: updated },\n updated.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogRoleAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_ROLE_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogRoleAfterUpdateHandler = RoleAfterUpdateHandler.createImplementation({\n implementation: AuditLogRoleAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,8DAA8D;AACrG,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,OAAO;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC3C,MAAMC,cAAc,GAAGT,cAAc,CAACD,KAAK,CAACW,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAChB,cAAc,EACd;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAQ,CAAC,EACpCA,OAAO,CAACS,EAAE,EACV,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 { TeamAfterCreateHandler } from "@webiny/api-core/features/CreateTeam";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: TeamAfterCreateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogTeamAfterCreateHandler: typeof AuditLogTeamAfterCreateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/security/teams/CreateTeam/events").TeamAfterCreateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { TeamAfterCreateHandler } from "@webiny/api-core/features/CreateTeam";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogTeamAfterCreateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
team
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.CREATE);
|
|
16
|
+
await createAuditLog("Team created", team, team.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing AuditLogTeamAfterCreateHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_TEAM_CREATE_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const AuditLogTeamAfterCreateHandler = TeamAfterCreateHandler.createImplementation({
|
|
26
|
+
implementation: AuditLogTeamAfterCreateHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=AuditLogTeamAfterCreateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","TeamAfterCreateHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterCreateHandlerImpl","constructor","context","handle","event","team","payload","createAuditLog","SECURITY","TEAM","CREATE","id","error","from","message","code","AuditLogTeamAfterCreateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterCreateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterCreateHandler } from \"@webiny/api-core/features/CreateTeam\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterCreateHandlerImpl implements TeamAfterCreateHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterCreateHandler.Event): Promise<void> {\n try {\n const { team } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.CREATE);\n\n await createAuditLog(\"Team created\", team, team.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterCreateHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterCreateHandler = TeamAfterCreateHandler.createImplementation({\n implementation: AuditLogTeamAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,sCAAsC;AAC7E,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,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,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 { TeamAfterDeleteHandler } from "@webiny/api-core/features/DeleteTeam";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogTeamAfterDeleteHandlerImpl implements TeamAfterDeleteHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: TeamAfterDeleteHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogTeamAfterDeleteHandler: typeof AuditLogTeamAfterDeleteHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/DeleteTeam").TeamAfterDeleteEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { TeamAfterDeleteHandler } from "@webiny/api-core/features/DeleteTeam";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogTeamAfterDeleteHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
team
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.DELETE);
|
|
16
|
+
await createAuditLog("Team deleted", team, team.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing AuditLogTeamAfterDeleteHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_TEAM_DELETE_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const AuditLogTeamAfterDeleteHandler = TeamAfterDeleteHandler.createImplementation({
|
|
26
|
+
implementation: AuditLogTeamAfterDeleteHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=AuditLogTeamAfterDeleteHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","TeamAfterDeleteHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterDeleteHandlerImpl","constructor","context","handle","event","team","payload","createAuditLog","SECURITY","TEAM","DELETE","id","error","from","message","code","AuditLogTeamAfterDeleteHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterDeleteHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterDeleteHandler } from \"@webiny/api-core/features/DeleteTeam\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterDeleteHandlerImpl implements TeamAfterDeleteHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterDeleteHandler.Event): Promise<void> {\n try {\n const { team } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.DELETE);\n\n await createAuditLog(\"Team deleted\", team, team.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterDeleteHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterDeleteHandler = TeamAfterDeleteHandler.createImplementation({\n implementation: AuditLogTeamAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,sCAAsC;AAC7E,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,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,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 { TeamAfterUpdateHandler } from "@webiny/api-core/features/UpdateTeam";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogTeamAfterUpdateHandlerImpl implements TeamAfterUpdateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: TeamAfterUpdateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogTeamAfterUpdateHandler: typeof AuditLogTeamAfterUpdateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/UpdateTeam").TeamAfterUpdateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { TeamAfterUpdateHandler } from "@webiny/api-core/features/UpdateTeam";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { AUDIT } from "../../../config.js";
|
|
5
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
6
|
+
class AuditLogTeamAfterUpdateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
updated,
|
|
14
|
+
original
|
|
15
|
+
} = event.payload;
|
|
16
|
+
const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.UPDATE);
|
|
17
|
+
await createAuditLog("Team updated", {
|
|
18
|
+
before: original,
|
|
19
|
+
after: updated
|
|
20
|
+
}, updated.id, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing AuditLogTeamAfterUpdateHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_TEAM_UPDATE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const AuditLogTeamAfterUpdateHandler = TeamAfterUpdateHandler.createImplementation({
|
|
30
|
+
implementation: AuditLogTeamAfterUpdateHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=AuditLogTeamAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","TeamAfterUpdateHandler","AuditLogsContext","AUDIT","getAuditConfig","AuditLogTeamAfterUpdateHandlerImpl","constructor","context","handle","event","updated","original","payload","createAuditLog","SECURITY","TEAM","UPDATE","before","after","id","error","from","message","code","AuditLogTeamAfterUpdateHandler","createImplementation","implementation","dependencies"],"sources":["AuditLogTeamAfterUpdateHandler.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { TeamAfterUpdateHandler } from \"@webiny/api-core/features/UpdateTeam\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { AUDIT } from \"~/config.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\n\nclass AuditLogTeamAfterUpdateHandlerImpl implements TeamAfterUpdateHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: TeamAfterUpdateHandler.Event): Promise<void> {\n try {\n const { updated, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.SECURITY.TEAM.UPDATE);\n\n await createAuditLog(\n \"Team updated\",\n { before: original, after: updated },\n updated.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing AuditLogTeamAfterUpdateHandler\",\n code: \"AUDIT_LOGS_AFTER_TEAM_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const AuditLogTeamAfterUpdateHandler = TeamAfterUpdateHandler.createImplementation({\n implementation: AuditLogTeamAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,sCAAsC;AAC7E,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,OAAO;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC3C,MAAMC,cAAc,GAAGT,cAAc,CAACD,KAAK,CAACW,QAAQ,CAACC,IAAI,CAACC,MAAM,CAAC;MAEjE,MAAMH,cAAc,CAChB,cAAc,EACd;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAQ,CAAC,EACpCA,OAAO,CAACS,EAAE,EACV,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 { UserAfterCreateHandler } from "@webiny/api-core/features/CreateUser";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class AuditLogUserAfterCreateHandlerImpl implements UserAfterCreateHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: UserAfterCreateHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AuditLogUserAfterCreateHandler: typeof AuditLogUserAfterCreateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/CreateUser").UserAfterCreateEvent>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|