@webiny/app-audit-logs 5.38.0-beta.0 → 5.38.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-audit-logs",
3
- "version": "5.38.0-beta.0",
3
+ "version": "5.38.0-beta.1",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,16 +13,16 @@
13
13
  "@babel/runtime": "7.22.6",
14
14
  "@emotion/react": "11.10.8",
15
15
  "@emotion/styled": "11.10.6",
16
- "@webiny/api-audit-logs": "5.38.0-beta.0",
17
- "@webiny/app": "5.38.0-beta.0",
18
- "@webiny/app-aco": "5.38.0-beta.0",
19
- "@webiny/app-admin": "5.38.0-beta.0",
20
- "@webiny/app-security": "5.38.0-beta.0",
21
- "@webiny/form": "5.38.0-beta.0",
22
- "@webiny/plugins": "5.38.0-beta.0",
23
- "@webiny/react-properties": "5.38.0-beta.0",
24
- "@webiny/react-router": "5.38.0-beta.0",
25
- "@webiny/ui": "5.38.0-beta.0",
16
+ "@webiny/api-audit-logs": "5.38.0-beta.1",
17
+ "@webiny/app": "5.38.0-beta.1",
18
+ "@webiny/app-aco": "5.38.0-beta.1",
19
+ "@webiny/app-admin": "5.38.0-beta.1",
20
+ "@webiny/app-security": "5.38.0-beta.1",
21
+ "@webiny/form": "5.38.0-beta.1",
22
+ "@webiny/plugins": "5.38.0-beta.1",
23
+ "@webiny/react-properties": "5.38.0-beta.1",
24
+ "@webiny/react-router": "5.38.0-beta.1",
25
+ "@webiny/ui": "5.38.0-beta.1",
26
26
  "date-fns": "2.29.3",
27
27
  "emotion": "10.0.27",
28
28
  "graphql-tag": "2.12.6",
@@ -40,8 +40,8 @@
40
40
  "@material-design-icons/svg": "0.14.3",
41
41
  "@material-symbols/svg-400": "0.4.3",
42
42
  "@types/react": "17.0.39",
43
- "@webiny/cli": "5.38.0-beta.0",
44
- "@webiny/project-utils": "5.38.0-beta.0",
43
+ "@webiny/cli": "5.38.0-beta.1",
44
+ "@webiny/project-utils": "5.38.0-beta.1",
45
45
  "execa": "5.1.1",
46
46
  "rimraf": "3.0.2",
47
47
  "ttypescript": "1.5.15",
@@ -55,5 +55,5 @@
55
55
  "build": "yarn webiny run build",
56
56
  "watch": "yarn webiny run watch"
57
57
  },
58
- "gitHead": "5746389d4988626b50e2523ccfa0a9a5e398e0ed"
58
+ "gitHead": "6daf38d3ed0c029a8fea005c2b6246e5b325a09c"
59
59
  }
