@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,10 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
|
|
2
|
+
import { AuditLogAfterUpdateHandler } from "./abstractions.js";
|
|
3
|
+
export class AuditLogAfterUpdateEvent extends DomainEvent {
|
|
4
|
+
eventType = "auditLog.afterUpdate";
|
|
5
|
+
getHandlerAbstraction() {
|
|
6
|
+
return AuditLogAfterUpdateHandler;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=AuditLogAfterUpdateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DomainEvent","AuditLogAfterUpdateHandler","AuditLogAfterUpdateEvent","eventType","getHandlerAbstraction"],"sources":["AuditLogAfterUpdateEvent.ts"],"sourcesContent":["import { DomainEvent } from \"@webiny/api-core/features/EventPublisher\";\nimport { AuditLogAfterUpdateHandler, AuditLogAfterUpdatePayload } from \"./abstractions.js\";\n\nexport class AuditLogAfterUpdateEvent extends DomainEvent<AuditLogAfterUpdatePayload> {\n eventType = \"auditLog.afterUpdate\" as const;\n\n getHandlerAbstraction() {\n return AuditLogAfterUpdateHandler;\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0CAA0C;AACtE,SAASC,0BAA0B;AAEnC,OAAO,MAAMC,wBAAwB,SAASF,WAAW,CAA6B;EAClFG,SAAS,GAAG,sBAAsB;EAElCC,qBAAqBA,CAAA,EAAG;IACpB,OAAOH,0BAA0B;EACrC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
|
|
2
|
+
import { AuditLogBeforeCreatePayload } from "./abstractions.js";
|
|
3
|
+
export declare class AuditLogBeforeCreateEvent extends DomainEvent<AuditLogBeforeCreatePayload> {
|
|
4
|
+
eventType: "auditLog.beforeCreate";
|
|
5
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
|
|
2
|
+
import { AuditLogBeforeCreateHandler } from "./abstractions.js";
|
|
3
|
+
export class AuditLogBeforeCreateEvent extends DomainEvent {
|
|
4
|
+
eventType = "auditLog.beforeCreate";
|
|
5
|
+
getHandlerAbstraction() {
|
|
6
|
+
return AuditLogBeforeCreateHandler;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=AuditLogBeforeCreateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DomainEvent","AuditLogBeforeCreateHandler","AuditLogBeforeCreateEvent","eventType","getHandlerAbstraction"],"sources":["AuditLogBeforeCreateEvent.ts"],"sourcesContent":["import { DomainEvent } from \"@webiny/api-core/features/EventPublisher\";\nimport { AuditLogBeforeCreateHandler, AuditLogBeforeCreatePayload } from \"./abstractions.js\";\n\nexport class AuditLogBeforeCreateEvent extends DomainEvent<AuditLogBeforeCreatePayload> {\n eventType = \"auditLog.beforeCreate\" as const;\n\n getHandlerAbstraction() {\n return AuditLogBeforeCreateHandler;\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0CAA0C;AACtE,SAASC,2BAA2B;AAEpC,OAAO,MAAMC,yBAAyB,SAASF,WAAW,CAA8B;EACpFG,SAAS,GAAG,uBAAuB;EAEnCC,qBAAqBA,CAAA,EAAG;IACpB,OAAOH,2BAA2B;EACtC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
|
|
2
|
+
import { AuditLogBeforeUpdatePayload } from "./abstractions.js";
|
|
3
|
+
export declare class AuditLogBeforeUpdateEvent extends DomainEvent<AuditLogBeforeUpdatePayload> {
|
|
4
|
+
eventType: "auditLog.beforeUpdate";
|
|
5
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/EventPublisher";
|
|
2
|
+
import { AuditLogBeforeUpdateHandler } from "./abstractions.js";
|
|
3
|
+
export class AuditLogBeforeUpdateEvent extends DomainEvent {
|
|
4
|
+
eventType = "auditLog.beforeUpdate";
|
|
5
|
+
getHandlerAbstraction() {
|
|
6
|
+
return AuditLogBeforeUpdateHandler;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=AuditLogBeforeUpdateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DomainEvent","AuditLogBeforeUpdateHandler","AuditLogBeforeUpdateEvent","eventType","getHandlerAbstraction"],"sources":["AuditLogBeforeUpdateEvent.ts"],"sourcesContent":["import { DomainEvent } from \"@webiny/api-core/features/EventPublisher\";\nimport { AuditLogBeforeUpdateHandler, AuditLogBeforeUpdatePayload } from \"./abstractions.js\";\n\nexport class AuditLogBeforeUpdateEvent extends DomainEvent<AuditLogBeforeUpdatePayload> {\n eventType = \"auditLog.beforeUpdate\" as const;\n\n getHandlerAbstraction() {\n return AuditLogBeforeUpdateHandler;\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,0CAA0C;AACtE,SAASC,2BAA2B;AAEpC,OAAO,MAAMC,yBAAyB,SAASF,WAAW,CAA8B;EACpFG,SAAS,GAAG,uBAAuB;EAEnCC,qBAAqBA,CAAA,EAAG;IACpB,OAAOH,2BAA2B;EACtC;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { DomainEvent, IEventHandler } from "@webiny/api-core/features/EventPublisher";
|
|
2
|
+
import type { IAuditLog } from "../storage/types.js";
|
|
3
|
+
import type { AuditLogsContext } from "../types.js";
|
|
4
|
+
export interface AuditLogBeforeCreatePayload {
|
|
5
|
+
auditLog: IAuditLog;
|
|
6
|
+
context: AuditLogsContext;
|
|
7
|
+
setAuditLog(auditLog: Partial<IAuditLog>): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AuditLogBeforeCreateHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>>;
|
|
10
|
+
export declare namespace AuditLogBeforeCreateHandler {
|
|
11
|
+
type Interface = IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>;
|
|
12
|
+
type Event = DomainEvent<AuditLogBeforeCreatePayload>;
|
|
13
|
+
}
|
|
14
|
+
export interface AuditLogAfterCreatePayload {
|
|
15
|
+
auditLog: IAuditLog;
|
|
16
|
+
context: AuditLogsContext;
|
|
17
|
+
}
|
|
18
|
+
export declare const AuditLogAfterCreateHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<AuditLogAfterCreatePayload>>>;
|
|
19
|
+
export declare namespace AuditLogAfterCreateHandler {
|
|
20
|
+
type Interface = IEventHandler<DomainEvent<AuditLogAfterCreatePayload>>;
|
|
21
|
+
type Event = DomainEvent<AuditLogAfterCreatePayload>;
|
|
22
|
+
}
|
|
23
|
+
export interface AuditLogBeforeUpdatePayload {
|
|
24
|
+
auditLog: IAuditLog;
|
|
25
|
+
original: IAuditLog;
|
|
26
|
+
context: AuditLogsContext;
|
|
27
|
+
setAuditLog(auditLog: Partial<IAuditLog>): void;
|
|
28
|
+
}
|
|
29
|
+
export declare const AuditLogBeforeUpdateHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>>;
|
|
30
|
+
export declare namespace AuditLogBeforeUpdateHandler {
|
|
31
|
+
type Interface = IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>;
|
|
32
|
+
type Event = DomainEvent<AuditLogBeforeUpdatePayload>;
|
|
33
|
+
}
|
|
34
|
+
export interface AuditLogAfterUpdatePayload {
|
|
35
|
+
auditLog: IAuditLog;
|
|
36
|
+
original: IAuditLog;
|
|
37
|
+
context: AuditLogsContext;
|
|
38
|
+
}
|
|
39
|
+
export declare const AuditLogAfterUpdateHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>>;
|
|
40
|
+
export declare namespace AuditLogAfterUpdateHandler {
|
|
41
|
+
type Interface = IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>;
|
|
42
|
+
type Event = DomainEvent<AuditLogAfterUpdatePayload>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
|
|
3
|
+
// ============================================================================
|
|
4
|
+
// AuditLogBeforeCreate Event
|
|
5
|
+
// ============================================================================
|
|
6
|
+
|
|
7
|
+
export const AuditLogBeforeCreateHandler = createAbstraction("AuditLogBeforeCreateHandler");
|
|
8
|
+
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// AuditLogAfterCreate Event
|
|
11
|
+
// ============================================================================
|
|
12
|
+
|
|
13
|
+
export const AuditLogAfterCreateHandler = createAbstraction("AuditLogAfterCreateHandler");
|
|
14
|
+
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// AuditLogBeforeUpdate Event
|
|
17
|
+
// ============================================================================
|
|
18
|
+
|
|
19
|
+
export const AuditLogBeforeUpdateHandler = createAbstraction("AuditLogBeforeUpdateHandler");
|
|
20
|
+
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// AuditLogAfterUpdate Event
|
|
23
|
+
// ============================================================================
|
|
24
|
+
|
|
25
|
+
export const AuditLogAfterUpdateHandler = createAbstraction("AuditLogAfterUpdateHandler");
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createAbstraction","AuditLogBeforeCreateHandler","AuditLogAfterCreateHandler","AuditLogBeforeUpdateHandler","AuditLogAfterUpdateHandler"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { DomainEvent, IEventHandler } from \"@webiny/api-core/features/EventPublisher\";\nimport type { IAuditLog } from \"~/storage/types.js\";\nimport type { AuditLogsContext } from \"~/types.js\";\n\n// ============================================================================\n// AuditLogBeforeCreate Event\n// ============================================================================\n\nexport interface AuditLogBeforeCreatePayload {\n auditLog: IAuditLog;\n context: AuditLogsContext;\n setAuditLog(auditLog: Partial<IAuditLog>): void;\n}\n\nexport const AuditLogBeforeCreateHandler = createAbstraction<\n IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>\n>(\"AuditLogBeforeCreateHandler\");\n\nexport namespace AuditLogBeforeCreateHandler {\n export type Interface = IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>;\n export type Event = DomainEvent<AuditLogBeforeCreatePayload>;\n}\n\n// ============================================================================\n// AuditLogAfterCreate Event\n// ============================================================================\n\nexport interface AuditLogAfterCreatePayload {\n auditLog: IAuditLog;\n context: AuditLogsContext;\n}\n\nexport const AuditLogAfterCreateHandler = createAbstraction<\n IEventHandler<DomainEvent<AuditLogAfterCreatePayload>>\n>(\"AuditLogAfterCreateHandler\");\n\nexport namespace AuditLogAfterCreateHandler {\n export type Interface = IEventHandler<DomainEvent<AuditLogAfterCreatePayload>>;\n export type Event = DomainEvent<AuditLogAfterCreatePayload>;\n}\n\n// ============================================================================\n// AuditLogBeforeUpdate Event\n// ============================================================================\n\nexport interface AuditLogBeforeUpdatePayload {\n auditLog: IAuditLog;\n original: IAuditLog;\n context: AuditLogsContext;\n setAuditLog(auditLog: Partial<IAuditLog>): void;\n}\n\nexport const AuditLogBeforeUpdateHandler = createAbstraction<\n IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>\n>(\"AuditLogBeforeUpdateHandler\");\n\nexport namespace AuditLogBeforeUpdateHandler {\n export type Interface = IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>;\n export type Event = DomainEvent<AuditLogBeforeUpdatePayload>;\n}\n\n// ============================================================================\n// AuditLogAfterUpdate Event\n// ============================================================================\n\nexport interface AuditLogAfterUpdatePayload {\n auditLog: IAuditLog;\n original: IAuditLog;\n context: AuditLogsContext;\n}\n\nexport const AuditLogAfterUpdateHandler = createAbstraction<\n IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>\n>(\"AuditLogAfterUpdateHandler\");\n\nexport namespace AuditLogAfterUpdateHandler {\n export type Interface = IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>;\n export type Event = DomainEvent<AuditLogAfterUpdatePayload>;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAKvD;AACA;AACA;;AAQA,OAAO,MAAMC,2BAA2B,GAAGD,iBAAiB,CAE1D,6BAA6B,CAAC;;AAOhC;AACA;AACA;;AAOA,OAAO,MAAME,0BAA0B,GAAGF,iBAAiB,CAEzD,4BAA4B,CAAC;;AAO/B;AACA;AACA;;AASA,OAAO,MAAMG,2BAA2B,GAAGH,iBAAiB,CAE1D,6BAA6B,CAAC;;AAOhC;AACA;AACA;;AAQA,OAAO,MAAMI,0BAA0B,GAAGJ,iBAAiB,CAEzD,4BAA4B,CAAC","ignoreList":[]}
|
package/events/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./abstractions.js";
|
|
2
|
+
export * from "./AuditLogBeforeCreateEvent.js";
|
|
3
|
+
export * from "./AuditLogAfterCreateEvent.js";
|
|
4
|
+
export * from "./AuditLogBeforeUpdateEvent.js";
|
|
5
|
+
export * from "./AuditLogAfterUpdateEvent.js";
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./abstractions.js\";\nexport * from \"./AuditLogBeforeCreateEvent.js\";\nexport * from \"./AuditLogAfterCreateEvent.js\";\nexport * from \"./AuditLogBeforeUpdateEvent.js\";\nexport * from \"./AuditLogAfterUpdateEvent.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { GraphQLSchemaPlugin, NotFoundError, resolve, resolveList } from "@webiny/handler-graphql";
|
|
2
|
+
import { getValidationSchema, listValidationSchema } from "./validation.js";
|
|
3
|
+
import { createZodError } from "@webiny/utils";
|
|
4
|
+
export const createGraphQLSchema = () => {
|
|
5
|
+
return new GraphQLSchemaPlugin({
|
|
6
|
+
isApplicable: context => {
|
|
7
|
+
return !!context.auditLogs;
|
|
8
|
+
},
|
|
9
|
+
typeDefs: `
|
|
10
|
+
type AuditLogCreatedBy {
|
|
11
|
+
id: ID!
|
|
12
|
+
displayName: String
|
|
13
|
+
type: String
|
|
14
|
+
}
|
|
15
|
+
type AuditLog {
|
|
16
|
+
id: ID!
|
|
17
|
+
createdBy: AuditLogCreatedBy!
|
|
18
|
+
createdOn: DateTime!
|
|
19
|
+
app: String!
|
|
20
|
+
action: String!
|
|
21
|
+
message: String!
|
|
22
|
+
entity: String!
|
|
23
|
+
entityId: String!
|
|
24
|
+
tags: [String!]!
|
|
25
|
+
expiresAt: DateTime!
|
|
26
|
+
content: String
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type AuditLogListMeta {
|
|
30
|
+
cursor: String
|
|
31
|
+
hasMoreItems: Boolean!
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type AuditLogError {
|
|
35
|
+
code: String
|
|
36
|
+
message: String!
|
|
37
|
+
data: JSON
|
|
38
|
+
stack: String
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type AuditLogListResponse {
|
|
42
|
+
data: [AuditLog!]
|
|
43
|
+
meta: AuditLogListMeta
|
|
44
|
+
error: AuditLogError
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
type AuditLogGetResponse {
|
|
48
|
+
data: AuditLog
|
|
49
|
+
error: AuditLogError
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
enum AuditLogsSort {
|
|
53
|
+
ASC
|
|
54
|
+
DESC
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
input ListAuditLogsWhere {
|
|
58
|
+
app: String
|
|
59
|
+
action: String
|
|
60
|
+
createdBy: String
|
|
61
|
+
entity: String
|
|
62
|
+
entityId: String
|
|
63
|
+
createdOn_gte: DateTime
|
|
64
|
+
createdOn_lte: DateTime
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
type AuditLogsQuery {
|
|
68
|
+
getAuditLog(id: ID!): AuditLogGetResponse
|
|
69
|
+
listAuditLogs(
|
|
70
|
+
where: ListAuditLogsWhere
|
|
71
|
+
sort: AuditLogsSort
|
|
72
|
+
limit: Number
|
|
73
|
+
after: String
|
|
74
|
+
): AuditLogListResponse!
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
extend type Query {
|
|
78
|
+
auditLogs: AuditLogsQuery
|
|
79
|
+
}
|
|
80
|
+
`,
|
|
81
|
+
resolvers: {
|
|
82
|
+
Query: {
|
|
83
|
+
auditLogs: () => ({})
|
|
84
|
+
},
|
|
85
|
+
AuditLogsQuery: {
|
|
86
|
+
async getAuditLog(_, args, context) {
|
|
87
|
+
return resolve(async () => {
|
|
88
|
+
const validation = await getValidationSchema.safeParseAsync(args);
|
|
89
|
+
if (!validation.success) {
|
|
90
|
+
throw createZodError(validation.error);
|
|
91
|
+
}
|
|
92
|
+
const result = await context.auditLogs.getAuditLog(validation.data.id);
|
|
93
|
+
if (!result) {
|
|
94
|
+
throw new NotFoundError(`Audit log with id "${validation.data.id}" not found.`);
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
});
|
|
98
|
+
},
|
|
99
|
+
async listAuditLogs(_, args, context) {
|
|
100
|
+
return resolveList(async () => {
|
|
101
|
+
const validation = await listValidationSchema.safeParseAsync(args);
|
|
102
|
+
if (!validation.success) {
|
|
103
|
+
throw createZodError(validation.error);
|
|
104
|
+
}
|
|
105
|
+
const result = await context.auditLogs.listAuditLogs({
|
|
106
|
+
...validation.data,
|
|
107
|
+
...validation.data.where
|
|
108
|
+
});
|
|
109
|
+
if (result.error) {
|
|
110
|
+
throw result.error;
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
items: result.items,
|
|
114
|
+
meta: {
|
|
115
|
+
...result.meta,
|
|
116
|
+
totalCount: 0
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["GraphQLSchemaPlugin","NotFoundError","resolve","resolveList","getValidationSchema","listValidationSchema","createZodError","createGraphQLSchema","isApplicable","context","auditLogs","typeDefs","resolvers","Query","AuditLogsQuery","getAuditLog","_","args","validation","safeParseAsync","success","error","result","data","id","listAuditLogs","where","items","meta","totalCount"],"sources":["schema.ts"],"sourcesContent":["import { GraphQLSchemaPlugin, NotFoundError, resolve, resolveList } from \"@webiny/handler-graphql\";\nimport type { AuditLogsContext } from \"~/types.js\";\nimport { getValidationSchema, listValidationSchema } from \"./validation.js\";\nimport { createZodError } from \"@webiny/utils\";\n\ninterface IListAuditLogsWhere {\n app?: string;\n action?: string;\n createdBy?: string;\n entity?: string;\n entityId?: string;\n createdOn_gte?: Date;\n createdOn_lte?: Date;\n}\n\ninterface IListAuditLogsArgs {\n where?: IListAuditLogsWhere;\n sort?: \"ASC\" | \"DESC\";\n limit?: number;\n after?: string;\n}\n\nexport const createGraphQLSchema = () => {\n return new GraphQLSchemaPlugin<AuditLogsContext>({\n isApplicable: context => {\n return !!context.auditLogs;\n },\n typeDefs: `\n type AuditLogCreatedBy {\n id: ID!\n displayName: String\n type: String\n }\n type AuditLog {\n id: ID!\n createdBy: AuditLogCreatedBy!\n createdOn: DateTime!\n app: String!\n action: String!\n message: String!\n entity: String!\n entityId: String!\n tags: [String!]!\n expiresAt: DateTime!\n content: String\n }\n \n type AuditLogListMeta {\n cursor: String\n hasMoreItems: Boolean!\n }\n \n type AuditLogError {\n code: String\n message: String!\n data: JSON\n stack: String\n }\n \n type AuditLogListResponse {\n data: [AuditLog!]\n meta: AuditLogListMeta\n error: AuditLogError\n }\n \n type AuditLogGetResponse {\n data: AuditLog\n error: AuditLogError\n }\n \n enum AuditLogsSort {\n ASC\n DESC\n }\n \n input ListAuditLogsWhere {\n app: String\n action: String\n createdBy: String\n entity: String\n entityId: String\n createdOn_gte: DateTime\n createdOn_lte: DateTime\n }\n \n type AuditLogsQuery {\n getAuditLog(id: ID!): AuditLogGetResponse\n listAuditLogs(\n where: ListAuditLogsWhere\n sort: AuditLogsSort\n limit: Number\n after: String\n ): AuditLogListResponse!\n }\n \n extend type Query {\n auditLogs: AuditLogsQuery\n }\n `,\n resolvers: {\n Query: {\n auditLogs: () => ({})\n },\n AuditLogsQuery: {\n async getAuditLog(_, args, context) {\n return resolve(async () => {\n const validation = await getValidationSchema.safeParseAsync(args);\n\n if (!validation.success) {\n throw createZodError(validation.error);\n }\n\n const result = await context.auditLogs.getAuditLog(validation.data.id);\n if (!result) {\n throw new NotFoundError(\n `Audit log with id \"${validation.data.id}\" not found.`\n );\n }\n return result;\n });\n },\n async listAuditLogs(_, args: IListAuditLogsArgs, context) {\n return resolveList(async () => {\n const validation = await listValidationSchema.safeParseAsync(args);\n if (!validation.success) {\n throw createZodError(validation.error);\n }\n const result = await context.auditLogs.listAuditLogs({\n ...validation.data,\n ...validation.data.where\n });\n if (result.error) {\n throw result.error;\n }\n return {\n items: result.items,\n meta: {\n ...result.meta,\n totalCount: 0\n }\n };\n });\n }\n }\n }\n });\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,aAAa,EAAEC,OAAO,EAAEC,WAAW,QAAQ,yBAAyB;AAElG,SAASC,mBAAmB,EAAEC,oBAAoB;AAClD,SAASC,cAAc,QAAQ,eAAe;AAmB9C,OAAO,MAAMC,mBAAmB,GAAGA,CAAA,KAAM;EACrC,OAAO,IAAIP,mBAAmB,CAAmB;IAC7CQ,YAAY,EAAEC,OAAO,IAAI;MACrB,OAAO,CAAC,CAACA,OAAO,CAACC,SAAS;IAC9B,CAAC;IACDC,QAAQ,EAAE;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;IACDC,SAAS,EAAE;MACPC,KAAK,EAAE;QACHH,SAAS,EAAEA,CAAA,MAAO,CAAC,CAAC;MACxB,CAAC;MACDI,cAAc,EAAE;QACZ,MAAMC,WAAWA,CAACC,CAAC,EAAEC,IAAI,EAAER,OAAO,EAAE;UAChC,OAAOP,OAAO,CAAC,YAAY;YACvB,MAAMgB,UAAU,GAAG,MAAMd,mBAAmB,CAACe,cAAc,CAACF,IAAI,CAAC;YAEjE,IAAI,CAACC,UAAU,CAACE,OAAO,EAAE;cACrB,MAAMd,cAAc,CAACY,UAAU,CAACG,KAAK,CAAC;YAC1C;YAEA,MAAMC,MAAM,GAAG,MAAMb,OAAO,CAACC,SAAS,CAACK,WAAW,CAACG,UAAU,CAACK,IAAI,CAACC,EAAE,CAAC;YACtE,IAAI,CAACF,MAAM,EAAE;cACT,MAAM,IAAIrB,aAAa,CACnB,sBAAsBiB,UAAU,CAACK,IAAI,CAACC,EAAE,cAC5C,CAAC;YACL;YACA,OAAOF,MAAM;UACjB,CAAC,CAAC;QACN,CAAC;QACD,MAAMG,aAAaA,CAACT,CAAC,EAAEC,IAAwB,EAAER,OAAO,EAAE;UACtD,OAAON,WAAW,CAAC,YAAY;YAC3B,MAAMe,UAAU,GAAG,MAAMb,oBAAoB,CAACc,cAAc,CAACF,IAAI,CAAC;YAClE,IAAI,CAACC,UAAU,CAACE,OAAO,EAAE;cACrB,MAAMd,cAAc,CAACY,UAAU,CAACG,KAAK,CAAC;YAC1C;YACA,MAAMC,MAAM,GAAG,MAAMb,OAAO,CAACC,SAAS,CAACe,aAAa,CAAC;cACjD,GAAGP,UAAU,CAACK,IAAI;cAClB,GAAGL,UAAU,CAACK,IAAI,CAACG;YACvB,CAAC,CAAC;YACF,IAAIJ,MAAM,CAACD,KAAK,EAAE;cACd,MAAMC,MAAM,CAACD,KAAK;YACtB;YACA,OAAO;cACHM,KAAK,EAAEL,MAAM,CAACK,KAAK;cACnBC,IAAI,EAAE;gBACF,GAAGN,MAAM,CAACM,IAAI;gBACdC,UAAU,EAAE;cAChB;YACJ,CAAC;UACL,CAAC,CAAC;QACN;MACJ;IACJ;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export declare const getValidationSchema: zod.ZodObject<{
|
|
3
|
+
id: zod.ZodString;
|
|
4
|
+
}, "strip", zod.ZodTypeAny, {
|
|
5
|
+
id: string;
|
|
6
|
+
}, {
|
|
7
|
+
id: string;
|
|
8
|
+
}>;
|
|
9
|
+
export declare const listValidationSchema: zod.ZodObject<{
|
|
10
|
+
where: zod.ZodObject<{
|
|
11
|
+
app: zod.ZodOptional<zod.ZodString>;
|
|
12
|
+
entity: zod.ZodOptional<zod.ZodString>;
|
|
13
|
+
entityId: zod.ZodOptional<zod.ZodString>;
|
|
14
|
+
createdOn_gte: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, Date | undefined, unknown>;
|
|
15
|
+
createdOn_lte: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, Date | undefined, unknown>;
|
|
16
|
+
createdBy: zod.ZodOptional<zod.ZodString>;
|
|
17
|
+
action: zod.ZodOptional<zod.ZodString>;
|
|
18
|
+
}, "strip", zod.ZodTypeAny, {
|
|
19
|
+
createdBy?: string | undefined;
|
|
20
|
+
app?: string | undefined;
|
|
21
|
+
action?: string | undefined;
|
|
22
|
+
entity?: string | undefined;
|
|
23
|
+
entityId?: string | undefined;
|
|
24
|
+
createdOn_gte?: Date | undefined;
|
|
25
|
+
createdOn_lte?: Date | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
createdBy?: string | undefined;
|
|
28
|
+
app?: string | undefined;
|
|
29
|
+
action?: string | undefined;
|
|
30
|
+
entity?: string | undefined;
|
|
31
|
+
entityId?: string | undefined;
|
|
32
|
+
createdOn_gte?: unknown;
|
|
33
|
+
createdOn_lte?: unknown;
|
|
34
|
+
}>;
|
|
35
|
+
after: zod.ZodOptional<zod.ZodString>;
|
|
36
|
+
sort: zod.ZodOptional<zod.ZodEnum<["ASC", "DESC"]>>;
|
|
37
|
+
limit: zod.ZodDefault<zod.ZodEffects<zod.ZodOptional<zod.ZodNumber>, number | undefined, unknown>>;
|
|
38
|
+
}, "strip", zod.ZodTypeAny, {
|
|
39
|
+
limit: number;
|
|
40
|
+
where: {
|
|
41
|
+
createdBy?: string | undefined;
|
|
42
|
+
app?: string | undefined;
|
|
43
|
+
action?: string | undefined;
|
|
44
|
+
entity?: string | undefined;
|
|
45
|
+
entityId?: string | undefined;
|
|
46
|
+
createdOn_gte?: Date | undefined;
|
|
47
|
+
createdOn_lte?: Date | undefined;
|
|
48
|
+
};
|
|
49
|
+
after?: string | undefined;
|
|
50
|
+
sort?: "ASC" | "DESC" | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
where: {
|
|
53
|
+
createdBy?: string | undefined;
|
|
54
|
+
app?: string | undefined;
|
|
55
|
+
action?: string | undefined;
|
|
56
|
+
entity?: string | undefined;
|
|
57
|
+
entityId?: string | undefined;
|
|
58
|
+
createdOn_gte?: unknown;
|
|
59
|
+
createdOn_lte?: unknown;
|
|
60
|
+
};
|
|
61
|
+
after?: string | undefined;
|
|
62
|
+
sort?: "ASC" | "DESC" | undefined;
|
|
63
|
+
limit?: unknown;
|
|
64
|
+
}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export const getValidationSchema = zod.object({
|
|
3
|
+
id: zod.string().min(1, "ID is required.")
|
|
4
|
+
});
|
|
5
|
+
export const listValidationSchema = zod.object({
|
|
6
|
+
where: zod.object({
|
|
7
|
+
app: zod.string().min(1, "App is required.").optional(),
|
|
8
|
+
entity: zod.string().optional(),
|
|
9
|
+
entityId: zod.string().min(1, "Entity ID is required.").optional(),
|
|
10
|
+
createdOn_gte: zod.preprocess(input => {
|
|
11
|
+
if (typeof input == "string" || input instanceof Date) {
|
|
12
|
+
return new Date(input);
|
|
13
|
+
}
|
|
14
|
+
return undefined;
|
|
15
|
+
}, zod.date().optional()),
|
|
16
|
+
createdOn_lte: zod.preprocess(input => {
|
|
17
|
+
if (typeof input == "string" || input instanceof Date) {
|
|
18
|
+
return new Date(input);
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
}, zod.date().optional()),
|
|
22
|
+
createdBy: zod.string().optional(),
|
|
23
|
+
action: zod.string().optional()
|
|
24
|
+
}),
|
|
25
|
+
after: zod.string().optional(),
|
|
26
|
+
sort: zod.enum(["ASC", "DESC"]).optional(),
|
|
27
|
+
limit: zod.preprocess(input => {
|
|
28
|
+
if (typeof input == "string") {
|
|
29
|
+
return parseInt(input);
|
|
30
|
+
}
|
|
31
|
+
return input;
|
|
32
|
+
}, zod.number().min(1).max(100).optional()).default(25)
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["zod","getValidationSchema","object","id","string","min","listValidationSchema","where","app","optional","entity","entityId","createdOn_gte","preprocess","input","Date","undefined","date","createdOn_lte","createdBy","action","after","sort","enum","limit","parseInt","number","max","default"],"sources":["validation.ts"],"sourcesContent":["import zod from \"zod\";\n\nexport const getValidationSchema = zod.object({\n id: zod.string().min(1, \"ID is required.\")\n});\n\nexport const listValidationSchema = zod.object({\n where: zod.object({\n app: zod.string().min(1, \"App is required.\").optional(),\n entity: zod.string().optional(),\n entityId: zod.string().min(1, \"Entity ID is required.\").optional(),\n createdOn_gte: zod.preprocess(input => {\n if (typeof input == \"string\" || input instanceof Date) {\n return new Date(input);\n }\n return undefined;\n }, zod.date().optional()),\n createdOn_lte: zod.preprocess(input => {\n if (typeof input == \"string\" || input instanceof Date) {\n return new Date(input);\n }\n return undefined;\n }, zod.date().optional()),\n createdBy: zod.string().optional(),\n action: zod.string().optional()\n }),\n after: zod.string().optional(),\n sort: zod.enum([\"ASC\", \"DESC\"]).optional(),\n limit: zod\n .preprocess(input => {\n if (typeof input == \"string\") {\n return parseInt(input);\n }\n return input;\n }, zod.number().min(1).max(100).optional())\n .default(25)\n});\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAErB,OAAO,MAAMC,mBAAmB,GAAGD,GAAG,CAACE,MAAM,CAAC;EAC1CC,EAAE,EAAEH,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,EAAE,iBAAiB;AAC7C,CAAC,CAAC;AAEF,OAAO,MAAMC,oBAAoB,GAAGN,GAAG,CAACE,MAAM,CAAC;EAC3CK,KAAK,EAAEP,GAAG,CAACE,MAAM,CAAC;IACdM,GAAG,EAAER,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAACI,QAAQ,CAAC,CAAC;IACvDC,MAAM,EAAEV,GAAG,CAACI,MAAM,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC;IAC/BE,QAAQ,EAAEX,GAAG,CAACI,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAACI,QAAQ,CAAC,CAAC;IAClEG,aAAa,EAAEZ,GAAG,CAACa,UAAU,CAACC,KAAK,IAAI;MACnC,IAAI,OAAOA,KAAK,IAAI,QAAQ,IAAIA,KAAK,YAAYC,IAAI,EAAE;QACnD,OAAO,IAAIA,IAAI,CAACD,KAAK,CAAC;MAC1B;MACA,OAAOE,SAAS;IACpB,CAAC,EAAEhB,GAAG,CAACiB,IAAI,CAAC,CAAC,CAACR,QAAQ,CAAC,CAAC,CAAC;IACzBS,aAAa,EAAElB,GAAG,CAACa,UAAU,CAACC,KAAK,IAAI;MACnC,IAAI,OAAOA,KAAK,IAAI,QAAQ,IAAIA,KAAK,YAAYC,IAAI,EAAE;QACnD,OAAO,IAAIA,IAAI,CAACD,KAAK,CAAC;MAC1B;MACA,OAAOE,SAAS;IACpB,CAAC,EAAEhB,GAAG,CAACiB,IAAI,CAAC,CAAC,CAACR,QAAQ,CAAC,CAAC,CAAC;IACzBU,SAAS,EAAEnB,GAAG,CAACI,MAAM,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC;IAClCW,MAAM,EAAEpB,GAAG,CAACI,MAAM,CAAC,CAAC,CAACK,QAAQ,CAAC;EAClC,CAAC,CAAC;EACFY,KAAK,EAAErB,GAAG,CAACI,MAAM,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC;EAC9Ba,IAAI,EAAEtB,GAAG,CAACuB,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAACd,QAAQ,CAAC,CAAC;EAC1Ce,KAAK,EAAExB,GAAG,CACLa,UAAU,CAACC,KAAK,IAAI;IACjB,IAAI,OAAOA,KAAK,IAAI,QAAQ,EAAE;MAC1B,OAAOW,QAAQ,CAACX,KAAK,CAAC;IAC1B;IACA,OAAOA,KAAK;EAChB,CAAC,EAAEd,GAAG,CAAC0B,MAAM,CAAC,CAAC,CAACrB,GAAG,CAAC,CAAC,CAAC,CAACsB,GAAG,CAAC,GAAG,CAAC,CAAClB,QAAQ,CAAC,CAAC,CAAC,CAC1CmB,OAAO,CAAC,EAAE;AACnB,CAAC,CAAC","ignoreList":[]}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { ContextPlugin } from "@webiny/api";
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
3
|
+
export interface ICreateAuditLogsParams {
|
|
4
|
+
deleteLogsAfterDays: number | undefined;
|
|
5
|
+
tableName?: string;
|
|
6
|
+
documentClient?: DynamoDBDocument;
|
|
7
|
+
}
|
|
8
|
+
export declare const createAuditLogs: (params?: ICreateAuditLogsParams) => (ContextPlugin<import("./types.js").AuditLogsContext> | import("@webiny/handler-graphql/index.js").GraphQLSchemaPlugin<import("./types.js").AuditLogsContext>)[];
|
|
9
|
+
export * from "./config.js";
|
package/index.js
CHANGED
|
@@ -1,49 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
exports.createAuditLogs = void 0;
|
|
10
|
-
var _api = require("@webiny/api");
|
|
11
|
-
var _subscriptions = require("./subscriptions");
|
|
12
|
-
var _app = require("./app");
|
|
13
|
-
var _config = require("./config");
|
|
14
|
-
Object.keys(_config).forEach(function (key) {
|
|
15
|
-
if (key === "default" || key === "__esModule") return;
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
-
if (key in exports && exports[key] === _config[key]) return;
|
|
18
|
-
Object.defineProperty(exports, key, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _config[key];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
var _createAppModifier = require("./app/createAppModifier");
|
|
26
|
-
Object.keys(_createAppModifier).forEach(function (key) {
|
|
27
|
-
if (key === "default" || key === "__esModule") return;
|
|
28
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
29
|
-
if (key in exports && exports[key] === _createAppModifier[key]) return;
|
|
30
|
-
Object.defineProperty(exports, key, {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _createAppModifier[key];
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
const createAuditLogs = () => {
|
|
38
|
-
const subscriptionsPlugin = new _api.ContextPlugin(async context => {
|
|
1
|
+
import { ContextPlugin } from "@webiny/api";
|
|
2
|
+
import { createSubscriptionHooks } from "./subscriptions/index.js";
|
|
3
|
+
import { createAuditLogsContext } from "./context/index.js";
|
|
4
|
+
import { createGraphQLSchema } from "./graphql/schema.js";
|
|
5
|
+
import { AuditLogsContext } from "./abstractions.js";
|
|
6
|
+
export const createAuditLogs = params => {
|
|
7
|
+
const subscriptionsPlugin = new ContextPlugin(context => {
|
|
39
8
|
if (!context.wcp.canUseFeature("auditLogs")) {
|
|
40
9
|
return;
|
|
41
10
|
}
|
|
42
|
-
(
|
|
11
|
+
context.container.registerInstance(AuditLogsContext, context);
|
|
12
|
+
createSubscriptionHooks(context);
|
|
43
13
|
});
|
|
44
14
|
subscriptionsPlugin.name = "auditLogs.context.subscriptions";
|
|
45
|
-
return [subscriptionsPlugin, (
|
|
15
|
+
return [subscriptionsPlugin, createGraphQLSchema(), createAuditLogsContext({
|
|
16
|
+
tableName: params?.tableName,
|
|
17
|
+
deleteLogsAfterDays: params?.deleteLogsAfterDays,
|
|
18
|
+
documentClient: params?.documentClient
|
|
19
|
+
})];
|
|
46
20
|
};
|
|
47
|
-
|
|
21
|
+
export * from "./config.js";
|
|
48
22
|
|
|
49
23
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["ContextPlugin","createSubscriptionHooks","createAuditLogsContext","createGraphQLSchema","AuditLogsContext","createAuditLogs","params","subscriptionsPlugin","context","wcp","canUseFeature","container","registerInstance","name","tableName","deleteLogsAfterDays","documentClient"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { createSubscriptionHooks } from \"~/subscriptions/index.js\";\nimport { createAuditLogsContext } from \"~/context/index.js\";\nimport { createGraphQLSchema } from \"~/graphql/schema.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { AuditLogsContext } from \"./abstractions.js\";\n\nexport interface ICreateAuditLogsParams {\n deleteLogsAfterDays: number | undefined;\n tableName?: string;\n documentClient?: DynamoDBDocument;\n}\n\nexport const createAuditLogs = (params?: ICreateAuditLogsParams) => {\n const subscriptionsPlugin = new ContextPlugin<AuditLogsContext.Interface>(context => {\n if (!context.wcp.canUseFeature(\"auditLogs\")) {\n return;\n }\n\n context.container.registerInstance(AuditLogsContext, context);\n\n createSubscriptionHooks(context);\n });\n\n subscriptionsPlugin.name = \"auditLogs.context.subscriptions\";\n\n return [\n subscriptionsPlugin,\n createGraphQLSchema(),\n createAuditLogsContext({\n tableName: params?.tableName,\n deleteLogsAfterDays: params?.deleteLogsAfterDays,\n documentClient: params?.documentClient\n })\n ];\n};\nexport * from \"~/config.js\";\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,aAAa;AAC3C,SAASC,uBAAuB;AAChC,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAE5B,SAASC,gBAAgB;AAQzB,OAAO,MAAMC,eAAe,GAAIC,MAA+B,IAAK;EAChE,MAAMC,mBAAmB,GAAG,IAAIP,aAAa,CAA6BQ,OAAO,IAAI;IACjF,IAAI,CAACA,OAAO,CAACC,GAAG,CAACC,aAAa,CAAC,WAAW,CAAC,EAAE;MACzC;IACJ;IAEAF,OAAO,CAACG,SAAS,CAACC,gBAAgB,CAACR,gBAAgB,EAAEI,OAAO,CAAC;IAE7DP,uBAAuB,CAACO,OAAO,CAAC;EACpC,CAAC,CAAC;EAEFD,mBAAmB,CAACM,IAAI,GAAG,iCAAiC;EAE5D,OAAO,CACHN,mBAAmB,EACnBJ,mBAAmB,CAAC,CAAC,EACrBD,sBAAsB,CAAC;IACnBY,SAAS,EAAER,MAAM,EAAEQ,SAAS;IAC5BC,mBAAmB,EAAET,MAAM,EAAES,mBAAmB;IAChDC,cAAc,EAAEV,MAAM,EAAEU;EAC5B,CAAC,CAAC,CACL;AACL,CAAC;AACD","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-audit-logs",
|
|
3
|
-
"version": "6.0.0-
|
|
3
|
+
"version": "6.0.0-rc.1",
|
|
4
4
|
"main": "index.js",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"repository": {
|
|
6
7
|
"type": "git",
|
|
7
8
|
"url": "https://github.com/webiny/webiny-js.git",
|
|
@@ -11,46 +12,41 @@
|
|
|
11
12
|
"author": "Webiny Ltd.",
|
|
12
13
|
"license": "MIT",
|
|
13
14
|
"scripts": {
|
|
14
|
-
"build": "
|
|
15
|
-
"watch": "
|
|
15
|
+
"build": "node ../cli/bin.js run build",
|
|
16
|
+
"watch": "node ../cli/bin.js run watch"
|
|
16
17
|
},
|
|
17
18
|
"publishConfig": {
|
|
18
19
|
"access": "public",
|
|
19
20
|
"directory": "dist"
|
|
20
21
|
},
|
|
21
22
|
"devDependencies": {
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"@webiny/api-file-manager": "6.0.0-beta.0",
|
|
29
|
-
"@webiny/api-headless-cms": "6.0.0-beta.0",
|
|
30
|
-
"@webiny/api-i18n": "6.0.0-beta.0",
|
|
31
|
-
"@webiny/api-security": "6.0.0-beta.0",
|
|
32
|
-
"@webiny/api-tenancy": "6.0.0-beta.0",
|
|
33
|
-
"@webiny/api-wcp": "6.0.0-beta.0",
|
|
34
|
-
"@webiny/cli": "6.0.0-beta.0",
|
|
35
|
-
"@webiny/handler-aws": "6.0.0-beta.0",
|
|
36
|
-
"@webiny/handler-graphql": "6.0.0-beta.0",
|
|
37
|
-
"@webiny/plugins": "6.0.0-beta.0",
|
|
38
|
-
"@webiny/project-utils": "6.0.0-beta.0",
|
|
39
|
-
"graphql": "15.8.0",
|
|
40
|
-
"ttypescript": "1.5.15",
|
|
41
|
-
"typescript": "4.7.4"
|
|
23
|
+
"@webiny/handler-aws": "6.0.0-rc.1",
|
|
24
|
+
"@webiny/plugins": "6.0.0-rc.1",
|
|
25
|
+
"@webiny/project-utils": "6.0.0-rc.1",
|
|
26
|
+
"graphql": "16.12.0",
|
|
27
|
+
"typescript": "5.9.3",
|
|
28
|
+
"vitest": "4.0.18"
|
|
42
29
|
},
|
|
43
30
|
"dependencies": {
|
|
44
|
-
"@webiny/api": "6.0.0-
|
|
45
|
-
"@webiny/api-aco": "6.0.0-
|
|
46
|
-
"@webiny/api-
|
|
47
|
-
"@webiny/api-
|
|
48
|
-
"@webiny/api-
|
|
49
|
-
"@webiny/api-
|
|
50
|
-
"@webiny/api-
|
|
51
|
-
"@webiny/
|
|
52
|
-
"@webiny/
|
|
53
|
-
"@webiny/
|
|
31
|
+
"@webiny/api": "6.0.0-rc.1",
|
|
32
|
+
"@webiny/api-aco": "6.0.0-rc.1",
|
|
33
|
+
"@webiny/api-core": "6.0.0-rc.1",
|
|
34
|
+
"@webiny/api-file-manager": "6.0.0-rc.1",
|
|
35
|
+
"@webiny/api-headless-cms": "6.0.0-rc.1",
|
|
36
|
+
"@webiny/api-mailer": "6.0.0-rc.1",
|
|
37
|
+
"@webiny/api-website-builder": "6.0.0-rc.1",
|
|
38
|
+
"@webiny/aws-sdk": "6.0.0-rc.1",
|
|
39
|
+
"@webiny/build-tools": "6.0.0-rc.1",
|
|
40
|
+
"@webiny/common-audit-logs": "6.0.0-rc.1",
|
|
41
|
+
"@webiny/db-dynamodb": "6.0.0-rc.1",
|
|
42
|
+
"@webiny/error": "6.0.0-rc.1",
|
|
43
|
+
"@webiny/feature": "6.0.0-rc.1",
|
|
44
|
+
"@webiny/handler": "6.0.0-rc.1",
|
|
45
|
+
"@webiny/handler-db": "6.0.0-rc.1",
|
|
46
|
+
"@webiny/handler-graphql": "6.0.0-rc.1",
|
|
47
|
+
"@webiny/utils": "6.0.0-rc.1",
|
|
48
|
+
"@webiny/wcp": "6.0.0-rc.1",
|
|
49
|
+
"zod": "3.25.76"
|
|
54
50
|
},
|
|
55
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "36d702721ff9ed39fb21d6f5fe7922a2a8716e63"
|
|
56
52
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IStorageListParams } from "../storage/abstractions/Storage.js";
|
|
2
|
+
import type { IAccessPatternHandler, IAccessPatternHandlerHandleResult } from "../storage/abstractions/AccessPatternHandler.js";
|
|
3
|
+
import type { IAccessPattern } from "../storage/abstractions/AccessPattern.js";
|
|
4
|
+
export interface IAccessPatternHandlerParams {
|
|
5
|
+
patterns: IAccessPattern<unknown>[];
|
|
6
|
+
}
|
|
7
|
+
export declare class AccessPatternHandler implements IAccessPatternHandler {
|
|
8
|
+
private readonly patterns;
|
|
9
|
+
constructor(params: IAccessPatternHandlerParams);
|
|
10
|
+
handle(params: IStorageListParams): Promise<IAccessPatternHandlerHandleResult>;
|
|
11
|
+
getDefaultPattern(): IAccessPattern<unknown>;
|
|
12
|
+
listIndexPatterns(): IAccessPattern<unknown>[];
|
|
13
|
+
private find;
|
|
14
|
+
}
|