@webiny/api-audit-logs 0.0.0-unstable.a4637c5ce6 → 0.0.0-unstable.a4f3e4ea8b
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 +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 +129 -0
- package/context/AuditLogsContextValue.js.map +1 -0
- package/context/index.d.ts +6 -0
- package/context/index.js +25 -0
- package/context/index.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/schema.d.ts +3 -0
- package/graphql/schema.js +115 -0
- package/graphql/schema.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 +5 -4
- package/index.js +21 -46
- package/index.js.map +1 -1
- package/package.json +33 -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 +37 -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 +75 -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/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 @@
|
|
|
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,115 @@
|
|
|
1
|
+
import { GraphQLSchemaPlugin, NotFoundError, resolve, resolveList } from "@webiny/handler-graphql";
|
|
2
|
+
import { getValidationSchema, listValidationSchema } from "./validation.js";
|
|
3
|
+
import { createZodError } from "@webiny/utils";
|
|
4
|
+
const createGraphQLSchema = ()=>new GraphQLSchemaPlugin({
|
|
5
|
+
isApplicable: (context)=>!!context.auditLogs,
|
|
6
|
+
typeDefs: `
|
|
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
|
+
resolvers: {
|
|
79
|
+
Query: {
|
|
80
|
+
auditLogs: ()=>({})
|
|
81
|
+
},
|
|
82
|
+
AuditLogsQuery: {
|
|
83
|
+
async getAuditLog (_, args, context) {
|
|
84
|
+
return resolve(async ()=>{
|
|
85
|
+
const validation = await getValidationSchema.safeParseAsync(args);
|
|
86
|
+
if (!validation.success) throw createZodError(validation.error);
|
|
87
|
+
const result = await context.auditLogs.getAuditLog(validation.data.id);
|
|
88
|
+
if (!result) throw new NotFoundError(`Audit log with id "${validation.data.id}" not found.`);
|
|
89
|
+
return result;
|
|
90
|
+
});
|
|
91
|
+
},
|
|
92
|
+
async listAuditLogs (_, args, context) {
|
|
93
|
+
return resolveList(async ()=>{
|
|
94
|
+
const validation = await listValidationSchema.safeParseAsync(args);
|
|
95
|
+
if (!validation.success) throw createZodError(validation.error);
|
|
96
|
+
const result = await context.auditLogs.listAuditLogs({
|
|
97
|
+
...validation.data,
|
|
98
|
+
...validation.data.where
|
|
99
|
+
});
|
|
100
|
+
if (result.error) throw result.error;
|
|
101
|
+
return {
|
|
102
|
+
items: result.items,
|
|
103
|
+
meta: {
|
|
104
|
+
...result.meta,
|
|
105
|
+
totalCount: 0
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
export { createGraphQLSchema };
|
|
114
|
+
|
|
115
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/schema.js","sources":["../../src/graphql/schema.ts"],"sourcesContent":["import { GraphQLSchemaPlugin, NotFoundError, resolve, resolveList } from \"@webiny/handler-graphql\";\nimport type { AuditLogsContext } from \"~/types.js\";\nimport { getValidationSchema, listValidationSchema } from \"./validation.js\";\nimport { createZodError } from \"@webiny/utils\";\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\nexport const createGraphQLSchema = () => {\n return new GraphQLSchemaPlugin<AuditLogsContext>({\n isApplicable: context => {\n return !!context.auditLogs;\n },\n typeDefs: `\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 resolvers: {\n Query: {\n auditLogs: () => ({})\n },\n AuditLogsQuery: {\n async getAuditLog(_, args, context) {\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 context.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 async listAuditLogs(_, args: IListAuditLogsArgs, context) {\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 context.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};\n"],"names":["createGraphQLSchema","GraphQLSchemaPlugin","context","_","args","resolve","validation","getValidationSchema","createZodError","result","NotFoundError","resolveList","listValidationSchema"],"mappings":";;;AAsBO,MAAMA,sBAAsB,IACxB,IAAIC,oBAAsC;QAC7C,cAAcC,CAAAA,UACH,CAAC,CAACA,QAAQ,SAAS;QAE9B,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAuEX,CAAC;QACD,WAAW;YACP,OAAO;gBACH,WAAW,IAAO,EAAC;YACvB;YACA,gBAAgB;gBACZ,MAAM,aAAYC,CAAC,EAAEC,IAAI,EAAEF,OAAO;oBAC9B,OAAOG,QAAQ;wBACX,MAAMC,aAAa,MAAMC,oBAAoB,cAAc,CAACH;wBAE5D,IAAI,CAACE,WAAW,OAAO,EACnB,MAAME,eAAeF,WAAW,KAAK;wBAGzC,MAAMG,SAAS,MAAMP,QAAQ,SAAS,CAAC,WAAW,CAACI,WAAW,IAAI,CAAC,EAAE;wBACrE,IAAI,CAACG,QACD,MAAM,IAAIC,cACN,CAAC,mBAAmB,EAAEJ,WAAW,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC;wBAG9D,OAAOG;oBACX;gBACJ;gBACA,MAAM,eAAcN,CAAC,EAAEC,IAAwB,EAAEF,OAAO;oBACpD,OAAOS,YAAY;wBACf,MAAML,aAAa,MAAMM,qBAAqB,cAAc,CAACR;wBAC7D,IAAI,CAACE,WAAW,OAAO,EACnB,MAAME,eAAeF,WAAW,KAAK;wBAEzC,MAAMG,SAAS,MAAMP,QAAQ,SAAS,CAAC,aAAa,CAAC;4BACjD,GAAGI,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;gBACJ;YACJ;QACJ;IACJ"}
|
|
@@ -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,6 @@
|
|
|
1
1
|
import { ContextPlugin } from "@webiny/api";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export
|
|
2
|
+
export interface ICreateAuditLogsParams {
|
|
3
|
+
deleteLogsAfterDays?: number | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare const createAuditLogs: (params?: ICreateAuditLogsParams) => (ContextPlugin<import("./types.js").AuditLogsContext> | import("@webiny/handler-graphql/index.js").GraphQLSchemaPlugin<import("./types.js").AuditLogsContext>)[];
|
|
6
|
+
export * from "./config.js";
|
package/index.js
CHANGED
|
@@ -1,49 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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)()];
|
|
1
|
+
import { ContextPlugin } from "@webiny/api";
|
|
2
|
+
import { createSubscriptionHooks } from "./subscriptions/index.js";
|
|
3
|
+
import { createAuditLogsContext } from "./context/index.js";
|
|
4
|
+
import { createGraphQLSchema } from "./graphql/schema.js";
|
|
5
|
+
import { AuditLogsContext } from "./abstractions.js";
|
|
6
|
+
export * from "./config.js";
|
|
7
|
+
const createAuditLogs = (params)=>{
|
|
8
|
+
const subscriptionsPlugin = new ContextPlugin((context)=>{
|
|
9
|
+
if (!context.wcp.canUseFeature("auditLogs")) return;
|
|
10
|
+
context.container.registerInstance(AuditLogsContext, context);
|
|
11
|
+
createSubscriptionHooks(context);
|
|
12
|
+
});
|
|
13
|
+
subscriptionsPlugin.name = "auditLogs.context.subscriptions";
|
|
14
|
+
return [
|
|
15
|
+
subscriptionsPlugin,
|
|
16
|
+
createGraphQLSchema(),
|
|
17
|
+
createAuditLogsContext({
|
|
18
|
+
deleteLogsAfterDays: params?.deleteLogsAfterDays
|
|
19
|
+
})
|
|
20
|
+
];
|
|
46
21
|
};
|
|
47
|
-
|
|
22
|
+
export { createAuditLogs };
|
|
48
23
|
|
|
49
24
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { createSubscriptionHooks } from \"~/subscriptions/index.js\";\nimport { createAuditLogsContext } from \"~/context/index.js\";\nimport { createGraphQLSchema } from \"~/graphql/schema.js\";\nimport { AuditLogsContext } from \"./abstractions.js\";\n\nexport interface ICreateAuditLogsParams {\n deleteLogsAfterDays?: number | undefined;\n}\n\nexport const createAuditLogs = (params?: ICreateAuditLogsParams) => {\n const subscriptionsPlugin = new ContextPlugin<AuditLogsContext.Interface>(context => {\n if (!context.wcp.canUseFeature(\"auditLogs\")) {\n return;\n }\n\n context.container.registerInstance(AuditLogsContext, context);\n\n createSubscriptionHooks(context);\n });\n\n subscriptionsPlugin.name = \"auditLogs.context.subscriptions\";\n return [\n subscriptionsPlugin,\n createGraphQLSchema(),\n createAuditLogsContext({\n deleteLogsAfterDays: params?.deleteLogsAfterDays\n })\n ];\n};\nexport * from \"~/config.js\";\n"],"names":["createAuditLogs","params","subscriptionsPlugin","ContextPlugin","context","AuditLogsContext","createSubscriptionHooks","createGraphQLSchema","createAuditLogsContext"],"mappings":";;;;;;AAUO,MAAMA,kBAAkB,CAACC;IAC5B,MAAMC,sBAAsB,IAAIC,cAA0CC,CAAAA;QACtE,IAAI,CAACA,QAAQ,GAAG,CAAC,aAAa,CAAC,cAC3B;QAGJA,QAAQ,SAAS,CAAC,gBAAgB,CAACC,kBAAkBD;QAErDE,wBAAwBF;IAC5B;IAEAF,oBAAoB,IAAI,GAAG;IAC3B,OAAO;QACHA;QACAK;QACAC,uBAAuB;YACnB,qBAAqBP,QAAQ;QACjC;KACH;AACL"}
|
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.a4f3e4ea8b",
|
|
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,36 @@
|
|
|
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/
|
|
23
|
-
"@webiny/
|
|
24
|
-
"@webiny/
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"@webiny/api-wcp": "0.0.0-unstable.a4637c5ce6",
|
|
29
|
-
"@webiny/handler-aws": "0.0.0-unstable.a4637c5ce6",
|
|
30
|
-
"@webiny/handler-graphql": "0.0.0-unstable.a4637c5ce6",
|
|
31
|
-
"@webiny/plugins": "0.0.0-unstable.a4637c5ce6",
|
|
32
|
-
"@webiny/project-utils": "0.0.0-unstable.a4637c5ce6",
|
|
33
|
-
"graphql": "15.9.0",
|
|
34
|
-
"typescript": "5.3.3"
|
|
25
|
+
"@webiny/handler-aws": "0.0.0-unstable.a4f3e4ea8b",
|
|
26
|
+
"@webiny/plugins": "0.0.0-unstable.a4f3e4ea8b",
|
|
27
|
+
"@webiny/project-utils": "0.0.0-unstable.a4f3e4ea8b",
|
|
28
|
+
"graphql": "16.14.2",
|
|
29
|
+
"typescript": "7.0.2",
|
|
30
|
+
"vitest": "4.1.10"
|
|
35
31
|
},
|
|
36
32
|
"dependencies": {
|
|
37
|
-
"@webiny/api": "0.0.0-unstable.
|
|
38
|
-
"@webiny/api-aco": "0.0.0-unstable.
|
|
39
|
-
"@webiny/api-
|
|
40
|
-
"@webiny/api-
|
|
41
|
-
"@webiny/
|
|
42
|
-
"@webiny/
|
|
43
|
-
"@webiny/
|
|
44
|
-
"@webiny/
|
|
33
|
+
"@webiny/api": "0.0.0-unstable.a4f3e4ea8b",
|
|
34
|
+
"@webiny/api-aco": "0.0.0-unstable.a4f3e4ea8b",
|
|
35
|
+
"@webiny/api-core": "0.0.0-unstable.a4f3e4ea8b",
|
|
36
|
+
"@webiny/api-file-manager": "0.0.0-unstable.a4f3e4ea8b",
|
|
37
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.a4f3e4ea8b",
|
|
38
|
+
"@webiny/api-mailer": "0.0.0-unstable.a4f3e4ea8b",
|
|
39
|
+
"@webiny/api-website-builder": "0.0.0-unstable.a4f3e4ea8b",
|
|
40
|
+
"@webiny/build-tools": "0.0.0-unstable.a4f3e4ea8b",
|
|
41
|
+
"@webiny/common-audit-logs": "0.0.0-unstable.a4f3e4ea8b",
|
|
42
|
+
"@webiny/error": "0.0.0-unstable.a4f3e4ea8b",
|
|
43
|
+
"@webiny/feature": "0.0.0-unstable.a4f3e4ea8b",
|
|
44
|
+
"@webiny/handler": "0.0.0-unstable.a4f3e4ea8b",
|
|
45
|
+
"@webiny/handler-db": "0.0.0-unstable.a4f3e4ea8b",
|
|
46
|
+
"@webiny/handler-graphql": "0.0.0-unstable.a4f3e4ea8b",
|
|
47
|
+
"@webiny/utils": "0.0.0-unstable.a4f3e4ea8b",
|
|
48
|
+
"@webiny/wcp": "0.0.0-unstable.a4f3e4ea8b",
|
|
49
|
+
"zod": "4.4.3"
|
|
45
50
|
},
|
|
46
|
-
"
|
|
51
|
+
"webiny": {
|
|
52
|
+
"publishFrom": "dist"
|
|
53
|
+
}
|
|
47
54
|
}
|
|
@@ -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
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface IAuditLogCreatedBy {
|
|
2
|
+
id: string;
|
|
3
|
+
type: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
}
|
|
6
|
+
export interface IAuditLog {
|
|
7
|
+
id: string;
|
|
8
|
+
tenant: string;
|
|
9
|
+
createdBy: IAuditLogCreatedBy;
|
|
10
|
+
createdOn: Date;
|
|
11
|
+
app: string;
|
|
12
|
+
action: string;
|
|
13
|
+
message: string;
|
|
14
|
+
entity: string;
|
|
15
|
+
entityId: string;
|
|
16
|
+
tags: string[];
|
|
17
|
+
expiresAt: Date;
|
|
18
|
+
content: string;
|
|
19
|
+
}
|