package/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare type AuditLog = {
1
+ export interface AuditLog {
2
2
  id: string;
3
3
  message: string;
4
4
  app: string;
@@ -8,12 +8,12 @@ export declare type AuditLog = {
8
8
  data: string;
9
9
  timestamp: Date;
10
10
  initiator: string;
11
- };
12
- export declare type User = {
11
+ }
12
+ export interface User {
13
13
  id: string;
14
14
  firstName: string;
15
15
  lastName: string;
16
- group: {
16
+ group?: {
17
17
  name: string;
18
18
  };
19
- };
19
+ }
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export type AuditLog = {\n id: string;\n message: string;\n app: string;\n entity: string;\n entityId: string;\n action: string;\n data: string;\n timestamp: Date;\n initiator: string;\n};\n\nexport type User = {\n id: string;\n firstName: string;\n lastName: string;\n group: {\n name: string;\n };\n};\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface AuditLog {\n id: string;\n message: string;\n app: string;\n entity: string;\n entityId: string;\n action: string;\n data: string;\n timestamp: Date;\n initiator: string;\n}\n\nexport interface User {\n id: string;\n firstName: string;\n lastName: string;\n group?: {\n name: string;\n };\n}\n"],"mappings":""}
@@ -7,7 +7,7 @@ exports.transformCmsContentEntriesToRecordEntries = void 0;
7
7
  var _config = require("@webiny/api-audit-logs/config");
8
8
  var transformCmsContentEntriesToRecordEntries = function transformCmsContentEntriesToRecordEntries(items, users) {
9
9
  return items.map(function (_ref) {
10
- var _app$entities, _entity$actions;
10
+ var _app$entities, _entity$actions, _user$group;
11
11
  var id = _ref.id,
12
12
  data = _ref.data;
13
13
  var app = _config.auditLogsApps.find(function (app) {
@@ -41,7 +41,7 @@ var transformCmsContentEntriesToRecordEntries = function transformCmsContentEntr
41
41
  initiator: {
42
42
  id: data.initiator,
43
43
  name: "".concat(user === null || user === void 0 ? void 0 : user.firstName, " ").concat(user === null || user === void 0 ? void 0 : user.lastName),
44
- role: (user === null || user === void 0 ? void 0 : user.group.name) || ""
44
+ role: (user === null || user === void 0 ? void 0 : (_user$group = user.group) === null || _user$group === void 0 ? void 0 : _user$group.name) || ""
45
45
  }
46
46
  };
47
47
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_config","require","transformCmsContentEntriesToRecordEntries","items","users","map","_ref","_app$entities","_entity$actions","id","data","app","auditLogsApps","find","entity","entities","type","action","actions","user","initiator","message","displayName","label","value","link","linkToEntity","encodeURIComponent","entityId","savedOn","timestamp","name","concat","firstName","lastName","role","group","exports"],"sources":["transformCmsContentEntriesToRecordEntries.ts"],"sourcesContent":["import { SearchRecordItem } from \"@webiny/app-aco/types\";\nimport { auditLogsApps } from \"@webiny/api-audit-logs/config\";\n\nimport { AuditLog, User } from \"~/types\";\n\nexport type Entry = {\n id: string;\n message: string;\n app: string;\n entity: {\n value: string;\n label: string;\n link?: string;\n };\n entityId: string;\n action: {\n label: string;\n value: string;\n };\n data: string;\n savedOn: Date;\n initiator: {\n id: string;\n name: string;\n role: string;\n };\n};\n\nexport const transformCmsContentEntriesToRecordEntries = (\n items: SearchRecordItem<AuditLog>[],\n users: User[]\n): Entry[] => {\n return items.map(({ id, data }) => {\n const app = auditLogsApps.find(app => app.app === data.app);\n const entity = app?.entities?.find(entity => entity.type === data.entity);\n const action = entity?.actions?.find(action => action.type === data.action);\n const user = users.find(user => user.id === data.initiator);\n\n return {\n id,\n message: data.message,\n app: app?.displayName || \"-\",\n entity: {\n label: entity?.displayName || \"-\",\n value: data.entity,\n link: entity?.linkToEntity && entity.linkToEntity(encodeURIComponent(data.entityId))\n },\n entityId: data.entityId,\n action: {\n label: action?.displayName || \"-\",\n value: data.action\n },\n data: data.data,\n savedOn: data.timestamp,\n initiator: {\n id: data.initiator,\n name: `${user?.firstName} ${user?.lastName}`,\n role: user?.group.name || \"\"\n }\n };\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AA2BO,IAAMC,yCAAyC,GAAG,SAA5CA,yCAAyCA,CAClDC,KAAmC,EACnCC,KAAa,EACH;EACV,OAAOD,KAAK,CAACE,GAAG,CAAC,UAAAC,IAAA,EAAkB;IAAA,IAAAC,aAAA,EAAAC,eAAA;IAAA,IAAfC,EAAE,GAAAH,IAAA,CAAFG,EAAE;MAAEC,IAAI,GAAAJ,IAAA,CAAJI,IAAI;IACxB,IAAMC,GAAG,GAAGC,qBAAa,CAACC,IAAI,CAAC,UAAAF,GAAG;MAAA,OAAIA,GAAG,CAACA,GAAG,KAAKD,IAAI,CAACC,GAAG;IAAA,EAAC;IAC3D,IAAMG,MAAM,GAAGH,GAAG,aAAHA,GAAG,wBAAAJ,aAAA,GAAHI,GAAG,CAAEI,QAAQ,cAAAR,aAAA,uBAAbA,aAAA,CAAeM,IAAI,CAAC,UAAAC,MAAM;MAAA,OAAIA,MAAM,CAACE,IAAI,KAAKN,IAAI,CAACI,MAAM;IAAA,EAAC;IACzE,IAAMG,MAAM,GAAGH,MAAM,aAANA,MAAM,wBAAAN,eAAA,GAANM,MAAM,CAAEI,OAAO,cAAAV,eAAA,uBAAfA,eAAA,CAAiBK,IAAI,CAAC,UAAAI,MAAM;MAAA,OAAIA,MAAM,CAACD,IAAI,KAAKN,IAAI,CAACO,MAAM;IAAA,EAAC;IAC3E,IAAME,IAAI,GAAGf,KAAK,CAACS,IAAI,CAAC,UAAAM,IAAI;MAAA,OAAIA,IAAI,CAACV,EAAE,KAAKC,IAAI,CAACU,SAAS;IAAA,EAAC;IAE3D,OAAO;MACHX,EAAE,EAAFA,EAAE;MACFY,OAAO,EAAEX,IAAI,CAACW,OAAO;MACrBV,GAAG,EAAE,CAAAA,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAEW,WAAW,KAAI,GAAG;MAC5BR,MAAM,EAAE;QACJS,KAAK,EAAE,CAAAT,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEQ,WAAW,KAAI,GAAG;QACjCE,KAAK,EAAEd,IAAI,CAACI,MAAM;QAClBW,IAAI,EAAE,CAAAX,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEY,YAAY,KAAIZ,MAAM,CAACY,YAAY,CAACC,kBAAkB,CAACjB,IAAI,CAACkB,QAAQ,CAAC;MACvF,CAAC;MACDA,QAAQ,EAAElB,IAAI,CAACkB,QAAQ;MACvBX,MAAM,EAAE;QACJM,KAAK,EAAE,CAAAN,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEK,WAAW,KAAI,GAAG;QACjCE,KAAK,EAAEd,IAAI,CAACO;MAChB,CAAC;MACDP,IAAI,EAAEA,IAAI,CAACA,IAAI;MACfmB,OAAO,EAAEnB,IAAI,CAACoB,SAAS;MACvBV,SAAS,EAAE;QACPX,EAAE,EAAEC,IAAI,CAACU,SAAS;QAClBW,IAAI,KAAAC,MAAA,CAAKb,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEc,SAAS,OAAAD,MAAA,CAAIb,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEe,QAAQ,CAAE;QAC5CC,IAAI,EAAE,CAAAhB,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEiB,KAAK,CAACL,IAAI,KAAI;MAC9B;IACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAACM,OAAA,CAAAnC,yCAAA,GAAAA,yCAAA"}
1
+ {"version":3,"names":["_config","require","transformCmsContentEntriesToRecordEntries","items","users","map","_ref","_app$entities","_entity$actions","_user$group","id","data","app","auditLogsApps","find","entity","entities","type","action","actions","user","initiator","message","displayName","label","value","link","linkToEntity","encodeURIComponent","entityId","savedOn","timestamp","name","concat","firstName","lastName","role","group","exports"],"sources":["transformCmsContentEntriesToRecordEntries.ts"],"sourcesContent":["import { SearchRecordItem } from \"@webiny/app-aco/types\";\nimport { auditLogsApps } from \"@webiny/api-audit-logs/config\";\n\nimport { AuditLog, User } from \"~/types\";\n\nexport type Entry = {\n id: string;\n message: string;\n app: string;\n entity: {\n value: string;\n label: string;\n link?: string;\n };\n entityId: string;\n action: {\n label: string;\n value: string;\n };\n data: string;\n savedOn: Date;\n initiator: {\n id: string;\n name: string;\n role: string;\n };\n};\n\nexport const transformCmsContentEntriesToRecordEntries = (\n items: SearchRecordItem<AuditLog>[],\n users: User[]\n): Entry[] => {\n return items.map(({ id, data }) => {\n const app = auditLogsApps.find(app => app.app === data.app);\n const entity = app?.entities?.find(entity => entity.type === data.entity);\n const action = entity?.actions?.find(action => action.type === data.action);\n const user = users.find(user => user.id === data.initiator);\n\n return {\n id,\n message: data.message,\n app: app?.displayName || \"-\",\n entity: {\n label: entity?.displayName || \"-\",\n value: data.entity,\n link: entity?.linkToEntity && entity.linkToEntity(encodeURIComponent(data.entityId))\n },\n entityId: data.entityId,\n action: {\n label: action?.displayName || \"-\",\n value: data.action\n },\n data: data.data,\n savedOn: data.timestamp,\n initiator: {\n id: data.initiator,\n name: `${user?.firstName} ${user?.lastName}`,\n role: user?.group?.name || \"\"\n }\n };\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AA2BO,IAAMC,yCAAyC,GAAG,SAA5CA,yCAAyCA,CAClDC,KAAmC,EACnCC,KAAa,EACH;EACV,OAAOD,KAAK,CAACE,GAAG,CAAC,UAAAC,IAAA,EAAkB;IAAA,IAAAC,aAAA,EAAAC,eAAA,EAAAC,WAAA;IAAA,IAAfC,EAAE,GAAAJ,IAAA,CAAFI,EAAE;MAAEC,IAAI,GAAAL,IAAA,CAAJK,I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