@webiny/api-audit-logs 6.0.0-rc.5 → 6.0.0-rc.6
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/package.json +24 -24
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js +2 -2
- package/subscriptions/aco/handlers/AuditLogFolderAfterCreateHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js +2 -2
- package/subscriptions/aco/handlers/AuditLogFolderAfterDeleteHandler.js.map +1 -1
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js +2 -2
- package/subscriptions/aco/handlers/AuditLogFolderAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js +2 -2
- package/subscriptions/fileManager/handlers/AuditLogFileAfterCreateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js +2 -2
- package/subscriptions/fileManager/handlers/AuditLogFileAfterDeleteHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js +2 -2
- package/subscriptions/fileManager/handlers/AuditLogFileAfterUpdateHandler.js.map +1 -1
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js +2 -2
- package/subscriptions/fileManager/handlers/AuditLogSettingsAfterUpdateHandler.js.map +1 -1
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.d.ts +3 -3
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js +2 -2
- package/subscriptions/mailer/handlers/AuditLogMailerSettingsAfterSaveHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogApiKeyAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogApiKeyAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogApiKeyAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogRoleAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogRoleAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogRoleAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogTeamAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogTeamAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogTeamAfterUpdateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogUserAfterCreateHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogUserAfterDeleteHandler.js.map +1 -1
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js +2 -2
- package/subscriptions/security/handlers/AuditLogUserAfterUpdateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterCreateRevisionFromHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterDuplicateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterPublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUnpublishHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js +3 -3
- package/subscriptions/websiteBuilder/pages/PageAfterUpdateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterCreateHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterDeleteHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterMoveHandler.js.map +1 -1
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.d.ts +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js +3 -3
- package/subscriptions/websiteBuilder/redirects/RedirectAfterUpdateHandler.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterCreateRevisionFromEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterCreateRevisionFromHandlerImpl","constructor","context","handle","event","page","payload","createAuditLog","WEBSITE_BUILDER","PAGE","CREATE_REVISION_FROM","id","error","from","message","code","PageAfterCreateRevisionFromAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterCreateRevisionFromHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterCreateRevisionFromEventHandler } from \"@webiny/api-website-builder/features/pages/CreatePageRevisionFrom/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterCreateRevisionFromHandlerImpl\n implements PageAfterCreateRevisionFromEventHandler.Interface\n{\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterCreateRevisionFromEventHandler.Event): Promise<void> {\n try {\n const { page } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.CREATE_REVISION_FROM);\n await createAuditLog(\"Website Page Create Revision From\", page, page.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterCreateRevisionFromEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_CREATE_REVISION_FROM_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterCreateRevisionFromAuditHandler =\n PageAfterCreateRevisionFromEventHandler.createImplementation({\n implementation: PageAfterCreateRevisionFromHandlerImpl,\n dependencies: [AuditLogsContext]\n });\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,uCAAuC,QAAQ,4EAA4E;AACpI,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,sCAAsC,CAE5C;EACIC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAoD,EAAiB;IAC9E,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,IAAI,CAACC,oBAAoB,CAAC;MACtF,MAAMH,cAAc,CAAC,mCAAmC,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IAC1F,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,+DAA+D;QACxEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,uCAAuC,GAChDpB,uCAAuC,CAACqB,oBAAoB,CAAC;EACzDC,cAAc,EAAElB,sCAAsC;EACtDmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageAfterDeleteEventHandler } from "@webiny/api-website-builder/features/pages/DeletePage/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class PageAfterDeleteHandlerImpl implements
|
|
3
|
+
declare class PageAfterDeleteHandlerImpl implements PageAfterDeleteEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: PageAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const PageAfterDeleteAuditHandler: typeof PageAfterDeleteHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/pages/DeletePage/abstractions").PageAfterDeletePayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { PageAfterDeleteEventHandler } from "@webiny/api-website-builder/features/pages/DeletePage/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -16,13 +16,13 @@ class PageAfterDeleteHandlerImpl {
|
|
|
16
16
|
await createAuditLog("Website Page Delete", page, page.id, this.context);
|
|
17
17
|
} catch (error) {
|
|
18
18
|
throw WebinyError.from(error, {
|
|
19
|
-
message: "Error while executing
|
|
19
|
+
message: "Error while executing PageAfterDeleteEventHandler",
|
|
20
20
|
code: "AUDIT_LOGS_AFTER_PAGE_DELETE_HANDLER"
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const PageAfterDeleteAuditHandler =
|
|
25
|
+
export const PageAfterDeleteAuditHandler = PageAfterDeleteEventHandler.createImplementation({
|
|
26
26
|
implementation: PageAfterDeleteHandlerImpl,
|
|
27
27
|
dependencies: [AuditLogsContext]
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterDeleteEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterDeleteHandlerImpl","constructor","context","handle","event","page","payload","createAuditLog","WEBSITE_BUILDER","PAGE","DELETE","id","error","from","message","code","PageAfterDeleteAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterDeleteHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterDeleteEventHandler } from \"@webiny/api-website-builder/features/pages/DeletePage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterDeleteHandlerImpl implements PageAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { page } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.DELETE);\n await createAuditLog(\"Website Page Delete\", page, page.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterDeleteEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterDeleteAuditHandler = PageAfterDeleteEventHandler.createImplementation({\n implementation: PageAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,2BAA2B,QAAQ,gEAAgE;AAC5G,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,0BAA0B,CAAkD;EAC9EC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,IAAI,CAACC,MAAM,CAAC;MACxE,MAAMH,cAAc,CAAC,qBAAqB,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IAC5E,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,mDAAmD;QAC5DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,2BAA2B,GAAGpB,2BAA2B,CAACqB,oBAAoB,CAAC;EACxFC,cAAc,EAAElB,0BAA0B;EAC1CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageAfterDuplicateEventHandler } from "@webiny/api-website-builder/features/pages/DuplicatePage/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class PageAfterDuplicateHandlerImpl implements
|
|
3
|
+
declare class PageAfterDuplicateHandlerImpl implements PageAfterDuplicateEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: PageAfterDuplicateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const PageAfterDuplicateAuditHandler: typeof PageAfterDuplicateHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/pages/DuplicatePage/abstractions").PageAfterDuplicatePayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { PageAfterDuplicateEventHandler } from "@webiny/api-website-builder/features/pages/DuplicatePage/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -20,13 +20,13 @@ class PageAfterDuplicateHandlerImpl {
|
|
|
20
20
|
}, original.id, this.context);
|
|
21
21
|
} catch (error) {
|
|
22
22
|
throw WebinyError.from(error, {
|
|
23
|
-
message: "Error while executing
|
|
23
|
+
message: "Error while executing PageAfterDuplicateEventHandler",
|
|
24
24
|
code: "AUDIT_LOGS_AFTER_PAGE_DUPLICATE_HANDLER"
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
export const PageAfterDuplicateAuditHandler =
|
|
29
|
+
export const PageAfterDuplicateAuditHandler = PageAfterDuplicateEventHandler.createImplementation({
|
|
30
30
|
implementation: PageAfterDuplicateHandlerImpl,
|
|
31
31
|
dependencies: [AuditLogsContext]
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterDuplicateEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterDuplicateHandlerImpl","constructor","context","handle","event","page","original","payload","createAuditLog","WEBSITE_BUILDER","PAGE","DUPLICATE","id","error","from","message","code","PageAfterDuplicateAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterDuplicateHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterDuplicateEventHandler } from \"@webiny/api-website-builder/features/pages/DuplicatePage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterDuplicateHandlerImpl implements PageAfterDuplicateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterDuplicateEventHandler.Event): Promise<void> {\n try {\n const { page, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.DUPLICATE);\n await createAuditLog(\n \"Website Page Duplicate\",\n { original, page },\n original.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterDuplicateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_DUPLICATE_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterDuplicateAuditHandler = PageAfterDuplicateEventHandler.createImplementation({\n implementation: PageAfterDuplicateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,8BAA8B,QAAQ,mEAAmE;AAClH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,6BAA6B,CAAqD;EACpFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA2C,EAAiB;IACrE,IAAI;MACA,MAAM;QAAEC,IAAI;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MACxC,MAAMC,cAAc,GAAGV,cAAc,CAACC,KAAK,CAACU,eAAe,CAACC,IAAI,CAACC,SAAS,CAAC;MAC3E,MAAMH,cAAc,CAChB,wBAAwB,EACxB;QAAEF,QAAQ;QAAED;MAAK,CAAC,EAClBC,QAAQ,CAACM,EAAE,EACX,IAAI,CAACV,OACT,CAAC;IACL,CAAC,CAAC,OAAOW,KAAK,EAAE;MACZ,MAAMlB,WAAW,CAACmB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGrB,8BAA8B,CAACsB,oBAAoB,CAAC;EAC9FC,cAAc,EAAEnB,6BAA6B;EAC7CoB,YAAY,EAAE,CAACvB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageAfterMoveEventHandler } from "@webiny/api-website-builder/features/pages/MovePage/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class PageAfterMoveHandlerImpl implements
|
|
3
|
+
declare class PageAfterMoveHandlerImpl implements PageAfterMoveEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: PageAfterMoveEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const PageAfterMoveAuditHandler: typeof PageAfterMoveHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/pages/MovePage/abstractions").PageAfterMovePayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { PageAfterMoveEventHandler } from "@webiny/api-website-builder/features/pages/MovePage/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -16,13 +16,13 @@ class PageAfterMoveHandlerImpl {
|
|
|
16
16
|
await createAuditLog("Website Page Move", page, page.id, this.context);
|
|
17
17
|
} catch (error) {
|
|
18
18
|
throw WebinyError.from(error, {
|
|
19
|
-
message: "Error while executing
|
|
19
|
+
message: "Error while executing PageAfterMoveEventHandler",
|
|
20
20
|
code: "AUDIT_LOGS_AFTER_PAGE_MOVE_HANDLER"
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const PageAfterMoveAuditHandler =
|
|
25
|
+
export const PageAfterMoveAuditHandler = PageAfterMoveEventHandler.createImplementation({
|
|
26
26
|
implementation: PageAfterMoveHandlerImpl,
|
|
27
27
|
dependencies: [AuditLogsContext]
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterMoveEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterMoveHandlerImpl","constructor","context","handle","event","page","payload","createAuditLog","WEBSITE_BUILDER","PAGE","MOVE","id","error","from","message","code","PageAfterMoveAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterMoveHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterMoveEventHandler } from \"@webiny/api-website-builder/features/pages/MovePage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterMoveHandlerImpl implements PageAfterMoveEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterMoveEventHandler.Event): Promise<void> {\n try {\n const { page } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.MOVE);\n await createAuditLog(\"Website Page Move\", page, page.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterMoveEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_MOVE_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterMoveAuditHandler = PageAfterMoveEventHandler.createImplementation({\n implementation: PageAfterMoveHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,yBAAyB,QAAQ,8DAA8D;AACxG,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,wBAAwB,CAAgD;EAC1EC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAsC,EAAiB;IAChE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,IAAI,CAACC,IAAI,CAAC;MACtE,MAAMH,cAAc,CAAC,mBAAmB,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IAC1E,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,iDAAiD;QAC1DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,yBAAyB,GAAGpB,yBAAyB,CAACqB,oBAAoB,CAAC;EACpFC,cAAc,EAAElB,wBAAwB;EACxCmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageAfterPublishEventHandler } from "@webiny/api-website-builder/features/pages/PublishPage/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class PageAfterPublishHandlerImpl implements
|
|
3
|
+
declare class PageAfterPublishHandlerImpl implements PageAfterPublishEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: PageAfterPublishEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const PageAfterPublishAuditHandler: typeof PageAfterPublishHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/pages/PublishPage/abstractions").PageAfterPublishPayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { PageAfterPublishEventHandler } from "@webiny/api-website-builder/features/pages/PublishPage/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -16,13 +16,13 @@ class PageAfterPublishHandlerImpl {
|
|
|
16
16
|
await createAuditLog("Website Page Published", page, page.id, this.context);
|
|
17
17
|
} catch (error) {
|
|
18
18
|
throw WebinyError.from(error, {
|
|
19
|
-
message: "Error while executing
|
|
19
|
+
message: "Error while executing PageAfterPublishEventHandler",
|
|
20
20
|
code: "AUDIT_LOGS_AFTER_PAGE_PUBLISH_HANDLER"
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const PageAfterPublishAuditHandler =
|
|
25
|
+
export const PageAfterPublishAuditHandler = PageAfterPublishEventHandler.createImplementation({
|
|
26
26
|
implementation: PageAfterPublishHandlerImpl,
|
|
27
27
|
dependencies: [AuditLogsContext]
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterPublishEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterPublishHandlerImpl","constructor","context","handle","event","page","payload","createAuditLog","WEBSITE_BUILDER","PAGE","PUBLISH","id","error","from","message","code","PageAfterPublishAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterPublishHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterPublishEventHandler } from \"@webiny/api-website-builder/features/pages/PublishPage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterPublishHandlerImpl implements PageAfterPublishEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterPublishEventHandler.Event): Promise<void> {\n try {\n const { page } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.PUBLISH);\n await createAuditLog(\"Website Page Published\", page, page.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterPublishEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_PUBLISH_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterPublishAuditHandler = PageAfterPublishEventHandler.createImplementation({\n implementation: PageAfterPublishHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,4BAA4B,QAAQ,iEAAiE;AAC9G,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,2BAA2B,CAAmD;EAChFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAyC,EAAiB;IACnE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,IAAI,CAACC,OAAO,CAAC;MACzE,MAAMH,cAAc,CAAC,wBAAwB,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IAC/E,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,oDAAoD;QAC7DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,4BAA4B,GAAGpB,4BAA4B,CAACqB,oBAAoB,CAAC;EAC1FC,cAAc,EAAElB,2BAA2B;EAC3CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageAfterUnpublishEventHandler } from "@webiny/api-website-builder/features/pages/UnpublishPage/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class PageAfterUnpublishHandlerImpl implements
|
|
3
|
+
declare class PageAfterUnpublishHandlerImpl implements PageAfterUnpublishEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: PageAfterUnpublishEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const PageAfterUnpublishAuditHandler: typeof PageAfterUnpublishHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/pages/UnpublishPage/abstractions").PageAfterUnpublishPayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { PageAfterUnpublishEventHandler } from "@webiny/api-website-builder/features/pages/UnpublishPage/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -16,13 +16,13 @@ class PageAfterUnpublishHandlerImpl {
|
|
|
16
16
|
await createAuditLog("Website Page Unpublished", page, page.id, this.context);
|
|
17
17
|
} catch (error) {
|
|
18
18
|
throw WebinyError.from(error, {
|
|
19
|
-
message: "Error while executing
|
|
19
|
+
message: "Error while executing PageAfterUnpublishEventHandler",
|
|
20
20
|
code: "AUDIT_LOGS_AFTER_PAGE_UNPUBLISH_HANDLER"
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const PageAfterUnpublishAuditHandler =
|
|
25
|
+
export const PageAfterUnpublishAuditHandler = PageAfterUnpublishEventHandler.createImplementation({
|
|
26
26
|
implementation: PageAfterUnpublishHandlerImpl,
|
|
27
27
|
dependencies: [AuditLogsContext]
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterUnpublishEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterUnpublishHandlerImpl","constructor","context","handle","event","page","payload","createAuditLog","WEBSITE_BUILDER","PAGE","UNPUBLISH","id","error","from","message","code","PageAfterUnpublishAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterUnpublishHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterUnpublishEventHandler } from \"@webiny/api-website-builder/features/pages/UnpublishPage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterUnpublishHandlerImpl implements PageAfterUnpublishEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterUnpublishEventHandler.Event): Promise<void> {\n try {\n const { page } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.UNPUBLISH);\n await createAuditLog(\"Website Page Unpublished\", page, page.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterUnpublishEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_UNPUBLISH_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterUnpublishAuditHandler = PageAfterUnpublishEventHandler.createImplementation({\n implementation: PageAfterUnpublishHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,8BAA8B,QAAQ,mEAAmE;AAClH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,6BAA6B,CAAqD;EACpFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA2C,EAAiB;IACrE,IAAI;MACA,MAAM;QAAEC;MAAK,CAAC,GAAGD,KAAK,CAACE,OAAO;MAC9B,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,IAAI,CAACC,SAAS,CAAC;MAC3E,MAAMH,cAAc,CAAC,0BAA0B,EAAEF,IAAI,EAAEA,IAAI,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACjF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,sDAAsD;QAC/DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,8BAA8B,GAAGpB,8BAA8B,CAACqB,oBAAoB,CAAC;EAC9FC,cAAc,EAAElB,6BAA6B;EAC7CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PageAfterUpdateEventHandler } from "@webiny/api-website-builder/features/pages/UpdatePage/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class PageAfterUpdateHandlerImpl implements
|
|
3
|
+
declare class PageAfterUpdateHandlerImpl implements PageAfterUpdateEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: PageAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const PageAfterUpdateAuditHandler: typeof PageAfterUpdateHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/pages/UpdatePage/abstractions").PageAfterUpdatePayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { PageAfterUpdateEventHandler } from "@webiny/api-website-builder/features/pages/UpdatePage/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -20,13 +20,13 @@ class PageAfterUpdateHandlerImpl {
|
|
|
20
20
|
}, page.id, this.context);
|
|
21
21
|
} catch (error) {
|
|
22
22
|
throw WebinyError.from(error, {
|
|
23
|
-
message: "Error while executing
|
|
23
|
+
message: "Error while executing PageAfterUpdateEventHandler",
|
|
24
24
|
code: "AUDIT_LOGS_AFTER_PAGE_UPDATE_HANDLER"
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
export const PageAfterUpdateAuditHandler =
|
|
29
|
+
export const PageAfterUpdateAuditHandler = PageAfterUpdateEventHandler.createImplementation({
|
|
30
30
|
implementation: PageAfterUpdateHandlerImpl,
|
|
31
31
|
dependencies: [AuditLogsContext]
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","PageAfterUpdateEventHandler","AuditLogsContext","getAuditConfig","AUDIT","PageAfterUpdateHandlerImpl","constructor","context","handle","event","page","original","payload","createAuditLog","WEBSITE_BUILDER","PAGE","UPDATE","before","after","id","error","from","message","code","PageAfterUpdateAuditHandler","createImplementation","implementation","dependencies"],"sources":["PageAfterUpdateHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { PageAfterUpdateEventHandler } from \"@webiny/api-website-builder/features/pages/UpdatePage/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass PageAfterUpdateHandlerImpl implements PageAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: PageAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { page, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.PAGE.UPDATE);\n await createAuditLog(\n \"Website Page Updated\",\n { before: original, after: page },\n page.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing PageAfterUpdateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_PAGE_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const PageAfterUpdateAuditHandler = PageAfterUpdateEventHandler.createImplementation({\n implementation: PageAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,2BAA2B,QAAQ,gEAAgE;AAC5G,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,0BAA0B,CAAkD;EAC9EC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAAwC,EAAiB;IAClE,IAAI;MACA,MAAM;QAAEC,IAAI;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MACxC,MAAMC,cAAc,GAAGV,cAAc,CAACC,KAAK,CAACU,eAAe,CAACC,IAAI,CAACC,MAAM,CAAC;MACxE,MAAMH,cAAc,CAChB,sBAAsB,EACtB;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAK,CAAC,EACjCA,IAAI,CAACS,EAAE,EACP,IAAI,CAACZ,OACT,CAAC;IACL,CAAC,CAAC,OAAOa,KAAK,EAAE;MACZ,MAAMpB,WAAW,CAACqB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,mDAAmD;QAC5DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,2BAA2B,GAAGvB,2BAA2B,CAACwB,oBAAoB,CAAC;EACxFC,cAAc,EAAErB,0BAA0B;EAC1CsB,YAAY,EAAE,CAACzB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedirectAfterCreateEventHandler } from "@webiny/api-website-builder/features/redirects/CreateRedirect/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class RedirectAfterCreateHandlerImpl implements
|
|
3
|
+
declare class RedirectAfterCreateHandlerImpl implements RedirectAfterCreateEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: RedirectAfterCreateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const RedirectAfterCreateAuditHandler: typeof RedirectAfterCreateHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/redirects/CreateRedirect/abstractions").RedirectAfterCreatePayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { RedirectAfterCreateEventHandler } from "@webiny/api-website-builder/features/redirects/CreateRedirect/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -16,13 +16,13 @@ class RedirectAfterCreateHandlerImpl {
|
|
|
16
16
|
await createAuditLog("Website Redirect Created", redirect, redirect.id, this.context);
|
|
17
17
|
} catch (error) {
|
|
18
18
|
throw WebinyError.from(error, {
|
|
19
|
-
message: "Error while executing
|
|
19
|
+
message: "Error while executing RedirectAfterCreateEventHandler",
|
|
20
20
|
code: "AUDIT_LOGS_AFTER_REDIRECT_CREATE_HANDLER"
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const RedirectAfterCreateAuditHandler =
|
|
25
|
+
export const RedirectAfterCreateAuditHandler = RedirectAfterCreateEventHandler.createImplementation({
|
|
26
26
|
implementation: RedirectAfterCreateHandlerImpl,
|
|
27
27
|
dependencies: [AuditLogsContext]
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","RedirectAfterCreateEventHandler","AuditLogsContext","getAuditConfig","AUDIT","RedirectAfterCreateHandlerImpl","constructor","context","handle","event","redirect","payload","createAuditLog","WEBSITE_BUILDER","REDIRECT","CREATE","id","error","from","message","code","RedirectAfterCreateAuditHandler","createImplementation","implementation","dependencies"],"sources":["RedirectAfterCreateHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { RedirectAfterCreateEventHandler } from \"@webiny/api-website-builder/features/redirects/CreateRedirect/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass RedirectAfterCreateHandlerImpl implements RedirectAfterCreateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RedirectAfterCreateEventHandler.Event): Promise<void> {\n try {\n const { redirect } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.CREATE);\n await createAuditLog(\"Website Redirect Created\", redirect, redirect.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing RedirectAfterCreateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_REDIRECT_CREATE_HANDLER\"\n });\n }\n }\n}\n\nexport const RedirectAfterCreateAuditHandler = RedirectAfterCreateEventHandler.createImplementation(\n {\n implementation: RedirectAfterCreateHandlerImpl,\n dependencies: [AuditLogsContext]\n }\n);\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,+BAA+B,QAAQ,wEAAwE;AACxH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,8BAA8B,CAAsD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA4C,EAAiB;IACtE,IAAI;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGD,KAAK,CAACE,OAAO;MAClC,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,QAAQ,CAACC,MAAM,CAAC;MAC5E,MAAMH,cAAc,CAAC,0BAA0B,EAAEF,QAAQ,EAAEA,QAAQ,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACzF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,+BAA+B,GAAGpB,+BAA+B,CAACqB,oBAAoB,CAC/F;EACIC,cAAc,EAAElB,8BAA8B;EAC9CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CACJ,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedirectAfterDeleteEventHandler } from "@webiny/api-website-builder/features/redirects/DeleteRedirect/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class RedirectAfterDeleteHandlerImpl implements
|
|
3
|
+
declare class RedirectAfterDeleteHandlerImpl implements RedirectAfterDeleteEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: RedirectAfterDeleteEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const RedirectAfterDeleteAuditHandler: typeof RedirectAfterDeleteHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/redirects/DeleteRedirect/abstractions").RedirectAfterDeletePayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { RedirectAfterDeleteEventHandler } from "@webiny/api-website-builder/features/redirects/DeleteRedirect/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -16,13 +16,13 @@ class RedirectAfterDeleteHandlerImpl {
|
|
|
16
16
|
await createAuditLog("Website Redirect Deleted", redirect, redirect.id, this.context);
|
|
17
17
|
} catch (error) {
|
|
18
18
|
throw WebinyError.from(error, {
|
|
19
|
-
message: "Error while executing
|
|
19
|
+
message: "Error while executing RedirectAfterDeleteEventHandler",
|
|
20
20
|
code: "AUDIT_LOGS_AFTER_REDIRECT_DELETE_HANDLER"
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const RedirectAfterDeleteAuditHandler =
|
|
25
|
+
export const RedirectAfterDeleteAuditHandler = RedirectAfterDeleteEventHandler.createImplementation({
|
|
26
26
|
implementation: RedirectAfterDeleteHandlerImpl,
|
|
27
27
|
dependencies: [AuditLogsContext]
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","RedirectAfterDeleteEventHandler","AuditLogsContext","getAuditConfig","AUDIT","RedirectAfterDeleteHandlerImpl","constructor","context","handle","event","redirect","payload","createAuditLog","WEBSITE_BUILDER","REDIRECT","DELETE","id","error","from","message","code","RedirectAfterDeleteAuditHandler","createImplementation","implementation","dependencies"],"sources":["RedirectAfterDeleteHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { RedirectAfterDeleteEventHandler } from \"@webiny/api-website-builder/features/redirects/DeleteRedirect/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass RedirectAfterDeleteHandlerImpl implements RedirectAfterDeleteEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RedirectAfterDeleteEventHandler.Event): Promise<void> {\n try {\n const { redirect } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.DELETE);\n await createAuditLog(\"Website Redirect Deleted\", redirect, redirect.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing RedirectAfterDeleteEventHandler\",\n code: \"AUDIT_LOGS_AFTER_REDIRECT_DELETE_HANDLER\"\n });\n }\n }\n}\n\nexport const RedirectAfterDeleteAuditHandler = RedirectAfterDeleteEventHandler.createImplementation(\n {\n implementation: RedirectAfterDeleteHandlerImpl,\n dependencies: [AuditLogsContext]\n }\n);\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,+BAA+B,QAAQ,wEAAwE;AACxH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,8BAA8B,CAAsD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA4C,EAAiB;IACtE,IAAI;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGD,KAAK,CAACE,OAAO;MAClC,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,QAAQ,CAACC,MAAM,CAAC;MAC5E,MAAMH,cAAc,CAAC,0BAA0B,EAAEF,QAAQ,EAAEA,QAAQ,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACzF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,+BAA+B,GAAGpB,+BAA+B,CAACqB,oBAAoB,CAC/F;EACIC,cAAc,EAAElB,8BAA8B;EAC9CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CACJ,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedirectAfterMoveEventHandler } from "@webiny/api-website-builder/features/redirects/MoveRedirect/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class RedirectAfterMoveHandlerImpl implements
|
|
3
|
+
declare class RedirectAfterMoveHandlerImpl implements RedirectAfterMoveEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: RedirectAfterMoveEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const RedirectAfterMoveAuditHandler: typeof RedirectAfterMoveHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/redirects/MoveRedirect/abstractions").RedirectAfterMovePayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { RedirectAfterMoveEventHandler } from "@webiny/api-website-builder/features/redirects/MoveRedirect/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -16,13 +16,13 @@ class RedirectAfterMoveHandlerImpl {
|
|
|
16
16
|
await createAuditLog("Website Redirect Moved", redirect, redirect.id, this.context);
|
|
17
17
|
} catch (error) {
|
|
18
18
|
throw WebinyError.from(error, {
|
|
19
|
-
message: "Error while executing
|
|
19
|
+
message: "Error while executing RedirectAfterMoveEventHandler",
|
|
20
20
|
code: "AUDIT_LOGS_AFTER_REDIRECT_MOVE_HANDLER"
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
export const RedirectAfterMoveAuditHandler =
|
|
25
|
+
export const RedirectAfterMoveAuditHandler = RedirectAfterMoveEventHandler.createImplementation({
|
|
26
26
|
implementation: RedirectAfterMoveHandlerImpl,
|
|
27
27
|
dependencies: [AuditLogsContext]
|
|
28
28
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","RedirectAfterMoveEventHandler","AuditLogsContext","getAuditConfig","AUDIT","RedirectAfterMoveHandlerImpl","constructor","context","handle","event","redirect","payload","createAuditLog","WEBSITE_BUILDER","REDIRECT","MOVE","id","error","from","message","code","RedirectAfterMoveAuditHandler","createImplementation","implementation","dependencies"],"sources":["RedirectAfterMoveHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { RedirectAfterMoveEventHandler } from \"@webiny/api-website-builder/features/redirects/MoveRedirect/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass RedirectAfterMoveHandlerImpl implements RedirectAfterMoveEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RedirectAfterMoveEventHandler.Event): Promise<void> {\n try {\n const { redirect } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.MOVE);\n await createAuditLog(\"Website Redirect Moved\", redirect, redirect.id, this.context);\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing RedirectAfterMoveEventHandler\",\n code: \"AUDIT_LOGS_AFTER_REDIRECT_MOVE_HANDLER\"\n });\n }\n }\n}\n\nexport const RedirectAfterMoveAuditHandler = RedirectAfterMoveEventHandler.createImplementation({\n implementation: RedirectAfterMoveHandlerImpl,\n dependencies: [AuditLogsContext]\n});\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,6BAA6B,QAAQ,sEAAsE;AACpH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,4BAA4B,CAAoD;EAClFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA0C,EAAiB;IACpE,IAAI;MACA,MAAM;QAAEC;MAAS,CAAC,GAAGD,KAAK,CAACE,OAAO;MAClC,MAAMC,cAAc,GAAGT,cAAc,CAACC,KAAK,CAACS,eAAe,CAACC,QAAQ,CAACC,IAAI,CAAC;MAC1E,MAAMH,cAAc,CAAC,wBAAwB,EAAEF,QAAQ,EAAEA,QAAQ,CAACM,EAAE,EAAE,IAAI,CAACT,OAAO,CAAC;IACvF,CAAC,CAAC,OAAOU,KAAK,EAAE;MACZ,MAAMjB,WAAW,CAACkB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,qDAAqD;QAC9DC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,6BAA6B,GAAGpB,6BAA6B,CAACqB,oBAAoB,CAAC;EAC5FC,cAAc,EAAElB,4BAA4B;EAC5CmB,YAAY,EAAE,CAACtB,gBAAgB;AACnC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RedirectAfterUpdateEventHandler } from "@webiny/api-website-builder/features/redirects/UpdateRedirect/index.js";
|
|
2
2
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
3
|
-
declare class RedirectAfterUpdateHandlerImpl implements
|
|
3
|
+
declare class RedirectAfterUpdateHandlerImpl implements RedirectAfterUpdateEventHandler.Interface {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: AuditLogsContext.Interface);
|
|
6
|
-
handle(event:
|
|
6
|
+
handle(event: RedirectAfterUpdateEventHandler.Event): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
export declare const RedirectAfterUpdateAuditHandler: typeof RedirectAfterUpdateHandlerImpl & {
|
|
9
9
|
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-core/features/EventPublisher").IEventHandler<import("@webiny/api-core/features/EventPublisher").DomainEvent<import("@webiny/api-website-builder/features/redirects/UpdateRedirect/abstractions").RedirectAfterUpdatePayload>>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebinyError } from "@webiny/error";
|
|
2
|
-
import {
|
|
2
|
+
import { RedirectAfterUpdateEventHandler } from "@webiny/api-website-builder/features/redirects/UpdateRedirect/index.js";
|
|
3
3
|
import { AuditLogsContext } from "../../../abstractions.js";
|
|
4
4
|
import { getAuditConfig } from "../../../utils/getAuditConfig.js";
|
|
5
5
|
import { AUDIT } from "../../../config.js";
|
|
@@ -20,13 +20,13 @@ class RedirectAfterUpdateHandlerImpl {
|
|
|
20
20
|
}, redirect.id, this.context);
|
|
21
21
|
} catch (error) {
|
|
22
22
|
throw WebinyError.from(error, {
|
|
23
|
-
message: "Error while executing
|
|
23
|
+
message: "Error while executing RedirectAfterUpdateEventHandler",
|
|
24
24
|
code: "AUDIT_LOGS_AFTER_REDIRECT_UPDATE_HANDLER"
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
export const RedirectAfterUpdateAuditHandler =
|
|
29
|
+
export const RedirectAfterUpdateAuditHandler = RedirectAfterUpdateEventHandler.createImplementation({
|
|
30
30
|
implementation: RedirectAfterUpdateHandlerImpl,
|
|
31
31
|
dependencies: [AuditLogsContext]
|
|
32
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","
|
|
1
|
+
{"version":3,"names":["WebinyError","RedirectAfterUpdateEventHandler","AuditLogsContext","getAuditConfig","AUDIT","RedirectAfterUpdateHandlerImpl","constructor","context","handle","event","redirect","original","payload","createAuditLog","WEBSITE_BUILDER","REDIRECT","UPDATE","before","after","id","error","from","message","code","RedirectAfterUpdateAuditHandler","createImplementation","implementation","dependencies"],"sources":["RedirectAfterUpdateHandler.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport { RedirectAfterUpdateEventHandler } from \"@webiny/api-website-builder/features/redirects/UpdateRedirect/index.js\";\nimport { AuditLogsContext } from \"~/abstractions.js\";\nimport { getAuditConfig } from \"~/utils/getAuditConfig.js\";\nimport { AUDIT } from \"~/config.js\";\n\nclass RedirectAfterUpdateHandlerImpl implements RedirectAfterUpdateEventHandler.Interface {\n constructor(private context: AuditLogsContext.Interface) {}\n\n async handle(event: RedirectAfterUpdateEventHandler.Event): Promise<void> {\n try {\n const { redirect, original } = event.payload;\n const createAuditLog = getAuditConfig(AUDIT.WEBSITE_BUILDER.REDIRECT.UPDATE);\n await createAuditLog(\n \"Website Redirect Updated\",\n { before: original, after: redirect },\n redirect.id,\n this.context\n );\n } catch (error) {\n throw WebinyError.from(error, {\n message: \"Error while executing RedirectAfterUpdateEventHandler\",\n code: \"AUDIT_LOGS_AFTER_REDIRECT_UPDATE_HANDLER\"\n });\n }\n }\n}\n\nexport const RedirectAfterUpdateAuditHandler = RedirectAfterUpdateEventHandler.createImplementation(\n {\n implementation: RedirectAfterUpdateHandlerImpl,\n dependencies: [AuditLogsContext]\n }\n);\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,+BAA+B,QAAQ,wEAAwE;AACxH,SAASC,gBAAgB;AACzB,SAASC,cAAc;AACvB,SAASC,KAAK;AAEd,MAAMC,8BAA8B,CAAsD;EACtFC,WAAWA,CAASC,OAAmC,EAAE;IAAA,KAArCA,OAAmC,GAAnCA,OAAmC;EAAG;EAE1D,MAAMC,MAAMA,CAACC,KAA4C,EAAiB;IACtE,IAAI;MACA,MAAM;QAAEC,QAAQ;QAAEC;MAAS,CAAC,GAAGF,KAAK,CAACG,OAAO;MAC5C,MAAMC,cAAc,GAAGV,cAAc,CAACC,KAAK,CAACU,eAAe,CAACC,QAAQ,CAACC,MAAM,CAAC;MAC5E,MAAMH,cAAc,CAChB,0BAA0B,EAC1B;QAAEI,MAAM,EAAEN,QAAQ;QAAEO,KAAK,EAAER;MAAS,CAAC,EACrCA,QAAQ,CAACS,EAAE,EACX,IAAI,CAACZ,OACT,CAAC;IACL,CAAC,CAAC,OAAOa,KAAK,EAAE;MACZ,MAAMpB,WAAW,CAACqB,IAAI,CAACD,KAAK,EAAE;QAC1BE,OAAO,EAAE,uDAAuD;QAChEC,IAAI,EAAE;MACV,CAAC,CAAC;IACN;EACJ;AACJ;AAEA,OAAO,MAAMC,+BAA+B,GAAGvB,+BAA+B,CAACwB,oBAAoB,CAC/F;EACIC,cAAc,EAAErB,8BAA8B;EAC9CsB,YAAY,EAAE,CAACzB,gBAAgB;AACnC,CACJ,CAAC","ignoreList":[]}
|