@webiny/api-audit-logs 0.0.0-unstable.06b2ede40f

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.
Files changed (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/app/app.d.ts +2 -0
  4. package/app/app.js +119 -0
  5. package/app/app.js.map +1 -0
  6. package/app/contants.d.ts +2 -0
  7. package/app/contants.js +10 -0
  8. package/app/contants.js.map +1 -0
  9. package/app/createAppModifier.d.ts +4 -0
  10. package/app/createAppModifier.js +14 -0
  11. package/app/createAppModifier.js.map +1 -0
  12. package/app/index.d.ts +4 -0
  13. package/app/index.js +43 -0
  14. package/app/index.js.map +1 -0
  15. package/app/types.d.ts +7 -0
  16. package/app/types.js +7 -0
  17. package/app/types.js.map +1 -0
  18. package/config.d.ts +14 -0
  19. package/config.js +293 -0
  20. package/config.js.map +1 -0
  21. package/index.d.ts +5 -0
  22. package/index.js +49 -0
  23. package/index.js.map +1 -0
  24. package/package.json +47 -0
  25. package/subscriptions/aco/folders.d.ts +4 -0
  26. package/subscriptions/aco/folders.js +94 -0
  27. package/subscriptions/aco/folders.js.map +1 -0
  28. package/subscriptions/aco/index.d.ts +2 -0
  29. package/subscriptions/aco/index.js +18 -0
  30. package/subscriptions/aco/index.js.map +1 -0
  31. package/subscriptions/apw/changeRequests.d.ts +4 -0
  32. package/subscriptions/apw/changeRequests.js +80 -0
  33. package/subscriptions/apw/changeRequests.js.map +1 -0
  34. package/subscriptions/apw/comments.d.ts +2 -0
  35. package/subscriptions/apw/comments.js +28 -0
  36. package/subscriptions/apw/comments.js.map +1 -0
  37. package/subscriptions/apw/contentReviews.d.ts +2 -0
  38. package/subscriptions/apw/contentReviews.js +28 -0
  39. package/subscriptions/apw/contentReviews.js.map +1 -0
  40. package/subscriptions/apw/index.d.ts +2 -0
  41. package/subscriptions/apw/index.js +26 -0
  42. package/subscriptions/apw/index.js.map +1 -0
  43. package/subscriptions/apw/workflows.d.ts +4 -0
  44. package/subscriptions/apw/workflows.js +64 -0
  45. package/subscriptions/apw/workflows.js.map +1 -0
  46. package/subscriptions/fileManager/files.d.ts +4 -0
  47. package/subscriptions/fileManager/files.js +64 -0
  48. package/subscriptions/fileManager/files.js.map +1 -0
  49. package/subscriptions/fileManager/index.d.ts +2 -0
  50. package/subscriptions/fileManager/index.js +17 -0
  51. package/subscriptions/fileManager/index.js.map +1 -0
  52. package/subscriptions/fileManager/settings.d.ts +2 -0
  53. package/subscriptions/fileManager/settings.js +32 -0
  54. package/subscriptions/fileManager/settings.js.map +1 -0
  55. package/subscriptions/headlessCms/entries.d.ts +9 -0
  56. package/subscriptions/headlessCms/entries.js +183 -0
  57. package/subscriptions/headlessCms/entries.js.map +1 -0
  58. package/subscriptions/headlessCms/groups.d.ts +4 -0
  59. package/subscriptions/headlessCms/groups.js +64 -0
  60. package/subscriptions/headlessCms/groups.js.map +1 -0
  61. package/subscriptions/headlessCms/index.d.ts +2 -0
  62. package/subscriptions/headlessCms/index.js +31 -0
  63. package/subscriptions/headlessCms/index.js.map +1 -0
  64. package/subscriptions/headlessCms/models.d.ts +4 -0
  65. package/subscriptions/headlessCms/models.js +64 -0
  66. package/subscriptions/headlessCms/models.js.map +1 -0
  67. package/subscriptions/headlessCms/utils/isSearchModelEntry.d.ts +1 -0
  68. package/subscriptions/headlessCms/utils/isSearchModelEntry.js +13 -0
  69. package/subscriptions/headlessCms/utils/isSearchModelEntry.js.map +1 -0
  70. package/subscriptions/i18n/index.d.ts +2 -0
  71. package/subscriptions/i18n/index.js +15 -0
  72. package/subscriptions/i18n/index.js.map +1 -0
  73. package/subscriptions/i18n/locales.d.ts +4 -0
  74. package/subscriptions/i18n/locales.js +64 -0
  75. package/subscriptions/i18n/locales.js.map +1 -0
  76. package/subscriptions/index.d.ts +2 -0
  77. package/subscriptions/index.js +25 -0
  78. package/subscriptions/index.js.map +1 -0
  79. package/subscriptions/mailer/index.d.ts +2 -0
  80. package/subscriptions/mailer/index.js +13 -0
  81. package/subscriptions/mailer/index.js.map +1 -0
  82. package/subscriptions/mailer/settings.d.ts +2 -0
  83. package/subscriptions/mailer/settings.js +32 -0
  84. package/subscriptions/mailer/settings.js.map +1 -0
  85. package/subscriptions/security/apiKeys.d.ts +4 -0
  86. package/subscriptions/security/apiKeys.js +85 -0
  87. package/subscriptions/security/apiKeys.js.map +1 -0
  88. package/subscriptions/security/index.d.ts +2 -0
  89. package/subscriptions/security/index.js +27 -0
  90. package/subscriptions/security/index.js.map +1 -0
  91. package/subscriptions/security/roles.d.ts +4 -0
  92. package/subscriptions/security/roles.js +64 -0
  93. package/subscriptions/security/roles.js.map +1 -0
  94. package/subscriptions/security/teams.d.ts +4 -0
  95. package/subscriptions/security/teams.js +64 -0
  96. package/subscriptions/security/teams.js.map +1 -0
  97. package/subscriptions/security/users.d.ts +4 -0
  98. package/subscriptions/security/users.js +64 -0
  99. package/subscriptions/security/users.js.map +1 -0
  100. package/types.d.ts +53 -0
  101. package/types.js +18 -0
  102. package/types.js.map +1 -0
  103. package/utils/getAuditConfig.d.ts +36 -0
  104. package/utils/getAuditConfig.js +149 -0
  105. package/utils/getAuditConfig.js.map +1 -0
  106. package/utils/getAuditObject.d.ts +2 -0
  107. package/utils/getAuditObject.js +25 -0
  108. package/utils/getAuditObject.js.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Webiny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # @webiny/api-audit-logs
package/app/app.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import type { IAcoAppRegisterParams } from "@webiny/api-aco/types";
2
+ export declare const createApp: () => IAcoAppRegisterParams;
package/app/app.js ADDED
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createApp = void 0;
7
+ var _contants = require("./contants");
8
+ var _apiSecurity = require("@webiny/api-security");
9
+ const toDate = value => {
10
+ if (value instanceof Date) {
11
+ return value;
12
+ }
13
+ try {
14
+ return new Date(value);
15
+ } catch {
16
+ return value;
17
+ }
18
+ };
19
+ const decompressData = async (entry, context) => {
20
+ if (!entry.data?.data) {
21
+ return entry;
22
+ }
23
+ return {
24
+ ...entry,
25
+ data: {
26
+ ...entry.data,
27
+ timestamp: toDate(entry.data.timestamp),
28
+ data: await context.compressor.decompress(JSON.parse(entry.data.data))
29
+ }
30
+ };
31
+ };
32
+ const createApp = () => {
33
+ return {
34
+ name: _contants.AUDIT_LOGS_TYPE,
35
+ apiName: "AuditLogs",
36
+ fields: [{
37
+ id: "id",
38
+ fieldId: "id",
39
+ type: "text",
40
+ storageId: "text@id",
41
+ label: "ID"
42
+ }, {
43
+ id: "message",
44
+ fieldId: "message",
45
+ type: "text",
46
+ storageId: "text@message",
47
+ label: "Message"
48
+ }, {
49
+ id: "app",
50
+ fieldId: "app",
51
+ type: "text",
52
+ storageId: "text@app",
53
+ label: "App"
54
+ }, {
55
+ id: "entity",
56
+ fieldId: "entity",
57
+ type: "text",
58
+ storageId: "text@entity",
59
+ label: "Entity"
60
+ }, {
61
+ id: "entityId",
62
+ fieldId: "entityId",
63
+ type: "text",
64
+ storageId: "text@entityId",
65
+ label: "Entity ID"
66
+ }, {
67
+ id: "action",
68
+ fieldId: "action",
69
+ type: "text",
70
+ storageId: "text@action",
71
+ label: "Action"
72
+ }, {
73
+ id: "data",
74
+ fieldId: "data",
75
+ type: "text",
76
+ storageId: "text@data",
77
+ label: "Data"
78
+ }, {
79
+ id: "timestamp",
80
+ fieldId: "timestamp",
81
+ type: "datetime",
82
+ settings: {
83
+ type: "dateTimeWithoutTimezone"
84
+ },
85
+ storageId: "datetime@timestamp",
86
+ label: "Timestamp"
87
+ }, {
88
+ id: "initiator",
89
+ fieldId: "initiator",
90
+ type: "text",
91
+ storageId: "text@initiator",
92
+ label: "Initiator"
93
+ }],
94
+ onEntry: async (entry, context) => {
95
+ return decompressData(entry, context);
96
+ },
97
+ onEntryList: async (entries, context) => {
98
+ return await Promise.all(entries.map(async entry => {
99
+ return decompressData(entry, context);
100
+ }));
101
+ },
102
+ onAnyRequest: async (context, action) => {
103
+ const permissions = await context.security.getPermissions("al.*");
104
+ for (const permission of permissions) {
105
+ if (permission.name === "al.*") {
106
+ return;
107
+ } else if (permission.name === `al.${action}`) {
108
+ return;
109
+ }
110
+ }
111
+ throw new _apiSecurity.NotAuthorizedError({
112
+ message: "You cannot access audit logs."
113
+ });
114
+ }
115
+ };
116
+ };
117
+ exports.createApp = createApp;
118
+
119
+ //# sourceMappingURL=app.js.map
package/app/app.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_contants","require","_apiSecurity","toDate","value","Date","decompressData","entry","context","data","timestamp","compressor","decompress","JSON","parse","createApp","name","AUDIT_LOGS_TYPE","apiName","fields","id","fieldId","type","storageId","label","settings","onEntry","onEntryList","entries","Promise","all","map","onAnyRequest","action","permissions","security","getPermissions","permission","NotAuthorizedError","message","exports"],"sources":["app.ts"],"sourcesContent":["import type { AcoContext } from \"@webiny/api-aco/types\";\nimport type { IAcoAppRegisterParams, SearchRecord } from \"@webiny/api-aco/types\";\nimport { AUDIT_LOGS_TYPE } from \"./contants\";\nimport { NotAuthorizedError } from \"@webiny/api-security\";\n\nconst toDate = (value: string | Date) => {\n if (value instanceof Date) {\n return value;\n }\n try {\n return new Date(value);\n } catch {\n return value;\n }\n};\n\nconst decompressData = async (\n entry: SearchRecord<any>,\n context: Pick<AcoContext, \"compressor\">\n): Promise<SearchRecord<any>> => {\n if (!entry.data?.data) {\n return entry;\n }\n\n return {\n ...entry,\n data: {\n ...entry.data,\n timestamp: toDate(entry.data.timestamp),\n data: await context.compressor.decompress(JSON.parse(entry.data.data))\n }\n };\n};\n\nexport const createApp = (): IAcoAppRegisterParams => {\n return {\n name: AUDIT_LOGS_TYPE,\n apiName: \"AuditLogs\",\n fields: [\n {\n id: \"id\",\n fieldId: \"id\",\n type: \"text\",\n storageId: \"text@id\",\n label: \"ID\"\n },\n {\n id: \"message\",\n fieldId: \"message\",\n type: \"text\",\n storageId: \"text@message\",\n label: \"Message\"\n },\n {\n id: \"app\",\n fieldId: \"app\",\n type: \"text\",\n storageId: \"text@app\",\n label: \"App\"\n },\n {\n id: \"entity\",\n fieldId: \"entity\",\n type: \"text\",\n storageId: \"text@entity\",\n label: \"Entity\"\n },\n {\n id: \"entityId\",\n fieldId: \"entityId\",\n type: \"text\",\n storageId: \"text@entityId\",\n label: \"Entity ID\"\n },\n {\n id: \"action\",\n fieldId: \"action\",\n type: \"text\",\n storageId: \"text@action\",\n label: \"Action\"\n },\n {\n id: \"data\",\n fieldId: \"data\",\n type: \"text\",\n storageId: \"text@data\",\n label: \"Data\"\n },\n {\n id: \"timestamp\",\n fieldId: \"timestamp\",\n type: \"datetime\",\n settings: {\n type: \"dateTimeWithoutTimezone\"\n },\n storageId: \"datetime@timestamp\",\n label: \"Timestamp\"\n },\n {\n id: \"initiator\",\n fieldId: \"initiator\",\n type: \"text\",\n storageId: \"text@initiator\",\n label: \"Initiator\"\n }\n ],\n onEntry: async (entry, context) => {\n return decompressData(entry, context);\n },\n onEntryList: async (entries, context) => {\n return await Promise.all(\n entries.map(async entry => {\n return decompressData(entry, context);\n })\n );\n },\n onAnyRequest: async (context, action) => {\n const permissions = await context.security.getPermissions(\"al.*\");\n for (const permission of permissions) {\n if (permission.name === \"al.*\") {\n return;\n } else if (permission.name === `al.${action}`) {\n return;\n }\n }\n\n throw new NotAuthorizedError({\n message: \"You cannot access audit logs.\"\n });\n }\n };\n};\n"],"mappings":";;;;;;AAEA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,MAAME,MAAM,GAAIC,KAAoB,IAAK;EACrC,IAAIA,KAAK,YAAYC,IAAI,EAAE;IACvB,OAAOD,KAAK;EAChB;EACA,IAAI;IACA,OAAO,IAAIC,IAAI,CAACD,KAAK,CAAC;EAC1B,CAAC,CAAC,MAAM;IACJ,OAAOA,KAAK;EAChB;AACJ,CAAC;AAED,MAAME,cAAc,GAAG,MAAAA,CACnBC,KAAwB,EACxBC,OAAuC,KACV;EAC7B,IAAI,CAACD,KAAK,CAACE,IAAI,EAAEA,IAAI,EAAE;IACnB,OAAOF,KAAK;EAChB;EAEA,OAAO;IACH,GAAGA,KAAK;IACRE,IAAI,EAAE;MACF,GAAGF,KAAK,CAACE,IAAI;MACbC,SAAS,EAAEP,MAAM,CAACI,KAAK,CAACE,IAAI,CAACC,SAAS,CAAC;MACvCD,IAAI,EAAE,MAAMD,OAAO,CAACG,UAAU,CAACC,UAAU,CAACC,IAAI,CAACC,KAAK,CAACP,KAAK,CAACE,IAAI,CAACA,IAAI,CAAC;IACzE;EACJ,CAAC;AACL,CAAC;AAEM,MAAMM,SAAS,GAAGA,CAAA,KAA6B;EAClD,OAAO;IACHC,IAAI,EAAEC,yBAAe;IACrBC,OA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MAAM;MACZC,SAAS,EAAE,gBAAgB;MAC3BC,KAAK,EAAE;IACX,CAAC,CACJ;IACDE,OAAO,EAAE,MAAAA,CAAOnB,KAAK,EAAEC,OAAO,KAAK;MAC/B,OAAOF,cAAc,CAACC,KAAK,EAAEC,OAAO,CAAC;IACzC,CAAC;IACDmB,WAAW,EAAE,MAAAA,CAAOC,OAAO,EAAEpB,OAAO,KAAK;MACrC,OAAO,MAAMqB,OAAO,CAACC,GAAG,CACpBF,OAAO,CAACG,GAAG,CAAC,MAAMxB,KAAK,IAAI;QACvB,OAAOD,cAAc,CAACC,KAAK,EAAEC,OAAO,CAAC;MACzC,CAAC,CACL,CAAC;IACL,CAAC;IACDwB,YAAY,EAAE,MAAAA,CAAOxB,OAAO,EAAEyB,MAAM,KAAK;MACrC,MAAMC,WAAW,GAAG,MAAM1B,OAAO,CAAC2B,QAAQ,CAACC,cAAc,CAAC,MAAM,CAAC;MACjE,KAAK,MAAMC,UAAU,IAAIH,WAAW,EAAE;QAClC,IAAIG,UAAU,CAACrB,IAAI,KAAK,MAAM,EAAE;UAC5B;QACJ,CAAC,MAAM,IAAIqB,UAAU,CAACrB,IAAI,KAAK,MAAMiB,MAAM,EAAE,EAAE;UAC3C;QACJ;MACJ;MAEA,MAAM,IAAIK,+BAAkB,CAAC;QACzBC,OAAO,EAAE;MACb,CAAC,CAAC;IACN;EACJ,CAAC;AACL,CAAC;AAACC,OAAA,CAAAzB,SAAA,GAAAA,SAAA","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export declare const ROOT_FOLDER = "root";
2
+ export declare const AUDIT_LOGS_TYPE = "AuditLogs";
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ROOT_FOLDER = exports.AUDIT_LOGS_TYPE = void 0;
7
+ const ROOT_FOLDER = exports.ROOT_FOLDER = "root";
8
+ const AUDIT_LOGS_TYPE = exports.AUDIT_LOGS_TYPE = "AuditLogs";
9
+
10
+ //# sourceMappingURL=contants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ROOT_FOLDER","exports","AUDIT_LOGS_TYPE"],"sources":["contants.ts"],"sourcesContent":["export const ROOT_FOLDER = \"root\";\nexport const AUDIT_LOGS_TYPE = \"AuditLogs\";\n"],"mappings":";;;;;;AAAO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,MAAM;AAC1B,MAAME,eAAe,GAAAD,OAAA,CAAAC,eAAA,GAAG,WAAW","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ import type { CreateAcoAppModifierCallable } from "@webiny/api-aco";
2
+ import type { AuditLogsAcoContext } from "./types";
3
+ import type { Context } from "@webiny/handler/types";
4
+ export declare const createAppModifier: <T extends Context = AuditLogsAcoContext>(cb: CreateAcoAppModifierCallable<T>) => import("@webiny/api-aco").AcoAppModifierPlugin<T>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createAppModifier = void 0;
7
+ var _apiAco = require("@webiny/api-aco");
8
+ var _contants = require("./contants");
9
+ const createAppModifier = cb => {
10
+ return (0, _apiAco.createAcoAppModifier)(_contants.AUDIT_LOGS_TYPE, cb);
11
+ };
12
+ exports.createAppModifier = createAppModifier;
13
+
14
+ //# sourceMappingURL=createAppModifier.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_apiAco","require","_contants","createAppModifier","cb","baseCreateAppModifier","AUDIT_LOGS_TYPE","exports"],"sources":["createAppModifier.ts"],"sourcesContent":["import type { CreateAcoAppModifierCallable } from \"@webiny/api-aco\";\nimport { createAcoAppModifier as baseCreateAppModifier } from \"@webiny/api-aco\";\nimport { AUDIT_LOGS_TYPE } from \"./contants\";\nimport type { AuditLogsAcoContext } from \"./types\";\nimport type { Context } from \"@webiny/handler/types\";\n\nexport const createAppModifier = <T extends Context = AuditLogsAcoContext>(\n cb: CreateAcoAppModifierCallable<T>\n) => {\n return baseCreateAppModifier<T>(AUDIT_LOGS_TYPE, cb);\n};\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAIO,MAAME,iBAAiB,GAC1BC,EAAmC,IAClC;EACD,OAAO,IAAAC,4BAAqB,EAAIC,yBAAe,EAAEF,EAAE,CAAC;AACxD,CAAC;AAACG,OAAA,CAAAJ,iBAAA,GAAAA,iBAAA","ignoreList":[]}
package/app/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import { ContextPlugin } from "@webiny/api";
2
+ import type { AuditLogsAcoContext } from "./types";
3
+ export * from "./createAppModifier";
4
+ export declare const createAcoAuditLogsContext: () => ContextPlugin<AuditLogsAcoContext>;
package/app/index.js ADDED
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _exportNames = {
7
+ createAcoAuditLogsContext: true
8
+ };
9
+ exports.createAcoAuditLogsContext = void 0;
10
+ var _api = require("@webiny/api");
11
+ var _app = require("./app");
12
+ var _createAppModifier = require("./createAppModifier");
13
+ Object.keys(_createAppModifier).forEach(function (key) {
14
+ if (key === "default" || key === "__esModule") return;
15
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
16
+ if (key in exports && exports[key] === _createAppModifier[key]) return;
17
+ Object.defineProperty(exports, key, {
18
+ enumerable: true,
19
+ get: function () {
20
+ return _createAppModifier[key];
21
+ }
22
+ });
23
+ });
24
+ const setupContext = async context => {
25
+ const app = await context.aco.registerApp((0, _app.createApp)());
26
+ context.auditLogsAco = {
27
+ app
28
+ };
29
+ };
30
+ const createAcoAuditLogsContext = () => {
31
+ const plugin = new _api.ContextPlugin(async context => {
32
+ if (!context.aco) {
33
+ console.log(`There is no ACO initialized so we will not initialize the Audit Logs ACO.`);
34
+ return;
35
+ }
36
+ await setupContext(context);
37
+ });
38
+ plugin.name = "audit-logs-aco.createContext";
39
+ return plugin;
40
+ };
41
+ exports.createAcoAuditLogsContext = createAcoAuditLogsContext;
42
+
43
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_api","require","_app","_createAppModifier","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","setupContext","context","app","aco","registerApp","createApp","auditLogsAco","createAcoAuditLogsContext","plugin","ContextPlugin","console","log","name"],"sources":["index.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport type { AuditLogsAcoContext } from \"./types\";\nimport { createApp } from \"./app\";\n\nexport * from \"./createAppModifier\";\n\nconst setupContext = async (context: AuditLogsAcoContext): Promise<void> => {\n const app = await context.aco.registerApp(createApp());\n\n context.auditLogsAco = {\n app\n };\n};\n\nexport const createAcoAuditLogsContext = () => {\n const plugin = new ContextPlugin<AuditLogsAcoContext>(async context => {\n if (!context.aco) {\n console.log(\n `There is no ACO initialized so we will not initialize the Audit Logs ACO.`\n );\n return;\n }\n await setupContext(context);\n });\n\n plugin.name = \"audit-logs-aco.createContext\";\n\n return plugin;\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAAE,kBAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,kBAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,kBAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,kBAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAEA,MAAMS,YAAY,GAAG,MAAOC,OAA4B,IAAoB;EACxE,MAAMC,GAAG,GAAG,MAAMD,OAAO,CAACE,GAAG,CAACC,WAAW,CAAC,IAAAC,cAAS,EAAC,CAAC,CAAC;EAEtDJ,OAAO,CAACK,YAAY,GAAG;IACnBJ;EACJ,CAAC;AACL,CAAC;AAEM,MAAMK,yBAAyB,GAAGA,CAAA,KAAM;EAC3C,MAAMC,MAAM,GAAG,IAAIC,kBAAa,CAAsB,MAAMR,OAAO,IAAI;IACnE,IAAI,CAACA,OAAO,CAACE,GAAG,EAAE;MACdO,OAAO,CAACC,GAAG,CACP,2EACJ,CAAC;MACD;IACJ;IACA,MAAMX,YAAY,CAACC,OAAO,CAAC;EAC/B,CAAC,CAAC;EAEFO,MAAM,CAACI,IAAI,GAAG,8BAA8B;EAE5C,OAAOJ,MAAM;AACjB,CAAC;AAACZ,OAAA,CAAAW,yBAAA,GAAAA,yBAAA","ignoreList":[]}
package/app/types.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import type { AcoContext, IAcoApp } from "@webiny/api-aco/types";
2
+ import type { Context as BaseContext } from "@webiny/handler/types";
3
+ export interface AuditLogsAcoContext extends BaseContext, AcoContext {
4
+ auditLogsAco: {
5
+ app: IAcoApp;
6
+ };
7
+ }
package/app/types.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+
7
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { AcoContext, IAcoApp } from \"@webiny/api-aco/types\";\nimport type { Context as BaseContext } from \"@webiny/handler/types\";\n\nexport interface AuditLogsAcoContext extends BaseContext, AcoContext {\n auditLogsAco: {\n app: IAcoApp;\n };\n}\n"],"mappings":"","ignoreList":[]}
package/config.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import type { App } from "./types";
2
+ export declare enum ActionType {
3
+ CREATE = "CREATE",
4
+ UPDATE = "UPDATE",
5
+ DELETE = "DELETE",
6
+ MOVE_TO_TRASH = "MOVE_TO_TRASH",
7
+ RESTORE_FROM_TRASH = "RESTORE_FROM_TRASH",
8
+ PUBLISH = "PUBLISH",
9
+ UNPUBLISH = "UNPUBLISH",
10
+ IMPORT = "IMPORT",
11
+ EXPORT = "EXPORT"
12
+ }
13
+ export declare const auditLogsApps: App[];
14
+ export declare const AUDIT: import("./types").AuditObject;
package/config.js ADDED
@@ -0,0 +1,293 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.auditLogsApps = exports.ActionType = exports.AUDIT = void 0;
7
+ var _getAuditObject = require("./utils/getAuditObject");
8
+ let ActionType = exports.ActionType = /*#__PURE__*/function (ActionType) {
9
+ ActionType["CREATE"] = "CREATE";
10
+ ActionType["UPDATE"] = "UPDATE";
11
+ ActionType["DELETE"] = "DELETE";
12
+ ActionType["MOVE_TO_TRASH"] = "MOVE_TO_TRASH";
13
+ ActionType["RESTORE_FROM_TRASH"] = "RESTORE_FROM_TRASH";
14
+ ActionType["PUBLISH"] = "PUBLISH";
15
+ ActionType["UNPUBLISH"] = "UNPUBLISH";
16
+ ActionType["IMPORT"] = "IMPORT";
17
+ ActionType["EXPORT"] = "EXPORT";
18
+ return ActionType;
19
+ }({});
20
+ const commonActions = {
21
+ CREATE: {
22
+ type: ActionType.CREATE,
23
+ displayName: "Create"
24
+ },
25
+ UPDATE: {
26
+ type: ActionType.UPDATE,
27
+ displayName: "Update"
28
+ },
29
+ DELETE: {
30
+ type: ActionType.DELETE,
31
+ displayName: "Delete"
32
+ }
33
+ };
34
+ const publishActions = {
35
+ PUBLISH: {
36
+ type: ActionType.PUBLISH,
37
+ displayName: "Publish"
38
+ },
39
+ UNPUBLISH: {
40
+ type: ActionType.UNPUBLISH,
41
+ displayName: "Unpublish"
42
+ }
43
+ };
44
+ const importExportActions = {
45
+ IMPORT: {
46
+ type: ActionType.IMPORT,
47
+ displayName: "Import"
48
+ },
49
+ EXPORT: {
50
+ type: ActionType.EXPORT,
51
+ displayName: "Export"
52
+ }
53
+ };
54
+ const trashBinActions = {
55
+ MOVE_TO_TRASH: {
56
+ type: ActionType.MOVE_TO_TRASH,
57
+ displayName: "Move to trash"
58
+ },
59
+ RESTORE_FROM_TRASH: {
60
+ type: ActionType.RESTORE_FROM_TRASH,
61
+ displayName: "Restore from trash"
62
+ }
63
+ };
64
+ const auditLogsApps = exports.auditLogsApps = [{
65
+ app: "APW",
66
+ displayName: "APW",
67
+ entities: [{
68
+ type: "CHANGE_REQUEST",
69
+ displayName: "Change Request",
70
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE, {
71
+ type: "MARK_RESOLVED",
72
+ displayName: "Mark resolved"
73
+ }, {
74
+ type: "MARK_UNRESOLVED",
75
+ displayName: "Mark unresolved"
76
+ }]
77
+ }, {
78
+ type: "COMMENT",
79
+ displayName: "Comment",
80
+ actions: [commonActions.CREATE]
81
+ }, {
82
+ type: "CONTENT_REVIEW",
83
+ displayName: "Content Review",
84
+ linkToEntity(id) {
85
+ return `/apw/content-reviews/${id}`;
86
+ },
87
+ actions: [commonActions.CREATE]
88
+ }, {
89
+ type: "WORKFLOW",
90
+ displayName: "Workflow",
91
+ linkToEntity(id) {
92
+ return `/apw/publishing-workflows?id=${id}`;
93
+ },
94
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
95
+ }]
96
+ }, {
97
+ app: "FILE_MANAGER",
98
+ displayName: "File Manager",
99
+ entities: [{
100
+ type: "FILE",
101
+ displayName: "File",
102
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
103
+ }, {
104
+ type: "FILE_FOLDER",
105
+ displayName: "File folder",
106
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
107
+ }, {
108
+ type: "SETTINGS",
109
+ displayName: "Settings",
110
+ actions: [commonActions.UPDATE]
111
+ }]
112
+ }, {
113
+ app: "FORM_BUILDER",
114
+ displayName: "Form Builder",
115
+ entities: [{
116
+ type: "FORM",
117
+ displayName: "Form",
118
+ linkToEntity(id) {
119
+ return `/form-builder/forms?id=${id}`;
120
+ },
121
+ actions: [commonActions.CREATE, commonActions.DELETE, importExportActions.EXPORT, importExportActions.IMPORT]
122
+ }, {
123
+ type: "FORM_REVISION",
124
+ displayName: "Form revision",
125
+ linkToEntity(id) {
126
+ return `/form-builder/forms?id=${id}`;
127
+ },
128
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE, publishActions.PUBLISH, publishActions.UNPUBLISH]
129
+ }, {
130
+ type: "FORM_SUBMISSION",
131
+ displayName: "Form submission",
132
+ actions: [importExportActions.EXPORT]
133
+ }, {
134
+ type: "SETTINGS",
135
+ displayName: "Settings",
136
+ actions: [commonActions.UPDATE]
137
+ }]
138
+ }, {
139
+ app: "HEADLESS_CMS",
140
+ displayName: "Headless CMS",
141
+ entities: [{
142
+ type: "ENTRY",
143
+ displayName: "Entry",
144
+ actions: [commonActions.CREATE, commonActions.DELETE, trashBinActions.MOVE_TO_TRASH, trashBinActions.RESTORE_FROM_TRASH]
145
+ }, {
146
+ type: "ENTRY_REVISION",
147
+ displayName: "Entry revision",
148
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE, publishActions.PUBLISH, publishActions.UNPUBLISH]
149
+ }, {
150
+ type: "GROUP",
151
+ displayName: "Group",
152
+ linkToEntity(id) {
153
+ return `/cms/content-model-groups?id=${id}`;
154
+ },
155
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
156
+ }, {
157
+ type: "MODEL",
158
+ displayName: "Model",
159
+ linkToEntity(modelId) {
160
+ return `/cms/content-models/${modelId}`;
161
+ },
162
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
163
+ }, {
164
+ type: "MODEL_FOLDER",
165
+ displayName: "Model folder",
166
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
167
+ }]
168
+ }, {
169
+ app: "I18N",
170
+ displayName: "i18n",
171
+ entities: [{
172
+ type: "LOCALE",
173
+ displayName: "Locale",
174
+ linkToEntity(id) {
175
+ return `/i18n/locales?code=${id}`;
176
+ },
177
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
178
+ }]
179
+ }, {
180
+ app: "MAILER",
181
+ displayName: "Mailer",
182
+ entities: [{
183
+ type: "SETTINGS",
184
+ displayName: "Settings",
185
+ actions: [commonActions.UPDATE]
186
+ }]
187
+ }, {
188
+ app: "PAGE_BUILDER",
189
+ displayName: "Page Builder",
190
+ entities: [{
191
+ type: "BLOCK",
192
+ displayName: "Block",
193
+ linkToEntity(id) {
194
+ return `/page-builder/block-editor/${id}`;
195
+ },
196
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE, importExportActions.EXPORT, importExportActions.IMPORT]
197
+ }, {
198
+ type: "BLOCK_CATEGORY",
199
+ displayName: "Block category",
200
+ linkToEntity(slug) {
201
+ return `/page-builder/block-categories?slug=${slug}`;
202
+ },
203
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
204
+ }, {
205
+ type: "CATEGORY",
206
+ displayName: "Category",
207
+ linkToEntity(slug) {
208
+ return `/page-builder/categories?slug=${slug}`;
209
+ },
210
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
211
+ }, {
212
+ type: "MENU",
213
+ displayName: "Menu",
214
+ linkToEntity(slug) {
215
+ return `/page-builder/menus?slug=${slug}`;
216
+ },
217
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
218
+ }, {
219
+ type: "PAGE",
220
+ displayName: "Page",
221
+ linkToEntity(id) {
222
+ return `/page-builder/editor/${id}`;
223
+ },
224
+ actions: [commonActions.CREATE, commonActions.DELETE, importExportActions.EXPORT, importExportActions.IMPORT]
225
+ }, {
226
+ type: "PAGE_ELEMENT",
227
+ displayName: "Page element",
228
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
229
+ }, {
230
+ type: "PAGE_FOLDER",
231
+ displayName: "Page folder",
232
+ linkToEntity(id) {
233
+ return `/page-builder/pages?folderId=${id}`;
234
+ },
235
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
236
+ }, {
237
+ type: "PAGE_REVISION",
238
+ displayName: "Page revision",
239
+ linkToEntity(id) {
240
+ return `/page-builder/editor/${id}`;
241
+ },
242
+ actions: [commonActions.CREATE, {
243
+ ...commonActions.UPDATE,
244
+ newEntryDelay: 60
245
+ }, commonActions.DELETE, publishActions.PUBLISH, publishActions.UNPUBLISH]
246
+ }, {
247
+ type: "SETTINGS",
248
+ displayName: "Settings",
249
+ actions: [commonActions.UPDATE]
250
+ }, {
251
+ type: "TEMPLATE",
252
+ displayName: "Template",
253
+ linkToEntity(id) {
254
+ return `/page-builder/page-templates?id=${id}`;
255
+ },
256
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE, importExportActions.EXPORT, importExportActions.IMPORT]
257
+ }]
258
+ }, {
259
+ app: "SECURITY",
260
+ displayName: "Security",
261
+ entities: [{
262
+ type: "API_KEY",
263
+ displayName: "API Key",
264
+ linkToEntity(id) {
265
+ return `/access-management/api-keys?id=${id}`;
266
+ },
267
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
268
+ }, {
269
+ type: "ROLE",
270
+ displayName: "Role",
271
+ linkToEntity(id) {
272
+ return `/access-management/roles?id=${id}`;
273
+ },
274
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
275
+ }, {
276
+ type: "TEAM",
277
+ displayName: "Team",
278
+ linkToEntity(id) {
279
+ return `/access-management/teams?id=${id}`;
280
+ },
281
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
282
+ }, {
283
+ type: "USER",
284
+ displayName: "User",
285
+ linkToEntity(id) {
286
+ return `/admin-users?id=${id}`;
287
+ },
288
+ actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]
289
+ }]
290
+ }];
291
+ const AUDIT = exports.AUDIT = (0, _getAuditObject.getAuditObject)(auditLogsApps);
292
+
293
+ //# sourceMappingURL=config.js.map
package/config.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_getAuditObject","require","ActionType","exports","commonActions","CREATE","type","displayName","UPDATE","DELETE","publishActions","PUBLISH","UNPUBLISH","importExportActions","IMPORT","EXPORT","trashBinActions","MOVE_TO_TRASH","RESTORE_FROM_TRASH","auditLogsApps","app","entities","actions","linkToEntity","id","modelId","slug","newEntryDelay","AUDIT","getAuditObject"],"sources":["config.ts"],"sourcesContent":["import { getAuditObject } from \"~/utils/getAuditObject\";\nimport type { App } from \"~/types\";\n\nexport enum ActionType {\n CREATE = \"CREATE\",\n UPDATE = \"UPDATE\",\n DELETE = \"DELETE\",\n MOVE_TO_TRASH = \"MOVE_TO_TRASH\",\n RESTORE_FROM_TRASH = \"RESTORE_FROM_TRASH\",\n PUBLISH = \"PUBLISH\",\n UNPUBLISH = \"UNPUBLISH\",\n IMPORT = \"IMPORT\",\n EXPORT = \"EXPORT\"\n}\n\nconst commonActions = {\n CREATE: { type: ActionType.CREATE, displayName: \"Create\" },\n UPDATE: { type: ActionType.UPDATE, displayName: \"Update\" },\n DELETE: { type: ActionType.DELETE, displayName: \"Delete\" }\n};\n\nconst publishActions = {\n PUBLISH: { type: ActionType.PUBLISH, displayName: \"Publish\" },\n UNPUBLISH: { type: ActionType.UNPUBLISH, displayName: \"Unpublish\" }\n};\n\nconst importExportActions = {\n IMPORT: { type: ActionType.IMPORT, displayName: \"Import\" },\n EXPORT: { type: ActionType.EXPORT, displayName: \"Export\" }\n};\n\nconst trashBinActions = {\n MOVE_TO_TRASH: { type: ActionType.MOVE_TO_TRASH, displayName: \"Move to trash\" },\n RESTORE_FROM_TRASH: { type: ActionType.RESTORE_FROM_TRASH, displayName: \"Restore from trash\" }\n};\n\nexport const auditLogsApps: App[] = [\n {\n app: \"APW\",\n displayName: \"APW\",\n entities: [\n {\n type: \"CHANGE_REQUEST\",\n displayName: \"Change Request\",\n actions: [\n commonActions.CREATE,\n commonActions.UPDATE,\n commonActions.DELETE,\n { type: \"MARK_RESOLVED\", displayName: \"Mark resolved\" },\n { type: \"MARK_UNRESOLVED\", displayName: \"Mark unresolved\" }\n ]\n },\n {\n type: \"COMMENT\",\n displayName: \"Comment\",\n actions: [commonActions.CREATE]\n },\n {\n type: \"CONTENT_REVIEW\",\n displayName: \"Content Review\",\n linkToEntity(id) {\n return `/apw/content-reviews/${id}`;\n },\n actions: [commonActions.CREATE]\n },\n {\n type: \"WORKFLOW\",\n displayName: \"Workflow\",\n linkToEntity(id) {\n return `/apw/publishing-workflows?id=${id}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n }\n ]\n },\n {\n app: \"FILE_MANAGER\",\n displayName: \"File Manager\",\n entities: [\n {\n type: \"FILE\",\n displayName: \"File\",\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"FILE_FOLDER\",\n displayName: \"File folder\",\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"SETTINGS\",\n displayName: \"Settings\",\n actions: [commonActions.UPDATE]\n }\n ]\n },\n {\n app: \"FORM_BUILDER\",\n displayName: \"Form Builder\",\n entities: [\n {\n type: \"FORM\",\n displayName: \"Form\",\n linkToEntity(id) {\n return `/form-builder/forms?id=${id}`;\n },\n actions: [\n commonActions.CREATE,\n commonActions.DELETE,\n importExportActions.EXPORT,\n importExportActions.IMPORT\n ]\n },\n {\n type: \"FORM_REVISION\",\n displayName: \"Form revision\",\n linkToEntity(id) {\n return `/form-builder/forms?id=${id}`;\n },\n actions: [\n commonActions.CREATE,\n commonActions.UPDATE,\n commonActions.DELETE,\n publishActions.PUBLISH,\n publishActions.UNPUBLISH\n ]\n },\n {\n type: \"FORM_SUBMISSION\",\n displayName: \"Form submission\",\n actions: [importExportActions.EXPORT]\n },\n {\n type: \"SETTINGS\",\n displayName: \"Settings\",\n actions: [commonActions.UPDATE]\n }\n ]\n },\n {\n app: \"HEADLESS_CMS\",\n displayName: \"Headless CMS\",\n entities: [\n {\n type: \"ENTRY\",\n displayName: \"Entry\",\n actions: [\n commonActions.CREATE,\n commonActions.DELETE,\n trashBinActions.MOVE_TO_TRASH,\n trashBinActions.RESTORE_FROM_TRASH\n ]\n },\n {\n type: \"ENTRY_REVISION\",\n displayName: \"Entry revision\",\n actions: [\n commonActions.CREATE,\n commonActions.UPDATE,\n commonActions.DELETE,\n publishActions.PUBLISH,\n publishActions.UNPUBLISH\n ]\n },\n {\n type: \"GROUP\",\n displayName: \"Group\",\n linkToEntity(id) {\n return `/cms/content-model-groups?id=${id}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"MODEL\",\n displayName: \"Model\",\n linkToEntity(modelId) {\n return `/cms/content-models/${modelId}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"MODEL_FOLDER\",\n displayName: \"Model folder\",\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n }\n ]\n },\n {\n app: \"I18N\",\n displayName: \"i18n\",\n entities: [\n {\n type: \"LOCALE\",\n displayName: \"Locale\",\n linkToEntity(id) {\n return `/i18n/locales?code=${id}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n }\n ]\n },\n {\n app: \"MAILER\",\n displayName: \"Mailer\",\n entities: [\n {\n type: \"SETTINGS\",\n displayName: \"Settings\",\n actions: [commonActions.UPDATE]\n }\n ]\n },\n {\n app: \"PAGE_BUILDER\",\n displayName: \"Page Builder\",\n entities: [\n {\n type: \"BLOCK\",\n displayName: \"Block\",\n linkToEntity(id) {\n return `/page-builder/block-editor/${id}`;\n },\n actions: [\n commonActions.CREATE,\n commonActions.UPDATE,\n commonActions.DELETE,\n importExportActions.EXPORT,\n importExportActions.IMPORT\n ]\n },\n {\n type: \"BLOCK_CATEGORY\",\n displayName: \"Block category\",\n linkToEntity(slug) {\n return `/page-builder/block-categories?slug=${slug}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"CATEGORY\",\n displayName: \"Category\",\n linkToEntity(slug) {\n return `/page-builder/categories?slug=${slug}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"MENU\",\n displayName: \"Menu\",\n linkToEntity(slug) {\n return `/page-builder/menus?slug=${slug}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"PAGE\",\n displayName: \"Page\",\n linkToEntity(id) {\n return `/page-builder/editor/${id}`;\n },\n actions: [\n commonActions.CREATE,\n commonActions.DELETE,\n importExportActions.EXPORT,\n importExportActions.IMPORT\n ]\n },\n {\n type: \"PAGE_ELEMENT\",\n displayName: \"Page element\",\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"PAGE_FOLDER\",\n displayName: \"Page folder\",\n linkToEntity(id) {\n return `/page-builder/pages?folderId=${id}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"PAGE_REVISION\",\n displayName: \"Page revision\",\n linkToEntity(id) {\n return `/page-builder/editor/${id}`;\n },\n actions: [\n commonActions.CREATE,\n { ...commonActions.UPDATE, newEntryDelay: 60 },\n commonActions.DELETE,\n publishActions.PUBLISH,\n publishActions.UNPUBLISH\n ]\n },\n {\n type: \"SETTINGS\",\n displayName: \"Settings\",\n actions: [commonActions.UPDATE]\n },\n {\n type: \"TEMPLATE\",\n displayName: \"Template\",\n linkToEntity(id) {\n return `/page-builder/page-templates?id=${id}`;\n },\n actions: [\n commonActions.CREATE,\n commonActions.UPDATE,\n commonActions.DELETE,\n importExportActions.EXPORT,\n importExportActions.IMPORT\n ]\n }\n ]\n },\n {\n app: \"SECURITY\",\n displayName: \"Security\",\n entities: [\n {\n type: \"API_KEY\",\n displayName: \"API Key\",\n linkToEntity(id) {\n return `/access-management/api-keys?id=${id}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"ROLE\",\n displayName: \"Role\",\n linkToEntity(id) {\n return `/access-management/roles?id=${id}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"TEAM\",\n displayName: \"Team\",\n linkToEntity(id) {\n return `/access-management/teams?id=${id}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n },\n {\n type: \"USER\",\n displayName: \"User\",\n linkToEntity(id) {\n return `/admin-users?id=${id}`;\n },\n actions: [commonActions.CREATE, commonActions.UPDATE, commonActions.DELETE]\n }\n ]\n }\n];\n\nexport const AUDIT = getAuditObject(auditLogsApps);\n"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAAwD,IAG5CC,UAAU,GAAAC,OAAA,CAAAD,UAAA,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAYtB,MAAME,aAAa,GAAG;EAClBC,MAAM,EAAE;IAAEC,IAAI,EAAEJ,UAAU,CAACG,MAAM;IAAEE,WAAW,EAAE;EAAS,CAAC;EAC1DC,MAAM,EAAE;IAAEF,IAAI,EAAEJ,UAAU,CAACM,MAAM;IAAED,WAAW,EAAE;EAAS,CAAC;EAC1DE,MAAM,EAAE;IAAEH,IAAI,EAAEJ,UAAU,CAACO,MAAM;IAAEF,WAAW,EAAE;EAAS;AAC7D,CAAC;AAED,MAAMG,cAAc,GAAG;EACnBC,OAAO,EAAE;IAAEL,IAAI,EAAEJ,UAAU,CAACS,OAA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EAAED,aAAa,CAACI,MAAM,EAAEJ,aAAa,CAACK,MAAM;EAC9E,CAAC,EACD;IACIH,IAAI,EAAE,MAAM;IACZC,WAAW,EAAE,MAAM;IACnBgB,YAAYA,CAACC,EAAE,EAAE;MACb,OAAO,+BAA+BA,EAAE,EAAE;IAC9C,CAAC;IACDF,OAAO,EAAE,CAAClB,aAAa,CAACC,MAAM,EAAED,aAAa,CAACI,MAAM,EAAEJ,aAAa,CAACK,MAAM;EAC9E,CAAC,EACD;IACIH,IAAI,EAAE,MAAM;IACZC,WAAW,EAAE,MAAM;IACnBgB,YAAYA,CAACC,EAAE,EAAE;MACb,OAAO,+BAA+BA,EAAE,EAAE;IAC9C,CAAC;IACDF,OAAO,EAAE,CAAClB,aAAa,CAACC,MAAM,EAAED,aAAa,CAACI,MAAM,EAAEJ,aAAa,CAACK,MAAM;EAC9E,CAAC,EACD;IACIH,IAAI,EAAE,MAAM;IACZC,WAAW,EAAE,MAAM;IACnBgB,YAAYA,CAACC,EAAE,EAAE;MACb,OAAO,mBAAmBA,EAAE,EAAE;IAClC,CAAC;IACDF,OAAO,EAAE,CAAClB,aAAa,CAACC,MAAM,EAAED,aAAa,CAACI,MAAM,EAAEJ,aAAa,CAACK,MAAM;EAC9E,CAAC;AAET,CAAC,CACJ;AAEM,MAAMmB,KAAK,GAAAzB,OAAA,CAAAyB,KAAA,GAAG,IAAAC,8BAAc,EAACV,aAAa,CAAC","ignoreList":[]}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { ContextPlugin } from "@webiny/api";
2
+ import type { AuditLogsContext } from "./types";
3
+ export declare const createAuditLogs: () => (ContextPlugin<import("./types").AuditLogsAcoContext> | ContextPlugin<AuditLogsContext>)[];
4
+ export * from "./config";
5
+ export * from "./app/createAppModifier";