@sphereon/ssi-sdk.event-logger 0.33.1-next.3 → 0.33.1-next.73
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/dist/index.cjs +785 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +88 -0
- package/dist/index.d.ts +84 -4
- package/dist/index.js +763 -26
- package/dist/index.js.map +1 -1
- package/package.json +26 -17
- package/plugin.schema.json +139 -240
- package/dist/agent/EventLogger.d.ts +0 -23
- package/dist/agent/EventLogger.d.ts.map +0 -1
- package/dist/agent/EventLogger.js +0 -133
- package/dist/agent/EventLogger.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/ssi-sdk.event-logger.d.ts +0 -115
- package/dist/tsdoc-metadata.json +0 -11
- package/dist/types/IEventLogger.d.ts +0 -61
- package/dist/types/IEventLogger.d.ts.map +0 -1
- package/dist/types/IEventLogger.js +0 -3
- package/dist/types/IEventLogger.js.map +0 -1
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.EventLogger = exports.eventLoggerMethods = exports.eventLoggerAuditMethods = void 0;
|
|
13
|
-
const ssi_types_1 = require("@sphereon/ssi-types");
|
|
14
|
-
const uuid_1 = require("uuid");
|
|
15
|
-
const index_1 = require("../index");
|
|
16
|
-
/**
|
|
17
|
-
* {@inheritDoc IEventLogger}
|
|
18
|
-
*/
|
|
19
|
-
// Exposing the methods here for any REST implementation
|
|
20
|
-
exports.eventLoggerAuditMethods = [
|
|
21
|
-
'loggerGetAuditEvents',
|
|
22
|
-
'loggerLogAuditEvent',
|
|
23
|
-
'loggerLogGeneralEvent',
|
|
24
|
-
'loggerLogActivityEvent',
|
|
25
|
-
'loggerGetActivityEvents',
|
|
26
|
-
];
|
|
27
|
-
exports.eventLoggerMethods = [...exports.eventLoggerAuditMethods];
|
|
28
|
-
class EventLogger {
|
|
29
|
-
constructor(options) {
|
|
30
|
-
var _a;
|
|
31
|
-
this.schema = index_1.schema.IEventLogger;
|
|
32
|
-
this.eventTypes = [];
|
|
33
|
-
this.methods = {
|
|
34
|
-
loggerGetAuditEvents: this.loggerGetAuditEvents.bind(this),
|
|
35
|
-
loggerLogAuditEvent: this.loggerLogAuditEvent.bind(this),
|
|
36
|
-
loggerLogGeneralEvent: this.loggerLogGeneralEvent.bind(this),
|
|
37
|
-
loggerLogActivityEvent: this.loggerLogActivityEvent.bind(this),
|
|
38
|
-
loggerGetActivityEvents: this.loggerGetActivityEvents.bind(this),
|
|
39
|
-
};
|
|
40
|
-
const { store, eventTypes } = options;
|
|
41
|
-
const generalOpts = (_a = options.general) !== null && _a !== void 0 ? _a : { debugPkg: true };
|
|
42
|
-
this.store = store;
|
|
43
|
-
this.eventTypes = eventTypes;
|
|
44
|
-
const methods = [];
|
|
45
|
-
if (generalOpts.debugPkg) {
|
|
46
|
-
methods.push(ssi_types_1.LogMethod.DEBUG_PKG);
|
|
47
|
-
}
|
|
48
|
-
if (generalOpts.console) {
|
|
49
|
-
methods.push(ssi_types_1.LogMethod.CONSOLE);
|
|
50
|
-
}
|
|
51
|
-
if (generalOpts.events) {
|
|
52
|
-
methods.push(ssi_types_1.LogMethod.EVENT);
|
|
53
|
-
}
|
|
54
|
-
this.simpleLoggers = new ssi_types_1.Loggers({
|
|
55
|
-
methods,
|
|
56
|
-
eventName: generalOpts.eventName,
|
|
57
|
-
defaultLogLevel: generalOpts.defaultLogLevel,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
onEvent(event, context) {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
switch (event.type) {
|
|
63
|
-
case ssi_types_1.LoggingEventType.AUDIT:
|
|
64
|
-
// Calling the context of the agent to make sure the REST client is called when configured
|
|
65
|
-
yield context.agent.loggerLogAuditEvent({ event: event.data });
|
|
66
|
-
break;
|
|
67
|
-
case ssi_types_1.LoggingEventType.GENERAL:
|
|
68
|
-
// Calling the context of the agent to make sure the REST client is called when configured
|
|
69
|
-
// TODO: We might also want to do this locally though, as these logs are not persisted typically
|
|
70
|
-
yield context.agent.loggerLogGeneralEvent({ event: event.data });
|
|
71
|
-
break;
|
|
72
|
-
case ssi_types_1.LoggingEventType.ACTIVITY:
|
|
73
|
-
// Calling the context of the agent to make sure the REST client is called when configured
|
|
74
|
-
yield context.agent.loggerLogActivityEvent({ event: event.data });
|
|
75
|
-
break;
|
|
76
|
-
default:
|
|
77
|
-
return Promise.reject(Error(`Event type ${event.type} not supported`));
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
loggerGetAuditEvents(args) {
|
|
82
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
const { filter } = args !== null && args !== void 0 ? args : {};
|
|
84
|
-
if (!this.store) {
|
|
85
|
-
return Promise.reject(Error('No store available in options'));
|
|
86
|
-
}
|
|
87
|
-
return this.store.getAuditEvents({ filter });
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
loggerGetActivityEvents(args) {
|
|
91
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
const { filter } = args !== null && args !== void 0 ? args : {};
|
|
93
|
-
if (!this.store) {
|
|
94
|
-
return Promise.reject(Error('No store available in options'));
|
|
95
|
-
}
|
|
96
|
-
return this.store.getActivityEvents({ filter });
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
loggerLogGeneralEvent(args) {
|
|
100
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
-
var _a;
|
|
102
|
-
const { event } = args;
|
|
103
|
-
this.simpleLoggers.get(event.data.system).logl((_a = event.data.level) !== null && _a !== void 0 ? _a : ssi_types_1.LogLevel.INFO, event.data.data, event.data);
|
|
104
|
-
return args.event;
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
loggerLogAuditEvent(args) {
|
|
108
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
109
|
-
var _a, _b;
|
|
110
|
-
const { event } = args;
|
|
111
|
-
if (!this.store) {
|
|
112
|
-
return Promise.reject(Error('No store available in options'));
|
|
113
|
-
}
|
|
114
|
-
return this.store.storeAuditEvent({
|
|
115
|
-
event: Object.assign(Object.assign({}, event), { system: event.system, subSystemType: event.subSystemType, initiatorType: event.initiatorType, level: (_a = event.level) !== null && _a !== void 0 ? _a : ssi_types_1.LogLevel.INFO, correlationId: (_b = event.correlationId) !== null && _b !== void 0 ? _b : (0, uuid_1.v4)(), timestamp: new Date() }),
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
loggerLogActivityEvent(args) {
|
|
120
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
var _a, _b;
|
|
122
|
-
const { event } = args;
|
|
123
|
-
if (!this.store) {
|
|
124
|
-
return Promise.reject(Error('No store available in options'));
|
|
125
|
-
}
|
|
126
|
-
return this.store.storeActivityEvent({
|
|
127
|
-
event: Object.assign(Object.assign({}, event), { system: event.system, subSystemType: event.subSystemType, initiatorType: event.initiatorType, level: (_a = event.level) !== null && _a !== void 0 ? _a : ssi_types_1.LogLevel.INFO, correlationId: (_b = event.correlationId) !== null && _b !== void 0 ? _b : (0, uuid_1.v4)(), timestamp: new Date() }),
|
|
128
|
-
});
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
exports.EventLogger = EventLogger;
|
|
133
|
-
//# sourceMappingURL=EventLogger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventLogger.js","sourceRoot":"","sources":["../../src/agent/EventLogger.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,mDAAoF;AAGpF,+BAAmC;AACnC,oCAAiC;AAcjC;;GAEG;AAEH,wDAAwD;AAC3C,QAAA,uBAAuB,GAAkB;IACpD,sBAAsB;IACtB,qBAAqB;IACrB,uBAAuB;IACvB,wBAAwB;IACxB,yBAAyB;CAC1B,CAAA;AACY,QAAA,kBAAkB,GAAkB,CAAC,GAAG,+BAAuB,CAAC,CAAA;AAE7E,MAAa,WAAW;IActB,YAAY,OAA2B;;QAb9B,WAAM,GAAG,cAAM,CAAC,YAAY,CAAA;QAC5B,eAAU,GAA4B,EAAE,CAAA;QAIxC,YAAO,GAAiB;YAC/B,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC;YAC1D,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC;YACxD,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC;YAC5D,sBAAsB,EAAE,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC;YAC9D,uBAAuB,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;SACjE,CAAA;QAGC,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;QACrC,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,OAAO,mCAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAA;QACzD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAE5B,MAAM,OAAO,GA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names":[],"mappings":"AAAA;;GAEG;AACH,QAAA,MAAM,MAAM,KAAmC,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,CAAA;AACjB,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAC9F,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { AbstractEventLoggerStore } from '@sphereon/ssi-sdk.data-store';
|
|
2
|
-
import { ActivityLoggingEvent } from '@sphereon/ssi-sdk.core';
|
|
3
|
-
import { AuditLoggingEvent } from '@sphereon/ssi-sdk.core';
|
|
4
|
-
import { CredentialType } from '@sphereon/ssi-sdk.core';
|
|
5
|
-
import { FindActivityLoggingEventArgs } from '@sphereon/ssi-sdk.data-store';
|
|
6
|
-
import { FindAuditLoggingEventArgs } from '@sphereon/ssi-sdk.data-store';
|
|
7
|
-
import { IAgentContext } from '@veramo/core';
|
|
8
|
-
import { IAgentPlugin } from '@veramo/core';
|
|
9
|
-
import { InitiatorType } from '@sphereon/ssi-types';
|
|
10
|
-
import { IPluginMethodMap } from '@veramo/core';
|
|
11
|
-
import { Loggers } from '@sphereon/ssi-types';
|
|
12
|
-
import { LoggingEventType } from '@sphereon/ssi-types';
|
|
13
|
-
import { LogLevel } from '@sphereon/ssi-types';
|
|
14
|
-
import { NonPersistedActivityLoggingEvent as NonPersistedActivityLoggingEvent_2 } from '@sphereon/ssi-sdk.core';
|
|
15
|
-
import { NonPersistedAuditLoggingEvent as NonPersistedAuditLoggingEvent_2 } from '@sphereon/ssi-sdk.core';
|
|
16
|
-
import { SubSystem } from '@sphereon/ssi-types';
|
|
17
|
-
import { System } from '@sphereon/ssi-types';
|
|
18
|
-
|
|
19
|
-
export declare class EventLogger implements IAgentPlugin {
|
|
20
|
-
readonly schema: any;
|
|
21
|
-
readonly eventTypes: Array<LoggingEventType>;
|
|
22
|
-
private readonly store?;
|
|
23
|
-
readonly simpleLoggers: Loggers;
|
|
24
|
-
readonly methods: IEventLogger;
|
|
25
|
-
constructor(options: EventLoggerOptions);
|
|
26
|
-
onEvent(event: LoggingEvent, context: RequiredContext): Promise<void>;
|
|
27
|
-
private loggerGetAuditEvents;
|
|
28
|
-
private loggerGetActivityEvents;
|
|
29
|
-
private loggerLogGeneralEvent;
|
|
30
|
-
private loggerLogAuditEvent;
|
|
31
|
-
private loggerLogActivityEvent;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* {@inheritDoc IEventLogger}
|
|
36
|
-
*/
|
|
37
|
-
export declare const eventLoggerAuditMethods: Array<string>;
|
|
38
|
-
|
|
39
|
-
export declare interface EventLoggerGeneralLogOpts {
|
|
40
|
-
debugPkg?: boolean;
|
|
41
|
-
console?: boolean;
|
|
42
|
-
events?: boolean;
|
|
43
|
-
eventName?: string;
|
|
44
|
-
defaultLogLevel?: LogLevel;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export declare const eventLoggerMethods: Array<string>;
|
|
48
|
-
|
|
49
|
-
export declare type EventLoggerOptions = {
|
|
50
|
-
store?: AbstractEventLoggerStore;
|
|
51
|
-
eventTypes: Array<LoggingEventType>;
|
|
52
|
-
general?: EventLoggerGeneralLogOpts;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export declare type GetActivityEventsArgs = {
|
|
56
|
-
filter?: FindActivityLoggingEventArgs;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export declare type GetAuditEventsArgs = {
|
|
60
|
-
filter?: FindAuditLoggingEventArgs;
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
export declare interface IEventLogger extends IPluginMethodMap {
|
|
64
|
-
loggerGetAuditEvents(args?: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>>;
|
|
65
|
-
loggerLogAuditEvent(args: LogEventArgs, context: RequiredContext): Promise<AuditLoggingEvent>;
|
|
66
|
-
loggerLogGeneralEvent(args: LogEventArgs, context: RequiredContext): Promise<LogEventType>;
|
|
67
|
-
loggerLogActivityEvent(args: LogEventArgs, context: RequiredContext): Promise<ActivityLoggingEvent>;
|
|
68
|
-
loggerGetActivityEvents(args?: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>>;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export declare type LogActivityEventArgs = {
|
|
72
|
-
event: NonPersistedActivityLoggingEvent;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
export declare type LogAuditEventArgs = {
|
|
76
|
-
event: NonPersistedAuditLoggingEvent;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
export declare type LogEventArgs = {
|
|
80
|
-
event: LogEventType;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
export declare type LogEventType = NonPersistedAuditLoggingEvent | NonPersistedActivityLoggingEvent;
|
|
84
|
-
|
|
85
|
-
export declare type LoggingEvent = {
|
|
86
|
-
type: LoggingEventType;
|
|
87
|
-
data: LogEventType;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
export declare type NonPersistedActivityLoggingEvent = Omit<NonPersistedActivityLoggingEvent_2, 'system' | 'subSystemType' | 'initiatorType'> & {
|
|
91
|
-
system: System;
|
|
92
|
-
subSystemType: SubSystem;
|
|
93
|
-
initiatorType: InitiatorType;
|
|
94
|
-
originalCredential?: string;
|
|
95
|
-
credentialHash?: string;
|
|
96
|
-
parentCredentialHash?: string;
|
|
97
|
-
credentialType?: CredentialType;
|
|
98
|
-
sharePurpose?: string;
|
|
99
|
-
data?: any;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export declare type NonPersistedAuditLoggingEvent = Omit<NonPersistedAuditLoggingEvent_2, 'system' | 'subSystemType' | 'initiatorType'> & {
|
|
103
|
-
system: System;
|
|
104
|
-
subSystemType: SubSystem;
|
|
105
|
-
initiatorType: InitiatorType;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
export declare type RequiredContext = IAgentContext<IEventLogger>;
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* @public
|
|
112
|
-
*/
|
|
113
|
-
export declare const schema: any;
|
|
114
|
-
|
|
115
|
-
export { }
|
package/dist/tsdoc-metadata.json
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.52.5"
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { InitiatorType, LoggingEventType, LogLevel, SubSystem, System } from '@sphereon/ssi-types';
|
|
2
|
-
import { AuditLoggingEvent, CredentialType, NonPersistedAuditLoggingEvent as NPAuditLoggingEvent, NonPersistedActivityLoggingEvent as NPActivityLoggingEvent, ActivityLoggingEvent } from '@sphereon/ssi-sdk.core';
|
|
3
|
-
import { AbstractEventLoggerStore, FindActivityLoggingEventArgs, FindAuditLoggingEventArgs } from '@sphereon/ssi-sdk.data-store';
|
|
4
|
-
import { IAgentContext, IPluginMethodMap } from '@veramo/core';
|
|
5
|
-
export interface IEventLogger extends IPluginMethodMap {
|
|
6
|
-
loggerGetAuditEvents(args?: GetAuditEventsArgs): Promise<Array<AuditLoggingEvent>>;
|
|
7
|
-
loggerLogAuditEvent(args: LogEventArgs, context: RequiredContext): Promise<AuditLoggingEvent>;
|
|
8
|
-
loggerLogGeneralEvent(args: LogEventArgs, context: RequiredContext): Promise<LogEventType>;
|
|
9
|
-
loggerLogActivityEvent(args: LogEventArgs, context: RequiredContext): Promise<ActivityLoggingEvent>;
|
|
10
|
-
loggerGetActivityEvents(args?: GetActivityEventsArgs): Promise<Array<ActivityLoggingEvent>>;
|
|
11
|
-
}
|
|
12
|
-
export interface EventLoggerGeneralLogOpts {
|
|
13
|
-
debugPkg?: boolean;
|
|
14
|
-
console?: boolean;
|
|
15
|
-
events?: boolean;
|
|
16
|
-
eventName?: string;
|
|
17
|
-
defaultLogLevel?: LogLevel;
|
|
18
|
-
}
|
|
19
|
-
export type EventLoggerOptions = {
|
|
20
|
-
store?: AbstractEventLoggerStore;
|
|
21
|
-
eventTypes: Array<LoggingEventType>;
|
|
22
|
-
general?: EventLoggerGeneralLogOpts;
|
|
23
|
-
};
|
|
24
|
-
export type GetAuditEventsArgs = {
|
|
25
|
-
filter?: FindAuditLoggingEventArgs;
|
|
26
|
-
};
|
|
27
|
-
export type GetActivityEventsArgs = {
|
|
28
|
-
filter?: FindActivityLoggingEventArgs;
|
|
29
|
-
};
|
|
30
|
-
export type LogEventArgs = {
|
|
31
|
-
event: LogEventType;
|
|
32
|
-
};
|
|
33
|
-
export type LogEventType = NonPersistedAuditLoggingEvent | NonPersistedActivityLoggingEvent;
|
|
34
|
-
export type LogAuditEventArgs = {
|
|
35
|
-
event: NonPersistedAuditLoggingEvent;
|
|
36
|
-
};
|
|
37
|
-
export type LogActivityEventArgs = {
|
|
38
|
-
event: NonPersistedActivityLoggingEvent;
|
|
39
|
-
};
|
|
40
|
-
export type NonPersistedAuditLoggingEvent = Omit<NPAuditLoggingEvent, 'system' | 'subSystemType' | 'initiatorType'> & {
|
|
41
|
-
system: System;
|
|
42
|
-
subSystemType: SubSystem;
|
|
43
|
-
initiatorType: InitiatorType;
|
|
44
|
-
};
|
|
45
|
-
export type NonPersistedActivityLoggingEvent = Omit<NPActivityLoggingEvent, 'system' | 'subSystemType' | 'initiatorType'> & {
|
|
46
|
-
system: System;
|
|
47
|
-
subSystemType: SubSystem;
|
|
48
|
-
initiatorType: InitiatorType;
|
|
49
|
-
originalCredential?: string;
|
|
50
|
-
credentialHash?: string;
|
|
51
|
-
parentCredentialHash?: string;
|
|
52
|
-
credentialType?: CredentialType;
|
|
53
|
-
sharePurpose?: string;
|
|
54
|
-
data?: any;
|
|
55
|
-
};
|
|
56
|
-
export type LoggingEvent = {
|
|
57
|
-
type: LoggingEventType;
|
|
58
|
-
data: LogEventType;
|
|
59
|
-
};
|
|
60
|
-
export type RequiredContext = IAgentContext<IEventLogger>;
|
|
61
|
-
//# sourceMappingURL=IEventLogger.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IEventLogger.d.ts","sourceRoot":"","sources":["../../src/types/IEventLogger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAClG,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,6BAA6B,IAAI,mBAAmB,EACpD,gCAAgC,IAAI,sBAAsB,EAC1D,oBAAoB,EACrB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAA;AAChI,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAE9D,MAAM,WAAW,YAAa,SAAQ,gBAAgB;IACpD,oBAAoB,CAAC,IAAI,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAClF,mBAAmB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAA;IAC7F,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA;IAC1F,sBAAsB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAA;IACnG,uBAAuB,CAAC,IAAI,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAC,CAAA;CAC5F;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