@enonic-types/lib-auditlog 7.11.3 → 7.12.0-RC1

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 (2) hide show
  1. package/auditlog.d.ts +6 -6
  2. package/package.json +2 -2
package/auditlog.d.ts CHANGED
@@ -13,22 +13,22 @@ declare global {
13
13
  }
14
14
  import type { UserKey } from '@enonic-types/core';
15
15
  export type { UserKey } from '@enonic-types/core';
16
- export interface AuditLogParams {
16
+ export interface AuditLogParams<Data extends Record<string, unknown>> {
17
17
  type: string;
18
18
  time?: string;
19
19
  source?: string;
20
20
  user?: UserKey;
21
21
  objects?: string[];
22
- data?: Record<string, unknown>;
22
+ data?: Data;
23
23
  }
24
- export interface AuditLog {
24
+ export interface AuditLog<Data extends Record<string, unknown> = Record<string, unknown>> {
25
25
  _id: string;
26
26
  type: string;
27
27
  time: string;
28
28
  source: string;
29
29
  user: UserKey;
30
30
  objects: string[];
31
- data: Record<string, unknown>;
31
+ data: Data;
32
32
  }
33
33
  /**
34
34
  * This function creates a single audit log entry.
@@ -43,11 +43,11 @@ export interface AuditLog {
43
43
  * @param {string} [params.source] Log entry source. Defaults to the application ID.
44
44
  * @param {string} [params.user] Log entry user. Defaults to the user of current context.
45
45
  * @param {array} [params.objects] URIs to objects that relate to this log entry. Defaults to empty array.
46
- * @param {object} [params.data] Custom extra data for the this log entry. Defaults to empty object.
46
+ * @param {object} [params.data] Custom extra data for this log entry. Defaults to empty object.
47
47
  *
48
48
  * @returns {object} Audit log created as JSON.
49
49
  */
50
- export declare function log(params: AuditLogParams): AuditLog;
50
+ export declare function log<Data extends Record<string, unknown> = Record<string, unknown>>(params: AuditLogParams<Data>): AuditLog<Data>;
51
51
  export interface GetAuditLogParams {
52
52
  id: string;
53
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-auditlog",
3
- "version": "7.11.3",
3
+ "version": "7.12.0-RC1",
4
4
  "description": "Type definitions for lib-auditlog.",
5
5
  "types": "auditlog.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/enonic/xp/tree/master#readme",
29
29
  "dependencies": {
30
- "@enonic-types/core": "7.11.3"
30
+ "@enonic-types/core": "7.12.0-RC1"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"