@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
package/storage/Storage.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { createEntity } from "./entity.js";
|
|
2
|
-
import { Converter } from "./Converter.js";
|
|
3
|
-
import { createAccessPatterns } from "./accessPatterns/index.js";
|
|
4
|
-
import { AccessPatternHandler } from "./AccessPatternHandler.js";
|
|
5
|
-
import { ListSuccessResult } from "./results/index.js";
|
|
6
|
-
export class Storage {
|
|
7
|
-
constructor(params) {
|
|
8
|
-
const {
|
|
9
|
-
entity
|
|
10
|
-
} = createEntity({
|
|
11
|
-
client: params.client,
|
|
12
|
-
tableName: params.tableName,
|
|
13
|
-
gsiAmount: 10
|
|
14
|
-
});
|
|
15
|
-
this.entity = entity;
|
|
16
|
-
const patterns = createAccessPatterns({
|
|
17
|
-
entity
|
|
18
|
-
});
|
|
19
|
-
this.patternHandler = new AccessPatternHandler({
|
|
20
|
-
patterns
|
|
21
|
-
});
|
|
22
|
-
this.converter = new Converter({
|
|
23
|
-
compressionHandler: params.compressionHandler,
|
|
24
|
-
patternHandler: this.patternHandler
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
async fetch(params) {
|
|
28
|
-
const {
|
|
29
|
-
id,
|
|
30
|
-
tenant
|
|
31
|
-
} = params;
|
|
32
|
-
try {
|
|
33
|
-
const result = await this.entity.get({
|
|
34
|
-
PK: `T#${tenant}#AUDIT_LOG`,
|
|
35
|
-
SK: `${id}`
|
|
36
|
-
});
|
|
37
|
-
if (!result) {
|
|
38
|
-
return {
|
|
39
|
-
error: new Error(`Audit log entry "${id}" not found.`),
|
|
40
|
-
success: false
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
data: await this.converter.oneFromStorage(result),
|
|
45
|
-
success: true
|
|
46
|
-
};
|
|
47
|
-
} catch (ex) {
|
|
48
|
-
return {
|
|
49
|
-
error: ex,
|
|
50
|
-
success: false
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
async store(params) {
|
|
55
|
-
const auditLog = structuredClone(params.data);
|
|
56
|
-
try {
|
|
57
|
-
const item = await this.converter.oneToStorage(auditLog);
|
|
58
|
-
await this.entity.put(item);
|
|
59
|
-
} catch (ex) {
|
|
60
|
-
return {
|
|
61
|
-
error: ex,
|
|
62
|
-
success: false
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
success: true,
|
|
67
|
-
data: auditLog
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
async list(params) {
|
|
71
|
-
try {
|
|
72
|
-
const result = await this.patternHandler.handle(params);
|
|
73
|
-
return ListSuccessResult.create({
|
|
74
|
-
data: await this.converter.listFromStorage(result.items),
|
|
75
|
-
lastEvaluatedKey: result.lastEvaluatedKey
|
|
76
|
-
});
|
|
77
|
-
} catch (ex) {
|
|
78
|
-
return {
|
|
79
|
-
error: ex,
|
|
80
|
-
success: false
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
export const createStorage = params => {
|
|
86
|
-
return new Storage(params);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
//# sourceMappingURL=Storage.js.map
|
package/storage/Storage.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createEntity","Converter","createAccessPatterns","AccessPatternHandler","ListSuccessResult","Storage","constructor","params","entity","client","tableName","gsiAmount","patterns","patternHandler","converter","compressionHandler","fetch","id","tenant","result","get","PK","SK","error","Error","success","data","oneFromStorage","ex","store","auditLog","structuredClone","item","oneToStorage","put","list","handle","create","listFromStorage","items","lastEvaluatedKey","createStorage"],"sources":["Storage.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createEntity } from \"~/storage/entity.js\";\nimport type {\n IStorage,\n IStorageFetchParams,\n IStorageFetchResult,\n IStorageListParams,\n IStorageListResult,\n IStorageStoreParams,\n IStorageStoreResult\n} from \"~/storage/abstractions/Storage.js\";\nimport { Converter } from \"~/storage/Converter.js\";\nimport { createAccessPatterns } from \"~/storage/accessPatterns/index.js\";\nimport { AccessPatternHandler } from \"~/storage/AccessPatternHandler.js\";\nimport { ListSuccessResult } from \"~/storage/results/index.js\";\nimport { CompressionHandler } from \"@webiny/utils/exports/api.js\";\n\nexport interface IStorageParams {\n compressionHandler: CompressionHandler.Interface;\n client: DynamoDBDocument;\n tableName: string | undefined;\n}\n\nexport class Storage implements IStorage {\n private readonly entity;\n private readonly converter;\n private readonly patternHandler;\n\n public constructor(params: IStorageParams) {\n const { entity } = createEntity({\n client: params.client,\n tableName: params.tableName,\n gsiAmount: 10\n });\n\n this.entity = entity;\n\n const patterns = createAccessPatterns({\n entity\n });\n this.patternHandler = new AccessPatternHandler({\n patterns\n });\n\n this.converter = new Converter({\n compressionHandler: params.compressionHandler,\n patternHandler: this.patternHandler\n });\n }\n\n public async fetch(params: IStorageFetchParams): Promise<IStorageFetchResult> {\n const { id, tenant } = params;\n\n try {\n const result = await this.entity.get({\n PK: `T#${tenant}#AUDIT_LOG`,\n SK: `${id}`\n });\n if (!result) {\n return {\n error: new Error(`Audit log entry \"${id}\" not found.`),\n success: false\n };\n }\n return {\n data: await this.converter.oneFromStorage(result),\n success: true\n };\n } catch (ex) {\n return {\n error: ex,\n success: false\n };\n }\n }\n\n public async store(params: IStorageStoreParams): Promise<IStorageStoreResult> {\n const auditLog = structuredClone(params.data);\n\n try {\n const item = await this.converter.oneToStorage(auditLog);\n await this.entity.put(item);\n } catch (ex) {\n return {\n error: ex,\n success: false\n };\n }\n\n return {\n success: true,\n data: auditLog\n };\n }\n\n public async list(params: IStorageListParams): Promise<IStorageListResult> {\n try {\n const result = await this.patternHandler.handle(params);\n\n return ListSuccessResult.create({\n data: await this.converter.listFromStorage(result.items),\n lastEvaluatedKey: result.lastEvaluatedKey\n });\n } catch (ex) {\n return {\n error: ex,\n success: false\n };\n }\n }\n}\n\nexport const createStorage = (params: IStorageParams): IStorage => {\n return new Storage(params);\n};\n"],"mappings":"AACA,SAASA,YAAY;AAUrB,SAASC,SAAS;AAClB,SAASC,oBAAoB;AAC7B,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAS1B,OAAO,MAAMC,OAAO,CAAqB;EAK9BC,WAAWA,CAACC,MAAsB,EAAE;IACvC,MAAM;MAAEC;IAAO,CAAC,GAAGR,YAAY,CAAC;MAC5BS,MAAM,EAAEF,MAAM,CAACE,MAAM;MACrBC,SAAS,EAAEH,MAAM,CAACG,SAAS;MAC3BC,SAAS,EAAE;IACf,CAAC,CAAC;IAEF,IAAI,CAACH,MAAM,GAAGA,MAAM;IAEpB,MAAMI,QAAQ,GAAGV,oBAAoB,CAAC;MAClCM;IACJ,CAAC,CAAC;IACF,IAAI,CAACK,cAAc,GAAG,IAAIV,oBAAoB,CAAC;MAC3CS;IACJ,CAAC,CAAC;IAEF,IAAI,CAACE,SAAS,GAAG,IAAIb,SAAS,CAAC;MAC3Bc,kBAAkB,EAAER,MAAM,CAACQ,kBAAkB;MAC7CF,cAAc,EAAE,IAAI,CAACA;IACzB,CAAC,CAAC;EACN;EAEA,MAAaG,KAAKA,CAACT,MAA2B,EAAgC;IAC1E,MAAM;MAAEU,EAAE;MAAEC;IAAO,CAAC,GAAGX,MAAM;IAE7B,IAAI;MACA,MAAMY,MAAM,GAAG,MAAM,IAAI,CAACX,MAAM,CAACY,GAAG,CAAC;QACjCC,EAAE,EAAE,KAAKH,MAAM,YAAY;QAC3BI,EAAE,EAAE,GAAGL,EAAE;MACb,CAAC,CAAC;MACF,IAAI,CAACE,MAAM,EAAE;QACT,OAAO;UACHI,KAAK,EAAE,IAAIC,KAAK,CAAC,oBAAoBP,EAAE,cAAc,CAAC;UACtDQ,OAAO,EAAE;QACb,CAAC;MACL;MACA,OAAO;QACHC,IAAI,EAAE,MAAM,IAAI,CAACZ,SAAS,CAACa,cAAc,CAACR,MAAM,CAAC;QACjDM,OAAO,EAAE;MACb,CAAC;IACL,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,OAAO;QACHL,KAAK,EAAEK,EAAE;QACTH,OAAO,EAAE;MACb,CAAC;IACL;EACJ;EAEA,MAAaI,KAAKA,CAACtB,MAA2B,EAAgC;IAC1E,MAAMuB,QAAQ,GAAGC,eAAe,CAACxB,MAAM,CAACmB,IAAI,CAAC;IAE7C,IAAI;MACA,MAAMM,IAAI,GAAG,MAAM,IAAI,CAAClB,SAAS,CAACmB,YAAY,CAACH,QAAQ,CAAC;MACxD,MAAM,IAAI,CAACtB,MAAM,CAAC0B,GAAG,CAACF,IAAI,CAAC;IAC/B,CAAC,CAAC,OAAOJ,EAAE,EAAE;MACT,OAAO;QACHL,KAAK,EAAEK,EAAE;QACTH,OAAO,EAAE;MACb,CAAC;IACL;IAEA,OAAO;MACHA,OAAO,EAAE,IAAI;MACbC,IAAI,EAAEI;IACV,CAAC;EACL;EAEA,MAAaK,IAAIA,CAAC5B,MAA0B,EAA+B;IACvE,IAAI;MACA,MAAMY,MAAM,GAAG,MAAM,IAAI,CAACN,cAAc,CAACuB,MAAM,CAAC7B,MAAM,CAAC;MAEvD,OAAOH,iBAAiB,CAACiC,MAAM,CAAC;QAC5BX,IAAI,EAAE,MAAM,IAAI,CAACZ,SAAS,CAACwB,eAAe,CAACnB,MAAM,CAACoB,KAAK,CAAC;QACxDC,gBAAgB,EAAErB,MAAM,CAACqB;MAC7B,CAAC,CAAC;IACN,CAAC,CAAC,OAAOZ,EAAE,EAAE;MACT,OAAO;QACHL,KAAK,EAAEK,EAAE;QACTH,OAAO,EAAE;MACb,CAAC;IACL;EACJ;AACJ;AAEA,OAAO,MAAMgB,aAAa,GAAIlC,MAAsB,IAAe;EAC/D,OAAO,IAAIF,OAAO,CAACE,MAAM,CAAC;AAC9B,CAAC","ignoreList":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog, IStorageItem } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListParams } from "./Storage.js";
|
|
3
|
-
import type { GenericRecord } from "@webiny/api/types.js";
|
|
4
|
-
export interface IAccessPatternCreateKeysResult {
|
|
5
|
-
partitionKey: string;
|
|
6
|
-
sortKey: string | number;
|
|
7
|
-
}
|
|
8
|
-
export interface IAccessPatternListResult {
|
|
9
|
-
items: IStorageItem[];
|
|
10
|
-
lastEvaluatedKey?: GenericRecord;
|
|
11
|
-
}
|
|
12
|
-
export type IAccessPatternHandlesKeys = keyof IStorageListParams;
|
|
13
|
-
export interface IAccessPatternHandles {
|
|
14
|
-
shouldInclude?: IAccessPatternHandlesKeys[];
|
|
15
|
-
mustInclude: IAccessPatternHandlesKeys[];
|
|
16
|
-
mustNotInclude: IAccessPatternHandlesKeys[];
|
|
17
|
-
}
|
|
18
|
-
export interface IAccessPattern<T> {
|
|
19
|
-
index: string | undefined;
|
|
20
|
-
handles(): IAccessPatternHandles;
|
|
21
|
-
canHandle(params: IStorageListParams): boolean;
|
|
22
|
-
list(params: T): Promise<IAccessPatternListResult>;
|
|
23
|
-
createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;
|
|
24
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AccessPattern.ts"],"sourcesContent":["import type { IAuditLog, IStorageItem } from \"~/storage/types.js\";\nimport type { IStorageListParams } from \"./Storage.js\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\nexport interface IAccessPatternCreateKeysResult {\n partitionKey: string;\n sortKey: string | number;\n}\n\nexport interface IAccessPatternListResult {\n items: IStorageItem[];\n lastEvaluatedKey?: GenericRecord;\n}\n\nexport type IAccessPatternHandlesKeys = keyof IStorageListParams;\n\nexport interface IAccessPatternHandles {\n shouldInclude?: IAccessPatternHandlesKeys[];\n mustInclude: IAccessPatternHandlesKeys[];\n mustNotInclude: IAccessPatternHandlesKeys[];\n}\n\nexport interface IAccessPattern<T> {\n index: string | undefined;\n handles(): IAccessPatternHandles;\n canHandle(params: IStorageListParams): boolean;\n list(params: T): Promise<IAccessPatternListResult>;\n createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { GenericRecord } from "@webiny/api/types.js";
|
|
2
|
-
import type { IStorageItem } from "../types.js";
|
|
3
|
-
import type { IAccessPattern } from "./AccessPattern.js";
|
|
4
|
-
import type { IStorageListParams } from "./Storage.js";
|
|
5
|
-
export interface IAccessPatternHandlerHandleResult {
|
|
6
|
-
items: IStorageItem[];
|
|
7
|
-
lastEvaluatedKey?: GenericRecord;
|
|
8
|
-
}
|
|
9
|
-
export interface IAccessPatternHandler {
|
|
10
|
-
handle(params: IStorageListParams): Promise<IAccessPatternHandlerHandleResult>;
|
|
11
|
-
getDefaultPattern(): IAccessPattern<unknown>;
|
|
12
|
-
listIndexPatterns(): IAccessPattern<unknown>[];
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["AccessPatternHandler.ts"],"sourcesContent":["import type { GenericRecord } from \"@webiny/api/types.js\";\nimport type { IStorageItem } from \"../types.js\";\nimport type { IAccessPattern } from \"./AccessPattern.js\";\nimport type { IStorageListParams } from \"./Storage.js\";\n\nexport interface IAccessPatternHandlerHandleResult {\n items: IStorageItem[];\n lastEvaluatedKey?: GenericRecord;\n}\n\nexport interface IAccessPatternHandler {\n handle(params: IStorageListParams): Promise<IAccessPatternHandlerHandleResult>;\n getDefaultPattern(): IAccessPattern<unknown>;\n listIndexPatterns(): IAccessPattern<unknown>[];\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog, IStorageItem } from "../../storage/types.js";
|
|
2
|
-
export interface IConverter {
|
|
3
|
-
oneFromStorage(item: IStorageItem): Promise<IAuditLog>;
|
|
4
|
-
listFromStorage(items: IStorageItem[]): Promise<IAuditLog[]>;
|
|
5
|
-
oneToStorage(auditLog: IAuditLog): Promise<IStorageItem>;
|
|
6
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["Converter.ts"],"sourcesContent":["import type { IAuditLog, IStorageItem } from \"~/storage/types.js\";\n\nexport interface IConverter {\n oneFromStorage(item: IStorageItem): Promise<IAuditLog>;\n listFromStorage(items: IStorageItem[]): Promise<IAuditLog[]>;\n oneToStorage(auditLog: IAuditLog): Promise<IStorageItem>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["Storage.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\n\nexport interface IStorageFetchParams {\n id: string;\n tenant: string;\n}\n\nexport interface IStorageFetchErrorResult {\n error: Error;\n data?: never;\n success: false;\n}\n\nexport interface IStorageFetchSuccessResult {\n data: IAuditLog;\n success: true;\n error?: never;\n}\n\nexport type IStorageFetchResult = IStorageFetchErrorResult | IStorageFetchSuccessResult;\n\nexport interface IStorageStoreParams {\n data: IAuditLog;\n}\n\nexport interface IStorageStoreErrorResult {\n error: Error;\n data?: never;\n success: false;\n}\n\nexport interface IStorageStoreSuccessResult {\n data: IAuditLog;\n success: true;\n error?: never;\n}\n\nexport type IStorageStoreResult = IStorageStoreErrorResult | IStorageStoreSuccessResult;\n\n// PK / SK\nexport interface IStorageListDefaultParams {\n tenant: string;\n sort?: \"ASC\" | \"DESC\";\n after?: string;\n limit: number | undefined;\n\n app?: never;\n createdBy?: never;\n action?: never;\n entityId?: never;\n}\n\n// GSI1_PK / GSI1_SK\nexport interface IStorageListByAppParams {\n tenant: string;\n app: string;\n after?: string;\n sort?: \"ASC\" | \"DESC\";\n createdOn_gte?: Date;\n createdOn_lte?: Date;\n limit: number | undefined;\n\n entity?: never;\n createdBy?: never;\n action?: never;\n entityId?: never;\n}\n\n// GSI2_PK / GSI2_SK\nexport interface IStorageListByAppCreatedByParams extends Omit<\n IStorageListByAppParams,\n \"createdBy\"\n> {\n createdBy: string;\n}\n\n// GSI3_PK / GSI3_SK\nexport interface IStorageListByAppEntityParams extends Omit<IStorageListByAppParams, \"entity\"> {\n entity: string;\n}\n// GSI4_PK / GSI4_SK\nexport interface IStorageListByEntityIdParams extends Omit<IStorageListByAppParams, \"entityId\"> {\n entityId: string;\n}\n// GSI5_PK / GSI5_SK\nexport interface IStorageListByActionParams extends Omit<IStorageListByAppParams, \"action\"> {\n action: string;\n}\n\n// GSI6_PK / GSI6_SK\nexport interface IStorageListByAppEntityActionCreatedByParams extends Omit<\n IStorageListByAppParams,\n \"action\" | \"entity\" | \"createdBy\"\n> {\n createdBy: string;\n entity: string;\n action: string;\n}\n// GSI7_PK / GSI7_SK\nexport interface IStorageListByAppEntityActionParams extends Omit<\n IStorageListByAppParams,\n \"entity\" | \"action\"\n> {\n entity: string;\n action: string;\n}\n// GSI8_PK / GSI8_SK\nexport interface IStorageListByAppEntityCreatedByParams extends Omit<\n IStorageListByAppParams,\n \"createdBy\" | \"entity\"\n> {\n createdBy: string;\n entity: string;\n}\n\n// GSI9_PK / GSI9_SK\nexport interface IStorageListByCreatedByParams extends Omit<IStorageListByAppParams, \"createdBy\"> {\n createdBy: string;\n}\n\n// GSI10_PK / GSI10_SK\nexport interface IStorageListByCreatedOnParams extends IStorageListByAppParams {\n createdOn_gte?: Date;\n createdOn_lte?: Date;\n}\n\nexport type IStorageListParams =\n | IStorageListByAppParams\n | IStorageListByAppCreatedByParams\n | IStorageListByAppEntityParams\n | IStorageListByEntityIdParams\n | IStorageListByActionParams\n | IStorageListByAppEntityActionCreatedByParams\n | IStorageListByAppEntityActionParams\n | IStorageListByAppEntityCreatedByParams\n | IStorageListByCreatedByParams\n | IStorageListByCreatedOnParams;\n\nexport interface IStorageListSuccessResultMeta {\n after?: string;\n hasMoreItems: boolean;\n}\n\nexport interface IStorageListSuccessResult {\n data: IAuditLog[];\n meta: IStorageListSuccessResultMeta;\n success: true;\n error?: never;\n}\n\nexport interface IStorageListErrorResult {\n error: Error;\n data?: never;\n meta?: never;\n success: false;\n}\n\nexport type IStorageListResult = IStorageListErrorResult | IStorageListSuccessResult;\n\nexport interface IStorage {\n fetch(params: IStorageFetchParams): Promise<IStorageFetchResult>;\n store(params: IStorageStoreParams): Promise<IStorageStoreResult>;\n list(params: IStorageListParams): Promise<IStorageListResult>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
-
import type { IStorageListByAppParams } 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 AppAccessPattern<T extends IStorageListByAppParams = IStorageListByAppParams> 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}`;
|
|
4
|
-
};
|
|
5
|
-
export class AppAccessPattern extends BaseAccessPattern {
|
|
6
|
-
handles() {
|
|
7
|
-
return {
|
|
8
|
-
mustInclude: ["app"],
|
|
9
|
-
mustNotInclude: ["createdBy", "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(item),
|
|
24
|
-
sortKey: time
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
//# sourceMappingURL=AppAccessPattern.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","app","AppAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","sortKey"],"sources":["AppAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListByAppParams } 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}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}`;\n};\n\nexport class AppAccessPattern<\n T extends IStorageListByAppParams = IStorageListByAppParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"app\"],\n mustNotInclude: [\"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 return {\n partitionKey: createPartitionKey(item),\n sortKey: time\n };\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB;AAY1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,kBAAkBD,MAAM,CAACE,GAAG,EAAE;AAC3D,CAAC;AAED,OAAO,MAAMC,gBAAgB,SAEnBL,iBAAiB,CAAI;EACXM,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,KAAK,CAAC;MACpBC,cAAc,EAAE,CAAC,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ;IAChE,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;IACrC,OAAO;MACHN,YAAY,EAAEb,kBAAkB,CAACgB,IAAI,CAAC;MACtCI,OAAO,EAAEH;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 { 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 IStorageListByAppEntityActionCreatedByParams =\n 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,83 +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
|
-
// @ts-expect-error
|
|
70
|
-
startKey: createStartKey({
|
|
71
|
-
after: params.after
|
|
72
|
-
}),
|
|
73
|
-
reverse: params.sort === "DESC",
|
|
74
|
-
index: this.index
|
|
75
|
-
};
|
|
76
|
-
if (params.createdOn_lte || params.createdOn_gte) {
|
|
77
|
-
options.between = [toGteTime(params.createdOn_gte), toLteTime(params.createdOn_lte)];
|
|
78
|
-
}
|
|
79
|
-
return options;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
//# sourceMappingURL=BaseAccessPattern.js.map
|