@webiny/api-audit-logs 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e
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.js +8 -5
- package/events/AuditLogAfterCreateEvent.js.map +1 -1
- package/events/AuditLogAfterUpdateEvent.js +8 -5
- package/events/AuditLogAfterUpdateEvent.js.map +1 -1
- package/events/AuditLogBeforeCreateEvent.js +8 -5
- package/events/AuditLogBeforeCreateEvent.js.map +1 -1
- package/events/AuditLogBeforeUpdateEvent.js +8 -5
- package/events/AuditLogBeforeUpdateEvent.js.map +1 -1
- package/events/abstractions.d.ts +0 -5
- 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 +29 -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 +108 -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.js +26 -30
- package/graphql/validation.js.map +1 -1
- package/index.d.ts +2 -8
- package/index.js +1 -22
- package/package.json +28 -28
- 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 +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +37 -27
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +45 -30
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +43 -34
- 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 +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +27 -22
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +27 -22
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +30 -26
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +30 -26
- 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 +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +37 -31
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +30 -29
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +27 -25
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +30 -26
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +3 -3
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +27 -22
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +3 -3
- 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 +3 -3
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +29 -24
- 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 +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +37 -39
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +37 -39
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +41 -44
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +30 -26
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +30 -26
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +27 -22
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +30 -26
- 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/index.d.ts +2 -2
- package/subscriptions/websiteBuilder/index.js +14 -16
- package/subscriptions/websiteBuilder/index.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +29 -25
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +26 -21
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +29 -25
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +26 -21
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +26 -21
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +26 -21
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +29 -25
- 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 -37
- 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 -83
- 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 +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 // @ts-expect-error\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":"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","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>[];
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { DefaultAccessPattern } from "./DefaultAccessPattern.js";
|
|
2
|
-
import { AppAccessPattern } from "./AppAccessPattern.js";
|
|
3
|
-
import { AppCreatedByAccessPattern } from "./AppCreatedByAccessPattern.js";
|
|
4
|
-
import { AppEntityActionCreatedByAccessPattern } from "./AppEntityActionCreatedByAccessPattern.js";
|
|
5
|
-
import { AppEntityCreatedByAccessPattern } from "./AppEntityCreatedByAccessPattern.js";
|
|
6
|
-
import { AppEntityAccessPattern } from "./AppEntityAccessPattern.js";
|
|
7
|
-
import { AppEntityActionAccessPattern } from "./AppEntityActionAccessPattern.js";
|
|
8
|
-
import { EntityIdGlobalAccessPattern } from "./EntityIdAccessPattern.js";
|
|
9
|
-
import { CreatedByAccessPattern } from "./CreatedByAccessPattern.js";
|
|
10
|
-
import { CreatedOnAccessPattern } from "./CreatedOnAccessPattern.js";
|
|
11
|
-
export const createAccessPatterns = params => {
|
|
12
|
-
const {
|
|
13
|
-
entity
|
|
14
|
-
} = params;
|
|
15
|
-
return [new DefaultAccessPattern({
|
|
16
|
-
entity
|
|
17
|
-
}), new AppAccessPattern({
|
|
18
|
-
entity,
|
|
19
|
-
index: "GSI1"
|
|
20
|
-
}), new AppCreatedByAccessPattern({
|
|
21
|
-
entity,
|
|
22
|
-
index: "GSI2"
|
|
23
|
-
}), new AppEntityAccessPattern({
|
|
24
|
-
entity,
|
|
25
|
-
index: "GSI3"
|
|
26
|
-
}), new EntityIdGlobalAccessPattern({
|
|
27
|
-
entity,
|
|
28
|
-
index: "GSI4"
|
|
29
|
-
}), new AppEntityActionCreatedByAccessPattern({
|
|
30
|
-
entity,
|
|
31
|
-
index: "GSI5"
|
|
32
|
-
}), new AppEntityActionAccessPattern({
|
|
33
|
-
entity,
|
|
34
|
-
index: "GSI6"
|
|
35
|
-
}), new AppEntityCreatedByAccessPattern({
|
|
36
|
-
entity,
|
|
37
|
-
index: "GSI7"
|
|
38
|
-
}), new CreatedByAccessPattern({
|
|
39
|
-
entity,
|
|
40
|
-
index: "GSI8"
|
|
41
|
-
}), new CreatedOnAccessPattern({
|
|
42
|
-
entity,
|
|
43
|
-
index: "GSI9"
|
|
44
|
-
})];
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["DefaultAccessPattern","AppAccessPattern","AppCreatedByAccessPattern","AppEntityActionCreatedByAccessPattern","AppEntityCreatedByAccessPattern","AppEntityAccessPattern","AppEntityActionAccessPattern","EntityIdGlobalAccessPattern","CreatedByAccessPattern","CreatedOnAccessPattern","createAccessPatterns","params","entity","index"],"sources":["index.ts"],"sourcesContent":["import type { IAccessPattern } from \"../abstractions/AccessPattern.js\";\nimport { DefaultAccessPattern } from \"~/storage/accessPatterns/DefaultAccessPattern.js\";\nimport { AppAccessPattern } from \"~/storage/accessPatterns/AppAccessPattern.js\";\nimport { AppCreatedByAccessPattern } from \"~/storage/accessPatterns/AppCreatedByAccessPattern.js\";\nimport { AppEntityActionCreatedByAccessPattern } from \"~/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js\";\nimport { AppEntityCreatedByAccessPattern } from \"~/storage/accessPatterns/AppEntityCreatedByAccessPattern.js\";\nimport { AppEntityAccessPattern } from \"~/storage/accessPatterns/AppEntityAccessPattern.js\";\nimport { AppEntityActionAccessPattern } from \"~/storage/accessPatterns/AppEntityActionAccessPattern.js\";\nimport { EntityIdGlobalAccessPattern } from \"~/storage/accessPatterns/EntityIdAccessPattern.js\";\nimport { CreatedByAccessPattern } from \"~/storage/accessPatterns/CreatedByAccessPattern.js\";\nimport { CreatedOnAccessPattern } from \"~/storage/accessPatterns/CreatedOnAccessPattern.js\";\nimport type { AuditLogsEntity } from \"~/storage/entity.js\";\n\nexport interface ICreateAccessPatternsParams {\n entity: AuditLogsEntity;\n}\n\nexport const createAccessPatterns = (\n params: ICreateAccessPatternsParams\n): IAccessPattern<unknown>[] => {\n const { entity } = params;\n return [\n new DefaultAccessPattern({\n entity\n }),\n new AppAccessPattern({\n entity,\n index: \"GSI1\"\n }),\n new AppCreatedByAccessPattern({\n entity,\n index: \"GSI2\"\n }),\n new AppEntityAccessPattern({\n entity,\n index: \"GSI3\"\n }),\n new EntityIdGlobalAccessPattern({\n entity,\n index: \"GSI4\"\n }),\n new AppEntityActionCreatedByAccessPattern({\n entity,\n index: \"GSI5\"\n }),\n new AppEntityActionAccessPattern({\n entity,\n index: \"GSI6\"\n }),\n new AppEntityCreatedByAccessPattern({\n entity,\n index: \"GSI7\"\n }),\n new CreatedByAccessPattern({\n entity,\n index: \"GSI8\"\n }),\n new CreatedOnAccessPattern({\n entity,\n index: \"GSI9\"\n })\n ];\n};\n"],"mappings":"AACA,SAASA,oBAAoB;AAC7B,SAASC,gBAAgB;AACzB,SAASC,yBAAyB;AAClC,SAASC,qCAAqC;AAC9C,SAASC,+BAA+B;AACxC,SAASC,sBAAsB;AAC/B,SAASC,4BAA4B;AACrC,SAASC,2BAA2B;AACpC,SAASC,sBAAsB;AAC/B,SAASC,sBAAsB;AAO/B,OAAO,MAAMC,oBAAoB,GAC7BC,MAAmC,IACP;EAC5B,MAAM;IAAEC;EAAO,CAAC,GAAGD,MAAM;EACzB,OAAO,CACH,IAAIX,oBAAoB,CAAC;IACrBY;EACJ,CAAC,CAAC,EACF,IAAIX,gBAAgB,CAAC;IACjBW,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,EACF,IAAIX,yBAAyB,CAAC;IAC1BU,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,EACF,IAAIR,sBAAsB,CAAC;IACvBO,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,EACF,IAAIN,2BAA2B,CAAC;IAC5BK,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,EACF,IAAIV,qCAAqC,CAAC;IACtCS,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,EACF,IAAIP,4BAA4B,CAAC;IAC7BM,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,EACF,IAAIT,+BAA+B,CAAC;IAChCQ,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,EACF,IAAIL,sBAAsB,CAAC;IACvBI,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,EACF,IAAIJ,sBAAsB,CAAC;IACvBG,MAAM;IACNC,KAAK,EAAE;EACX,CAAC,CAAC,CACL;AACL,CAAC","ignoreList":[]}
|
package/storage/cursorSchema.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import zod from "zod";
|
|
2
|
-
import { decodeCursor } from "@webiny/db-dynamodb";
|
|
3
|
-
const schema = zod.string().transform(value => {
|
|
4
|
-
const decoded = decodeCursor(value);
|
|
5
|
-
if (!decoded) {
|
|
6
|
-
throw new Error("Invalid cursor.");
|
|
7
|
-
}
|
|
8
|
-
try {
|
|
9
|
-
return JSON.parse(decoded);
|
|
10
|
-
} catch {
|
|
11
|
-
return decoded;
|
|
12
|
-
}
|
|
13
|
-
}).pipe(zod.object({
|
|
14
|
-
PK: zod.string(),
|
|
15
|
-
SK: zod.string()
|
|
16
|
-
}));
|
|
17
|
-
export const fetchCursor = input => {
|
|
18
|
-
const result = schema.safeParse(input);
|
|
19
|
-
if (!result.success) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
return result.data;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=cursorSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["zod","decodeCursor","schema","string","transform","value","decoded","Error","JSON","parse","pipe","object","PK","SK","fetchCursor","input","result","safeParse","success","undefined","data"],"sources":["cursorSchema.ts"],"sourcesContent":["import zod from \"zod\";\nimport { decodeCursor } from \"@webiny/db-dynamodb\";\n\nconst schema = zod\n .string()\n .transform(value => {\n const decoded = decodeCursor(value);\n if (!decoded) {\n throw new Error(\"Invalid cursor.\");\n }\n try {\n return JSON.parse(decoded);\n } catch {\n return decoded;\n }\n })\n .pipe(\n zod.object({\n PK: zod.string(),\n SK: zod.string()\n })\n );\n\nexport const fetchCursor = (input: unknown) => {\n const result = schema.safeParse(input);\n if (!result.success) {\n return undefined;\n }\n return result.data;\n};\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AACrB,SAASC,YAAY,QAAQ,qBAAqB;AAElD,MAAMC,MAAM,GAAGF,GAAG,CACbG,MAAM,CAAC,CAAC,CACRC,SAAS,CAACC,KAAK,IAAI;EAChB,MAAMC,OAAO,GAAGL,YAAY,CAACI,KAAK,CAAC;EACnC,IAAI,CAACC,OAAO,EAAE;IACV,MAAM,IAAIC,KAAK,CAAC,iBAAiB,CAAC;EACtC;EACA,IAAI;IACA,OAAOC,IAAI,CAACC,KAAK,CAACH,OAAO,CAAC;EAC9B,CAAC,CAAC,MAAM;IACJ,OAAOA,OAAO;EAClB;AACJ,CAAC,CAAC,CACDI,IAAI,CACDV,GAAG,CAACW,MAAM,CAAC;EACPC,EAAE,EAAEZ,GAAG,CAACG,MAAM,CAAC,CAAC;EAChBU,EAAE,EAAEb,GAAG,CAACG,MAAM,CAAC;AACnB,CAAC,CACL,CAAC;AAEL,OAAO,MAAMW,WAAW,GAAIC,KAAc,IAAK;EAC3C,MAAMC,MAAM,GAAGd,MAAM,CAACe,SAAS,CAACF,KAAK,CAAC;EACtC,IAAI,CAACC,MAAM,CAACE,OAAO,EAAE;IACjB,OAAOC,SAAS;EACpB;EACA,OAAOH,MAAM,CAACI,IAAI;AACtB,CAAC","ignoreList":[]}
|
package/storage/entity.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
-
import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
|
|
3
|
-
import { createTable } from "@webiny/db-dynamodb";
|
|
4
|
-
import type { IStorageAuditLog } from "../storage/types.js";
|
|
5
|
-
export interface IAuditLogsEntityAttributes extends Omit<IStandardEntityAttributes<IStorageAuditLog>, "GSI1_SK" | "GSI2_SK" | "expiresAt"> {
|
|
6
|
-
GSI1_PK: string;
|
|
7
|
-
GSI1_SK: number;
|
|
8
|
-
GSI2_PK: string;
|
|
9
|
-
GSI2_SK: number;
|
|
10
|
-
GSI3_PK: string;
|
|
11
|
-
GSI3_SK: number;
|
|
12
|
-
GSI4_PK: string;
|
|
13
|
-
GSI4_SK: number;
|
|
14
|
-
GSI5_PK: string;
|
|
15
|
-
GSI5_SK: number;
|
|
16
|
-
GSI6_PK: string;
|
|
17
|
-
GSI6_SK: number;
|
|
18
|
-
GSI7_PK: string;
|
|
19
|
-
GSI7_SK: number;
|
|
20
|
-
GSI8_PK: string;
|
|
21
|
-
GSI8_SK: number;
|
|
22
|
-
GSI9_PK: string;
|
|
23
|
-
GSI9_SK: number;
|
|
24
|
-
expiresAt: number;
|
|
25
|
-
}
|
|
26
|
-
export type AuditLogsEntity = IEntity<IAuditLogsEntityAttributes>;
|
|
27
|
-
export interface ICreateEntityParams {
|
|
28
|
-
client: DynamoDBDocument;
|
|
29
|
-
gsiAmount: number;
|
|
30
|
-
tableName: string | undefined;
|
|
31
|
-
}
|
|
32
|
-
export interface ICreateEntityResult {
|
|
33
|
-
entity: AuditLogsEntity;
|
|
34
|
-
table: ReturnType<typeof createTable>;
|
|
35
|
-
}
|
|
36
|
-
export declare const createEntity: (params: ICreateEntityParams) => ICreateEntityResult;
|
package/storage/entity.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { createEntity as baseCreateEntity, createTable } from "@webiny/db-dynamodb";
|
|
2
|
-
const createTableGSIIndexes = count => {
|
|
3
|
-
const result = {};
|
|
4
|
-
for (let i = 1; i <= count; i++) {
|
|
5
|
-
result[`GSI${i}`] = {
|
|
6
|
-
partitionKey: `GSI${i}_PK`,
|
|
7
|
-
sortKey: `GSI${i}_SK`
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
};
|
|
12
|
-
export const createEntity = params => {
|
|
13
|
-
const {
|
|
14
|
-
gsiAmount,
|
|
15
|
-
client,
|
|
16
|
-
tableName
|
|
17
|
-
} = params;
|
|
18
|
-
const name = tableName || process.env.DB_TABLE_AUDIT_LOGS;
|
|
19
|
-
if (!name) {
|
|
20
|
-
throw new Error("Missing env.DB_TABLE_AUDIT_LOGS environment variable.");
|
|
21
|
-
}
|
|
22
|
-
const table = createTable({
|
|
23
|
-
documentClient: client,
|
|
24
|
-
name,
|
|
25
|
-
indexes: {
|
|
26
|
-
...createTableGSIIndexes(gsiAmount)
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
const entity = baseCreateEntity({
|
|
30
|
-
name: "AuditLogs",
|
|
31
|
-
table: table.table,
|
|
32
|
-
attributes: {
|
|
33
|
-
PK: {
|
|
34
|
-
partitionKey: true
|
|
35
|
-
},
|
|
36
|
-
SK: {
|
|
37
|
-
sortKey: true
|
|
38
|
-
},
|
|
39
|
-
GSI_TENANT: {
|
|
40
|
-
type: "string",
|
|
41
|
-
required: true
|
|
42
|
-
},
|
|
43
|
-
GSI1_PK: {
|
|
44
|
-
type: "string",
|
|
45
|
-
required: true
|
|
46
|
-
},
|
|
47
|
-
GSI1_SK: {
|
|
48
|
-
type: "number",
|
|
49
|
-
required: true
|
|
50
|
-
},
|
|
51
|
-
GSI2_PK: {
|
|
52
|
-
type: "string",
|
|
53
|
-
required: true
|
|
54
|
-
},
|
|
55
|
-
GSI2_SK: {
|
|
56
|
-
type: "number",
|
|
57
|
-
required: true
|
|
58
|
-
},
|
|
59
|
-
GSI3_PK: {
|
|
60
|
-
type: "string",
|
|
61
|
-
required: true
|
|
62
|
-
},
|
|
63
|
-
GSI3_SK: {
|
|
64
|
-
type: "number",
|
|
65
|
-
required: true
|
|
66
|
-
},
|
|
67
|
-
GSI4_PK: {
|
|
68
|
-
type: "string",
|
|
69
|
-
required: true
|
|
70
|
-
},
|
|
71
|
-
GSI4_SK: {
|
|
72
|
-
type: "number",
|
|
73
|
-
required: true
|
|
74
|
-
},
|
|
75
|
-
GSI5_PK: {
|
|
76
|
-
type: "string",
|
|
77
|
-
required: true
|
|
78
|
-
},
|
|
79
|
-
GSI5_SK: {
|
|
80
|
-
type: "number",
|
|
81
|
-
required: true
|
|
82
|
-
},
|
|
83
|
-
GSI6_PK: {
|
|
84
|
-
type: "string",
|
|
85
|
-
required: true
|
|
86
|
-
},
|
|
87
|
-
GSI6_SK: {
|
|
88
|
-
type: "number",
|
|
89
|
-
required: true
|
|
90
|
-
},
|
|
91
|
-
GSI7_PK: {
|
|
92
|
-
type: "string",
|
|
93
|
-
required: true
|
|
94
|
-
},
|
|
95
|
-
GSI7_SK: {
|
|
96
|
-
type: "number",
|
|
97
|
-
required: true
|
|
98
|
-
},
|
|
99
|
-
GSI8_PK: {
|
|
100
|
-
type: "string",
|
|
101
|
-
required: true
|
|
102
|
-
},
|
|
103
|
-
GSI8_SK: {
|
|
104
|
-
type: "number",
|
|
105
|
-
required: true
|
|
106
|
-
},
|
|
107
|
-
GSI9_PK: {
|
|
108
|
-
type: "string",
|
|
109
|
-
required: true
|
|
110
|
-
},
|
|
111
|
-
GSI9_SK: {
|
|
112
|
-
type: "number",
|
|
113
|
-
required: true
|
|
114
|
-
},
|
|
115
|
-
data: {
|
|
116
|
-
type: "map",
|
|
117
|
-
required: true
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
return {
|
|
122
|
-
entity,
|
|
123
|
-
table
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
//# sourceMappingURL=entity.js.map
|
package/storage/entity.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createEntity","baseCreateEntity","createTable","createTableGSIIndexes","count","result","i","partitionKey","sortKey","params","gsiAmount","client","tableName","name","process","env","DB_TABLE_AUDIT_LOGS","Error","table","documentClient","indexes","entity","attributes","PK","SK","GSI_TENANT","type","required","GSI1_PK","GSI1_SK","GSI2_PK","GSI2_SK","GSI3_PK","GSI3_SK","GSI4_PK","GSI4_SK","GSI5_PK","GSI5_SK","GSI6_PK","GSI6_SK","GSI7_PK","GSI7_SK","GSI8_PK","GSI8_SK","GSI9_PK","GSI9_SK","data"],"sources":["entity.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { IEntity, IStandardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport { createEntity as baseCreateEntity, createTable } from \"@webiny/db-dynamodb\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type { IStorageAuditLog } from \"~/storage/types.js\";\n\nexport interface IAuditLogsEntityAttributes extends Omit<\n IStandardEntityAttributes<IStorageAuditLog>,\n \"GSI1_SK\" | \"GSI2_SK\" | \"expiresAt\"\n> {\n GSI1_PK: string;\n GSI1_SK: number;\n GSI2_PK: string;\n GSI2_SK: number;\n GSI3_PK: string;\n GSI3_SK: number;\n GSI4_PK: string;\n GSI4_SK: number;\n GSI5_PK: string;\n GSI5_SK: number;\n GSI6_PK: string;\n GSI6_SK: number;\n GSI7_PK: string;\n GSI7_SK: number;\n GSI8_PK: string;\n GSI8_SK: number;\n GSI9_PK: string;\n GSI9_SK: number;\n expiresAt: number;\n}\n\nexport type AuditLogsEntity = IEntity<IAuditLogsEntityAttributes>;\n\nexport interface ICreateEntityParams {\n client: DynamoDBDocument;\n gsiAmount: number;\n tableName: string | undefined;\n}\n\nexport interface ICreateEntityResult {\n entity: AuditLogsEntity;\n table: ReturnType<typeof createTable>;\n}\n\nconst createTableGSIIndexes = (count: number) => {\n const result: GenericRecord = {};\n for (let i = 1; i <= count; i++) {\n result[`GSI${i}`] = {\n partitionKey: `GSI${i}_PK`,\n sortKey: `GSI${i}_SK`\n };\n }\n return result;\n};\n\nexport const createEntity = (params: ICreateEntityParams): ICreateEntityResult => {\n const { gsiAmount, client, tableName } = params;\n const name = tableName || process.env.DB_TABLE_AUDIT_LOGS;\n if (!name) {\n throw new Error(\"Missing env.DB_TABLE_AUDIT_LOGS environment variable.\");\n }\n const table = createTable({\n documentClient: client,\n name,\n indexes: {\n ...createTableGSIIndexes(gsiAmount)\n }\n });\n\n const entity = baseCreateEntity<IAuditLogsEntityAttributes>({\n name: \"AuditLogs\",\n table: table.table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n GSI_TENANT: {\n type: \"string\",\n required: true\n },\n GSI1_PK: {\n type: \"string\",\n required: true\n },\n GSI1_SK: {\n type: \"number\",\n required: true\n },\n GSI2_PK: {\n type: \"string\",\n required: true\n },\n GSI2_SK: {\n type: \"number\",\n required: true\n },\n GSI3_PK: {\n type: \"string\",\n required: true\n },\n GSI3_SK: {\n type: \"number\",\n required: true\n },\n GSI4_PK: {\n type: \"string\",\n required: true\n },\n GSI4_SK: {\n type: \"number\",\n required: true\n },\n GSI5_PK: {\n type: \"string\",\n required: true\n },\n GSI5_SK: {\n type: \"number\",\n required: true\n },\n GSI6_PK: {\n type: \"string\",\n required: true\n },\n GSI6_SK: {\n type: \"number\",\n required: true\n },\n GSI7_PK: {\n type: \"string\",\n required: true\n },\n GSI7_SK: {\n type: \"number\",\n required: true\n },\n GSI8_PK: {\n type: \"string\",\n required: true\n },\n GSI8_SK: {\n type: \"number\",\n required: true\n },\n GSI9_PK: {\n type: \"string\",\n required: true\n },\n GSI9_SK: {\n type: \"number\",\n required: true\n },\n data: {\n type: \"map\",\n required: true\n }\n }\n });\n\n return {\n entity,\n table\n };\n};\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { IStorageListErrorResult } from "../../storage/abstractions/Storage.js";
|
|
2
|
-
export interface IListErrorResultParams {
|
|
3
|
-
error: Error;
|
|
4
|
-
}
|
|
5
|
-
export declare class ListErrorResult implements IStorageListErrorResult {
|
|
6
|
-
readonly error: Error;
|
|
7
|
-
readonly success = false;
|
|
8
|
-
private constructor();
|
|
9
|
-
static create(params: IListErrorResultParams): IStorageListErrorResult;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ListErrorResult","success","constructor","params","error","create"],"sources":["ListErrorResult.ts"],"sourcesContent":["import type { IStorageListErrorResult } from \"~/storage/abstractions/Storage.js\";\n\nexport interface IListErrorResultParams {\n error: Error;\n}\n\nexport class ListErrorResult implements IStorageListErrorResult {\n public readonly error: Error;\n public readonly success = false;\n\n private constructor(params: IListErrorResultParams) {\n this.error = params.error;\n }\n\n public static create(params: IListErrorResultParams): IStorageListErrorResult {\n return new ListErrorResult(params);\n }\n}\n"],"mappings":"AAMA,OAAO,MAAMA,eAAe,CAAoC;EAE5CC,OAAO,GAAG,KAAK;EAEvBC,WAAWA,CAACC,MAA8B,EAAE;IAChD,IAAI,CAACC,KAAK,GAAGD,MAAM,CAACC,KAAK;EAC7B;EAEA,OAAcC,MAAMA,CAACF,MAA8B,EAA2B;IAC1E,OAAO,IAAIH,eAAe,CAACG,MAAM,CAAC;EACtC;AACJ","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { IStorageListSuccessResult, IStorageListSuccessResultMeta } from "../../storage/abstractions/Storage.js";
|
|
2
|
-
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
4
|
-
export interface IListSuccessResultParams {
|
|
5
|
-
data: IAuditLog[];
|
|
6
|
-
lastEvaluatedKey?: GenericRecord;
|
|
7
|
-
}
|
|
8
|
-
export declare class ListSuccessResult implements IStorageListSuccessResult {
|
|
9
|
-
readonly data: IAuditLog[];
|
|
10
|
-
readonly meta: IStorageListSuccessResultMeta;
|
|
11
|
-
readonly success = true;
|
|
12
|
-
protected constructor(params: IListSuccessResultParams);
|
|
13
|
-
static create(params: IListSuccessResultParams): IStorageListSuccessResult;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { encodeCursor } from "@webiny/db-dynamodb";
|
|
2
|
-
export class ListSuccessResult {
|
|
3
|
-
success = true;
|
|
4
|
-
constructor(params) {
|
|
5
|
-
this.data = params.data;
|
|
6
|
-
this.meta = {
|
|
7
|
-
after: encodeCursor(params.lastEvaluatedKey) || undefined,
|
|
8
|
-
hasMoreItems: !!params.lastEvaluatedKey
|
|
9
|
-
};
|
|
10
|
-
}
|
|
11
|
-
static create(params) {
|
|
12
|
-
return new ListSuccessResult(params);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=ListSuccessResult.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["encodeCursor","ListSuccessResult","success","constructor","params","data","meta","after","lastEvaluatedKey","undefined","hasMoreItems","create"],"sources":["ListSuccessResult.ts"],"sourcesContent":["import type {\n IStorageListSuccessResult,\n IStorageListSuccessResultMeta\n} from \"~/storage/abstractions/Storage.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport { encodeCursor } from \"@webiny/db-dynamodb\";\nimport type { IAuditLog } from \"~/storage/types.js\";\n\nexport interface IListSuccessResultParams {\n data: IAuditLog[];\n lastEvaluatedKey?: GenericRecord;\n}\n\nexport class ListSuccessResult implements IStorageListSuccessResult {\n public readonly data: IAuditLog[];\n public readonly meta: IStorageListSuccessResultMeta;\n public readonly success = true;\n\n protected constructor(params: IListSuccessResultParams) {\n this.data = params.data;\n this.meta = {\n after: encodeCursor(params.lastEvaluatedKey) || undefined,\n hasMoreItems: !!params.lastEvaluatedKey\n };\n }\n\n public static create(params: IListSuccessResultParams): IStorageListSuccessResult {\n return new ListSuccessResult(params);\n }\n}\n"],"mappings":"AAKA,SAASA,YAAY,QAAQ,qBAAqB;AAQlD,OAAO,MAAMC,iBAAiB,CAAsC;EAGhDC,OAAO,GAAG,IAAI;EAEpBC,WAAWA,CAACC,MAAgC,EAAE;IACpD,IAAI,CAACC,IAAI,GAAGD,MAAM,CAACC,IAAI;IACvB,IAAI,CAACC,IAAI,GAAG;MACRC,KAAK,EAAEP,YAAY,CAACI,MAAM,CAACI,gBAAgB,CAAC,IAAIC,SAAS;MACzDC,YAAY,EAAE,CAAC,CAACN,MAAM,CAACI;IAC3B,CAAC;EACL;EAEA,OAAcG,MAAMA,CAACP,MAAgC,EAA6B;IAC9E,OAAO,IAAIH,iBAAiB,CAACG,MAAM,CAAC;EACxC;AACJ","ignoreList":[]}
|
package/storage/results/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ListErrorResult.js\";\nexport * from \"./ListSuccessResult.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
package/storage/startKey.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IStorageListParams } from "../storage/abstractions/Storage.js";
|
|
2
|
-
export interface ICreateStartKeyResult {
|
|
3
|
-
PK: string;
|
|
4
|
-
SK: string;
|
|
5
|
-
}
|
|
6
|
-
export declare const createStartKey: (params: Pick<IStorageListParams, "after">) => ICreateStartKeyResult | undefined;
|
package/storage/startKey.js
DELETED
package/storage/startKey.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["fetchCursor","createStartKey","params","after","undefined"],"sources":["startKey.ts"],"sourcesContent":["import type { IStorageListParams } from \"~/storage/abstractions/Storage.js\";\nimport { fetchCursor } from \"~/storage/cursorSchema.js\";\n\nexport interface ICreateStartKeyResult {\n PK: string;\n SK: string;\n}\n\nexport const createStartKey = (\n params: Pick<IStorageListParams, \"after\">\n): ICreateStartKeyResult | undefined => {\n if (!params.after) {\n return undefined;\n }\n return fetchCursor(params.after);\n};\n"],"mappings":"AACA,SAASA,WAAW;AAOpB,OAAO,MAAMC,cAAc,GACvBC,MAAyC,IACL;EACpC,IAAI,CAACA,MAAM,CAACC,KAAK,EAAE;IACf,OAAOC,SAAS;EACpB;EACA,OAAOJ,WAAW,CAACE,MAAM,CAACC,KAAK,CAAC;AACpC,CAAC","ignoreList":[]}
|