@webiny/api-audit-logs 6.0.0-beta.0 → 6.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/abstractions.d.ts +5 -0
- package/abstractions.js +6 -0
- package/abstractions.js.map +1 -0
- package/config.d.ts +0 -13
- package/config.js +3 -291
- package/config.js.map +1 -1
- package/context/AuditLogsContextValue.d.ts +10 -0
- package/context/AuditLogsContextValue.js +139 -0
- package/context/AuditLogsContextValue.js.map +1 -0
- package/context/index.d.ts +9 -0
- package/context/index.js +35 -0
- package/context/index.js.map +1 -0
- package/events/AuditLogAfterCreateEvent.d.ts +6 -0
- package/events/AuditLogAfterCreateEvent.js +10 -0
- package/events/AuditLogAfterCreateEvent.js.map +1 -0
- package/events/AuditLogAfterUpdateEvent.d.ts +6 -0
- package/events/AuditLogAfterUpdateEvent.js +10 -0
- package/events/AuditLogAfterUpdateEvent.js.map +1 -0
- package/events/AuditLogBeforeCreateEvent.d.ts +6 -0
- package/events/AuditLogBeforeCreateEvent.js +10 -0
- package/events/AuditLogBeforeCreateEvent.js.map +1 -0
- package/events/AuditLogBeforeUpdateEvent.d.ts +6 -0
- package/events/AuditLogBeforeUpdateEvent.js +10 -0
- package/events/AuditLogBeforeUpdateEvent.js.map +1 -0
- package/events/abstractions.d.ts +43 -0
- package/events/abstractions.js +27 -0
- package/events/abstractions.js.map +1 -0
- package/events/index.d.ts +5 -0
- package/events/index.js +7 -0
- package/events/index.js.map +1 -0
- package/graphql/schema.d.ts +3 -0
- package/graphql/schema.js +126 -0
- package/graphql/schema.js.map +1 -0
- package/graphql/validation.d.ts +64 -0
- package/graphql/validation.js +35 -0
- package/graphql/validation.js.map +1 -0
- package/index.d.ts +8 -4
- package/index.js +15 -41
- package/index.js.map +1 -1
- package/package.json +30 -34
- package/storage/AccessPatternHandler.d.ts +14 -0
- package/storage/AccessPatternHandler.js +60 -0
- package/storage/AccessPatternHandler.js.map +1 -0
- package/storage/Converter.d.ts +16 -0
- package/storage/Converter.js +52 -0
- package/storage/Converter.js.map +1 -0
- package/storage/Storage.d.ts +18 -0
- package/storage/Storage.js +89 -0
- package/storage/Storage.js.map +1 -0
- package/storage/abstractions/AccessPattern.d.ts +24 -0
- package/storage/abstractions/AccessPattern.js +3 -0
- package/storage/abstractions/AccessPattern.js.map +1 -0
- package/storage/abstractions/AccessPatternHandler.d.ts +13 -0
- package/storage/abstractions/AccessPatternHandler.js +3 -0
- package/storage/abstractions/AccessPatternHandler.js.map +1 -0
- package/storage/abstractions/Converter.d.ts +6 -0
- package/storage/abstractions/Converter.js +3 -0
- package/storage/abstractions/Converter.js.map +1 -0
- package/storage/abstractions/Storage.d.ts +108 -0
- package/storage/abstractions/Storage.js +3 -0
- package/storage/abstractions/Storage.js.map +1 -0
- package/storage/accessPatterns/AppAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppAccessPattern.js +29 -0
- package/storage/accessPatterns/AppAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppCreatedByAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppCreatedByAccessPattern.js +32 -0
- package/storage/accessPatterns/AppCreatedByAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppEntityAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppEntityAccessPattern.js +29 -0
- package/storage/accessPatterns/AppEntityAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppEntityActionAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppEntityActionAccessPattern.js +29 -0
- package/storage/accessPatterns/AppEntityActionAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js +32 -0
- package/storage/accessPatterns/AppEntityActionCreatedByAccessPattern.js.map +1 -0
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js +32 -0
- package/storage/accessPatterns/AppEntityCreatedByAccessPattern.js.map +1 -0
- package/storage/accessPatterns/BaseAccessPattern.d.ts +32 -0
- package/storage/accessPatterns/BaseAccessPattern.js +82 -0
- package/storage/accessPatterns/BaseAccessPattern.js.map +1 -0
- package/storage/accessPatterns/CreatedByAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/CreatedByAccessPattern.js +32 -0
- package/storage/accessPatterns/CreatedByAccessPattern.js.map +1 -0
- package/storage/accessPatterns/CreatedOnAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/CreatedOnAccessPattern.js +30 -0
- package/storage/accessPatterns/CreatedOnAccessPattern.js.map +1 -0
- package/storage/accessPatterns/DefaultAccessPattern.d.ts +15 -0
- package/storage/accessPatterns/DefaultAccessPattern.js +36 -0
- package/storage/accessPatterns/DefaultAccessPattern.js.map +1 -0
- package/storage/accessPatterns/EntityIdAccessPattern.d.ts +9 -0
- package/storage/accessPatterns/EntityIdAccessPattern.js +33 -0
- package/storage/accessPatterns/EntityIdAccessPattern.js.map +1 -0
- package/storage/accessPatterns/index.d.ts +6 -0
- package/storage/accessPatterns/index.js +47 -0
- package/storage/accessPatterns/index.js.map +1 -0
- package/storage/cursorSchema.d.ts +4 -0
- package/storage/cursorSchema.js +25 -0
- package/storage/cursorSchema.js.map +1 -0
- package/storage/entity.d.ts +36 -0
- package/storage/entity.js +127 -0
- package/storage/entity.js.map +1 -0
- package/storage/results/ListErrorResult.d.ts +10 -0
- package/storage/results/ListErrorResult.js +11 -0
- package/storage/results/ListErrorResult.js.map +1 -0
- package/storage/results/ListSuccessResult.d.ts +14 -0
- package/storage/results/ListSuccessResult.js +16 -0
- package/storage/results/ListSuccessResult.js.map +1 -0
- package/storage/results/index.d.ts +2 -0
- package/storage/results/index.js +4 -0
- package/storage/results/index.js.map +1 -0
- package/storage/startKey.d.ts +6 -0
- package/storage/startKey.js +9 -0
- package/storage/startKey.js.map +1 -0
- package/storage/types.d.ts +54 -0
- package/storage/types.js +3 -0
- package/storage/types.js.map +1 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +35 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +38 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +42 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -0
- package/subscriptions/aco/index.d.ts +1 -1
- package/subscriptions/aco/index.js +7 -15
- package/subscriptions/aco/index.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +30 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +30 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +34 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +34 -0
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -0
- package/subscriptions/fileManager/index.d.ts +2 -2
- package/subscriptions/fileManager/index.js +11 -13
- package/subscriptions/fileManager/index.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js +40 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterPublishEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterRestoreFromBinEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUnpublishEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js +38 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryRevisionAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js +30 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js +30 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogGroupAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js +30 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterCreateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js +30 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterDeleteEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js +34 -0
- package/subscriptions/headlessCms/handlers/AuditLogModelAfterUpdateEventHandler.js.map +1 -0
- package/subscriptions/headlessCms/index.d.ts +1 -1
- package/subscriptions/headlessCms/index.js +33 -27
- package/subscriptions/headlessCms/index.js.map +1 -1
- package/subscriptions/index.d.ts +1 -1
- package/subscriptions/index.js +13 -26
- package/subscriptions/index.js.map +1 -1
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +11 -0
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +32 -0
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -0
- package/subscriptions/mailer/index.d.ts +2 -2
- package/subscriptions/mailer/index.js +4 -10
- package/subscriptions/mailer/index.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +47 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +47 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +52 -0
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +34 -0
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +34 -0
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +30 -0
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +34 -0
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -0
- package/subscriptions/security/handlers/cleanupApiKey.d.ts +7 -0
- package/subscriptions/security/handlers/cleanupApiKey.js +18 -0
- package/subscriptions/security/handlers/cleanupApiKey.js.map +1 -0
- package/subscriptions/security/index.d.ts +2 -2
- package/subscriptions/security/index.js +31 -23
- package/subscriptions/security/index.js.map +1 -1
- package/subscriptions/websiteBuilder/index.d.ts +2 -0
- package/subscriptions/websiteBuilder/index.js +31 -0
- package/subscriptions/websiteBuilder/index.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +34 -0
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +30 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +34 -0
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +30 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +30 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +30 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +34 -0
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -0
- package/types.d.ts +37 -43
- package/types.js +1 -16
- package/types.js.map +1 -1
- package/utils/expiresAt.d.ts +4 -0
- package/utils/expiresAt.js +25 -0
- package/utils/expiresAt.js.map +1 -0
- package/utils/getAuditConfig.d.ts +4 -36
- package/utils/getAuditConfig.js +77 -113
- package/utils/getAuditConfig.js.map +1 -1
- package/utils/getAuditObject.d.ts +2 -1
- package/utils/getAuditObject.js +1 -8
- package/utils/getAuditObject.js.map +1 -1
- package/app/app.d.ts +0 -2
- package/app/app.js +0 -120
- package/app/app.js.map +0 -1
- package/app/contants.d.ts +0 -2
- package/app/contants.js +0 -10
- package/app/contants.js.map +0 -1
- package/app/createAppModifier.d.ts +0 -4
- package/app/createAppModifier.js +0 -14
- package/app/createAppModifier.js.map +0 -1
- package/app/index.d.ts +0 -4
- package/app/index.js +0 -43
- package/app/index.js.map +0 -1
- package/app/types.d.ts +0 -7
- package/app/types.js +0 -7
- package/app/types.js.map +0 -1
- package/subscriptions/aco/folders.d.ts +0 -4
- package/subscriptions/aco/folders.js +0 -94
- package/subscriptions/aco/folders.js.map +0 -1
- package/subscriptions/apw/changeRequests.d.ts +0 -4
- package/subscriptions/apw/changeRequests.js +0 -80
- package/subscriptions/apw/changeRequests.js.map +0 -1
- package/subscriptions/apw/comments.d.ts +0 -2
- package/subscriptions/apw/comments.js +0 -28
- package/subscriptions/apw/comments.js.map +0 -1
- package/subscriptions/apw/contentReviews.d.ts +0 -2
- package/subscriptions/apw/contentReviews.js +0 -28
- package/subscriptions/apw/contentReviews.js.map +0 -1
- package/subscriptions/apw/index.d.ts +0 -2
- package/subscriptions/apw/index.js +0 -26
- package/subscriptions/apw/index.js.map +0 -1
- package/subscriptions/apw/workflows.d.ts +0 -4
- package/subscriptions/apw/workflows.js +0 -64
- package/subscriptions/apw/workflows.js.map +0 -1
- package/subscriptions/fileManager/files.d.ts +0 -4
- package/subscriptions/fileManager/files.js +0 -64
- package/subscriptions/fileManager/files.js.map +0 -1
- package/subscriptions/fileManager/settings.d.ts +0 -2
- package/subscriptions/fileManager/settings.js +0 -32
- package/subscriptions/fileManager/settings.js.map +0 -1
- package/subscriptions/formBuilder/formRevisions.d.ts +0 -6
- package/subscriptions/formBuilder/formRevisions.js +0 -96
- package/subscriptions/formBuilder/formRevisions.js.map +0 -1
- package/subscriptions/formBuilder/formSubmissions.d.ts +0 -2
- package/subscriptions/formBuilder/formSubmissions.js +0 -28
- package/subscriptions/formBuilder/formSubmissions.js.map +0 -1
- package/subscriptions/formBuilder/forms.d.ts +0 -5
- package/subscriptions/formBuilder/forms.js +0 -76
- package/subscriptions/formBuilder/forms.js.map +0 -1
- package/subscriptions/formBuilder/index.d.ts +0 -2
- package/subscriptions/formBuilder/index.js +0 -26
- package/subscriptions/formBuilder/index.js.map +0 -1
- package/subscriptions/formBuilder/settings.d.ts +0 -2
- package/subscriptions/formBuilder/settings.js +0 -32
- package/subscriptions/formBuilder/settings.js.map +0 -1
- package/subscriptions/headlessCms/entries.d.ts +0 -9
- package/subscriptions/headlessCms/entries.js +0 -183
- package/subscriptions/headlessCms/entries.js.map +0 -1
- package/subscriptions/headlessCms/groups.d.ts +0 -4
- package/subscriptions/headlessCms/groups.js +0 -64
- package/subscriptions/headlessCms/groups.js.map +0 -1
- package/subscriptions/headlessCms/models.d.ts +0 -4
- package/subscriptions/headlessCms/models.js +0 -64
- package/subscriptions/headlessCms/models.js.map +0 -1
- package/subscriptions/headlessCms/utils/isSearchModelEntry.d.ts +0 -1
- package/subscriptions/headlessCms/utils/isSearchModelEntry.js +0 -13
- package/subscriptions/headlessCms/utils/isSearchModelEntry.js.map +0 -1
- package/subscriptions/i18n/index.d.ts +0 -2
- package/subscriptions/i18n/index.js +0 -15
- package/subscriptions/i18n/index.js.map +0 -1
- package/subscriptions/i18n/locales.d.ts +0 -4
- package/subscriptions/i18n/locales.js +0 -64
- package/subscriptions/i18n/locales.js.map +0 -1
- package/subscriptions/mailer/settings.d.ts +0 -2
- package/subscriptions/mailer/settings.js +0 -32
- package/subscriptions/mailer/settings.js.map +0 -1
- package/subscriptions/pageBuilder/blockCategories.d.ts +0 -4
- package/subscriptions/pageBuilder/blockCategories.js +0 -64
- package/subscriptions/pageBuilder/blockCategories.js.map +0 -1
- package/subscriptions/pageBuilder/blocks.d.ts +0 -6
- package/subscriptions/pageBuilder/blocks.js +0 -96
- package/subscriptions/pageBuilder/blocks.js.map +0 -1
- package/subscriptions/pageBuilder/categories.d.ts +0 -4
- package/subscriptions/pageBuilder/categories.js +0 -64
- package/subscriptions/pageBuilder/categories.js.map +0 -1
- package/subscriptions/pageBuilder/index.d.ts +0 -2
- package/subscriptions/pageBuilder/index.js +0 -51
- package/subscriptions/pageBuilder/index.js.map +0 -1
- package/subscriptions/pageBuilder/menus.d.ts +0 -4
- package/subscriptions/pageBuilder/menus.js +0 -64
- package/subscriptions/pageBuilder/menus.js.map +0 -1
- package/subscriptions/pageBuilder/pageElements.d.ts +0 -4
- package/subscriptions/pageBuilder/pageElements.js +0 -64
- package/subscriptions/pageBuilder/pageElements.js.map +0 -1
- package/subscriptions/pageBuilder/pageRevisions.d.ts +0 -6
- package/subscriptions/pageBuilder/pageRevisions.js +0 -101
- package/subscriptions/pageBuilder/pageRevisions.js.map +0 -1
- package/subscriptions/pageBuilder/pages.d.ts +0 -4
- package/subscriptions/pageBuilder/pages.js +0 -60
- package/subscriptions/pageBuilder/pages.js.map +0 -1
- package/subscriptions/pageBuilder/settings.d.ts +0 -2
- package/subscriptions/pageBuilder/settings.js +0 -32
- package/subscriptions/pageBuilder/settings.js.map +0 -1
- package/subscriptions/pageBuilder/templates.d.ts +0 -6
- package/subscriptions/pageBuilder/templates.js +0 -96
- package/subscriptions/pageBuilder/templates.js.map +0 -1
- package/subscriptions/security/apiKeys.d.ts +0 -4
- package/subscriptions/security/apiKeys.js +0 -85
- package/subscriptions/security/apiKeys.js.map +0 -1
- package/subscriptions/security/roles.d.ts +0 -4
- package/subscriptions/security/roles.js +0 -64
- package/subscriptions/security/roles.js.map +0 -1
- package/subscriptions/security/teams.d.ts +0 -4
- package/subscriptions/security/teams.js +0 -64
- package/subscriptions/security/teams.js.map +0 -1
- package/subscriptions/security/users.d.ts +0 -4
- package/subscriptions/security/users.js +0 -64
- package/subscriptions/security/users.js.map +0 -1
- package/utils/compressor.d.ts +0 -11
- package/utils/compressor.js +0 -109
- package/utils/compressor.js.map +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BaseAccessPattern","createPartitionKey","params","tenant","app","entity","action","createdBy","AppEntityActionCreatedByAccessPattern","handles","mustInclude","mustNotInclude","list","options","createOptions","result","query","partitionKey","populateResult","createKeys","item","time","createdOn","getTime","id","sortKey"],"sources":["AppEntityActionCreatedByAccessPattern.ts"],"sourcesContent":["import type { IAuditLog } from \"~/storage/types.js\";\nimport type { IStorageListByAppEntityActionCreatedByParams } from \"~/storage/abstractions/Storage.js\";\nimport { BaseAccessPattern } from \"~/storage/accessPatterns/BaseAccessPattern.js\";\nimport type {\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"~/storage/abstractions/AccessPattern.js\";\n\ninterface ICreatePartitionKeyParams {\n tenant: string;\n app: string;\n action: string;\n entity: string;\n createdBy: string;\n}\n\nconst createPartitionKey = (params: ICreatePartitionKeyParams) => {\n return `T#${params.tenant}#AUDIT_LOG#APP#${params.app}#ENTITY#${params.entity}#ACTION#${params.action}#CREATEDBY#${params.createdBy}`;\n};\n\nexport class AppEntityActionCreatedByAccessPattern<\n T extends\n IStorageListByAppEntityActionCreatedByParams = IStorageListByAppEntityActionCreatedByParams\n> extends BaseAccessPattern<T> {\n public override handles(): IAccessPatternHandles {\n return {\n mustInclude: [\"app\", \"action\", \"entity\", \"createdBy\"],\n mustNotInclude: [\"entityId\"]\n };\n }\n\n public async list(params: T): Promise<IAccessPatternListResult> {\n const options = this.createOptions(params);\n\n const result = await this.query({\n partitionKey: createPartitionKey(params),\n options\n });\n return this.populateResult(result);\n }\n\n public createKeys(item: IAuditLog): IAccessPatternCreateKeysResult {\n const time = item.createdOn.getTime();\n\n return {\n partitionKey: createPartitionKey({\n ...item,\n createdBy: item.createdBy.id\n }),\n sortKey: time\n };\n }\n}\n"],"mappings":"AAEA,SAASA,iBAAiB;AAe1B,MAAMC,kBAAkB,GAAIC,MAAiC,IAAK;EAC9D,OAAO,KAAKA,MAAM,CAACC,MAAM,kBAAkBD,MAAM,CAACE,GAAG,WAAWF,MAAM,CAACG,MAAM,WAAWH,MAAM,CAACI,MAAM,cAAcJ,MAAM,CAACK,SAAS,EAAE;AACzI,CAAC;AAED,OAAO,MAAMC,qCAAqC,SAGxCR,iBAAiB,CAAI;EACXS,OAAOA,CAAA,EAA0B;IAC7C,OAAO;MACHC,WAAW,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAC;MACrDC,cAAc,EAAE,CAAC,UAAU;IAC/B,CAAC;EACL;EAEA,MAAaC,IAAIA,CAACV,MAAS,EAAqC;IAC5D,MAAMW,OAAO,GAAG,IAAI,CAACC,aAAa,CAACZ,MAAM,CAAC;IAE1C,MAAMa,MAAM,GAAG,MAAM,IAAI,CAACC,KAAK,CAAC;MAC5BC,YAAY,EAAEhB,kBAAkB,CAACC,MAAM,CAAC;MACxCW;IACJ,CAAC,CAAC;IACF,OAAO,IAAI,CAACK,cAAc,CAACH,MAAM,CAAC;EACtC;EAEOI,UAAUA,CAACC,IAAe,EAAkC;IAC/D,MAAMC,IAAI,GAAGD,IAAI,CAACE,SAAS,CAACC,OAAO,CAAC,CAAC;IAErC,OAAO;MACHN,YAAY,EAAEhB,kBAAkB,CAAC;QAC7B,GAAGmB,IAAI;QACPb,SAAS,EAAEa,IAAI,CAACb,SAAS,CAACiB;MAC9B,CAAC,CAAC;MACFC,OAAO,EAAEJ;IACb,CAAC;EACL;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createStartKey } from "../startKey.js";
|
|
2
|
+
const toGteTime = date => {
|
|
3
|
+
if (!date) {
|
|
4
|
+
return 0;
|
|
5
|
+
}
|
|
6
|
+
return date.getTime();
|
|
7
|
+
};
|
|
8
|
+
const toLteTime = date => {
|
|
9
|
+
if (!date) {
|
|
10
|
+
return Date.now();
|
|
11
|
+
}
|
|
12
|
+
return date.getTime();
|
|
13
|
+
};
|
|
14
|
+
export class BaseAccessPattern {
|
|
15
|
+
constructor(params) {
|
|
16
|
+
this.index = params.index;
|
|
17
|
+
this.entity = params.entity;
|
|
18
|
+
}
|
|
19
|
+
canHandle(params) {
|
|
20
|
+
const handles = this.handles();
|
|
21
|
+
for (const key of handles.mustInclude) {
|
|
22
|
+
if (!params[key]) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
for (const key of handles.mustNotInclude) {
|
|
27
|
+
if (!!params[key]) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!handles.shouldInclude?.length) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
for (const key of handles.shouldInclude) {
|
|
35
|
+
if (!!params[key]) {
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
async query(params) {
|
|
42
|
+
return this.entity.queryPerPage({
|
|
43
|
+
partitionKey: params.partitionKey,
|
|
44
|
+
options: params.options
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
async populateResult(input) {
|
|
48
|
+
const reader = this.entity.createEntityReader({
|
|
49
|
+
read: input.items.map(item => {
|
|
50
|
+
return {
|
|
51
|
+
PK: item.PK,
|
|
52
|
+
SK: item.SK
|
|
53
|
+
};
|
|
54
|
+
})
|
|
55
|
+
});
|
|
56
|
+
const result = await reader.execute();
|
|
57
|
+
return {
|
|
58
|
+
...input,
|
|
59
|
+
items: input.items.map(item => {
|
|
60
|
+
return result.find(i => {
|
|
61
|
+
return i.PK === item.PK && i.SK === item.SK;
|
|
62
|
+
});
|
|
63
|
+
}).filter(item => !!item)
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
createOptions(params) {
|
|
67
|
+
const options = {
|
|
68
|
+
limit: params.limit || 25,
|
|
69
|
+
startKey: createStartKey({
|
|
70
|
+
after: params.after
|
|
71
|
+
}),
|
|
72
|
+
reverse: params.sort === "DESC",
|
|
73
|
+
index: this.index
|
|
74
|
+
};
|
|
75
|
+
if (params.createdOn_lte || params.createdOn_gte) {
|
|
76
|
+
options.between = [toGteTime(params.createdOn_gte), toLteTime(params.createdOn_lte)];
|
|
77
|
+
}
|
|
78
|
+
return options;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=BaseAccessPattern.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createStartKey","toGteTime","date","getTime","toLteTime","Date","now","BaseAccessPattern","constructor","params","index","entity","canHandle","handles","key","mustInclude","mustNotInclude","shouldInclude","length","query","queryPerPage","partitionKey","options","populateResult","input","reader","createEntityReader","read","items","map","item","PK","SK","result","execute","find","i","filter","createOptions","limit","startKey","after","reverse","sort","createdOn_lte","createdOn_gte","between"],"sources":["BaseAccessPattern.ts"],"sourcesContent":["import type { IAuditLog, IIndexStorageItem, IStorageItem } from \"~/storage/types.js\";\nimport { createStartKey } from \"~/storage/startKey.js\";\nimport type { IStorageListParams } from \"../abstractions/Storage.js\";\nimport type {\n IAccessPattern,\n IAccessPatternCreateKeysResult,\n IAccessPatternHandles,\n IAccessPatternListResult\n} from \"../abstractions/AccessPattern.js\";\nimport type { AuditLogsEntity } from \"~/storage/entity.js\";\nimport type { IEntityQueryAllParams, IEntityQueryPerPageResult } from \"@webiny/db-dynamodb\";\n\nconst toGteTime = (date?: Date): number => {\n if (!date) {\n return 0;\n }\n return date.getTime();\n};\nconst toLteTime = (date?: Date): number => {\n if (!date) {\n return Date.now();\n }\n return date.getTime();\n};\n\nexport interface ICreateOptionsParams {\n limit?: number;\n sort?: \"ASC\" | \"DESC\";\n after?: string;\n createdOn_gte?: Date;\n createdOn_lte?: Date;\n}\n\nexport interface IBaseAccessPatternParams {\n index: string | undefined;\n entity: AuditLogsEntity;\n}\n\nexport interface IAccessPatternQueryParams {\n partitionKey: string;\n options: IEntityQueryAllParams[\"options\"];\n}\n\nexport abstract class BaseAccessPattern<T> implements IAccessPattern<T> {\n public readonly index;\n protected readonly entity;\n\n public constructor(params: IBaseAccessPatternParams) {\n this.index = params.index;\n this.entity = params.entity;\n }\n\n public abstract handles(): IAccessPatternHandles;\n\n public canHandle(params: IStorageListParams): boolean {\n const handles = this.handles();\n for (const key of handles.mustInclude) {\n if (!params[key]) {\n return false;\n }\n }\n for (const key of handles.mustNotInclude) {\n if (!!params[key]) {\n return false;\n }\n }\n if (!handles.shouldInclude?.length) {\n return true;\n }\n\n for (const key of handles.shouldInclude) {\n if (!!params[key]) {\n return true;\n }\n }\n return false;\n }\n\n protected async query<T extends IStorageItem = IStorageItem>(\n params: IAccessPatternQueryParams\n ) {\n return this.entity.queryPerPage<T>({\n partitionKey: params.partitionKey,\n options: params.options\n });\n }\n\n protected async populateResult(\n input: Awaited<IEntityQueryPerPageResult<IIndexStorageItem>>\n ): Promise<IEntityQueryPerPageResult<IStorageItem>> {\n const reader = this.entity.createEntityReader({\n read: input.items.map(item => {\n return {\n PK: item.PK,\n SK: item.SK\n };\n })\n });\n const result = await reader.execute();\n\n return {\n ...input,\n items: input.items\n .map(item => {\n return result.find(i => {\n return i.PK === item.PK && i.SK === item.SK;\n });\n })\n .filter((item): item is IStorageItem => !!item)\n };\n }\n\n public abstract list(params: T): Promise<IAccessPatternListResult>;\n public abstract createKeys(item: IAuditLog): IAccessPatternCreateKeysResult;\n\n protected createOptions(params: ICreateOptionsParams): IEntityQueryAllParams[\"options\"] {\n const options: IEntityQueryAllParams[\"options\"] = {\n limit: params.limit || 25,\n startKey: createStartKey({\n after: params.after\n }),\n reverse: params.sort === \"DESC\",\n index: this.index\n };\n\n if (params.createdOn_lte || params.createdOn_gte) {\n options.between = [toGteTime(params.createdOn_gte), toLteTime(params.createdOn_lte)];\n }\n\n return options;\n }\n}\n"],"mappings":"AACA,SAASA,cAAc;AAWvB,MAAMC,SAAS,GAAIC,IAAW,IAAa;EACvC,IAAI,CAACA,IAAI,EAAE;IACP,OAAO,CAAC;EACZ;EACA,OAAOA,IAAI,CAACC,OAAO,CAAC,CAAC;AACzB,CAAC;AACD,MAAMC,SAAS,GAAIF,IAAW,IAAa;EACvC,IAAI,CAACA,IAAI,EAAE;IACP,OAAOG,IAAI,CAACC,GAAG,CAAC,CAAC;EACrB;EACA,OAAOJ,IAAI,CAACC,OAAO,CAAC,CAAC;AACzB,CAAC;AAoBD,OAAO,MAAeI,iBAAiB,CAAiC;EAI7DC,WAAWA,CAACC,MAAgC,EAAE;IACjD,IAAI,CAACC,KAAK,GAAGD,MAAM,CAACC,KAAK;IACzB,IAAI,CAACC,MAAM,GAAGF,MAAM,CAACE,MAAM;EAC/B;EAIOC,SAASA,CAACH,MAA0B,EAAW;IAClD,MAAMI,OAAO,GAAG,IAAI,CAACA,OAAO,CAAC,CAAC;IAC9B,KAAK,MAAMC,GAAG,IAAID,OAAO,CAACE,WAAW,EAAE;MACnC,IAAI,CAACN,MAAM,CAACK,GAAG,CAAC,EAAE;QACd,OAAO,KAAK;MAChB;IACJ;IACA,KAAK,MAAMA,GAAG,IAAID,OAAO,CAACG,cAAc,EAAE;MACtC,IAAI,CAAC,CAACP,MAAM,CAACK,GAAG,CAAC,EAAE;QACf,OAAO,KAAK;MAChB;IACJ;IACA,IAAI,CAACD,OAAO,CAACI,aAAa,EAAEC,MAAM,EAAE;MAChC,OAAO,IAAI;IACf;IAEA,KAAK,MAAMJ,GAAG,IAAID,OAAO,CAACI,aAAa,EAAE;MACrC,IAAI,CAAC,CAACR,MAAM,CAACK,GAAG,CAAC,EAAE;QACf,OAAO,IAAI;MACf;IACJ;IACA,OAAO,KAAK;EAChB;EAEA,MAAgBK,KAAKA,CACjBV,MAAiC,EACnC;IACE,OAAO,IAAI,CAACE,MAAM,CAACS,YAAY,CAAI;MAC/BC,YAAY,EAAEZ,MAAM,CAACY,YAAY;MACjCC,OAAO,EAAEb,MAAM,CAACa;IACpB,CAAC,CAAC;EACN;EAEA,MAAgBC,cAAcA,CAC1BC,KAA4D,EACZ;IAChD,MAAMC,MAAM,GAAG,IAAI,CAACd,MAAM,CAACe,kBAAkB,CAAC;MAC1CC,IAAI,EAAEH,KAAK,CAACI,KAAK,CAACC,GAAG,CAACC,IAAI,IAAI;QAC1B,OAAO;UACHC,EAAE,EAAED,IAAI,CAACC,EAAE;UACXC,EAAE,EAAEF,IAAI,CAACE;QACb,CAAC;MACL,CAAC;IACL,CAAC,CAAC;IACF,MAAMC,MAAM,GAAG,MAAMR,MAAM,CAACS,OAAO,CAAC,CAAC;IAErC,OAAO;MACH,GAAGV,KAAK;MACRI,KAAK,EAAEJ,KAAK,CAACI,KAAK,CACbC,GAAG,CAACC,IAAI,IAAI;QACT,OAAOG,MAAM,CAACE,IAAI,CAACC,CAAC,IAAI;UACpB,OAAOA,CAAC,CAACL,EAAE,KAAKD,IAAI,CAACC,EAAE,IAAIK,CAAC,CAACJ,EAAE,KAAKF,IAAI,CAACE,EAAE;QAC/C,CAAC,CAAC;MACN,CAAC,CAAC,CACDK,MAAM,CAAEP,IAAI,IAA2B,CAAC,CAACA,IAAI;IACtD,CAAC;EACL;EAKUQ,aAAaA,CAAC7B,MAA4B,EAAoC;IACpF,MAAMa,OAAyC,GAAG;MAC9CiB,KAAK,EAAE9B,MAAM,CAAC8B,KAAK,IAAI,EAAE;MACzBC,QAAQ,EAAExC,cAAc,CAAC;QACrByC,KAAK,EAAEhC,MAAM,CAACgC;MAClB,CAAC,CAAC;MACFC,OAAO,EAAEjC,MAAM,CAACkC,IAAI,KAAK,MAAM;MAC/BjC,KAAK,EAAE,IAAI,CAACA;IAChB,CAAC;IAED,IAAID,MAAM,CAACmC,aAAa,IAAInC,MAAM,CAACoC,aAAa,EAAE;MAC9CvB,OAAO,CAACwB,OAAO,GAAG,CAAC7C,SAAS,CAACQ,MAAM,CAACoC,aAAa,CAAC,EAAEzC,SAAS,CAACK,MAAM,CAACmC,aAAa,CAAC,CAAC;IACxF;IAEA,OAAOtB,OAAO;EAClB;AACJ","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
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>[];
|
|
@@ -0,0 +1,47 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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":[]}
|