@webiny/api-audit-logs 0.0.0-unstable.df7a8bb475 → 0.0.0-unstable.e1999482d0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AuditLogsFeature.d.ts +8 -0
- package/AuditLogsFeature.js +32 -0
- package/AuditLogsFeature.js.map +1 -0
- package/abstractions.d.ts +14 -4
- package/abstractions.js +3 -3
- package/abstractions.js.map +1 -1
- package/config.js +2 -1
- package/config.js.map +1 -1
- package/domain/errors.d.ts +5 -0
- package/domain/errors.js +11 -0
- package/domain/errors.js.map +1 -0
- package/events/AuditLogAfterCreateEvent.d.ts +2 -2
- package/events/AuditLogAfterCreateEvent.js +9 -6
- package/events/AuditLogAfterCreateEvent.js.map +1 -1
- package/events/AuditLogAfterUpdateEvent.d.ts +2 -2
- package/events/AuditLogAfterUpdateEvent.js +9 -6
- package/events/AuditLogAfterUpdateEvent.js.map +1 -1
- package/events/AuditLogBeforeCreateEvent.d.ts +2 -2
- package/events/AuditLogBeforeCreateEvent.js +9 -6
- package/events/AuditLogBeforeCreateEvent.js.map +1 -1
- package/events/AuditLogBeforeUpdateEvent.d.ts +2 -2
- package/events/AuditLogBeforeUpdateEvent.js +9 -6
- package/events/AuditLogBeforeUpdateEvent.js.map +1 -1
- package/events/abstractions.d.ts +1 -6
- package/events/abstractions.js +5 -24
- package/events/abstractions.js.map +1 -1
- package/events/index.js +0 -2
- package/features/AuditLogPermissions/AuditLogPermissions.d.ts +15 -0
- package/features/AuditLogPermissions/AuditLogPermissions.js +24 -0
- package/features/AuditLogPermissions/AuditLogPermissions.js.map +1 -0
- package/features/AuditLogPermissions/abstractions.d.ts +11 -0
- package/features/AuditLogPermissions/abstractions.js +5 -0
- package/features/AuditLogPermissions/abstractions.js.map +1 -0
- package/features/AuditLogPermissions/feature.d.ts +4 -0
- package/features/AuditLogPermissions/feature.js +11 -0
- package/features/AuditLogPermissions/feature.js.map +1 -0
- package/features/CreateAuditLog/CreateAuditLogGateway.d.ts +12 -0
- package/features/CreateAuditLog/CreateAuditLogGateway.js +23 -0
- package/features/CreateAuditLog/CreateAuditLogGateway.js.map +1 -0
- package/features/CreateAuditLog/CreateAuditLogRepository.d.ts +14 -0
- package/features/CreateAuditLog/CreateAuditLogRepository.js +25 -0
- package/features/CreateAuditLog/CreateAuditLogRepository.js.map +1 -0
- package/features/CreateAuditLog/CreateAuditLogUseCase.d.ts +24 -0
- package/features/CreateAuditLog/CreateAuditLogUseCase.js +70 -0
- package/features/CreateAuditLog/CreateAuditLogUseCase.js.map +1 -0
- package/features/CreateAuditLog/abstractions.d.ts +42 -0
- package/features/CreateAuditLog/abstractions.js +7 -0
- package/features/CreateAuditLog/abstractions.js.map +1 -0
- package/features/CreateAuditLog/feature.d.ts +4 -0
- package/features/CreateAuditLog/feature.js +15 -0
- package/features/CreateAuditLog/feature.js.map +1 -0
- package/features/GetAuditLog/GetAuditLogGateway.d.ts +13 -0
- package/features/GetAuditLog/GetAuditLogGateway.js +21 -0
- package/features/GetAuditLog/GetAuditLogGateway.js.map +1 -0
- package/features/GetAuditLog/GetAuditLogRepository.d.ts +16 -0
- package/features/GetAuditLog/GetAuditLogRepository.js +32 -0
- package/features/GetAuditLog/GetAuditLogRepository.js.map +1 -0
- package/features/GetAuditLog/GetAuditLogUseCase.d.ts +15 -0
- package/features/GetAuditLog/GetAuditLogUseCase.js +32 -0
- package/features/GetAuditLog/GetAuditLogUseCase.js.map +1 -0
- package/features/GetAuditLog/abstractions.d.ts +42 -0
- package/features/GetAuditLog/abstractions.js +7 -0
- package/features/GetAuditLog/abstractions.js.map +1 -0
- package/features/GetAuditLog/feature.d.ts +4 -0
- package/features/GetAuditLog/feature.js +15 -0
- package/features/GetAuditLog/feature.js.map +1 -0
- package/features/ListAuditLogs/ListAuditLogsGateway.d.ts +12 -0
- package/features/ListAuditLogs/ListAuditLogsGateway.js +24 -0
- package/features/ListAuditLogs/ListAuditLogsGateway.js.map +1 -0
- package/features/ListAuditLogs/ListAuditLogsRepository.d.ts +17 -0
- package/features/ListAuditLogs/ListAuditLogsRepository.js +38 -0
- package/features/ListAuditLogs/ListAuditLogsRepository.js.map +1 -0
- package/features/ListAuditLogs/ListAuditLogsUseCase.d.ts +15 -0
- package/features/ListAuditLogs/ListAuditLogsUseCase.js +27 -0
- package/features/ListAuditLogs/ListAuditLogsUseCase.js.map +1 -0
- package/features/ListAuditLogs/abstractions.d.ts +55 -0
- package/features/ListAuditLogs/abstractions.js +7 -0
- package/features/ListAuditLogs/abstractions.js.map +1 -0
- package/features/ListAuditLogs/feature.d.ts +4 -0
- package/features/ListAuditLogs/feature.js +15 -0
- package/features/ListAuditLogs/feature.js.map +1 -0
- package/features/RecordAuditLog/RecordAuditLogUseCase.d.ts +30 -0
- package/features/RecordAuditLog/RecordAuditLogUseCase.js +104 -0
- package/features/RecordAuditLog/RecordAuditLogUseCase.js.map +1 -0
- package/features/RecordAuditLog/abstractions.d.ts +26 -0
- package/features/RecordAuditLog/abstractions.js +5 -0
- package/features/RecordAuditLog/abstractions.js.map +1 -0
- package/features/RecordAuditLog/feature.d.ts +4 -0
- package/features/RecordAuditLog/feature.js +11 -0
- package/features/RecordAuditLog/feature.js.map +1 -0
- package/features/UpdateAuditLog/UpdateAuditLogGateway.d.ts +12 -0
- package/features/UpdateAuditLog/UpdateAuditLogGateway.js +23 -0
- package/features/UpdateAuditLog/UpdateAuditLogGateway.js.map +1 -0
- package/features/UpdateAuditLog/UpdateAuditLogRepository.d.ts +14 -0
- package/features/UpdateAuditLog/UpdateAuditLogRepository.js +25 -0
- package/features/UpdateAuditLog/UpdateAuditLogRepository.js.map +1 -0
- package/features/UpdateAuditLog/UpdateAuditLogUseCase.d.ts +18 -0
- package/features/UpdateAuditLog/UpdateAuditLogUseCase.js +53 -0
- package/features/UpdateAuditLog/UpdateAuditLogUseCase.js.map +1 -0
- package/features/UpdateAuditLog/abstractions.d.ts +42 -0
- package/features/UpdateAuditLog/abstractions.js +7 -0
- package/features/UpdateAuditLog/abstractions.js.map +1 -0
- package/features/UpdateAuditLog/feature.d.ts +4 -0
- package/features/UpdateAuditLog/feature.js +15 -0
- package/features/UpdateAuditLog/feature.js.map +1 -0
- package/graphql/AuditLogsGraphQLSchema.d.ts +10 -0
- package/graphql/AuditLogsGraphQLSchema.js +139 -0
- package/graphql/AuditLogsGraphQLSchema.js.map +1 -0
- package/graphql/validation.d.ts +10 -53
- package/graphql/validation.js +26 -30
- package/graphql/validation.js.map +1 -1
- package/index.d.ts +2 -8
- package/index.js +1 -22
- package/package.json +34 -30
- package/storage/abstractions/Storage.js +0 -3
- package/storage/types.d.ts +0 -35
- package/storage/types.js +0 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +7 -7
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +38 -28
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +7 -7
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +54 -31
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +44 -35
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -1
- package/subscriptions/aco/index.d.ts +2 -2
- package/subscriptions/aco/index.js +5 -4
- package/subscriptions/aco/index.js.map +1 -1
- package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.d.ts +11 -0
- package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.js +45 -0
- package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.js.map +1 -0
- package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.d.ts +11 -0
- package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.js +42 -0
- package/subscriptions/ai/handlers/AuditLogAiBeforeGenerateTextHandler.js.map +1 -0
- package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.d.ts +11 -0
- package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.js +44 -0
- package/subscriptions/ai/handlers/AuditLogAiGenerateTextErrorHandler.js.map +1 -0
- package/subscriptions/ai/index.d.ts +2 -0
- package/subscriptions/ai/index.js +11 -0
- package/subscriptions/ai/index.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.d.ts +7 -7
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +28 -23
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +7 -7
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +28 -23
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +31 -27
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +31 -27
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/index.d.ts +2 -2
- package/subscriptions/fileManager/index.js +6 -8
- package/subscriptions/fileManager/index.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +37 -31
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +30 -29
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +30 -26
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +4 -4
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js +30 -26
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/index.d.ts +2 -2
- package/subscriptions/headlessCms/index.js +16 -20
- package/subscriptions/headlessCms/index.js.map +1 -1
- package/subscriptions/index.d.ts +2 -2
- package/subscriptions/index.js +10 -7
- package/subscriptions/index.js.map +1 -1
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +7 -7
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +33 -25
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -1
- package/subscriptions/mailer/index.d.ts +2 -2
- package/subscriptions/mailer/index.js +3 -3
- package/subscriptions/mailer/index.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +38 -40
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +38 -40
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +42 -45
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +28 -23
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +28 -23
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +31 -27
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +28 -23
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +28 -23
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +31 -27
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +28 -23
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +28 -23
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +31 -27
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/cleanupApiKey.js +10 -16
- package/subscriptions/security/handlers/cleanupApiKey.js.map +1 -1
- package/subscriptions/security/index.d.ts +2 -2
- package/subscriptions/security/index.js +14 -20
- package/subscriptions/security/index.js.map +1 -1
- package/subscriptions/websiteBuilder/globalComponents/SaveGlobalComponentWithAuditLog.d.ts +21 -0
- package/subscriptions/websiteBuilder/globalComponents/SaveGlobalComponentWithAuditLog.js +63 -0
- package/subscriptions/websiteBuilder/globalComponents/SaveGlobalComponentWithAuditLog.js.map +1 -0
- package/subscriptions/websiteBuilder/index.d.ts +2 -2
- package/subscriptions/websiteBuilder/index.js +16 -16
- package/subscriptions/websiteBuilder/index.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +27 -22
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +27 -22
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +27 -22
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +30 -26
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +27 -22
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +27 -22
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +27 -22
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +30 -26
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +27 -22
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +27 -22
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +27 -22
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +7 -7
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +30 -26
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -1
- package/types.d.ts +0 -23
- package/types.js +0 -3
- package/utils/expiresAt.js +14 -19
- package/utils/expiresAt.js.map +1 -1
- package/utils/getAuditObject.js +14 -15
- package/utils/getAuditObject.js.map +1 -1
- package/context/AuditLogsContextValue.d.ts +0 -10
- package/context/AuditLogsContextValue.js +0 -139
- package/context/AuditLogsContextValue.js.map +0 -1
- package/context/index.d.ts +0 -9
- package/context/index.js +0 -35
- package/context/index.js.map +0 -1
- package/events/index.js.map +0 -1
- package/graphql/schema.d.ts +0 -3
- package/graphql/schema.js +0 -126
- package/graphql/schema.js.map +0 -1
- package/index.js.map +0 -1
- package/storage/AccessPatternHandler.d.ts +0 -14
- package/storage/AccessPatternHandler.js +0 -60
- package/storage/AccessPatternHandler.js.map +0 -1
- package/storage/Converter.d.ts +0 -16
- package/storage/Converter.js +0 -52
- package/storage/Converter.js.map +0 -1
- package/storage/Storage.d.ts +0 -18
- package/storage/Storage.js +0 -89
- package/storage/Storage.js.map +0 -1
- package/storage/abstractions/AccessPattern.d.ts +0 -24
- package/storage/abstractions/AccessPattern.js +0 -3
- package/storage/abstractions/AccessPattern.js.map +0 -1
- package/storage/abstractions/AccessPatternHandler.d.ts +0 -13
- package/storage/abstractions/AccessPatternHandler.js +0 -3
- package/storage/abstractions/AccessPatternHandler.js.map +0 -1
- package/storage/abstractions/Converter.d.ts +0 -6
- package/storage/abstractions/Converter.js +0 -3
- package/storage/abstractions/Converter.js.map +0 -1
- package/storage/abstractions/Storage.js.map +0 -1
- package/storage/accessPatterns/AppAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppAccessPattern.js +0 -29
- package/storage/accessPatterns/AppAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppCreatedByAccessPattern.js +0 -32
- package/storage/accessPatterns/AppCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityAccessPattern.js +0 -29
- package/storage/accessPatterns/AppEntityAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityActionAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityActionAccessPattern.js +0 -29
- package/storage/accessPatterns/AppEntityActionAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js +0 -32
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js +0 -32
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/BaseAccessPattern.d.ts +0 -32
- package/storage/accessPatterns/BaseAccessPattern.js +0 -82
- package/storage/accessPatterns/BaseAccessPattern.js.map +0 -1
- package/storage/accessPatterns/CreatedByAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/CreatedByAccessPattern.js +0 -32
- package/storage/accessPatterns/CreatedByAccessPattern.js.map +0 -1
- package/storage/accessPatterns/CreatedOnAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/CreatedOnAccessPattern.js +0 -30
- package/storage/accessPatterns/CreatedOnAccessPattern.js.map +0 -1
- package/storage/accessPatterns/DefaultAccessPattern.d.ts +0 -15
- package/storage/accessPatterns/DefaultAccessPattern.js +0 -36
- package/storage/accessPatterns/DefaultAccessPattern.js.map +0 -1
- package/storage/accessPatterns/EntityIdAccessPattern.d.ts +0 -9
- package/storage/accessPatterns/EntityIdAccessPattern.js +0 -33
- package/storage/accessPatterns/EntityIdAccessPattern.js.map +0 -1
- package/storage/accessPatterns/index.d.ts +0 -6
- package/storage/accessPatterns/index.js +0 -47
- package/storage/accessPatterns/index.js.map +0 -1
- package/storage/cursorSchema.d.ts +0 -4
- package/storage/cursorSchema.js +0 -25
- package/storage/cursorSchema.js.map +0 -1
- package/storage/entity.d.ts +0 -36
- package/storage/entity.js +0 -127
- package/storage/entity.js.map +0 -1
- package/storage/results/ListErrorResult.d.ts +0 -10
- package/storage/results/ListErrorResult.js +0 -11
- package/storage/results/ListErrorResult.js.map +0 -1
- package/storage/results/ListSuccessResult.d.ts +0 -14
- package/storage/results/ListSuccessResult.js +0 -16
- package/storage/results/ListSuccessResult.js.map +0 -1
- package/storage/results/index.d.ts +0 -2
- package/storage/results/index.js +0 -4
- package/storage/results/index.js.map +0 -1
- package/storage/startKey.d.ts +0 -6
- package/storage/startKey.js +0 -9
- package/storage/startKey.js.map +0 -1
- package/storage/types.js.map +0 -1
- package/types.js.map +0 -1
- package/utils/getAuditConfig.d.ts +0 -4
- package/utils/getAuditConfig.js +0 -105
- package/utils/getAuditConfig.js.map +0 -1
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import { BaseAccessPattern } from "../../storage/accessPatterns/BaseAccessPattern.js";
|
|
3
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
4
|
-
import type { IStorageListByAppCreatedByParams } from "../../storage/abstractions/Storage.js";
|
|
5
|
-
export declare class AppCreatedByAccessPattern<T extends IStorageListByAppCreatedByParams = IStorageListByAppCreatedByParams> extends BaseAccessPattern<T> {
|
|
6
|
-
handles(): IAccessPatternHandles;
|
|
7
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
8
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
const createPartitionKey = params => {
|
|
3
|
-
return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#CREATEDBY#${params.createdBy}`;
|
|
4
|
-
};
|
|
5
|
-
export class AppCreatedByAccessPattern extends BaseAccessPattern {
|
|
6
|
-
handles() {
|
|
7
|
-
return {
|
|
8
|
-
mustInclude: ["app", "createdBy"],
|
|
9
|
-
mustNotInclude: ["action", "entityId", "entity"]
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
async list(params) {
|
|
13
|
-
const options = this.createOptions(params);
|
|
14
|
-
const result = await this.query({
|
|
15
|
-
partitionKey: createPartitionKey(params),
|
|
16
|
-
options
|
|
17
|
-
});
|
|
18
|
-
return this.populateResult(result);
|
|
19
|
-
}
|
|
20
|
-
createKeys(item) {
|
|
21
|
-
const time = item.createdOn.getTime();
|
|
22
|
-
return {
|
|
23
|
-
partitionKey: createPartitionKey({
|
|
24
|
-
...item,
|
|
25
|
-
createdBy: item.createdBy.id
|
|
26
|
-
}),
|
|
27
|
-
sortKey: time
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=AppCreatedByAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","app","createdBy","AppCreatedByAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","id","sortKey"],"sources":["AppCreatedByAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\nimport type { IStorageListByAppCreatedByParams } from \"~/storage/abstractions/Storage.js\";\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n app: string;\n createdBy: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#CREATEDBY#${params.createdBy}`;\n};\n\nexport class AppCreatedByAccessPattern<\n T extends IStorageListByAppCreatedByParams = IStorageListByAppCreatedByParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"app\", \"createdBy\"],\n mustNotInclude: [\"action\", \"entityId\", \"entity\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey({\n ...item,\n createdBy: item.createdBy.id\n }),\n sortKey: time\n };\n }\n}\n"],"mappings":"AACA,SAASA,iBAAiB;AAc1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,kBAAkBD,MAAM,CAACE,GAAG,cAAcF,MAAM,CAACG,SAAS,EAAE;AACzF,CAAC;AAED,OAAO,MAAMC,yBAAyB,SAE5BN,iBAAiB,CAAI;EACXO,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC;MACjCC,cAAc,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,QAAQ;IACnD,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACR,MAAS,EAAqC;IAC5D,MAAMS,OAAO,GAAG,IAAI,CAACC,aAAa,CAACV,MAAM,CAAC;IAE1C,MAAMW,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEd,kBAAkB,CAACC,MAAM,CAAC;MACxCS;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEd,kBAAkB,CAAC;QAC7B,GAAGiB,IAAI;QACPb,SAAS,EAAEa,IAAI,CAACb,SAAS,CAACiB;MAC9B,CAAC,CAAC;MACFC,OAAO,EAAEJ;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListByAppEntityParams } from "../../storage/abstractions/Storage.js";
|
|
3
|
-
import { BaseAccessPattern } from "../../storage/accessPatterns/BaseAccessPattern.js";
|
|
4
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
5
|
-
export declare class AppEntityAccessPattern<T extends IStorageListByAppEntityParams = IStorageListByAppEntityParams> extends BaseAccessPattern<T> {
|
|
6
|
-
handles(): IAccessPatternHandles;
|
|
7
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
8
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
9
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
const createPartitionKey = params => {
|
|
3
|
-
return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}`;
|
|
4
|
-
};
|
|
5
|
-
export class AppEntityAccessPattern extends BaseAccessPattern {
|
|
6
|
-
handles() {
|
|
7
|
-
return {
|
|
8
|
-
mustInclude: ["app", "entity"],
|
|
9
|
-
mustNotInclude: ["createdBy", "action", "entityId"]
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
async list(params) {
|
|
13
|
-
const options = this.createOptions(params);
|
|
14
|
-
const result = await this.query({
|
|
15
|
-
partitionKey: createPartitionKey(params),
|
|
16
|
-
options
|
|
17
|
-
});
|
|
18
|
-
return this.populateResult(result);
|
|
19
|
-
}
|
|
20
|
-
createKeys(item) {
|
|
21
|
-
const time = item.createdOn.getTime();
|
|
22
|
-
return {
|
|
23
|
-
partitionKey: createPartitionKey(item),
|
|
24
|
-
sortKey: time
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=AppEntityAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","app","entity","AppEntityAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","sortKey"],"sources":["AppEntityAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListByAppEntityParams } from \"~/storage/abstractions/Storage.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n app: string;\n entity: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}`;\n};\nexport class AppEntityAccessPattern<\n T extends IStorageListByAppEntityParams = IStorageListByAppEntityParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"app\", \"entity\"],\n mustNotInclude: [\"createdBy\", \"action\", \"entityId\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey(item),\n sortKey: time\n };\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB;AAa1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,kBAAkBD,MAAM,CAACE,GAAG,WAAWF,MAAM,CAACG,MAAM,EAAE;AACnF,CAAC;AACD,OAAO,MAAMC,sBAAsB,SAEzBN,iBAAiB,CAAI;EACXO,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;MAC9BC,cAAc,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU;IACtD,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACR,MAAS,EAAqC;IAC5D,MAAMS,OAAO,GAAG,IAAI,CAACC,aAAa,CAACV,MAAM,CAAC;IAE1C,MAAMW,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEd,kBAAkB,CAACC,MAAM,CAAC;MACxCS;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEd,kBAAkB,CAACiB,IAAI,CAAC;MACtCI,OAAO,EAAEH;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListByAppEntityActionParams } from "../../storage/abstractions/Storage.js";
|
|
3
|
-
import { BaseAccessPattern } from "../../storage/accessPatterns/BaseAccessPattern.js";
|
|
4
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
5
|
-
export declare class AppEntityActionAccessPattern<T extends IStorageListByAppEntityActionParams = IStorageListByAppEntityActionParams> extends BaseAccessPattern<T> {
|
|
6
|
-
handles(): IAccessPatternHandles;
|
|
7
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
8
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
9
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
const createPartitionKey = params => {
|
|
3
|
-
return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}#ACTION#${params.action}`;
|
|
4
|
-
};
|
|
5
|
-
export class AppEntityActionAccessPattern extends BaseAccessPattern {
|
|
6
|
-
handles() {
|
|
7
|
-
return {
|
|
8
|
-
mustInclude: ["app", "entity", "action"],
|
|
9
|
-
mustNotInclude: ["entityId", "createdBy"]
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
async list(params) {
|
|
13
|
-
const options = this.createOptions(params);
|
|
14
|
-
const result = await this.query({
|
|
15
|
-
partitionKey: createPartitionKey(params),
|
|
16
|
-
options
|
|
17
|
-
});
|
|
18
|
-
return this.populateResult(result);
|
|
19
|
-
}
|
|
20
|
-
createKeys(item) {
|
|
21
|
-
const time = item.createdOn.getTime();
|
|
22
|
-
return {
|
|
23
|
-
partitionKey: createPartitionKey(item),
|
|
24
|
-
sortKey: time
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=AppEntityActionAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","app","entity","action","AppEntityActionAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","sortKey"],"sources":["AppEntityActionAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListByAppEntityActionParams } from \"~/storage/abstractions/Storage.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n app: string;\n entity: string;\n action: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}#ACTION#${params.action}`;\n};\n\nexport class AppEntityActionAccessPattern<\n T extends IStorageListByAppEntityActionParams = IStorageListByAppEntityActionParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"app\", \"entity\", \"action\"],\n mustNotInclude: [\"entityId\", \"createdBy\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey(item),\n sortKey: time\n };\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB;AAc1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,kBAAkBD,MAAM,CAACE,GAAG,WAAWF,MAAM,CAACG,MAAM,WAAWH,MAAM,CAACI,MAAM,EAAE;AAC3G,CAAC;AAED,OAAO,MAAMC,4BAA4B,SAE/BP,iBAAiB,CAAI;EACXQ,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAC;MACxCC,cAAc,EAAE,CAAC,UAAU,EAAE,WAAW;IAC5C,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACT,MAAS,EAAqC;IAC5D,MAAMU,OAAO,GAAG,IAAI,CAACC,aAAa,CAACX,MAAM,CAAC;IAE1C,MAAMY,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEf,kBAAkB,CAACC,MAAM,CAAC;MACxCU;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEf,kBAAkB,CAACkB,IAAI,CAAC;MACtCI,OAAO,EAAEH;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListByAppEntityActionCreatedByParams } from "../../storage/abstractions/Storage.js";
|
|
3
|
-
import { BaseAccessPattern } from "../../storage/accessPatterns/BaseAccessPattern.js";
|
|
4
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
5
|
-
export declare class AppEntityActionCreatedByAccessPattern<T extends IStorageListByAppEntityActionCreatedByParams = IStorageListByAppEntityActionCreatedByParams> extends BaseAccessPattern<T> {
|
|
6
|
-
handles(): IAccessPatternHandles;
|
|
7
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
8
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
const createPartitionKey = params => {
|
|
3
|
-
return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}#ACTION#${params.action}#CREATEDBY#${params.createdBy}`;
|
|
4
|
-
};
|
|
5
|
-
export class AppEntityActionCreatedByAccessPattern extends BaseAccessPattern {
|
|
6
|
-
handles() {
|
|
7
|
-
return {
|
|
8
|
-
mustInclude: ["app", "action", "entity", "createdBy"],
|
|
9
|
-
mustNotInclude: ["entityId"]
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
async list(params) {
|
|
13
|
-
const options = this.createOptions(params);
|
|
14
|
-
const result = await this.query({
|
|
15
|
-
partitionKey: createPartitionKey(params),
|
|
16
|
-
options
|
|
17
|
-
});
|
|
18
|
-
return this.populateResult(result);
|
|
19
|
-
}
|
|
20
|
-
createKeys(item) {
|
|
21
|
-
const time = item.createdOn.getTime();
|
|
22
|
-
return {
|
|
23
|
-
partitionKey: createPartitionKey({
|
|
24
|
-
...item,
|
|
25
|
-
createdBy: item.createdBy.id
|
|
26
|
-
}),
|
|
27
|
-
sortKey: time
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=AppEntityActionCreatedByAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","app","entity","action","createdBy","AppEntityActionCreatedByAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","id","sortKey"],"sources":["AppEntityActionCreatedByAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListByAppEntityActionCreatedByParams } from \"~/storage/abstractions/Storage.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n app: string;\n action: string;\n entity: string;\n createdBy: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}#ACTION#${params.action}#CREATEDBY#${params.createdBy}`;\n};\n\nexport class AppEntityActionCreatedByAccessPattern<\n T extends\n IStorageListByAppEntityActionCreatedByParams = IStorageListByAppEntityActionCreatedByParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"app\", \"action\", \"entity\", \"createdBy\"],\n mustNotInclude: [\"entityId\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey({\n ...item,\n createdBy: item.createdBy.id\n }),\n sortKey: time\n };\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB;AAe1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,kBAAkBD,MAAM,CAACE,GAAG,WAAWF,MAAM,CAACG,MAAM,WAAWH,MAAM,CAACI,MAAM,cAAcJ,MAAM,CAACK,SAAS,EAAE;AACzI,CAAC;AAED,OAAO,MAAMC,qCAAqC,SAGxCR,iBAAiB,CAAI;EACXS,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC;MACrDC,cAAc,EAAE,CAAC,UAAU;IAC/B,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACV,MAAS,EAAqC;IAC5D,MAAMW,OAAO,GAAG,IAAI,CAACC,aAAa,CAACZ,MAAM,CAAC;IAE1C,MAAMa,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEhB,kBAAkB,CAACC,MAAM,CAAC;MACxCW;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEhB,kBAAkB,CAAC;QAC7B,GAAGmB,IAAI;QACPb,SAAS,EAAEa,IAAI,CAACb,SAAS,CAACiB;MAC9B,CAAC,CAAC;MACFC,OAAO,EAAEJ;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListByAppEntityCreatedByParams } from "../../storage/abstractions/Storage.js";
|
|
3
|
-
import { BaseAccessPattern } from "../../storage/accessPatterns/BaseAccessPattern.js";
|
|
4
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
5
|
-
export declare class AppEntityCreatedByAccessPattern<T extends IStorageListByAppEntityCreatedByParams = IStorageListByAppEntityCreatedByParams> extends BaseAccessPattern<T> {
|
|
6
|
-
handles(): IAccessPatternHandles;
|
|
7
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
8
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
const createPartitionKey = params => {
|
|
3
|
-
return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}#CREATEDBY#${params.createdBy}`;
|
|
4
|
-
};
|
|
5
|
-
export class AppEntityCreatedByAccessPattern extends BaseAccessPattern {
|
|
6
|
-
handles() {
|
|
7
|
-
return {
|
|
8
|
-
mustInclude: ["app", "createdBy", "entity"],
|
|
9
|
-
mustNotInclude: ["action", "entityId"]
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
async list(params) {
|
|
13
|
-
const options = this.createOptions(params);
|
|
14
|
-
const result = await this.query({
|
|
15
|
-
partitionKey: createPartitionKey(params),
|
|
16
|
-
options
|
|
17
|
-
});
|
|
18
|
-
return this.populateResult(result);
|
|
19
|
-
}
|
|
20
|
-
createKeys(item) {
|
|
21
|
-
const time = item.createdOn.getTime();
|
|
22
|
-
return {
|
|
23
|
-
partitionKey: createPartitionKey({
|
|
24
|
-
...item,
|
|
25
|
-
createdBy: item.createdBy.id
|
|
26
|
-
}),
|
|
27
|
-
sortKey: time
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=AppEntityCreatedByAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","app","entity","createdBy","AppEntityCreatedByAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","id","sortKey"],"sources":["AppEntityCreatedByAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListByAppEntityCreatedByParams } from \"~/storage/abstractions/Storage.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n app: string;\n createdBy: string;\n entity: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}#CREATEDBY#${params.createdBy}`;\n};\n\nexport class AppEntityCreatedByAccessPattern<\n T extends IStorageListByAppEntityCreatedByParams = IStorageListByAppEntityCreatedByParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"app\", \"createdBy\", \"entity\"],\n mustNotInclude: [\"action\", \"entityId\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey({\n ...item,\n createdBy: item.createdBy.id\n }),\n sortKey: time\n };\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB;AAc1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,kBAAkBD,MAAM,CAACE,GAAG,WAAWF,MAAM,CAACG,MAAM,cAAcH,MAAM,CAACI,SAAS,EAAE;AACjH,CAAC;AAED,OAAO,MAAMC,+BAA+B,SAElCP,iBAAiB,CAAI;EACXQ,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC;MAC3CC,cAAc,EAAE,CAAC,QAAQ,EAAE,UAAU;IACzC,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACT,MAAS,EAAqC;IAC5D,MAAMU,OAAO,GAAG,IAAI,CAACC,aAAa,CAACX,MAAM,CAAC;IAE1C,MAAMY,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEf,kBAAkB,CAACC,MAAM,CAAC;MACxCU;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEf,kBAAkB,CAAC;QAC7B,GAAGkB,IAAI;QACPb,SAAS,EAAEa,IAAI,CAACb,SAAS,CAACiB;MAC9B,CAAC,CAAC;MACFC,OAAO,EAAEJ;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog, IIndexStorageItem, IStorageItem } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListParams } from "../abstractions/Storage.js";
|
|
3
|
-
import type { IAccessPattern, IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../abstractions/AccessPattern.js";
|
|
4
|
-
import type { AuditLogsEntity } from "../../storage/entity.js";
|
|
5
|
-
import type { IEntityQueryAllParams, IEntityQueryPerPageResult } from "@webiny/db-dynamodb";
|
|
6
|
-
export interface ICreateOptionsParams {
|
|
7
|
-
limit?: number;
|
|
8
|
-
sort?: "ASC" | "DESC";
|
|
9
|
-
after?: string;
|
|
10
|
-
createdOn_gte?: Date;
|
|
11
|
-
createdOn_lte?: Date;
|
|
12
|
-
}
|
|
13
|
-
export interface IBaseAccessPatternParams {
|
|
14
|
-
index: string | undefined;
|
|
15
|
-
entity: AuditLogsEntity;
|
|
16
|
-
}
|
|
17
|
-
export interface IAccessPatternQueryParams {
|
|
18
|
-
partitionKey: string;
|
|
19
|
-
options: IEntityQueryAllParams["options"];
|
|
20
|
-
}
|
|
21
|
-
export declare abstract class BaseAccessPattern<T> implements IAccessPattern<T> {
|
|
22
|
-
readonly index: string | undefined;
|
|
23
|
-
protected readonly entity: AuditLogsEntity;
|
|
24
|
-
constructor(params: IBaseAccessPatternParams);
|
|
25
|
-
abstract handles(): IAccessPatternHandles;
|
|
26
|
-
canHandle(params: IStorageListParams): boolean;
|
|
27
|
-
protected query<T extends IStorageItem = IStorageItem>(params: IAccessPatternQueryParams): Promise<import("@webiny/db-dynamodb").IQueryPageResponse<T>>;
|
|
28
|
-
protected populateResult(input: Awaited<IEntityQueryPerPageResult<IIndexStorageItem>>): Promise<IEntityQueryPerPageResult<IStorageItem>>;
|
|
29
|
-
abstract list(params: T): Promise<IAccessPatternListResult>;
|
|
30
|
-
abstract createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
31
|
-
protected createOptions(params: ICreateOptionsParams): IEntityQueryAllParams["options"];
|
|
32
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { createStartKey } from "../startKey.js";
|
|
2
|
-
const toGteTime = date => {
|
|
3
|
-
if (!date) {
|
|
4
|
-
return 0;
|
|
5
|
-
}
|
|
6
|
-
return date.getTime();
|
|
7
|
-
};
|
|
8
|
-
const toLteTime = date => {
|
|
9
|
-
if (!date) {
|
|
10
|
-
return Date.now();
|
|
11
|
-
}
|
|
12
|
-
return date.getTime();
|
|
13
|
-
};
|
|
14
|
-
export class BaseAccessPattern {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
this.index = params.index;
|
|
17
|
-
this.entity = params.entity;
|
|
18
|
-
}
|
|
19
|
-
canHandle(params) {
|
|
20
|
-
const handles = this.handles();
|
|
21
|
-
for (const key of handles.mustInclude) {
|
|
22
|
-
if (!params[key]) {
|
|
23
|
-
return false;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
for (const key of handles.mustNotInclude) {
|
|
27
|
-
if (!!params[key]) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
if (!handles.shouldInclude?.length) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
for (const key of handles.shouldInclude) {
|
|
35
|
-
if (!!params[key]) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
async query(params) {
|
|
42
|
-
return this.entity.queryPerPage({
|
|
43
|
-
partitionKey: params.partitionKey,
|
|
44
|
-
options: params.options
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
async populateResult(input) {
|
|
48
|
-
const reader = this.entity.createEntityReader({
|
|
49
|
-
read: input.items.map(item => {
|
|
50
|
-
return {
|
|
51
|
-
PK: item.PK,
|
|
52
|
-
SK: item.SK
|
|
53
|
-
};
|
|
54
|
-
})
|
|
55
|
-
});
|
|
56
|
-
const result = await reader.execute();
|
|
57
|
-
return {
|
|
58
|
-
...input,
|
|
59
|
-
items: input.items.map(item => {
|
|
60
|
-
return result.find(i => {
|
|
61
|
-
return i.PK === item.PK && i.SK === item.SK;
|
|
62
|
-
});
|
|
63
|
-
}).filter(item => !!item)
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
createOptions(params) {
|
|
67
|
-
const options = {
|
|
68
|
-
limit: params.limit || 25,
|
|
69
|
-
startKey: createStartKey({
|
|
70
|
-
after: params.after
|
|
71
|
-
}),
|
|
72
|
-
reverse: params.sort === "DESC",
|
|
73
|
-
index: this.index
|
|
74
|
-
};
|
|
75
|
-
if (params.createdOn_lte || params.createdOn_gte) {
|
|
76
|
-
options.between = [toGteTime(params.createdOn_gte), toLteTime(params.createdOn_lte)];
|
|
77
|
-
}
|
|
78
|
-
return options;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
//# sourceMappingURL=BaseAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createStartKey","toGteTime","date","getTime","toLteTime","Date","now","BaseAccessPattern","constructor","params","index","entity","canHandle","handles","key","mustInclude","mustNotInclude","shouldInclude","length","query","queryPerPage","partitionKey","options","populateResult","input","reader","createEntityReader","read","items","map","item","PK","SK","result","execute","find","i","filter","createOptions","limit","startKey","after","reverse","sort","createdOn_lte","createdOn_gte","between"],"sources":["BaseAccessPattern.ts"],"sourcesContent":["import type { IAuditLog, IIndexStorageItem, IStorageItem } from \"~/storage/types.js\";\nimport { createStartKey } from \"~/storage/startKey.js\";\nimport type { IStorageListParams } from \"../abstractions/Storage.js\";\nimport type {\n IAccessPattern,\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"../abstractions/AccessPattern.js\";\nimport type { AuditLogsEntity } from \"~/storage/entity.js\";\nimport type { IEntityQueryAllParams, IEntityQueryPerPageResult } from \"@webiny/db-dynamodb\";\n\nconst toGteTime = (date?: Date): number => {\n if (!date) {\n return 0;\n }\n return date.getTime();\n};\nconst toLteTime = (date?: Date): number => {\n if (!date) {\n return Date.now();\n }\n return date.getTime();\n};\n\nexport interface ICreateOptionsParams {\n limit?: number;\n sort?: \"ASC\" | \"DESC\";\n after?: string;\n createdOn_gte?: Date;\n createdOn_lte?: Date;\n}\n\nexport interface IBaseAccessPatternParams {\n index: string | undefined;\n entity: AuditLogsEntity;\n}\n\nexport interface IAccessPatternQueryParams {\n partitionKey: string;\n options: IEntityQueryAllParams[\"options\"];\n}\n\nexport abstract class BaseAccessPattern<T> implements IAccessPattern<T> {\n public readonly index;\n protected readonly entity;\n\n public constructor(params: IBaseAccessPatternParams) {\n this.index = params.index;\n this.entity = params.entity;\n }\n\n public abstract handles(): IAccessPatternHandles;\n\n public canHandle(params: IStorageListParams): boolean {\n const handles = this.handles();\n for (const key of handles.mustInclude) {\n if (!params[key]) {\n return false;\n }\n }\n for (const key of handles.mustNotInclude) {\n if (!!params[key]) {\n return false;\n }\n }\n if (!handles.shouldInclude?.length) {\n return true;\n }\n\n for (const key of handles.shouldInclude) {\n if (!!params[key]) {\n return true;\n }\n }\n return false;\n }\n\n protected async query<T extends IStorageItem = IStorageItem>(\n params: IAccessPatternQueryParams\n ) {\n return this.entity.queryPerPage<T>({\n partitionKey: params.partitionKey,\n options: params.options\n });\n }\n\n protected async populateResult(\n input: Awaited<IEntityQueryPerPageResult<IIndexStorageItem>>\n ): Promise<IEntityQueryPerPageResult<IStorageItem>> {\n const reader = this.entity.createEntityReader({\n read: input.items.map(item => {\n return {\n PK: item.PK,\n SK: item.SK\n };\n })\n });\n const result = await reader.execute();\n\n return {\n ...input,\n items: input.items\n .map(item => {\n return result.find(i => {\n return i.PK === item.PK && i.SK === item.SK;\n });\n })\n .filter((item): item is IStorageItem => !!item)\n };\n }\n\n public abstract list(params: T): Promise<IAccessPatternListResult>;\n public abstract createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;\n\n protected createOptions(params: ICreateOptionsParams): IEntityQueryAllParams[\"options\"] {\n const options: IEntityQueryAllParams[\"options\"] = {\n limit: params.limit || 25,\n startKey: createStartKey({\n after: params.after\n }),\n reverse: params.sort === \"DESC\",\n index: this.index\n };\n\n if (params.createdOn_lte || params.createdOn_gte) {\n options.between = [toGteTime(params.createdOn_gte), toLteTime(params.createdOn_lte)];\n }\n\n return options;\n }\n}\n"],"mappings":"AACA,SAASA,cAAc;AAWvB,MAAMC,SAAS,GAAIC,IAAW,IAAa;EACvC,IAAI,CAACA,IAAI,EAAE;IACP,OAAO,CAAC;EACZ;EACA,OAAOA,IAAI,CAACC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,MAAMC,SAAS,GAAIF,IAAW,IAAa;EACvC,IAAI,CAACA,IAAI,EAAE;IACP,OAAOG,IAAI,CAACC,GAAG,CAAC,CAAC;EACrB;EACA,OAAOJ,IAAI,CAACC,OAAO,CAAC,CAAC;AACzB,CAAC;AAoBD,OAAO,MAAeI,iBAAiB,CAAiC;EAI7DC,WAAWA,CAACC,MAAgC,EAAE;IACjD,IAAI,CAACC,KAAK,GAAGD,MAAM,CAACC,KAAK;IACzB,IAAI,CAACC,MAAM,GAAGF,MAAM,CAACE,MAAM;EAC/B;EAIOC,SAASA,CAACH,MAA0B,EAAW;IAClD,MAAMI,OAAO,GAAG,IAAI,CAACA,OAAO,CAAC,CAAC;IAC9B,KAAK,MAAMC,GAAG,IAAID,OAAO,CAACE,WAAW,EAAE;MACnC,IAAI,CAACN,MAAM,CAACK,GAAG,CAAC,EAAE;QACd,OAAO,KAAK;MAChB;IACJ;IACA,KAAK,MAAMA,GAAG,IAAID,OAAO,CAACG,cAAc,EAAE;MACtC,IAAI,CAAC,CAACP,MAAM,CAACK,GAAG,CAAC,EAAE;QACf,OAAO,KAAK;MAChB;IACJ;IACA,IAAI,CAACD,OAAO,CAACI,aAAa,EAAEC,MAAM,EAAE;MAChC,OAAO,IAAI;IACf;IAEA,KAAK,MAAMJ,GAAG,IAAID,OAAO,CAACI,aAAa,EAAE;MACrC,IAAI,CAAC,CAACR,MAAM,CAACK,GAAG,CAAC,EAAE;QACf,OAAO,IAAI;MACf;IACJ;IACA,OAAO,KAAK;EAChB;EAEA,MAAgBK,KAAKA,CACjBV,MAAiC,EACnC;IACE,OAAO,IAAI,CAACE,MAAM,CAACS,YAAY,CAAI;MAC/BC,YAAY,EAAEZ,MAAM,CAACY,YAAY;MACjCC,OAAO,EAAEb,MAAM,CAACa;IACpB,CAAC,CAAC;EACN;EAEA,MAAgBC,cAAcA,CAC1BC,KAA4D,EACZ;IAChD,MAAMC,MAAM,GAAG,IAAI,CAACd,MAAM,CAACe,kBAAkB,CAAC;MAC1CC,IAAI,EAAEH,KAAK,CAACI,KAAK,CAACC,GAAG,CAACC,IAAI,IAAI;QAC1B,OAAO;UACHC,EAAE,EAAED,IAAI,CAACC,EAAE;UACXC,EAAE,EAAEF,IAAI,CAACE;QACb,CAAC;MACL,CAAC;IACL,CAAC,CAAC;IACF,MAAMC,MAAM,GAAG,MAAMR,MAAM,CAACS,OAAO,CAAC,CAAC;IAErC,OAAO;MACH,GAAGV,KAAK;MACRI,KAAK,EAAEJ,KAAK,CAACI,KAAK,CACbC,GAAG,CAACC,IAAI,IAAI;QACT,OAAOG,MAAM,CAACE,IAAI,CAACC,CAAC,IAAI;UACpB,OAAOA,CAAC,CAACL,EAAE,KAAKD,IAAI,CAACC,EAAE,IAAIK,CAAC,CAACJ,EAAE,KAAKF,IAAI,CAACE,EAAE;QAC/C,CAAC,CAAC;MACN,CAAC,CAAC,CACDK,MAAM,CAAEP,IAAI,IAA2B,CAAC,CAACA,IAAI;IACtD,CAAC;EACL;EAKUQ,aAAaA,CAAC7B,MAA4B,EAAoC;IACpF,MAAMa,OAAyC,GAAG;MAC9CiB,KAAK,EAAE9B,MAAM,CAAC8B,KAAK,IAAI,EAAE;MACzBC,QAAQ,EAAExC,cAAc,CAAC;QACrByC,KAAK,EAAEhC,MAAM,CAACgC;MAClB,CAAC,CAAC;MACFC,OAAO,EAAEjC,MAAM,CAACkC,IAAI,KAAK,MAAM;MAC/BjC,KAAK,EAAE,IAAI,CAACA;IAChB,CAAC;IAED,IAAID,MAAM,CAACmC,aAAa,IAAInC,MAAM,CAACoC,aAAa,EAAE;MAC9CvB,OAAO,CAACwB,OAAO,GAAG,CAAC7C,SAAS,CAACQ,MAAM,CAACoC,aAAa,CAAC,EAAEzC,SAAS,CAACK,MAAM,CAACmC,aAAa,CAAC,CAAC;IACxF;IAEA,OAAOtB,OAAO;EAClB;AACJ","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import { BaseAccessPattern } from "../../storage/accessPatterns/BaseAccessPattern.js";
|
|
3
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
4
|
-
import type { IStorageListByCreatedByParams } from "../../storage/abstractions/Storage.js";
|
|
5
|
-
export declare class CreatedByAccessPattern<T extends IStorageListByCreatedByParams = IStorageListByCreatedByParams> extends BaseAccessPattern<T> {
|
|
6
|
-
handles(): IAccessPatternHandles;
|
|
7
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
8
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
9
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
const createPartitionKey = params => {
|
|
3
|
-
return `T#${params.tenant}#AUDIT_LOG#CREATEDBY#${params.createdBy}`;
|
|
4
|
-
};
|
|
5
|
-
export class CreatedByAccessPattern extends BaseAccessPattern {
|
|
6
|
-
handles() {
|
|
7
|
-
return {
|
|
8
|
-
mustInclude: ["createdBy"],
|
|
9
|
-
mustNotInclude: ["app", "action", "entityId", "entity"]
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
async list(params) {
|
|
13
|
-
const options = this.createOptions(params);
|
|
14
|
-
const result = await this.query({
|
|
15
|
-
partitionKey: createPartitionKey(params),
|
|
16
|
-
options
|
|
17
|
-
});
|
|
18
|
-
return this.populateResult(result);
|
|
19
|
-
}
|
|
20
|
-
createKeys(item) {
|
|
21
|
-
const time = item.createdOn.getTime();
|
|
22
|
-
return {
|
|
23
|
-
partitionKey: createPartitionKey({
|
|
24
|
-
...item,
|
|
25
|
-
createdBy: item.createdBy.id
|
|
26
|
-
}),
|
|
27
|
-
sortKey: time
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
//# sourceMappingURL=CreatedByAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","createdBy","CreatedByAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","id","sortKey"],"sources":["CreatedByAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\nimport type { IStorageListByCreatedByParams } from \"~/storage/abstractions/Storage.js\";\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n createdBy: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#CREATEDBY#${params.createdBy}`;\n};\n\nexport class CreatedByAccessPattern<\n T extends IStorageListByCreatedByParams = IStorageListByCreatedByParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"createdBy\"],\n mustNotInclude: [\"app\", \"action\", \"entityId\", \"entity\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey({\n ...item,\n createdBy: item.createdBy.id\n }),\n sortKey: time\n };\n }\n}\n"],"mappings":"AACA,SAASA,iBAAiB;AAa1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,wBAAwBD,MAAM,CAACE,SAAS,EAAE;AACvE,CAAC;AAED,OAAO,MAAMC,sBAAsB,SAEzBL,iBAAiB,CAAI;EACXM,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,WAAW,CAAC;MAC1BC,cAAc,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ;IAC1D,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACP,MAAS,EAAqC;IAC5D,MAAMQ,OAAO,GAAG,IAAI,CAACC,aAAa,CAACT,MAAM,CAAC;IAE1C,MAAMU,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEb,kBAAkB,CAACC,MAAM,CAAC;MACxCQ;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEb,kBAAkB,CAAC;QAC7B,GAAGgB,IAAI;QACPb,SAAS,EAAEa,IAAI,CAACb,SAAS,CAACiB;MAC9B,CAAC,CAAC;MACFC,OAAO,EAAEJ;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import { BaseAccessPattern } from "../../storage/accessPatterns/BaseAccessPattern.js";
|
|
3
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
4
|
-
import type { IStorageListByCreatedOnParams } from "../../storage/abstractions/Storage.js";
|
|
5
|
-
export declare class CreatedOnAccessPattern<T extends IStorageListByCreatedOnParams = IStorageListByCreatedOnParams> extends BaseAccessPattern<T> {
|
|
6
|
-
handles(): IAccessPatternHandles;
|
|
7
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
8
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
9
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
const createPartitionKey = params => {
|
|
3
|
-
return `T#${params.tenant}#AUDIT_LOG#CREATED_ON`;
|
|
4
|
-
};
|
|
5
|
-
export class CreatedOnAccessPattern extends BaseAccessPattern {
|
|
6
|
-
handles() {
|
|
7
|
-
return {
|
|
8
|
-
shouldInclude: ["createdOn_gte", "createdOn_lte"],
|
|
9
|
-
mustInclude: [],
|
|
10
|
-
mustNotInclude: ["app", "createdBy", "action", "entityId", "entity"]
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
async list(params) {
|
|
14
|
-
const options = this.createOptions(params);
|
|
15
|
-
const result = await this.query({
|
|
16
|
-
partitionKey: createPartitionKey(params),
|
|
17
|
-
options
|
|
18
|
-
});
|
|
19
|
-
return this.populateResult(result);
|
|
20
|
-
}
|
|
21
|
-
createKeys(item) {
|
|
22
|
-
const time = item.createdOn.getTime();
|
|
23
|
-
return {
|
|
24
|
-
partitionKey: createPartitionKey(item),
|
|
25
|
-
sortKey: time
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
//# sourceMappingURL=CreatedOnAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","CreatedOnAccessPattern","handles","shouldInclude","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","sortKey"],"sources":["CreatedOnAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\nimport type { IStorageListByCreatedOnParams } from \"~/storage/abstractions/Storage.js\";\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#CREATED_ON`;\n};\n\nexport class CreatedOnAccessPattern<\n T extends IStorageListByCreatedOnParams = IStorageListByCreatedOnParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n shouldInclude: [\"createdOn_gte\", \"createdOn_lte\"],\n mustInclude: [],\n mustNotInclude: [\"app\", \"createdBy\", \"action\", \"entityId\", \"entity\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey(item),\n sortKey: time\n };\n }\n}\n"],"mappings":"AACA,SAASA,iBAAiB;AAY1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,uBAAuB;AACpD,CAAC;AAED,OAAO,MAAMC,sBAAsB,SAEzBJ,iBAAiB,CAAI;EACXK,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,aAAa,EAAE,CAAC,eAAe,EAAE,eAAe,CAAC;MACjDC,WAAW,EAAE,EAAE;MACfC,cAAc,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ;IACvE,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACP,MAAS,EAAqC;IAC5D,MAAMQ,OAAO,GAAG,IAAI,CAACC,aAAa,CAACT,MAAM,CAAC;IAE1C,MAAMU,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEb,kBAAkB,CAACC,MAAM,CAAC;MACxCQ;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEb,kBAAkB,CAACgB,IAAI,CAAC;MACtCI,OAAO,EAAEH;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListDefaultParams } from "../../storage/abstractions/Storage.js";
|
|
3
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
4
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
5
|
-
import type { AuditLogsEntity } from "../../storage/entity.js";
|
|
6
|
-
export interface IDefaultAccessPatternParams {
|
|
7
|
-
entity: AuditLogsEntity;
|
|
8
|
-
}
|
|
9
|
-
export declare class DefaultAccessPattern<T extends IStorageListDefaultParams = IStorageListDefaultParams> extends BaseAccessPattern<T> {
|
|
10
|
-
constructor(params: IDefaultAccessPatternParams);
|
|
11
|
-
handles(): IAccessPatternHandles;
|
|
12
|
-
canHandle(): boolean;
|
|
13
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
14
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
15
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
const createPartitionKey = params => {
|
|
3
|
-
return `T#${params.tenant}#AUDIT_LOG`;
|
|
4
|
-
};
|
|
5
|
-
export class DefaultAccessPattern extends BaseAccessPattern {
|
|
6
|
-
constructor(params) {
|
|
7
|
-
super({
|
|
8
|
-
index: undefined,
|
|
9
|
-
entity: params.entity
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
handles() {
|
|
13
|
-
return {
|
|
14
|
-
mustInclude: [],
|
|
15
|
-
mustNotInclude: []
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
canHandle() {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
async list(params) {
|
|
22
|
-
const options = this.createOptions(params);
|
|
23
|
-
return await this.query({
|
|
24
|
-
partitionKey: createPartitionKey(params),
|
|
25
|
-
options
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
createKeys(item) {
|
|
29
|
-
return {
|
|
30
|
-
partitionKey: createPartitionKey(item),
|
|
31
|
-
sortKey: `${item.id}`
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
//# sourceMappingURL=DefaultAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","DefaultAccessPattern","constructor","index","undefined","entity","handles","mustInclude","mustNotInclude","canHandle","list","options","createOptions","query","partitionKey","createKeys","item","sortKey","id"],"sources":["DefaultAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListDefaultParams } from \"~/storage/abstractions/Storage.js\";\nimport { BaseAccessPattern } from \"./BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\nimport type { AuditLogsEntity } from \"~/storage/entity.js\";\n\nexport interface IDefaultAccessPatternParams {\n entity: AuditLogsEntity;\n}\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG`;\n};\n\nexport class DefaultAccessPattern<\n T extends IStorageListDefaultParams = IStorageListDefaultParams\n> extends BaseAccessPattern<T> {\n public constructor(params: IDefaultAccessPatternParams) {\n super({\n index: undefined,\n entity: params.entity\n });\n }\n\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [],\n mustNotInclude: []\n };\n }\n\n public override canHandle(): boolean {\n return false;\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n return await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n return {\n partitionKey: createPartitionKey(item),\n sortKey: `${item.id}`\n };\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB;AAgB1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,YAAY;AACzC,CAAC;AAED,OAAO,MAAMC,oBAAoB,SAEvBJ,iBAAiB,CAAI;EACpBK,WAAWA,CAACH,MAAmC,EAAE;IACpD,KAAK,CAAC;MACFI,KAAK,EAAEC,SAAS;MAChBC,MAAM,EAAEN,MAAM,CAACM;IACnB,CAAC,CAAC;EACN;EAEgBC,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,EAAE;MACfC,cAAc,EAAE;IACpB,CAAC;EACL;EAEgBC,SAASA,CAAA,EAAY;IACjC,OAAO,KAAK;EAChB;EAEA,MAAaC,IAAIA,CAACX,MAAS,EAAqC;IAC5D,MAAMY,OAAO,GAAG,IAAI,CAACC,aAAa,CAACb,MAAM,CAAC;IAE1C,OAAO,MAAM,IAAI,CAACc,KAAK,CAAC;MACpBC,YAAY,EAAEhB,kBAAkB,CAACC,MAAM,CAAC;MACxCY;IACJ,CAAC,CAAC;EACN;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,OAAO;MACHF,YAAY,EAAEhB,kBAAkB,CAACkB,IAAI,CAAC;MACtCC,OAAO,EAAE,GAAGD,IAAI,CAACE,EAAE;IACvB,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListByEntityIdParams } from "../../storage/abstractions/Storage.js";
|
|
3
|
-
import { BaseAccessPattern } from "../../storage/accessPatterns/BaseAccessPattern.js";
|
|
4
|
-
import type { IAccessPatternCreateKeysResult, IAccessPatternHandles, IAccessPatternListResult } from "../../storage/abstractions/AccessPattern.js";
|
|
5
|
-
export declare class EntityIdGlobalAccessPattern<T extends IStorageListByEntityIdParams = IStorageListByEntityIdParams> extends BaseAccessPattern<T> {
|
|
6
|
-
handles(): IAccessPatternHandles;
|
|
7
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
8
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
9
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BaseAccessPattern } from "./BaseAccessPattern.js";
|
|
2
|
-
import { parseIdentifier } from "@webiny/utils";
|
|
3
|
-
const createPartitionKey = params => {
|
|
4
|
-
const {
|
|
5
|
-
id
|
|
6
|
-
} = parseIdentifier(params.entityId);
|
|
7
|
-
return `T#${params.tenant}#AUDIT_LOG#ENTITY_ID#${id}`;
|
|
8
|
-
};
|
|
9
|
-
export class EntityIdGlobalAccessPattern extends BaseAccessPattern {
|
|
10
|
-
handles() {
|
|
11
|
-
return {
|
|
12
|
-
mustInclude: ["entityId"],
|
|
13
|
-
mustNotInclude: ["entity", "createdBy", "action"]
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
async list(params) {
|
|
17
|
-
const options = this.createOptions(params);
|
|
18
|
-
const result = await this.query({
|
|
19
|
-
partitionKey: createPartitionKey(params),
|
|
20
|
-
options
|
|
21
|
-
});
|
|
22
|
-
return this.populateResult(result);
|
|
23
|
-
}
|
|
24
|
-
createKeys(item) {
|
|
25
|
-
const time = item.createdOn.getTime();
|
|
26
|
-
return {
|
|
27
|
-
partitionKey: createPartitionKey(item),
|
|
28
|
-
sortKey: time
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=EntityIdAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","parseIdentifier","createPartitionKey","params","id","entityId","tenant","EntityIdGlobalAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","sortKey"],"sources":["EntityIdAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListByEntityIdParams } from \"~/storage/abstractions/Storage.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\nimport { parseIdentifier } from \"@webiny/utils\";\n\ninterface ICreatePartitionKeyParams {\n entityId: string;\n tenant: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n const { id } = parseIdentifier(params.entityId);\n return `T#${params.tenant}#AUDIT_LOG#ENTITY_ID#${id}`;\n};\n\nexport class EntityIdGlobalAccessPattern<\n T extends IStorageListByEntityIdParams = IStorageListByEntityIdParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"entityId\"],\n mustNotInclude: [\"entity\", \"createdBy\", \"action\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey(item),\n sortKey: time\n };\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB;AAM1B,SAASC,eAAe,QAAQ,eAAe;AAO/C,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,MAAM;IAAEC;EAAG,CAAC,GAAGH,eAAe,CAACE,MAAM,CAACE,QAAQ,CAAC;EAC/C,OAAO,KAAKF,MAAM,CAACG,MAAM,wBAAwBF,EAAE,EAAE;AACzD,CAAC;AAED,OAAO,MAAMG,2BAA2B,SAE9BP,iBAAiB,CAAI;EACXQ,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,UAAU,CAAC;MACzBC,cAAc,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,QAAQ;IACpD,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACR,MAAS,EAAqC;IAC5D,MAAMS,OAAO,GAAG,IAAI,CAACC,aAAa,CAACV,MAAM,CAAC;IAE1C,MAAMW,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEd,kBAAkB,CAACC,MAAM,CAAC;MACxCS;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEd,kBAAkB,CAACiB,IAAI,CAAC;MACtCI,OAAO,EAAEH;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IAccessPattern } from "../abstractions/AccessPattern.js";
|
|
2
|
-
import type { AuditLogsEntity } from "../../storage/entity.js";
|
|
3
|
-
export interface ICreateAccessPatternsParams {
|
|
4
|
-
entity: AuditLogsEntity;
|
|
5
|
-
}
|
|
6
|
-
export declare const createAccessPatterns: (params: ICreateAccessPatternsParams) => IAccessPattern<unknown>[];
|