@webiny/api-audit-logs 0.0.0-unstable.06b2ede40f → 0.0.0-unstable.0d717d18dd
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 +43 -0
- package/AuditLogsFeature.js.map +1 -0
- package/README.md +11 -1
- package/abstractions.d.ts +10 -0
- package/abstractions.js +6 -0
- package/abstractions.js.map +1 -0
- package/config.d.ts +0 -13
- package/config.js +4 -291
- package/config.js.map +1 -1
- package/context/AuditLogsContextValue.d.ts +10 -0
- package/context/AuditLogsContextValue.js +131 -0
- package/context/AuditLogsContextValue.js.map +1 -0
- package/events/AuditLogAfterCreateEvent.d.ts +6 -0
- package/events/AuditLogAfterCreateEvent.js +13 -0
- package/events/AuditLogAfterCreateEvent.js.map +1 -0
- package/events/AuditLogAfterUpdateEvent.d.ts +6 -0
- package/events/AuditLogAfterUpdateEvent.js +13 -0
- package/events/AuditLogAfterUpdateEvent.js.map +1 -0
- package/events/AuditLogBeforeCreateEvent.d.ts +6 -0
- package/events/AuditLogBeforeCreateEvent.js +13 -0
- package/events/AuditLogBeforeCreateEvent.js.map +1 -0
- package/events/AuditLogBeforeUpdateEvent.d.ts +6 -0
- package/events/AuditLogBeforeUpdateEvent.js +13 -0
- package/events/AuditLogBeforeUpdateEvent.js.map +1 -0
- package/events/abstractions.d.ts +43 -0
- package/events/abstractions.js +8 -0
- package/events/abstractions.js.map +1 -0
- package/events/index.d.ts +5 -0
- package/events/index.js +5 -0
- package/graphql/AuditLogsGraphQLSchema.d.ts +9 -0
- package/graphql/AuditLogsGraphQLSchema.js +134 -0
- package/graphql/AuditLogsGraphQLSchema.js.map +1 -0
- package/graphql/validation.d.ts +21 -0
- package/graphql/validation.js +31 -0
- package/graphql/validation.js.map +1 -0
- package/index.d.ts +3 -5
- package/index.js +2 -49
- package/package.json +35 -26
- package/storage/abstractions/Storage.d.ts +108 -0
- package/storage/abstractions/Storage.js +0 -0
- package/storage/types.d.ts +19 -0
- package/storage/types.js +0 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +11 -0
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +36 -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 +39 -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 +8 -15
- package/subscriptions/aco/index.js.map +1 -1
- package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.d.ts +11 -0
- package/subscriptions/ai/handlers/AuditLogAiAfterGenerateTextHandler.js +41 -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 +38 -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 +40 -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 +11 -0
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +31 -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 +31 -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 +10 -14
- package/subscriptions/fileManager/index.js.map +1 -1
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.d.ts +11 -0
- package/subscriptions/headlessCms/handlers/AuditLogEntryAfterCreateEventHandler.js +32 -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 +37 -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 +32 -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 +32 -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 +32 -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 +35 -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 +32 -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 +32 -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 +31 -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 +31 -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 +31 -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 +31 -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 +30 -28
- package/subscriptions/headlessCms/index.js.map +1 -1
- package/subscriptions/index.d.ts +1 -1
- package/subscriptions/index.js +16 -22
- package/subscriptions/index.js.map +1 -1
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +11 -0
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +33 -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 +41 -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 +41 -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 +45 -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 +31 -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 +31 -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 +31 -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 +31 -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 +31 -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 +31 -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 +12 -0
- package/subscriptions/security/handlers/cleanupApiKey.js.map +1 -0
- package/subscriptions/security/index.d.ts +2 -2
- package/subscriptions/security/index.js +26 -24
- package/subscriptions/security/index.js.map +1 -1
- package/subscriptions/websiteBuilder/index.d.ts +2 -0
- package/subscriptions/websiteBuilder/index.js +29 -0
- package/subscriptions/websiteBuilder/index.js.map +1 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +11 -0
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +31 -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 +31 -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 +31 -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 +31 -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 +31 -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 +31 -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 +31 -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 +31 -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 +31 -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 +36 -38
- package/types.js +0 -18
- package/utils/expiresAt.d.ts +4 -0
- package/utils/expiresAt.js +20 -0
- package/utils/expiresAt.js.map +1 -0
- package/utils/getAuditConfig.d.ts +4 -36
- package/utils/getAuditConfig.js +77 -138
- package/utils/getAuditConfig.js.map +1 -1
- package/utils/getAuditObject.d.ts +2 -1
- package/utils/getAuditObject.js +14 -22
- package/utils/getAuditObject.js.map +1 -1
- package/app/app.d.ts +0 -2
- package/app/app.js +0 -119
- 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/index.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/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/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/types.js.map +0 -1
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
|
+
import { AuditLogAfterUpdatePayload } from "./abstractions.js";
|
|
3
|
+
export declare class AuditLogAfterUpdateEvent extends DomainEvent<AuditLogAfterUpdatePayload> {
|
|
4
|
+
eventType: "auditLog.afterUpdate";
|
|
5
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher/abstractions.js").IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
|
+
import { AuditLogAfterUpdateHandler } from "./abstractions.js";
|
|
3
|
+
class AuditLogAfterUpdateEvent extends DomainEvent {
|
|
4
|
+
getHandlerAbstraction() {
|
|
5
|
+
return AuditLogAfterUpdateHandler;
|
|
6
|
+
}
|
|
7
|
+
constructor(...args){
|
|
8
|
+
super(...args), this.eventType = "auditLog.afterUpdate";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export { AuditLogAfterUpdateEvent };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=AuditLogAfterUpdateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events/AuditLogAfterUpdateEvent.js","sources":["../../src/events/AuditLogAfterUpdateEvent.ts"],"sourcesContent":["import { DomainEvent } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { AuditLogAfterUpdateHandler, AuditLogAfterUpdatePayload } from \"./abstractions.js\";\n\nexport class AuditLogAfterUpdateEvent extends DomainEvent<AuditLogAfterUpdatePayload> {\n eventType = \"auditLog.afterUpdate\" as const;\n\n getHandlerAbstraction() {\n return AuditLogAfterUpdateHandler;\n }\n}\n"],"names":["AuditLogAfterUpdateEvent","DomainEvent","AuditLogAfterUpdateHandler"],"mappings":";;AAGO,MAAMA,iCAAiCC;IAG1C,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
|
+
import { AuditLogBeforeCreatePayload } from "./abstractions.js";
|
|
3
|
+
export declare class AuditLogBeforeCreateEvent extends DomainEvent<AuditLogBeforeCreatePayload> {
|
|
4
|
+
eventType: "auditLog.beforeCreate";
|
|
5
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher/abstractions.js").IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
|
+
import { AuditLogBeforeCreateHandler } from "./abstractions.js";
|
|
3
|
+
class AuditLogBeforeCreateEvent extends DomainEvent {
|
|
4
|
+
getHandlerAbstraction() {
|
|
5
|
+
return AuditLogBeforeCreateHandler;
|
|
6
|
+
}
|
|
7
|
+
constructor(...args){
|
|
8
|
+
super(...args), this.eventType = "auditLog.beforeCreate";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export { AuditLogBeforeCreateEvent };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=AuditLogBeforeCreateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events/AuditLogBeforeCreateEvent.js","sources":["../../src/events/AuditLogBeforeCreateEvent.ts"],"sourcesContent":["import { DomainEvent } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { AuditLogBeforeCreateHandler, AuditLogBeforeCreatePayload } from \"./abstractions.js\";\n\nexport class AuditLogBeforeCreateEvent extends DomainEvent<AuditLogBeforeCreatePayload> {\n eventType = \"auditLog.beforeCreate\" as const;\n\n getHandlerAbstraction() {\n return AuditLogBeforeCreateHandler;\n }\n}\n"],"names":["AuditLogBeforeCreateEvent","DomainEvent","AuditLogBeforeCreateHandler"],"mappings":";;AAGO,MAAMA,kCAAkCC;IAG3C,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
|
+
import { AuditLogBeforeUpdatePayload } from "./abstractions.js";
|
|
3
|
+
export declare class AuditLogBeforeUpdateEvent extends DomainEvent<AuditLogBeforeUpdatePayload> {
|
|
4
|
+
eventType: "auditLog.beforeUpdate";
|
|
5
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<import("@webiny/api-core/features/eventPublisher/abstractions.js").IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DomainEvent } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
|
+
import { AuditLogBeforeUpdateHandler } from "./abstractions.js";
|
|
3
|
+
class AuditLogBeforeUpdateEvent extends DomainEvent {
|
|
4
|
+
getHandlerAbstraction() {
|
|
5
|
+
return AuditLogBeforeUpdateHandler;
|
|
6
|
+
}
|
|
7
|
+
constructor(...args){
|
|
8
|
+
super(...args), this.eventType = "auditLog.beforeUpdate";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export { AuditLogBeforeUpdateEvent };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=AuditLogBeforeUpdateEvent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events/AuditLogBeforeUpdateEvent.js","sources":["../../src/events/AuditLogBeforeUpdateEvent.ts"],"sourcesContent":["import { DomainEvent } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport { AuditLogBeforeUpdateHandler, AuditLogBeforeUpdatePayload } from \"./abstractions.js\";\n\nexport class AuditLogBeforeUpdateEvent extends DomainEvent<AuditLogBeforeUpdatePayload> {\n eventType = \"auditLog.beforeUpdate\" as const;\n\n getHandlerAbstraction() {\n return AuditLogBeforeUpdateHandler;\n }\n}\n"],"names":["AuditLogBeforeUpdateEvent","DomainEvent","AuditLogBeforeUpdateHandler"],"mappings":";;AAGO,MAAMA,kCAAkCC;IAG3C,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { DomainEvent, IEventHandler } from "@webiny/api-core/features/eventPublisher/index.js";
|
|
2
|
+
import type { IAuditLog } from "../storage/types.js";
|
|
3
|
+
import type { AuditLogsContext } from "../types.js";
|
|
4
|
+
export interface AuditLogBeforeCreatePayload {
|
|
5
|
+
auditLog: IAuditLog;
|
|
6
|
+
context: AuditLogsContext;
|
|
7
|
+
setAuditLog(auditLog: Partial<IAuditLog>): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const AuditLogBeforeCreateHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>>;
|
|
10
|
+
export declare namespace AuditLogBeforeCreateHandler {
|
|
11
|
+
type Interface = IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>;
|
|
12
|
+
type Event = DomainEvent<AuditLogBeforeCreatePayload>;
|
|
13
|
+
}
|
|
14
|
+
export interface AuditLogAfterCreatePayload {
|
|
15
|
+
auditLog: IAuditLog;
|
|
16
|
+
context: AuditLogsContext;
|
|
17
|
+
}
|
|
18
|
+
export declare const AuditLogAfterCreateHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<AuditLogAfterCreatePayload>>>;
|
|
19
|
+
export declare namespace AuditLogAfterCreateHandler {
|
|
20
|
+
type Interface = IEventHandler<DomainEvent<AuditLogAfterCreatePayload>>;
|
|
21
|
+
type Event = DomainEvent<AuditLogAfterCreatePayload>;
|
|
22
|
+
}
|
|
23
|
+
export interface AuditLogBeforeUpdatePayload {
|
|
24
|
+
auditLog: IAuditLog;
|
|
25
|
+
original: IAuditLog;
|
|
26
|
+
context: AuditLogsContext;
|
|
27
|
+
setAuditLog(auditLog: Partial<IAuditLog>): void;
|
|
28
|
+
}
|
|
29
|
+
export declare const AuditLogBeforeUpdateHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>>;
|
|
30
|
+
export declare namespace AuditLogBeforeUpdateHandler {
|
|
31
|
+
type Interface = IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>;
|
|
32
|
+
type Event = DomainEvent<AuditLogBeforeUpdatePayload>;
|
|
33
|
+
}
|
|
34
|
+
export interface AuditLogAfterUpdatePayload {
|
|
35
|
+
auditLog: IAuditLog;
|
|
36
|
+
original: IAuditLog;
|
|
37
|
+
context: AuditLogsContext;
|
|
38
|
+
}
|
|
39
|
+
export declare const AuditLogAfterUpdateHandler: import("@webiny/di").Abstraction<IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>>;
|
|
40
|
+
export declare namespace AuditLogAfterUpdateHandler {
|
|
41
|
+
type Interface = IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>;
|
|
42
|
+
type Event = DomainEvent<AuditLogAfterUpdatePayload>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
const AuditLogBeforeCreateHandler = createAbstraction("AuditLogBeforeCreateHandler");
|
|
3
|
+
const AuditLogAfterCreateHandler = createAbstraction("AuditLogAfterCreateHandler");
|
|
4
|
+
const AuditLogBeforeUpdateHandler = createAbstraction("AuditLogBeforeUpdateHandler");
|
|
5
|
+
const AuditLogAfterUpdateHandler = createAbstraction("AuditLogAfterUpdateHandler");
|
|
6
|
+
export { AuditLogAfterCreateHandler, AuditLogAfterUpdateHandler, AuditLogBeforeCreateHandler, AuditLogBeforeUpdateHandler };
|
|
7
|
+
|
|
8
|
+
//# sourceMappingURL=abstractions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events/abstractions.js","sources":["../../src/events/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { DomainEvent, IEventHandler } from \"@webiny/api-core/features/eventPublisher/index.js\";\nimport type { IAuditLog } from \"~/storage/types.js\";\nimport type { AuditLogsContext } from \"~/types.js\";\n\n// ============================================================================\n// AuditLogBeforeCreate Event\n// ============================================================================\n\nexport interface AuditLogBeforeCreatePayload {\n auditLog: IAuditLog;\n context: AuditLogsContext;\n setAuditLog(auditLog: Partial<IAuditLog>): void;\n}\n\nexport const AuditLogBeforeCreateHandler = createAbstraction<\n IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>\n>(\"AuditLogBeforeCreateHandler\");\n\nexport namespace AuditLogBeforeCreateHandler {\n export type Interface = IEventHandler<DomainEvent<AuditLogBeforeCreatePayload>>;\n export type Event = DomainEvent<AuditLogBeforeCreatePayload>;\n}\n\n// ============================================================================\n// AuditLogAfterCreate Event\n// ============================================================================\n\nexport interface AuditLogAfterCreatePayload {\n auditLog: IAuditLog;\n context: AuditLogsContext;\n}\n\nexport const AuditLogAfterCreateHandler = createAbstraction<\n IEventHandler<DomainEvent<AuditLogAfterCreatePayload>>\n>(\"AuditLogAfterCreateHandler\");\n\nexport namespace AuditLogAfterCreateHandler {\n export type Interface = IEventHandler<DomainEvent<AuditLogAfterCreatePayload>>;\n export type Event = DomainEvent<AuditLogAfterCreatePayload>;\n}\n\n// ============================================================================\n// AuditLogBeforeUpdate Event\n// ============================================================================\n\nexport interface AuditLogBeforeUpdatePayload {\n auditLog: IAuditLog;\n original: IAuditLog;\n context: AuditLogsContext;\n setAuditLog(auditLog: Partial<IAuditLog>): void;\n}\n\nexport const AuditLogBeforeUpdateHandler = createAbstraction<\n IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>\n>(\"AuditLogBeforeUpdateHandler\");\n\nexport namespace AuditLogBeforeUpdateHandler {\n export type Interface = IEventHandler<DomainEvent<AuditLogBeforeUpdatePayload>>;\n export type Event = DomainEvent<AuditLogBeforeUpdatePayload>;\n}\n\n// ============================================================================\n// AuditLogAfterUpdate Event\n// ============================================================================\n\nexport interface AuditLogAfterUpdatePayload {\n auditLog: IAuditLog;\n original: IAuditLog;\n context: AuditLogsContext;\n}\n\nexport const AuditLogAfterUpdateHandler = createAbstraction<\n IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>\n>(\"AuditLogAfterUpdateHandler\");\n\nexport namespace AuditLogAfterUpdateHandler {\n export type Interface = IEventHandler<DomainEvent<AuditLogAfterUpdatePayload>>;\n export type Event = DomainEvent<AuditLogAfterUpdatePayload>;\n}\n"],"names":["AuditLogBeforeCreateHandler","createAbstraction","AuditLogAfterCreateHandler","AuditLogBeforeUpdateHandler","AuditLogAfterUpdateHandler"],"mappings":";AAeO,MAAMA,8BAA8BC,kBAEzC;AAgBK,MAAMC,6BAA6BD,kBAExC;AAkBK,MAAME,8BAA8BF,kBAEzC;AAiBK,MAAMG,6BAA6BH,kBAExC"}
|
package/events/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { GraphQLSchemaBuilder } from "@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js";
|
|
3
|
+
declare class AuditLogsGraphQLSchemaImpl implements CoreGraphQLSchemaFactory.Interface {
|
|
4
|
+
execute(builder: GraphQLSchemaBuilder.Interface): CoreGraphQLSchemaFactory.Return;
|
|
5
|
+
}
|
|
6
|
+
export declare const AuditLogsGraphQLSchema: typeof AuditLogsGraphQLSchemaImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.core.js").ICoreGraphQLSchemaFactory>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { NotFoundError, resolve, resolveList } from "@webiny/api-graphql";
|
|
2
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
3
|
+
import { createZodError } from "@webiny/utils";
|
|
4
|
+
import { AuditLogsContext } from "../abstractions.js";
|
|
5
|
+
import { getValidationSchema, listValidationSchema } from "./validation.js";
|
|
6
|
+
const TYPE_DEFS = `
|
|
7
|
+
type AuditLogCreatedBy {
|
|
8
|
+
id: ID!
|
|
9
|
+
displayName: String
|
|
10
|
+
type: String
|
|
11
|
+
}
|
|
12
|
+
type AuditLog {
|
|
13
|
+
id: ID!
|
|
14
|
+
createdBy: AuditLogCreatedBy!
|
|
15
|
+
createdOn: DateTime!
|
|
16
|
+
app: String!
|
|
17
|
+
action: String!
|
|
18
|
+
message: String!
|
|
19
|
+
entity: String!
|
|
20
|
+
entityId: String!
|
|
21
|
+
tags: [String!]!
|
|
22
|
+
expiresAt: DateTime!
|
|
23
|
+
content: String
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type AuditLogListMeta {
|
|
27
|
+
cursor: String
|
|
28
|
+
hasMoreItems: Boolean!
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type AuditLogError {
|
|
32
|
+
code: String
|
|
33
|
+
message: String!
|
|
34
|
+
data: JSON
|
|
35
|
+
stack: String
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
type AuditLogListResponse {
|
|
39
|
+
data: [AuditLog!]
|
|
40
|
+
meta: AuditLogListMeta
|
|
41
|
+
error: AuditLogError
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
type AuditLogGetResponse {
|
|
45
|
+
data: AuditLog
|
|
46
|
+
error: AuditLogError
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
enum AuditLogsSort {
|
|
50
|
+
ASC
|
|
51
|
+
DESC
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
input ListAuditLogsWhere {
|
|
55
|
+
app: String
|
|
56
|
+
action: String
|
|
57
|
+
createdBy: String
|
|
58
|
+
entity: String
|
|
59
|
+
entityId: String
|
|
60
|
+
createdOn_gte: DateTime
|
|
61
|
+
createdOn_lte: DateTime
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type AuditLogsQuery {
|
|
65
|
+
getAuditLog(id: ID!): AuditLogGetResponse
|
|
66
|
+
listAuditLogs(
|
|
67
|
+
where: ListAuditLogsWhere
|
|
68
|
+
sort: AuditLogsSort
|
|
69
|
+
limit: Number
|
|
70
|
+
after: String
|
|
71
|
+
): AuditLogListResponse!
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
extend type Query {
|
|
75
|
+
auditLogs: AuditLogsQuery
|
|
76
|
+
}
|
|
77
|
+
`;
|
|
78
|
+
class AuditLogsGraphQLSchemaImpl {
|
|
79
|
+
async execute(builder) {
|
|
80
|
+
builder.addTypeDefs(TYPE_DEFS);
|
|
81
|
+
builder.addResolver({
|
|
82
|
+
path: "Query.auditLogs",
|
|
83
|
+
dependencies: [],
|
|
84
|
+
resolver: ()=>()=>({})
|
|
85
|
+
});
|
|
86
|
+
builder.addResolver({
|
|
87
|
+
path: "AuditLogsQuery.getAuditLog",
|
|
88
|
+
dependencies: [
|
|
89
|
+
AuditLogsContext
|
|
90
|
+
],
|
|
91
|
+
resolver (auditLogs) {
|
|
92
|
+
return async ({ args })=>resolve(async ()=>{
|
|
93
|
+
const validation = await getValidationSchema.safeParseAsync(args);
|
|
94
|
+
if (!validation.success) throw createZodError(validation.error);
|
|
95
|
+
const result = await auditLogs.getAuditLog(validation.data.id);
|
|
96
|
+
if (!result) throw new NotFoundError(`Audit log with id "${validation.data.id}" not found.`);
|
|
97
|
+
return result;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
builder.addResolver({
|
|
102
|
+
path: "AuditLogsQuery.listAuditLogs",
|
|
103
|
+
dependencies: [
|
|
104
|
+
AuditLogsContext
|
|
105
|
+
],
|
|
106
|
+
resolver (auditLogs) {
|
|
107
|
+
return async ({ args })=>resolveList(async ()=>{
|
|
108
|
+
const validation = await listValidationSchema.safeParseAsync(args);
|
|
109
|
+
if (!validation.success) throw createZodError(validation.error);
|
|
110
|
+
const result = await auditLogs.listAuditLogs({
|
|
111
|
+
...validation.data,
|
|
112
|
+
...validation.data.where
|
|
113
|
+
});
|
|
114
|
+
if (result.error) throw result.error;
|
|
115
|
+
return {
|
|
116
|
+
items: result.items,
|
|
117
|
+
meta: {
|
|
118
|
+
...result.meta,
|
|
119
|
+
totalCount: 0
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return builder;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const AuditLogsGraphQLSchema = CoreGraphQLSchemaFactory.createImplementation({
|
|
129
|
+
implementation: AuditLogsGraphQLSchemaImpl,
|
|
130
|
+
dependencies: []
|
|
131
|
+
});
|
|
132
|
+
export { AuditLogsGraphQLSchema };
|
|
133
|
+
|
|
134
|
+
//# sourceMappingURL=AuditLogsGraphQLSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/AuditLogsGraphQLSchema.js","sources":["../../src/graphql/AuditLogsGraphQLSchema.ts"],"sourcesContent":["import { NotFoundError, resolve, resolveList } from \"@webiny/api-graphql\";\nimport { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { GraphQLSchemaBuilder } from \"@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js\";\nimport { createZodError } from \"@webiny/utils\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport type { AuditLogsContextValue } from \"~/types.js\";\nimport { getValidationSchema, listValidationSchema } from \"./validation.js\";\n\ninterface IListAuditLogsWhere {\n app?: string;\n action?: string;\n createdBy?: string;\n entity?: string;\n entityId?: string;\n createdOn_gte?: Date;\n createdOn_lte?: Date;\n}\n\ninterface IListAuditLogsArgs {\n where?: IListAuditLogsWhere;\n sort?: \"ASC\" | \"DESC\";\n limit?: number;\n after?: string;\n}\n\nconst TYPE_DEFS = /* GraphQL */ `\n type AuditLogCreatedBy {\n id: ID!\n displayName: String\n type: String\n }\n type AuditLog {\n id: ID!\n createdBy: AuditLogCreatedBy!\n createdOn: DateTime!\n app: String!\n action: String!\n message: String!\n entity: String!\n entityId: String!\n tags: [String!]!\n expiresAt: DateTime!\n content: String\n }\n\n type AuditLogListMeta {\n cursor: String\n hasMoreItems: Boolean!\n }\n\n type AuditLogError {\n code: String\n message: String!\n data: JSON\n stack: String\n }\n\n type AuditLogListResponse {\n data: [AuditLog!]\n meta: AuditLogListMeta\n error: AuditLogError\n }\n\n type AuditLogGetResponse {\n data: AuditLog\n error: AuditLogError\n }\n\n enum AuditLogsSort {\n ASC\n DESC\n }\n\n input ListAuditLogsWhere {\n app: String\n action: String\n createdBy: String\n entity: String\n entityId: String\n createdOn_gte: DateTime\n createdOn_lte: DateTime\n }\n\n type AuditLogsQuery {\n getAuditLog(id: ID!): AuditLogGetResponse\n listAuditLogs(\n where: ListAuditLogsWhere\n sort: AuditLogsSort\n limit: Number\n after: String\n ): AuditLogListResponse!\n }\n\n extend type Query {\n auditLogs: AuditLogsQuery\n }\n`;\n\nclass AuditLogsGraphQLSchemaImpl implements CoreGraphQLSchemaFactory.Interface {\n public async execute(builder: GraphQLSchemaBuilder.Interface): CoreGraphQLSchemaFactory.Return {\n builder.addTypeDefs(TYPE_DEFS);\n\n builder.addResolver({\n path: \"Query.auditLogs\",\n dependencies: [],\n resolver: () => () => ({})\n });\n\n builder.addResolver<{ id: string }>({\n path: \"AuditLogsQuery.getAuditLog\",\n dependencies: [AuditLogsContext],\n resolver(auditLogs: AuditLogsContextValue) {\n return async ({ args }) => {\n return resolve(async () => {\n const validation = await getValidationSchema.safeParseAsync(args);\n\n if (!validation.success) {\n throw createZodError(validation.error);\n }\n\n const result = await auditLogs.getAuditLog(validation.data.id);\n if (!result) {\n throw new NotFoundError(\n `Audit log with id \"${validation.data.id}\" not found.`\n );\n }\n return result;\n });\n };\n }\n });\n\n builder.addResolver<IListAuditLogsArgs>({\n path: \"AuditLogsQuery.listAuditLogs\",\n dependencies: [AuditLogsContext],\n resolver(auditLogs: AuditLogsContextValue) {\n return async ({ args }) => {\n return resolveList(async () => {\n const validation = await listValidationSchema.safeParseAsync(args);\n if (!validation.success) {\n throw createZodError(validation.error);\n }\n const result = await auditLogs.listAuditLogs({\n ...validation.data,\n ...validation.data.where\n });\n if (result.error) {\n throw result.error;\n }\n return {\n items: result.items,\n meta: {\n ...result.meta,\n totalCount: 0\n }\n };\n });\n };\n }\n });\n\n return builder;\n }\n}\n\nexport const AuditLogsGraphQLSchema = CoreGraphQLSchemaFactory.createImplementation({\n implementation: AuditLogsGraphQLSchemaImpl,\n dependencies: []\n});\n"],"names":["TYPE_DEFS","AuditLogsGraphQLSchemaImpl","builder","AuditLogsContext","auditLogs","args","resolve","validation","getValidationSchema","createZodError","result","NotFoundError","resolveList","listValidationSchema","AuditLogsGraphQLSchema","CoreGraphQLSchemaFactory"],"mappings":";;;;;AAyBA,MAAMA,YAA0B,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEjC,CAAC;AAED,MAAMC;IACF,MAAa,QAAQC,OAAuC,EAAmC;QAC3FA,QAAQ,WAAW,CAACF;QAEpBE,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc,EAAE;YAChB,UAAU,IAAM,IAAO,EAAC;QAC5B;QAEAA,QAAQ,WAAW,CAAiB;YAChC,MAAM;YACN,cAAc;gBAACC;aAAiB;YAChC,UAASC,SAAgC;gBACrC,OAAO,OAAO,EAAEC,IAAI,EAAE,GACXC,QAAQ;wBACX,MAAMC,aAAa,MAAMC,oBAAoB,cAAc,CAACH;wBAE5D,IAAI,CAACE,WAAW,OAAO,EACnB,MAAME,eAAeF,WAAW,KAAK;wBAGzC,MAAMG,SAAS,MAAMN,UAAU,WAAW,CAACG,WAAW,IAAI,CAAC,EAAE;wBAC7D,IAAI,CAACG,QACD,MAAM,IAAIC,cACN,CAAC,mBAAmB,EAAEJ,WAAW,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC;wBAG9D,OAAOG;oBACX;YAER;QACJ;QAEAR,QAAQ,WAAW,CAAqB;YACpC,MAAM;YACN,cAAc;gBAACC;aAAiB;YAChC,UAASC,SAAgC;gBACrC,OAAO,OAAO,EAAEC,IAAI,EAAE,GACXO,YAAY;wBACf,MAAML,aAAa,MAAMM,qBAAqB,cAAc,CAACR;wBAC7D,IAAI,CAACE,WAAW,OAAO,EACnB,MAAME,eAAeF,WAAW,KAAK;wBAEzC,MAAMG,SAAS,MAAMN,UAAU,aAAa,CAAC;4BACzC,GAAGG,WAAW,IAAI;4BAClB,GAAGA,WAAW,IAAI,CAAC,KAAK;wBAC5B;wBACA,IAAIG,OAAO,KAAK,EACZ,MAAMA,OAAO,KAAK;wBAEtB,OAAO;4BACH,OAAOA,OAAO,KAAK;4BACnB,MAAM;gCACF,GAAGA,OAAO,IAAI;gCACd,YAAY;4BAChB;wBACJ;oBACJ;YAER;QACJ;QAEA,OAAOR;IACX;AACJ;AAEO,MAAMY,yBAAyBC,yBAAyB,oBAAoB,CAAC;IAChF,gBAAgBd;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
export declare const getValidationSchema: zod.ZodObject<{
|
|
3
|
+
id: zod.ZodString;
|
|
4
|
+
}, zod.core.$strip>;
|
|
5
|
+
export declare const listValidationSchema: zod.ZodObject<{
|
|
6
|
+
where: zod.ZodObject<{
|
|
7
|
+
app: zod.ZodOptional<zod.ZodString>;
|
|
8
|
+
entity: zod.ZodOptional<zod.ZodString>;
|
|
9
|
+
entityId: zod.ZodOptional<zod.ZodString>;
|
|
10
|
+
createdOn_gte: zod.ZodPreprocess<zod.ZodOptional<zod.ZodDate>>;
|
|
11
|
+
createdOn_lte: zod.ZodPreprocess<zod.ZodOptional<zod.ZodDate>>;
|
|
12
|
+
createdBy: zod.ZodOptional<zod.ZodString>;
|
|
13
|
+
action: zod.ZodOptional<zod.ZodString>;
|
|
14
|
+
}, zod.core.$strip>;
|
|
15
|
+
after: zod.ZodOptional<zod.ZodString>;
|
|
16
|
+
sort: zod.ZodOptional<zod.ZodEnum<{
|
|
17
|
+
ASC: "ASC";
|
|
18
|
+
DESC: "DESC";
|
|
19
|
+
}>>;
|
|
20
|
+
limit: zod.ZodDefault<zod.ZodPreprocess<zod.ZodOptional<zod.ZodNumber>>>;
|
|
21
|
+
}, zod.core.$strip>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import zod from "zod";
|
|
2
|
+
const getValidationSchema = zod.object({
|
|
3
|
+
id: zod.string().min(1, "ID is required.")
|
|
4
|
+
});
|
|
5
|
+
const listValidationSchema = zod.object({
|
|
6
|
+
where: zod.object({
|
|
7
|
+
app: zod.string().min(1, "App is required.").optional(),
|
|
8
|
+
entity: zod.string().optional(),
|
|
9
|
+
entityId: zod.string().min(1, "Entity ID is required.").optional(),
|
|
10
|
+
createdOn_gte: zod.preprocess((input)=>{
|
|
11
|
+
if ("string" == typeof input || input instanceof Date) return new Date(input);
|
|
12
|
+
}, zod.date().optional()),
|
|
13
|
+
createdOn_lte: zod.preprocess((input)=>{
|
|
14
|
+
if ("string" == typeof input || input instanceof Date) return new Date(input);
|
|
15
|
+
}, zod.date().optional()),
|
|
16
|
+
createdBy: zod.string().optional(),
|
|
17
|
+
action: zod.string().optional()
|
|
18
|
+
}),
|
|
19
|
+
after: zod.string().optional(),
|
|
20
|
+
sort: zod["enum"]([
|
|
21
|
+
"ASC",
|
|
22
|
+
"DESC"
|
|
23
|
+
]).optional(),
|
|
24
|
+
limit: zod.preprocess((input)=>{
|
|
25
|
+
if ("string" == typeof input) return parseInt(input);
|
|
26
|
+
return input;
|
|
27
|
+
}, zod.number().min(1).max(100).optional()).default(25)
|
|
28
|
+
});
|
|
29
|
+
export { getValidationSchema, listValidationSchema };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/validation.js","sources":["../../src/graphql/validation.ts"],"sourcesContent":["import zod from \"zod\";\n\nexport const getValidationSchema = zod.object({\n id: zod.string().min(1, \"ID is required.\")\n});\n\nexport const listValidationSchema = zod.object({\n where: zod.object({\n app: zod.string().min(1, \"App is required.\").optional(),\n entity: zod.string().optional(),\n entityId: zod.string().min(1, \"Entity ID is required.\").optional(),\n createdOn_gte: zod.preprocess(input => {\n if (typeof input == \"string\" || input instanceof Date) {\n return new Date(input);\n }\n return undefined;\n }, zod.date().optional()),\n createdOn_lte: zod.preprocess(input => {\n if (typeof input == \"string\" || input instanceof Date) {\n return new Date(input);\n }\n return undefined;\n }, zod.date().optional()),\n createdBy: zod.string().optional(),\n action: zod.string().optional()\n }),\n after: zod.string().optional(),\n sort: zod.enum([\"ASC\", \"DESC\"]).optional(),\n limit: zod\n .preprocess(input => {\n if (typeof input == \"string\") {\n return parseInt(input);\n }\n return input;\n }, zod.number().min(1).max(100).optional())\n .default(25)\n});\n"],"names":["getValidationSchema","zod","listValidationSchema","input","Date","parseInt"],"mappings":";AAEO,MAAMA,sBAAsBC,IAAI,MAAM,CAAC;IAC1C,IAAIA,IAAI,MAAM,GAAG,GAAG,CAAC,GAAG;AAC5B;AAEO,MAAMC,uBAAuBD,IAAI,MAAM,CAAC;IAC3C,OAAOA,IAAI,MAAM,CAAC;QACd,KAAKA,IAAI,MAAM,GAAG,GAAG,CAAC,GAAG,oBAAoB,QAAQ;QACrD,QAAQA,IAAI,MAAM,GAAG,QAAQ;QAC7B,UAAUA,IAAI,MAAM,GAAG,GAAG,CAAC,GAAG,0BAA0B,QAAQ;QAChE,eAAeA,IAAI,UAAU,CAACE,CAAAA;YAC1B,IAAI,AAAgB,YAAhB,OAAOA,SAAqBA,iBAAiBC,MAC7C,OAAO,IAAIA,KAAKD;QAGxB,GAAGF,IAAI,IAAI,GAAG,QAAQ;QACtB,eAAeA,IAAI,UAAU,CAACE,CAAAA;YAC1B,IAAI,AAAgB,YAAhB,OAAOA,SAAqBA,iBAAiBC,MAC7C,OAAO,IAAIA,KAAKD;QAGxB,GAAGF,IAAI,IAAI,GAAG,QAAQ;QACtB,WAAWA,IAAI,MAAM,GAAG,QAAQ;QAChC,QAAQA,IAAI,MAAM,GAAG,QAAQ;IACjC;IACA,OAAOA,IAAI,MAAM,GAAG,QAAQ;IAC5B,MAAMA,GAAG,CAAHA,OAAQ,CAAC;QAAC;QAAO;KAAO,EAAE,QAAQ;IACxC,OAAOA,IAAAA,UACQ,CAACE,CAAAA;QACR,IAAI,AAAgB,YAAhB,OAAOA,OACP,OAAOE,SAASF;QAEpB,OAAOA;IACX,GAAGF,IAAI,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,KAAK,QAAQ,IACvC,OAAO,CAAC;AACjB"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export * from "./config";
|
|
5
|
-
export * from "./app/createAppModifier";
|
|
1
|
+
export * from "./config.js";
|
|
2
|
+
export { AuditLogsFeature } from "./AuditLogsFeature.js";
|
|
3
|
+
export type { AuditLogsFeatureConfig } from "./AuditLogsFeature.js";
|
package/index.js
CHANGED
|
@@ -1,49 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
createAuditLogs: true
|
|
8
|
-
};
|
|
9
|
-
exports.createAuditLogs = void 0;
|
|
10
|
-
var _api = require("@webiny/api");
|
|
11
|
-
var _subscriptions = require("./subscriptions");
|
|
12
|
-
var _app = require("./app");
|
|
13
|
-
var _config = require("./config");
|
|
14
|
-
Object.keys(_config).forEach(function (key) {
|
|
15
|
-
if (key === "default" || key === "__esModule") return;
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
-
if (key in exports && exports[key] === _config[key]) return;
|
|
18
|
-
Object.defineProperty(exports, key, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function () {
|
|
21
|
-
return _config[key];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
var _createAppModifier = require("./app/createAppModifier");
|
|
26
|
-
Object.keys(_createAppModifier).forEach(function (key) {
|
|
27
|
-
if (key === "default" || key === "__esModule") return;
|
|
28
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
29
|
-
if (key in exports && exports[key] === _createAppModifier[key]) return;
|
|
30
|
-
Object.defineProperty(exports, key, {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _createAppModifier[key];
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
const createAuditLogs = () => {
|
|
38
|
-
const subscriptionsPlugin = new _api.ContextPlugin(async context => {
|
|
39
|
-
if (!context.wcp.canUseFeature("auditLogs")) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
(0, _subscriptions.createSubscriptionHooks)(context);
|
|
43
|
-
});
|
|
44
|
-
subscriptionsPlugin.name = "auditLogs.context.subscriptions";
|
|
45
|
-
return [subscriptionsPlugin, (0, _app.createAcoAuditLogsContext)()];
|
|
46
|
-
};
|
|
47
|
-
exports.createAuditLogs = createAuditLogs;
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./config.js";
|
|
2
|
+
export { AuditLogsFeature } from "./AuditLogsFeature.js";
|
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-audit-logs",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.0-unstable.0d717d18dd",
|
|
4
|
+
"exports": {
|
|
5
|
+
".": "./index.js",
|
|
6
|
+
"./*": "./*"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
5
9
|
"repository": {
|
|
6
10
|
"type": "git",
|
|
7
11
|
"url": "https://github.com/webiny/webiny-js.git",
|
|
@@ -15,33 +19,38 @@
|
|
|
15
19
|
"watch": "node ../cli/bin.js run watch"
|
|
16
20
|
},
|
|
17
21
|
"publishConfig": {
|
|
18
|
-
"access": "public"
|
|
19
|
-
"directory": "dist"
|
|
22
|
+
"access": "public"
|
|
20
23
|
},
|
|
21
24
|
"devDependencies": {
|
|
22
|
-
"@webiny/api-
|
|
23
|
-
"@webiny/
|
|
24
|
-
"@webiny/
|
|
25
|
-
"@webiny/
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"@webiny/plugins": "0.0.0-unstable.06b2ede40f",
|
|
32
|
-
"@webiny/project-utils": "0.0.0-unstable.06b2ede40f",
|
|
33
|
-
"graphql": "15.9.0",
|
|
34
|
-
"typescript": "5.3.3"
|
|
25
|
+
"@webiny/api-headless-cms-testing": "0.0.0-unstable.0d717d18dd",
|
|
26
|
+
"@webiny/di": "1.0.2",
|
|
27
|
+
"@webiny/event-handler-core": "0.0.0-unstable.0d717d18dd",
|
|
28
|
+
"@webiny/handler": "0.0.0-unstable.0d717d18dd",
|
|
29
|
+
"@webiny/plugins": "0.0.0-unstable.0d717d18dd",
|
|
30
|
+
"@webiny/project-utils": "0.0.0-unstable.0d717d18dd",
|
|
31
|
+
"graphql": "16.14.2",
|
|
32
|
+
"typescript": "7.0.2",
|
|
33
|
+
"vitest": "4.1.10"
|
|
35
34
|
},
|
|
36
35
|
"dependencies": {
|
|
37
|
-
"@
|
|
38
|
-
"@webiny/api
|
|
39
|
-
"@webiny/api-
|
|
40
|
-
"@webiny/api-
|
|
41
|
-
"@webiny/
|
|
42
|
-
"@webiny/
|
|
43
|
-
"@webiny/
|
|
44
|
-
"@webiny/
|
|
36
|
+
"@graphql-tools/schema": "10.0.38",
|
|
37
|
+
"@webiny/api": "0.0.0-unstable.0d717d18dd",
|
|
38
|
+
"@webiny/api-aco": "0.0.0-unstable.0d717d18dd",
|
|
39
|
+
"@webiny/api-core": "0.0.0-unstable.0d717d18dd",
|
|
40
|
+
"@webiny/api-file-manager": "0.0.0-unstable.0d717d18dd",
|
|
41
|
+
"@webiny/api-graphql": "0.0.0-unstable.0d717d18dd",
|
|
42
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.0d717d18dd",
|
|
43
|
+
"@webiny/api-mailer": "0.0.0-unstable.0d717d18dd",
|
|
44
|
+
"@webiny/api-website-builder": "0.0.0-unstable.0d717d18dd",
|
|
45
|
+
"@webiny/build-tools": "0.0.0-unstable.0d717d18dd",
|
|
46
|
+
"@webiny/common-audit-logs": "0.0.0-unstable.0d717d18dd",
|
|
47
|
+
"@webiny/error": "0.0.0-unstable.0d717d18dd",
|
|
48
|
+
"@webiny/feature": "0.0.0-unstable.0d717d18dd",
|
|
49
|
+
"@webiny/utils": "0.0.0-unstable.0d717d18dd",
|
|
50
|
+
"@webiny/wcp": "0.0.0-unstable.0d717d18dd",
|
|
51
|
+
"zod": "4.4.3"
|
|
45
52
|
},
|
|
46
|
-
"
|
|
53
|
+
"webiny": {
|
|
54
|
+
"publishFrom": "dist"
|
|
55
|
+
}
|
|
47
56
|
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import type { IAuditLog } from "../../storage/types.js";
|
|
2
|
+
export interface IStorageFetchParams {
|
|
3
|
+
id: string;
|
|
4
|
+
tenant: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IStorageFetchErrorResult {
|
|
7
|
+
error: Error;
|
|
8
|
+
data?: never;
|
|
9
|
+
success: false;
|
|
10
|
+
}
|
|
11
|
+
export interface IStorageFetchSuccessResult {
|
|
12
|
+
data: IAuditLog;
|
|
13
|
+
success: true;
|
|
14
|
+
error?: never;
|
|
15
|
+
}
|
|
16
|
+
export type IStorageFetchResult = IStorageFetchErrorResult | IStorageFetchSuccessResult;
|
|
17
|
+
export interface IStorageStoreParams {
|
|
18
|
+
data: IAuditLog;
|
|
19
|
+
}
|
|
20
|
+
export interface IStorageStoreErrorResult {
|
|
21
|
+
error: Error;
|
|
22
|
+
data?: never;
|
|
23
|
+
success: false;
|
|
24
|
+
}
|
|
25
|
+
export interface IStorageStoreSuccessResult {
|
|
26
|
+
data: IAuditLog;
|
|
27
|
+
success: true;
|
|
28
|
+
error?: never;
|
|
29
|
+
}
|
|
30
|
+
export type IStorageStoreResult = IStorageStoreErrorResult | IStorageStoreSuccessResult;
|
|
31
|
+
export interface IStorageListDefaultParams {
|
|
32
|
+
tenant: string;
|
|
33
|
+
sort?: "ASC" | "DESC";
|
|
34
|
+
after?: string;
|
|
35
|
+
limit: number | undefined;
|
|
36
|
+
app?: never;
|
|
37
|
+
createdBy?: never;
|
|
38
|
+
action?: never;
|
|
39
|
+
entityId?: never;
|
|
40
|
+
}
|
|
41
|
+
export interface IStorageListByAppParams {
|
|
42
|
+
tenant: string;
|
|
43
|
+
app: string;
|
|
44
|
+
after?: string;
|
|
45
|
+
sort?: "ASC" | "DESC";
|
|
46
|
+
createdOn_gte?: Date;
|
|
47
|
+
createdOn_lte?: Date;
|
|
48
|
+
limit: number | undefined;
|
|
49
|
+
entity?: never;
|
|
50
|
+
createdBy?: never;
|
|
51
|
+
action?: never;
|
|
52
|
+
entityId?: never;
|
|
53
|
+
}
|
|
54
|
+
export interface IStorageListByAppCreatedByParams extends Omit<IStorageListByAppParams, "createdBy"> {
|
|
55
|
+
createdBy: string;
|
|
56
|
+
}
|
|
57
|
+
export interface IStorageListByAppEntityParams extends Omit<IStorageListByAppParams, "entity"> {
|
|
58
|
+
entity: string;
|
|
59
|
+
}
|
|
60
|
+
export interface IStorageListByEntityIdParams extends Omit<IStorageListByAppParams, "entityId"> {
|
|
61
|
+
entityId: string;
|
|
62
|
+
}
|
|
63
|
+
export interface IStorageListByActionParams extends Omit<IStorageListByAppParams, "action"> {
|
|
64
|
+
action: string;
|
|
65
|
+
}
|
|
66
|
+
export interface IStorageListByAppEntityActionCreatedByParams extends Omit<IStorageListByAppParams, "action" | "entity" | "createdBy"> {
|
|
67
|
+
createdBy: string;
|
|
68
|
+
entity: string;
|
|
69
|
+
action: string;
|
|
70
|
+
}
|
|
71
|
+
export interface IStorageListByAppEntityActionParams extends Omit<IStorageListByAppParams, "entity" | "action"> {
|
|
72
|
+
entity: string;
|
|
73
|
+
action: string;
|
|
74
|
+
}
|
|
75
|
+
export interface IStorageListByAppEntityCreatedByParams extends Omit<IStorageListByAppParams, "createdBy" | "entity"> {
|
|
76
|
+
createdBy: string;
|
|
77
|
+
entity: string;
|
|
78
|
+
}
|
|
79
|
+
export interface IStorageListByCreatedByParams extends Omit<IStorageListByAppParams, "createdBy"> {
|
|
80
|
+
createdBy: string;
|
|
81
|
+
}
|
|
82
|
+
export interface IStorageListByCreatedOnParams extends IStorageListByAppParams {
|
|
83
|
+
createdOn_gte?: Date;
|
|
84
|
+
createdOn_lte?: Date;
|
|
85
|
+
}
|
|
86
|
+
export type IStorageListParams = IStorageListByAppParams | IStorageListByAppCreatedByParams | IStorageListByAppEntityParams | IStorageListByEntityIdParams | IStorageListByActionParams | IStorageListByAppEntityActionCreatedByParams | IStorageListByAppEntityActionParams | IStorageListByAppEntityCreatedByParams | IStorageListByCreatedByParams | IStorageListByCreatedOnParams;
|
|
87
|
+
export interface IStorageListSuccessResultMeta {
|
|
88
|
+
after?: string;
|
|
89
|
+
hasMoreItems: boolean;
|
|
90
|
+
}
|
|
91
|
+
export interface IStorageListSuccessResult {
|
|
92
|
+
data: IAuditLog[];
|
|
93
|
+
meta: IStorageListSuccessResultMeta;
|
|
94
|
+
success: true;
|
|
95
|
+
error?: never;
|
|
96
|
+
}
|
|
97
|
+
export interface IStorageListErrorResult {
|
|
98
|
+
error: Error;
|
|
99
|
+
data?: never;
|
|
100
|
+
meta?: never;
|
|
101
|
+
success: false;
|
|
102
|
+
}
|
|
103
|
+
export type IStorageListResult = IStorageListErrorResult | IStorageListSuccessResult;
|
|
104
|
+
export interface IStorage {
|
|
105
|
+
fetch(params: IStorageFetchParams): Promise<IStorageFetchResult>;
|
|
106
|
+
store(params: IStorageStoreParams): Promise<IStorageStoreResult>;
|
|
107
|
+
list(params: IStorageListParams): Promise<IStorageListResult>;
|
|
108
|
+
}
|
|
File without changes
|