@webiny/app-audit-logs 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.eb196ccd2f

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/graphql.js CHANGED
@@ -12,7 +12,7 @@ export const LIST_USERS = gql`
12
12
  id
13
13
  firstName
14
14
  lastName
15
- group {
15
+ groups {
16
16
  name
17
17
  }
18
18
  }
package/graphql.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["gql","ERROR_FIELDS","LIST_USERS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nconst ERROR_FIELDS = /* GraphQL */ `\n code\n message\n data\n`;\n\nexport const LIST_USERS: any = gql`\n query ListUsers {\n adminUsers {\n users: listUsers {\n data {\n id\n firstName\n lastName\n group {\n name\n }\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,MAAMC,YAAY,GAAG,aAAc;AACnC;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,UAAe,GAAGF,GAAG;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBC,YAAY;AAClC;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["gql","ERROR_FIELDS","LIST_USERS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\n\nconst ERROR_FIELDS = /* GraphQL */ `\n code\n message\n data\n`;\n\nexport const LIST_USERS: any = gql`\n query ListUsers {\n adminUsers {\n users: listUsers {\n data {\n id\n firstName\n lastName\n groups {\n name\n }\n }\n error {\n ${ERROR_FIELDS}\n }\n }\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,aAAa;AAE7B,MAAMC,YAAY,GAAG,aAAc;AACnC;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,UAAe,GAAGF,GAAG;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsBC,YAAY;AAClC;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-audit-logs",
3
- "version": "0.0.0-unstable.e53eceafb5",
3
+ "version": "0.0.0-unstable.eb196ccd2f",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,18 +12,18 @@
12
12
  "@apollo/react-hooks": "3.1.5",
13
13
  "@emotion/react": "11.10.8",
14
14
  "@emotion/styled": "11.10.6",
15
- "@webiny/admin-ui": "0.0.0-unstable.e53eceafb5",
16
- "@webiny/api-audit-logs": "0.0.0-unstable.e53eceafb5",
17
- "@webiny/app": "0.0.0-unstable.e53eceafb5",
18
- "@webiny/app-aco": "0.0.0-unstable.e53eceafb5",
19
- "@webiny/app-admin": "0.0.0-unstable.e53eceafb5",
20
- "@webiny/app-security": "0.0.0-unstable.e53eceafb5",
21
- "@webiny/form": "0.0.0-unstable.e53eceafb5",
22
- "@webiny/icons": "0.0.0-unstable.e53eceafb5",
23
- "@webiny/plugins": "0.0.0-unstable.e53eceafb5",
24
- "@webiny/react-properties": "0.0.0-unstable.e53eceafb5",
25
- "@webiny/react-router": "0.0.0-unstable.e53eceafb5",
26
- "@webiny/ui": "0.0.0-unstable.e53eceafb5",
15
+ "@webiny/admin-ui": "0.0.0-unstable.eb196ccd2f",
16
+ "@webiny/api-audit-logs": "0.0.0-unstable.eb196ccd2f",
17
+ "@webiny/app": "0.0.0-unstable.eb196ccd2f",
18
+ "@webiny/app-aco": "0.0.0-unstable.eb196ccd2f",
19
+ "@webiny/app-admin": "0.0.0-unstable.eb196ccd2f",
20
+ "@webiny/app-security": "0.0.0-unstable.eb196ccd2f",
21
+ "@webiny/form": "0.0.0-unstable.eb196ccd2f",
22
+ "@webiny/icons": "0.0.0-unstable.eb196ccd2f",
23
+ "@webiny/plugins": "0.0.0-unstable.eb196ccd2f",
24
+ "@webiny/react-properties": "0.0.0-unstable.eb196ccd2f",
25
+ "@webiny/react-router": "0.0.0-unstable.eb196ccd2f",
26
+ "@webiny/ui": "0.0.0-unstable.eb196ccd2f",
27
27
  "date-fns": "2.29.3",
28
28
  "emotion": "10.0.27",
29
29
  "graphql-tag": "2.12.6",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/react": "18.2.79",
37
- "@webiny/project-utils": "0.0.0-unstable.e53eceafb5",
37
+ "@webiny/project-utils": "0.0.0-unstable.eb196ccd2f",
38
38
  "execa": "5.1.1",
39
39
  "rimraf": "6.0.1",
40
40
  "typescript": "5.3.3"
@@ -47,5 +47,5 @@
47
47
  "build": "node ../cli/bin.js run build",
48
48
  "watch": "node ../cli/bin.js run watch"
49
49
  },
50
- "gitHead": "e53eceafb5ce1a3872c9b4548939bb2eae5b1aef"
50
+ "gitHead": "eb196ccd2f32296e10f7add6dd7220d4e3abece4"
51
51
  }
package/types.d.ts CHANGED
@@ -24,7 +24,7 @@ export interface User {
24
24
  id: string;
25
25
  firstName: string;
26
26
  lastName: string;
27
- group?: {
27
+ groups?: {
28
28
  name: string;
29
- };
29
+ }[];
30
30
  }
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ActionType"],"sources":["types.ts"],"sourcesContent":["export 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\nexport interface AuditLog {\n id: string;\n message: string;\n app: string;\n entity: string;\n entityId: string;\n action: ActionType;\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":"AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA","ignoreList":[]}
1
+ {"version":3,"names":["ActionType"],"sources":["types.ts"],"sourcesContent":["export 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\nexport interface AuditLog {\n id: string;\n message: string;\n app: string;\n entity: string;\n entityId: string;\n action: ActionType;\n data: string;\n timestamp: Date;\n initiator: string;\n}\n\nexport interface User {\n id: string;\n firstName: string;\n lastName: string;\n groups?: {\n name: string;\n }[];\n}\n"],"mappings":"AAAA,WAAYA,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA","ignoreList":[]}
@@ -27,7 +27,7 @@ export const transformCmsContentEntriesToRecordEntries = (items, users) => {
27
27
  initiator: {
28
28
  id: data.initiator,
29
29
  name: `${user?.firstName} ${user?.lastName}`,
30
- role: user?.group?.name || ""
30
+ role: user?.groups?.[0]?.name || ""
31
31
  }
32
32
  };
33
33
  });
@@ -1 +1 @@
1
- {"version":3,"names":["auditLogsApps","transformCmsContentEntriesToRecordEntries","items","users","map","id","data","app","find","entity","entities","type","action","actions","user","initiator","message","displayName","label","value","link","linkToEntity","encodeURIComponent","entityId","savedOn","timestamp","name","firstName","lastName","role","group"],"sources":["transformCmsContentEntriesToRecordEntries.ts"],"sourcesContent":["import type { SearchRecordItem } from \"@webiny/app-aco/types\";\nimport { auditLogsApps } from \"@webiny/api-audit-logs/config\";\n\nimport type { ActionType, 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: ActionType;\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,SAASA,aAAa,QAAQ,+BAA+B;AA2B7D,OAAO,MAAMC,yCAAyC,GAAGA,CACrDC,KAAmC,EACnCC,KAAa,KACH;EACV,OAAOD,KAAK,CAACE,GAAG,CAAC,CAAC;IAAEC,EAAE;IAAEC;EAAK,CAAC,KAAK;IAC/B,MAAMC,GAAG,GAAGP,aAAa,CAACQ,IAAI,CAACD,GAAG,IAAIA,GAAG,CAACA,GAAG,KAAKD,IAAI,CAACC,GAAG,CAAC;IAC3D,MAAME,MAAM,GAAGF,GAAG,EAAEG,QAAQ,EAAEF,IAAI,CAACC,MAAM,IAAIA,MAAM,CAACE,IAAI,KAAKL,IAAI,CAACG,MAAM,CAAC;IACzE,MAAMG,MAAM,GAAGH,MAAM,EAAEI,OAAO,EAAEL,IAAI,CAACI,MAAM,IAAIA,MAAM,CAACD,IAAI,KAAKL,IAAI,CAACM,MAAM,CAAC;IAC3E,MAAME,IAAI,GAAGX,KAAK,CAACK,IAAI,CAACM,IAAI,IAAIA,IAAI,CAACT,EAAE,KAAKC,IAAI,CAACS,SAAS,CAAC;IAE3D,OAAO;MACHV,EAAE;MACFW,OAAO,EAAEV,IAAI,CAACU,OAAO;MACrBT,GAAG,EAAEA,GAAG,EAAEU,WAAW,IAAI,GAAG;MAC5BR,MAAM,EAAE;QACJS,KAAK,EAAET,MAAM,EAAEQ,WAAW,IAAI,GAAG;QACjCE,KAAK,EAAEb,IAAI,CAACG,MAAM;QAClBW,IAAI,EAAEX,MAAM,EAAEY,YAAY,IAAIZ,MAAM,CAACY,YAAY,CAACC,kBAAkB,CAAChB,IAAI,CAACiB,QAAQ,CAAC;MACvF,CAAC;MACDA,QAAQ,EAAEjB,IAAI,CAACiB,QAAQ;MACvBX,MAAM,EAAE;QACJM,KAAK,EAAEN,MAAM,EAAEK,WAAW,IAAI,GAAG;QACjCE,KAAK,EAAEb,IAAI,CAACM;MAChB,CAAC;MACDN,IAAI,EAAEA,IAAI,CAACA,IAAI;MACfkB,OAAO,EAAElB,IAAI,CAACmB,SAAS;MACvBV,SAAS,EAAE;QACPV,EAAE,EAAEC,IAAI,CAACS,SAAS;QAClBW,IAAI,EAAE,GAAGZ,IAAI,EAAEa,SAAS,IAAIb,IAAI,EAAEc,QAAQ,EAAE;QAC5CC,IAAI,EAAEf,IAAI,EAAEgB,KAAK,EAAEJ,IAAI,IAAI;MAC/B;IACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["auditLogsApps","transformCmsContentEntriesToRecordEntries","items","users","map","id","data","app","find","entity","entities","type","action","actions","user","initiator","message","displayName","label","value","link","linkToEntity","encodeURIComponent","entityId","savedOn","timestamp","name","firstName","lastName","role","groups"],"sources":["transformCmsContentEntriesToRecordEntries.ts"],"sourcesContent":["import type { SearchRecordItem } from \"@webiny/app-aco/types\";\nimport { auditLogsApps } from \"@webiny/api-audit-logs/config\";\n\nimport type { ActionType, 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: ActionType;\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?.groups?.[0]?.name || \"\"\n }\n };\n });\n};\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,+BAA+B;AA2B7D,OAAO,MAAMC,yCAAyC,GAAGA,CACrDC,KAAmC,EACnCC,KAAa,KACH;EACV,OAAOD,KAAK,CAACE,GAAG,CAAC,CAAC;IAAEC,EAAE;IAAEC;EAAK,CAAC,KAAK;IAC/B,MAAMC,GAAG,GAAGP,aAAa,CAACQ,IAAI,CAACD,GAAG,IAAIA,GAAG,CAACA,GAAG,KAAKD,IAAI,CAACC,GAAG,CAAC;IAC3D,MAAME,MAAM,GAAGF,GA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