@webiny/api-audit-logs 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.e6f0dc8ca7
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 +37 -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 +21 -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 +32 -27
- 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 +83 -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 -121
- 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 -119
- 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
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WebinyError } from "@webiny/error";
|
|
2
|
+
import { PageAfterPublishEventHandler } from "@webiny/api-website-builder/features/pages/PublishPage/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AUDIT } from "../../../config.js";
|
|
6
|
+
class PageAfterPublishHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
page
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.PUBLISH);
|
|
16
|
+
await createAuditLog("Website Page Published", page, page.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing PageAfterPublishEventHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_PAGE_PUBLISH_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const PageAfterPublishAuditHandler = PageAfterPublishEventHandler.createImplementation({
|
|
26
|
+
implementation: PageAfterPublishHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=PageAfterPublishHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterPublishEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterPublishHandlerImpl","constructor","context","handle","event","page","payload","createAuditLog","WEBSITE_BUILDER","PAGE","PUBLISH","id","error","from","message","code","PageAfterPublishAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterPublishHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterPublishEventHandler } from \"@webiny/api-website-builder/features/pages/PublishPage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterPublishHandlerImpl implements PageAfterPublishEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterPublishEventHandler.Event): Promise<void> {\n try {\n const { page } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.PUBLISH);\n await createAuditLog(\"Website Page Published\", page, page.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterPublishEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_PUBLISH_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterPublishAuditHandler = PageAfterPublishEventHandler.createImplementation({\n implementation: PageAfterPublishHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,4BAA4B,QAAQ,iEAAiE;AAC9G,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,2BAA2B,CAAmD;EAChFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAyC,EAAiB;IACnE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,IAAI,CAACC,OAAO,CAAC;MACzE,MAAMH,cAAc,CAAC,wBAAwB,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IAC/E,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,oDAAoD;QAC7DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,4BAA4B,GAAGpB,4BAA4B,CAACqB,oBAAoB,CAAC;EAC1FC,cAAc,EAAElB,2BAA2B;EAC3CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageAfterUnpublishEventHandler } from "@webiny/api-website-builder/features/pages/UnpublishPage/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class PageAfterUnpublishHandlerImpl implements PageAfterUnpublishEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: PageAfterUnpublishEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const PageAfterUnpublishAuditHandler: typeof PageAfterUnpublishHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/eventPublisher").DomainEvent<import("@webiny/api-website-builder/features/pages/UnpublishPage/abstractions").PageAfterUnpublishPayload>>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WebinyError } from "@webiny/error";
|
|
2
|
+
import { PageAfterUnpublishEventHandler } from "@webiny/api-website-builder/features/pages/UnpublishPage/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AUDIT } from "../../../config.js";
|
|
6
|
+
class PageAfterUnpublishHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
page
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.UNPUBLISH);
|
|
16
|
+
await createAuditLog("Website Page Unpublished", page, page.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing PageAfterUnpublishEventHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_PAGE_UNPUBLISH_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const PageAfterUnpublishAuditHandler = PageAfterUnpublishEventHandler.createImplementation({
|
|
26
|
+
implementation: PageAfterUnpublishHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=PageAfterUnpublishHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterUnpublishEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterUnpublishHandlerImpl","constructor","context","handle","event","page","payload","createAuditLog","WEBSITE_BUILDER","PAGE","UNPUBLISH","id","error","from","message","code","PageAfterUnpublishAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterUnpublishHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterUnpublishEventHandler } from \"@webiny/api-website-builder/features/pages/UnpublishPage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterUnpublishHandlerImpl implements PageAfterUnpublishEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterUnpublishEventHandler.Event): Promise<void> {\n try {\n const { page } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.UNPUBLISH);\n await createAuditLog(\"Website Page Unpublished\", page, page.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterUnpublishEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_UNPUBLISH_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterUnpublishAuditHandler = PageAfterUnpublishEventHandler.createImplementation({\n implementation: PageAfterUnpublishHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,8BAA8B,QAAQ,mEAAmE;AAClH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,6BAA6B,CAAqD;EACpFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA2C,EAAiB;IACrE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,IAAI,CAACC,SAAS,CAAC;MAC3E,MAAMH,cAAc,CAAC,0BAA0B,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACjF,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,8BAA8B,CAACqB,oBAAoB,CAAC;EAC9FC,cAAc,EAAElB,6BAA6B;EAC7CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PageAfterUpdateEventHandler } from "@webiny/api-website-builder/features/pages/UpdatePage/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class PageAfterUpdateHandlerImpl implements PageAfterUpdateEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: PageAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const PageAfterUpdateAuditHandler: typeof PageAfterUpdateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/eventPublisher").DomainEvent<import("@webiny/api-website-builder/features/pages/UpdatePage/abstractions").PageAfterUpdatePayload>>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { WebinyError } from "@webiny/error";
|
|
2
|
+
import { PageAfterUpdateEventHandler } from "@webiny/api-website-builder/features/pages/UpdatePage/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AUDIT } from "../../../config.js";
|
|
6
|
+
class PageAfterUpdateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
page,
|
|
14
|
+
original
|
|
15
|
+
} = event.payload;
|
|
16
|
+
const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.UPDATE);
|
|
17
|
+
await createAuditLog("Website Page Updated", {
|
|
18
|
+
before: original,
|
|
19
|
+
after: page
|
|
20
|
+
}, page.id, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing PageAfterUpdateEventHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_PAGE_UPDATE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const PageAfterUpdateAuditHandler = PageAfterUpdateEventHandler.createImplementation({
|
|
30
|
+
implementation: PageAfterUpdateHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=PageAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterUpdateEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterUpdateHandlerImpl","constructor","context","handle","event","page","original","payload","createAuditLog","WEBSITE_BUILDER","PAGE","UPDATE","before","after","id","error","from","message","code","PageAfterUpdateAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterUpdateHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterUpdateEventHandler } from \"@webiny/api-website-builder/features/pages/UpdatePage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterUpdateHandlerImpl implements PageAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { page, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.UPDATE);\n await createAuditLog(\n \"Website Page Updated\",\n { before: original, after: page },\n page.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterUpdateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterUpdateAuditHandler = PageAfterUpdateEventHandler.createImplementation({\n implementation: PageAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,2BAA2B,QAAQ,gEAAgE;AAC5G,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,0BAA0B,CAAkD;EAC9EC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC,IAAI;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MACxC,MAAMC,cAAc,GAAGV,cAAc,CAACC,KAAK,CAACU,eAAe,CAACC,IAAI,CAACC,MAAM,CAAC;MACxE,MAAMH,cAAc,CAChB,sBAAsB,EACtB;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,mDAAmD;QAC5DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,2BAA2B,GAAGvB,2BAA2B,CAACwB,oBAAoB,CAAC;EACxFC,cAAc,EAAErB,0BAA0B;EAC1CsB,YAAY,EAAE,CAACzB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedirectAfterCreateEventHandler } from "@webiny/api-website-builder/features/redirects/CreateRedirect/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class RedirectAfterCreateHandlerImpl implements RedirectAfterCreateEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: RedirectAfterCreateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const RedirectAfterCreateAuditHandler: typeof RedirectAfterCreateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/eventPublisher").DomainEvent<import("@webiny/api-website-builder/features/redirects/CreateRedirect/abstractions").RedirectAfterCreatePayload>>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WebinyError } from "@webiny/error";
|
|
2
|
+
import { RedirectAfterCreateEventHandler } from "@webiny/api-website-builder/features/redirects/CreateRedirect/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AUDIT } from "../../../config.js";
|
|
6
|
+
class RedirectAfterCreateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
redirect
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.CREATE);
|
|
16
|
+
await createAuditLog("Website Redirect Created", redirect, redirect.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing RedirectAfterCreateEventHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_REDIRECT_CREATE_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const RedirectAfterCreateAuditHandler = RedirectAfterCreateEventHandler.createImplementation({
|
|
26
|
+
implementation: RedirectAfterCreateHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=RedirectAfterCreateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","RedirectAfterCreateEventHandler","AuditLogsContext","getAuditConfig","AUDIT","RedirectAfterCreateHandlerImpl","constructor","context","handle","event","redirect","payload","createAuditLog","WEBSITE_BUILDER","REDIRECT","CREATE","id","error","from","message","code","RedirectAfterCreateAuditHandler","createImplementation","implementation","dependencies"],"sources":["RedirectAfterCreateHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { RedirectAfterCreateEventHandler } from \"@webiny/api-website-builder/features/redirects/CreateRedirect/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass RedirectAfterCreateHandlerImpl implements RedirectAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RedirectAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { redirect } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.CREATE);\n await createAuditLog(\"Website Redirect Created\", redirect, redirect.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing RedirectAfterCreateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_REDIRECT_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const RedirectAfterCreateAuditHandler = RedirectAfterCreateEventHandler.createImplementation(\n {\n implementation: RedirectAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n }\n);\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,+BAA+B,QAAQ,wEAAwE;AACxH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,8BAA8B,CAAsD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA4C,EAAiB;IACtE,IAAI;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGD,KAAK,CAACE,OAAO;MAClC,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,QAAQ,CAACC,MAAM,CAAC;MAC5E,MAAMH,cAAc,CAAC,0BAA0B,EAAEF,QAAQ,EAAEA,QAAQ,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACzF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,+BAA+B,GAAGpB,+BAA+B,CAACqB,oBAAoB,CAC/F;EACIC,cAAc,EAAElB,8BAA8B;EAC9CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedirectAfterDeleteEventHandler } from "@webiny/api-website-builder/features/redirects/DeleteRedirect/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class RedirectAfterDeleteHandlerImpl implements RedirectAfterDeleteEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: RedirectAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const RedirectAfterDeleteAuditHandler: typeof RedirectAfterDeleteHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/eventPublisher").DomainEvent<import("@webiny/api-website-builder/features/redirects/DeleteRedirect/abstractions").RedirectAfterDeletePayload>>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WebinyError } from "@webiny/error";
|
|
2
|
+
import { RedirectAfterDeleteEventHandler } from "@webiny/api-website-builder/features/redirects/DeleteRedirect/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AUDIT } from "../../../config.js";
|
|
6
|
+
class RedirectAfterDeleteHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
redirect
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.DELETE);
|
|
16
|
+
await createAuditLog("Website Redirect Deleted", redirect, redirect.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing RedirectAfterDeleteEventHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_REDIRECT_DELETE_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const RedirectAfterDeleteAuditHandler = RedirectAfterDeleteEventHandler.createImplementation({
|
|
26
|
+
implementation: RedirectAfterDeleteHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=RedirectAfterDeleteHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","RedirectAfterDeleteEventHandler","AuditLogsContext","getAuditConfig","AUDIT","RedirectAfterDeleteHandlerImpl","constructor","context","handle","event","redirect","payload","createAuditLog","WEBSITE_BUILDER","REDIRECT","DELETE","id","error","from","message","code","RedirectAfterDeleteAuditHandler","createImplementation","implementation","dependencies"],"sources":["RedirectAfterDeleteHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { RedirectAfterDeleteEventHandler } from \"@webiny/api-website-builder/features/redirects/DeleteRedirect/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass RedirectAfterDeleteHandlerImpl implements RedirectAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RedirectAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { redirect } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.DELETE);\n await createAuditLog(\"Website Redirect Deleted\", redirect, redirect.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing RedirectAfterDeleteEventHandler\",\n code: \"AUDIT_LOGS_AFTER_REDIRECT_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const RedirectAfterDeleteAuditHandler = RedirectAfterDeleteEventHandler.createImplementation(\n {\n implementation: RedirectAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n }\n);\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,+BAA+B,QAAQ,wEAAwE;AACxH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,8BAA8B,CAAsD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA4C,EAAiB;IACtE,IAAI;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGD,KAAK,CAACE,OAAO;MAClC,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,QAAQ,CAACC,MAAM,CAAC;MAC5E,MAAMH,cAAc,CAAC,0BAA0B,EAAEF,QAAQ,EAAEA,QAAQ,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACzF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,+BAA+B,GAAGpB,+BAA+B,CAACqB,oBAAoB,CAC/F;EACIC,cAAc,EAAElB,8BAA8B;EAC9CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedirectAfterMoveEventHandler } from "@webiny/api-website-builder/features/redirects/MoveRedirect/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class RedirectAfterMoveHandlerImpl implements RedirectAfterMoveEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: RedirectAfterMoveEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const RedirectAfterMoveAuditHandler: typeof RedirectAfterMoveHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/eventPublisher").DomainEvent<import("@webiny/api-website-builder/features/redirects/MoveRedirect/abstractions").RedirectAfterMovePayload>>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { WebinyError } from "@webiny/error";
|
|
2
|
+
import { RedirectAfterMoveEventHandler } from "@webiny/api-website-builder/features/redirects/MoveRedirect/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AUDIT } from "../../../config.js";
|
|
6
|
+
class RedirectAfterMoveHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
redirect
|
|
14
|
+
} = event.payload;
|
|
15
|
+
const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.MOVE);
|
|
16
|
+
await createAuditLog("Website Redirect Moved", redirect, redirect.id, this.context);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
throw WebinyError.from(error, {
|
|
19
|
+
message: "Error while executing RedirectAfterMoveEventHandler",
|
|
20
|
+
code: "AUDIT_LOGS_AFTER_REDIRECT_MOVE_HANDLER"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
export const RedirectAfterMoveAuditHandler = RedirectAfterMoveEventHandler.createImplementation({
|
|
26
|
+
implementation: RedirectAfterMoveHandlerImpl,
|
|
27
|
+
dependencies: [AuditLogsContext]
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=RedirectAfterMoveHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","RedirectAfterMoveEventHandler","AuditLogsContext","getAuditConfig","AUDIT","RedirectAfterMoveHandlerImpl","constructor","context","handle","event","redirect","payload","createAuditLog","WEBSITE_BUILDER","REDIRECT","MOVE","id","error","from","message","code","RedirectAfterMoveAuditHandler","createImplementation","implementation","dependencies"],"sources":["RedirectAfterMoveHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { RedirectAfterMoveEventHandler } from \"@webiny/api-website-builder/features/redirects/MoveRedirect/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass RedirectAfterMoveHandlerImpl implements RedirectAfterMoveEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RedirectAfterMoveEventHandler.Event): Promise<void> {\n try {\n const { redirect } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.MOVE);\n await createAuditLog(\"Website Redirect Moved\", redirect, redirect.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing RedirectAfterMoveEventHandler\",\n code: \"AUDIT_LOGS_AFTER_REDIRECT_MOVE_HANDLER\"\n });\n }\n }\n}\n\nexport const RedirectAfterMoveAuditHandler = RedirectAfterMoveEventHandler.createImplementation({\n implementation: RedirectAfterMoveHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,6BAA6B,QAAQ,sEAAsE;AACpH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,4BAA4B,CAAoD;EAClFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGD,KAAK,CAACE,OAAO;MAClC,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,QAAQ,CAACC,IAAI,CAAC;MAC1E,MAAMH,cAAc,CAAC,wBAAwB,EAAEF,QAAQ,EAAEA,QAAQ,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACvF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,qDAAqD;QAC9DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,6BAA6B,GAAGpB,6BAA6B,CAACqB,oBAAoB,CAAC;EAC5FC,cAAc,EAAElB,4BAA4B;EAC5CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RedirectAfterUpdateEventHandler } from "@webiny/api-website-builder/features/redirects/UpdateRedirect/index.js";
|
|
2
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
+
declare class RedirectAfterUpdateHandlerImpl implements RedirectAfterUpdateEventHandler.Interface {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: AuditLogsContext.Interface);
|
|
6
|
+
handle(event: RedirectAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const RedirectAfterUpdateAuditHandler: typeof RedirectAfterUpdateHandlerImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher").IEventHandler<import("@webiny/api-core/features/eventPublisher").DomainEvent<import("@webiny/api-website-builder/features/redirects/UpdateRedirect/abstractions").RedirectAfterUpdatePayload>>>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { WebinyError } from "@webiny/error";
|
|
2
|
+
import { RedirectAfterUpdateEventHandler } from "@webiny/api-website-builder/features/redirects/UpdateRedirect/index.js";
|
|
3
|
+
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
|
+
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
|
+
import { AUDIT } from "../../../config.js";
|
|
6
|
+
class RedirectAfterUpdateHandlerImpl {
|
|
7
|
+
constructor(context) {
|
|
8
|
+
this.context = context;
|
|
9
|
+
}
|
|
10
|
+
async handle(event) {
|
|
11
|
+
try {
|
|
12
|
+
const {
|
|
13
|
+
redirect,
|
|
14
|
+
original
|
|
15
|
+
} = event.payload;
|
|
16
|
+
const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.UPDATE);
|
|
17
|
+
await createAuditLog("Website Redirect Updated", {
|
|
18
|
+
before: original,
|
|
19
|
+
after: redirect
|
|
20
|
+
}, redirect.id, this.context);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
throw WebinyError.from(error, {
|
|
23
|
+
message: "Error while executing RedirectAfterUpdateEventHandler",
|
|
24
|
+
code: "AUDIT_LOGS_AFTER_REDIRECT_UPDATE_HANDLER"
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export const RedirectAfterUpdateAuditHandler = RedirectAfterUpdateEventHandler.createImplementation({
|
|
30
|
+
implementation: RedirectAfterUpdateHandlerImpl,
|
|
31
|
+
dependencies: [AuditLogsContext]
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=RedirectAfterUpdateHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebinyError","RedirectAfterUpdateEventHandler","AuditLogsContext","getAuditConfig","AUDIT","RedirectAfterUpdateHandlerImpl","constructor","context","handle","event","redirect","original","payload","createAuditLog","WEBSITE_BUILDER","REDIRECT","UPDATE","before","after","id","error","from","message","code","RedirectAfterUpdateAuditHandler","createImplementation","implementation","dependencies"],"sources":["RedirectAfterUpdateHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { RedirectAfterUpdateEventHandler } from \"@webiny/api-website-builder/features/redirects/UpdateRedirect/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass RedirectAfterUpdateHandlerImpl implements RedirectAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RedirectAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { redirect, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.UPDATE);\n await createAuditLog(\n \"Website Redirect Updated\",\n { before: original, after: redirect },\n redirect.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing RedirectAfterUpdateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_REDIRECT_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const RedirectAfterUpdateAuditHandler = RedirectAfterUpdateEventHandler.createImplementation(\n {\n implementation: RedirectAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n }\n);\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,+BAA+B,QAAQ,wEAAwE;AACxH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,8BAA8B,CAAsD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA4C,EAAiB;IACtE,IAAI;MACA,MAAM;QAAEC,QAAQ;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC5C,MAAMC,cAAc,GAAGV,cAAc,CAACC,KAAK,CAACU,eAAe,CAACC,QAAQ,CAACC,MAAM,CAAC;MAC5E,MAAMH,cAAc,CAChB,0BAA0B,EAC1B;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAS,CAAC,EACrCA,QAAQ,CAACS,EAAE,EACX,IAAI,CAACZ,OACT,CAAC;IACL,CAAC,CAAC,OAAOa,KAAK,EAAE;MACZ,MAAMpB,WAAW,CAACqB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,+BAA+B,GAAGvB,+BAA+B,CAACwB,oBAAoB,CAC/F;EACIC,cAAc,EAAErB,8BAA8B;EAC9CsB,YAAY,EAAE,CAACzB,gBAAgB;AACnC,CACJ,CAAC","ignoreList":[]}
|
package/types.d.ts
CHANGED
|
@@ -1,46 +1,40 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export interface
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
timestamp: Date;
|
|
39
|
-
initiator: string;
|
|
40
|
-
}
|
|
41
|
-
export interface AuditLogsContext extends BaseContext, PbContext, FormBuilderContext, AcoContext, MailerContext, SecurityContext, ApwContext {
|
|
42
|
-
pageBuilder: PbImportExportContext["pageBuilder"];
|
|
43
|
-
formBuilder: PbImportExportContext["formBuilder"];
|
|
1
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
2
|
+
import type { Action, App, Entity } from "@webiny/common-audit-logs/types.js";
|
|
3
|
+
import type { DbContext } from "@webiny/handler-db/types.js";
|
|
4
|
+
import type { ApiCoreContext } from "@webiny/api-core/types/core.js";
|
|
5
|
+
import type { IAuditLog } from "./storage/types.js";
|
|
6
|
+
import type { IStorageListParams } from "./storage/abstractions/Storage.js";
|
|
7
|
+
export interface AuditLogPayload extends Omit<IAuditLog, "id" | "tenant" | "createdOn" | "createdBy" | "expiresAt" | "content"> {
|
|
8
|
+
content: GenericRecord;
|
|
9
|
+
}
|
|
10
|
+
export interface IListAuditLogsParams extends Omit<IStorageListParams, "tenant" | "limit" | "app"> {
|
|
11
|
+
app?: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface IListAuditLogsResultMeta {
|
|
15
|
+
cursor: string | null;
|
|
16
|
+
hasMoreItems: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface IListAuditLogsSuccessResult {
|
|
19
|
+
items: IAuditLog[];
|
|
20
|
+
meta: IListAuditLogsResultMeta;
|
|
21
|
+
error?: never;
|
|
22
|
+
}
|
|
23
|
+
export interface IListAuditLogsErrorResult {
|
|
24
|
+
items?: never;
|
|
25
|
+
meta?: never;
|
|
26
|
+
error: Error;
|
|
27
|
+
}
|
|
28
|
+
export type IListAuditLogsResult = IListAuditLogsSuccessResult | IListAuditLogsErrorResult;
|
|
29
|
+
export interface AuditLogsContextValue {
|
|
30
|
+
deleteLogsAfterDays: number | undefined;
|
|
31
|
+
createAuditLog(payload: AuditLogPayload): Promise<IAuditLog>;
|
|
32
|
+
updateAuditLog(original: IAuditLog, payload: Partial<AuditLogPayload>): Promise<IAuditLog>;
|
|
33
|
+
getAuditLog(id: string): Promise<IAuditLog | null>;
|
|
34
|
+
listAuditLogs(params: IListAuditLogsParams): Promise<IListAuditLogsResult>;
|
|
35
|
+
}
|
|
36
|
+
export interface AuditLogsContext extends ApiCoreContext, Pick<DbContext, "db"> {
|
|
37
|
+
auditLogs: AuditLogsContextValue;
|
|
44
38
|
}
|
|
45
39
|
export interface AuditObject {
|
|
46
40
|
[app: string]: EntityObject;
|
package/types.js
CHANGED
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _types = require("./app/types");
|
|
7
|
-
Object.keys(_types).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _types[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _types[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
1
|
+
export {};
|
|
17
2
|
|
|
18
3
|
//# sourceMappingURL=types.js.map
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/api/types.js\";\nimport type { Action, App, Entity } from \"@webiny/common-audit-logs/types.js\";\nimport type { DbContext } from \"@webiny/handler-db/types.js\";\nimport type { ApiCoreContext } from \"@webiny/api-core/types/core.js\";\nimport type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListParams } from \"~/storage/abstractions/Storage.js\";\n\nexport interface AuditLogPayload extends Omit<\n IAuditLog,\n \"id\" | \"tenant\" | \"createdOn\" | \"createdBy\" | \"expiresAt\" | \"content\"\n> {\n content: GenericRecord;\n}\n\nexport interface IListAuditLogsParams extends Omit<IStorageListParams, \"tenant\" | \"limit\" | \"app\"> {\n app?: string;\n limit?: number;\n}\n\nexport interface IListAuditLogsResultMeta {\n cursor: string | null;\n hasMoreItems: boolean;\n}\n\nexport interface IListAuditLogsSuccessResult {\n items: IAuditLog[];\n meta: IListAuditLogsResultMeta;\n error?: never;\n}\n\nexport interface IListAuditLogsErrorResult {\n items?: never;\n meta?: never;\n error: Error;\n}\n\nexport type IListAuditLogsResult = IListAuditLogsSuccessResult | IListAuditLogsErrorResult;\n\nexport interface AuditLogsContextValue {\n deleteLogsAfterDays: number | undefined;\n createAuditLog(payload: AuditLogPayload): Promise<IAuditLog>;\n updateAuditLog(original: IAuditLog, payload: Partial<AuditLogPayload>): Promise<IAuditLog>;\n getAuditLog(id: string): Promise<IAuditLog | null>;\n listAuditLogs(params: IListAuditLogsParams): Promise<IListAuditLogsResult>;\n}\n\nexport interface AuditLogsContext extends ApiCoreContext, Pick<DbContext, \"db\"> {\n auditLogs: AuditLogsContextValue;\n}\n\nexport interface AuditObject {\n [app: string]: EntityObject;\n}\n\nexport interface EntityObject {\n [entity: string]: ActionObject;\n}\n\nexport interface ActionObject {\n [action: string]: AuditAction;\n}\n\nexport interface AuditAction {\n app: App;\n entity: Entity;\n action: Action;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const convertExpiresAtDaysToDate: (days: number) => Date;
|
|
2
|
+
export declare const convertExpiresAtToUnixTimestamp: (expiresAt: Date | string) => number;
|
|
3
|
+
export declare const convertUnixTimestampToDate: (expiresAt: number | undefined | null) => Date | undefined;
|
|
4
|
+
export declare const convertUnixTimestampToISODateString: (expiresAt: number | undefined | null) => string | undefined;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const convertExpiresAtDaysToDate = days => {
|
|
2
|
+
const date = new Date();
|
|
3
|
+
date.setTime(days * 24 * 60 * 60 * 1000 + date.getTime());
|
|
4
|
+
return date;
|
|
5
|
+
};
|
|
6
|
+
export const convertExpiresAtToUnixTimestamp = expiresAt => {
|
|
7
|
+
if (typeof expiresAt === "string") {
|
|
8
|
+
expiresAt = new Date(expiresAt);
|
|
9
|
+
}
|
|
10
|
+
return Math.floor(expiresAt.getTime() / 1000);
|
|
11
|
+
};
|
|
12
|
+
export const convertUnixTimestampToDate = expiresAt => {
|
|
13
|
+
if (!expiresAt) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
return new Date(expiresAt * 1000);
|
|
17
|
+
};
|
|
18
|
+
export const convertUnixTimestampToISODateString = expiresAt => {
|
|
19
|
+
if (!expiresAt) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
return convertUnixTimestampToDate(expiresAt)?.toISOString();
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=expiresAt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["convertExpiresAtDaysToDate","days","date","Date","setTime","getTime","convertExpiresAtToUnixTimestamp","expiresAt","Math","floor","convertUnixTimestampToDate","undefined","convertUnixTimestampToISODateString","toISOString"],"sources":["expiresAt.ts"],"sourcesContent":["export const convertExpiresAtDaysToDate = (days: number): Date => {\n const date = new Date();\n date.setTime(days * 24 * 60 * 60 * 1000 + date.getTime());\n return date;\n};\n\nexport const convertExpiresAtToUnixTimestamp = (expiresAt: Date | string): number => {\n if (typeof expiresAt === \"string\") {\n expiresAt = new Date(expiresAt);\n }\n return Math.floor(expiresAt.getTime() / 1000);\n};\n\nexport const convertUnixTimestampToDate = (\n expiresAt: number | undefined | null\n): Date | undefined => {\n if (!expiresAt) {\n return undefined;\n }\n return new Date(expiresAt * 1000);\n};\n\nexport const convertUnixTimestampToISODateString = (\n expiresAt: number | undefined | null\n): string | undefined => {\n if (!expiresAt) {\n return undefined;\n }\n return convertUnixTimestampToDate(expiresAt)?.toISOString();\n};\n"],"mappings":"AAAA,OAAO,MAAMA,0BAA0B,GAAIC,IAAY,IAAW;EAC9D,MAAMC,IAAI,GAAG,IAAIC,IAAI,CAAC,CAAC;EACvBD,IAAI,CAACE,OAAO,CAACH,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,GAAGC,IAAI,CAACG,OAAO,CAAC,CAAC,CAAC;EACzD,OAAOH,IAAI;AACf,CAAC;AAED,OAAO,MAAMI,+BAA+B,GAAIC,SAAwB,IAAa;EACjF,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;IAC/BA,SAAS,GAAG,IAAIJ,IAAI,CAACI,SAAS,CAAC;EACnC;EACA,OAAOC,IAAI,CAACC,KAAK,CAACF,SAAS,CAACF,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;AACjD,CAAC;AAED,OAAO,MAAMK,0BAA0B,GACnCH,SAAoC,IACjB;EACnB,IAAI,CAACA,SAAS,EAAE;IACZ,OAAOI,SAAS;EACpB;EACA,OAAO,IAAIR,IAAI,CAACI,SAAS,GAAG,IAAI,CAAC;AACrC,CAAC;AAED,OAAO,MAAMK,mCAAmC,GAC5CL,SAAoC,IACf;EACrB,IAAI,CAACA,SAAS,EAAE;IACZ,OAAOI,SAAS;EACpB;EACA,OAAOD,0BAA0B,CAACH,SAAS,CAAC,EAAEM,WAAW,CAAC,CAAC;AAC/D,CAAC","ignoreList":[]}
|
|
@@ -1,36 +1,4 @@
|
|
|
1
|
-
import type { AuditAction, AuditLogsContext } from "../types";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
content: string;
|
|
6
|
-
tags: never[];
|
|
7
|
-
type: string;
|
|
8
|
-
location: {
|
|
9
|
-
folderId: string;
|
|
10
|
-
};
|
|
11
|
-
data: {
|
|
12
|
-
data: string;
|
|
13
|
-
message: string;
|
|
14
|
-
action: string;
|
|
15
|
-
timestamp: Date;
|
|
16
|
-
app: string;
|
|
17
|
-
entity: string;
|
|
18
|
-
entityId: string;
|
|
19
|
-
initiator: string;
|
|
20
|
-
};
|
|
21
|
-
} | {
|
|
22
|
-
data: string;
|
|
23
|
-
type: string;
|
|
24
|
-
title: string;
|
|
25
|
-
content?: string | undefined;
|
|
26
|
-
location: import("@webiny/api-aco/types").Location;
|
|
27
|
-
tags: string[];
|
|
28
|
-
id: string;
|
|
29
|
-
entryId: string;
|
|
30
|
-
createdOn: string;
|
|
31
|
-
modifiedOn: string | null;
|
|
32
|
-
savedOn: string;
|
|
33
|
-
createdBy: import("@webiny/api-aco/types").User;
|
|
34
|
-
modifiedBy: import("@webiny/api-aco/types").User | null;
|
|
35
|
-
savedBy: import("@webiny/api-aco/types").User;
|
|
36
|
-
} | undefined>;
|
|
1
|
+
import type { AuditAction, AuditLogsContext } from "../types.js";
|
|
2
|
+
import type { IAuditLog } from "../storage/types.js";
|
|
3
|
+
import type { GenericRecord } from "@webiny/api/types.js";
|
|
4
|
+
export declare const getAuditConfig: (audit: AuditAction) => (message: string, content: GenericRecord, entityId: string, context: AuditLogsContext) => Promise<IAuditLog | null>;
|