@sphereon/ssi-sdk.event-logger 0.33.0 → 0.33.1-feature.jose.vcdm.56

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 ADDED
@@ -0,0 +1,847 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __export = (target, all) => {
11
+ for (var name in all)
12
+ __defProp(target, name, { get: all[name], enumerable: true });
13
+ };
14
+ var __copyProps = (to, from, except, desc) => {
15
+ if (from && typeof from === "object" || typeof from === "function") {
16
+ for (let key of __getOwnPropNames(from))
17
+ if (!__hasOwnProp.call(to, key) && key !== except)
18
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
19
+ }
20
+ return to;
21
+ };
22
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
23
+
24
+ // plugin.schema.json
25
+ var require_plugin_schema = __commonJS({
26
+ "plugin.schema.json"(exports, module2) {
27
+ module2.exports = {
28
+ IEventLogger: {
29
+ components: {
30
+ schemas: {
31
+ GetActivityEventsArgs: {
32
+ type: "object",
33
+ properties: {
34
+ filter: {
35
+ $ref: "#/components/schemas/FindActivityLoggingEventArgs"
36
+ }
37
+ },
38
+ additionalProperties: false
39
+ },
40
+ FindActivityLoggingEventArgs: {
41
+ type: "array",
42
+ items: {
43
+ $ref: "#/components/schemas/PartialActivityLoggingEvent"
44
+ }
45
+ },
46
+ PartialActivityLoggingEvent: {
47
+ $ref: "#/components/schemas/Partial<ActivityLoggingEvent>"
48
+ },
49
+ "Partial<ActivityLoggingEvent>": {
50
+ type: "object",
51
+ properties: {
52
+ level: {
53
+ $ref: "#/components/schemas/LogLevel"
54
+ },
55
+ correlationId: {
56
+ type: "string"
57
+ },
58
+ timestamp: {
59
+ type: "string",
60
+ format: "date-time"
61
+ },
62
+ diagnosticData: {},
63
+ id: {
64
+ type: "string"
65
+ },
66
+ type: {
67
+ $ref: "#/components/schemas/LoggingEventType.ACTIVITY"
68
+ },
69
+ originalCredential: {
70
+ type: "string"
71
+ },
72
+ credentialHash: {
73
+ type: "string"
74
+ },
75
+ parentCredentialHash: {
76
+ type: "string"
77
+ },
78
+ credentialType: {
79
+ $ref: "#/components/schemas/CredentialType"
80
+ },
81
+ sharePurpose: {
82
+ type: "string"
83
+ },
84
+ system: {
85
+ $ref: "#/components/schemas/System"
86
+ },
87
+ subSystemType: {
88
+ $ref: "#/components/schemas/SubSystem"
89
+ },
90
+ actionType: {
91
+ $ref: "#/components/schemas/ActionType"
92
+ },
93
+ actionSubType: {
94
+ $ref: "#/components/schemas/ActionSubType"
95
+ },
96
+ initiatorType: {
97
+ $ref: "#/components/schemas/InitiatorType"
98
+ },
99
+ systemCorrelationIdType: {
100
+ $ref: "#/components/schemas/SystemCorrelationIdType"
101
+ },
102
+ systemCorrelationId: {
103
+ type: "string"
104
+ },
105
+ systemAlias: {
106
+ type: "string"
107
+ },
108
+ partyCorrelationType: {
109
+ $ref: "#/components/schemas/PartyCorrelationType"
110
+ },
111
+ partyCorrelationId: {
112
+ type: "string"
113
+ },
114
+ partyAlias: {
115
+ type: "string"
116
+ },
117
+ description: {
118
+ type: "string"
119
+ },
120
+ data: {}
121
+ },
122
+ additionalProperties: false
123
+ },
124
+ LogLevel: {
125
+ type: "number",
126
+ enum: [
127
+ 0,
128
+ 1,
129
+ 2,
130
+ 3,
131
+ 4
132
+ ]
133
+ },
134
+ "LoggingEventType.ACTIVITY": {
135
+ type: "string",
136
+ const: "activity"
137
+ },
138
+ CredentialType: {
139
+ type: "string",
140
+ enum: [
141
+ "JSON_LD",
142
+ "JWT",
143
+ "SD_JWT",
144
+ "MSO_MDOC"
145
+ ]
146
+ },
147
+ System: {
148
+ type: "string",
149
+ enum: [
150
+ "general",
151
+ "kms",
152
+ "identity",
153
+ "oid4vci",
154
+ "oid4vp",
155
+ "siopv2",
156
+ "PE",
157
+ "credentials",
158
+ "web3",
159
+ "profile",
160
+ "contact"
161
+ ]
162
+ },
163
+ SubSystem: {
164
+ type: "string",
165
+ enum: [
166
+ "key",
167
+ "did_provider",
168
+ "did_resolver",
169
+ "oid4vp_op",
170
+ "oid4vci_client",
171
+ "siopv2_op",
172
+ "contact_manager",
173
+ "vc_issuer",
174
+ "vc_verifier",
175
+ "vc_persistence",
176
+ "transport",
177
+ "profile",
178
+ "api"
179
+ ]
180
+ },
181
+ ActionType: {
182
+ type: "string",
183
+ enum: [
184
+ "create",
185
+ "read",
186
+ "update",
187
+ "delete",
188
+ "execute"
189
+ ]
190
+ },
191
+ ActionSubType: {
192
+ anyOf: [
193
+ {
194
+ $ref: "#/components/schemas/DefaultActionSubType"
195
+ },
196
+ {
197
+ type: "string"
198
+ }
199
+ ]
200
+ },
201
+ DefaultActionSubType: {
202
+ type: "string",
203
+ enum: [
204
+ "Key generation",
205
+ "Key import",
206
+ "Key persistence",
207
+ "Key removal",
208
+ "DID creation",
209
+ "DID resolution",
210
+ "DID service update",
211
+ "VC issue",
212
+ "VC verify",
213
+ "VC share",
214
+ "VC delete",
215
+ "VC issue decline",
216
+ "VC share decline"
217
+ ]
218
+ },
219
+ InitiatorType: {
220
+ type: "string",
221
+ enum: [
222
+ "user",
223
+ "system",
224
+ "external"
225
+ ]
226
+ },
227
+ SystemCorrelationIdType: {
228
+ type: "string",
229
+ enum: [
230
+ "did",
231
+ "url",
232
+ "email",
233
+ "hostname",
234
+ "phone",
235
+ "user"
236
+ ]
237
+ },
238
+ PartyCorrelationType: {
239
+ type: "string",
240
+ enum: [
241
+ "did",
242
+ "url",
243
+ "email",
244
+ "hostname",
245
+ "phone"
246
+ ]
247
+ },
248
+ ActivityLoggingEvent: {
249
+ type: "object",
250
+ additionalProperties: false,
251
+ properties: {
252
+ id: {
253
+ type: "string"
254
+ },
255
+ type: {
256
+ $ref: "#/components/schemas/LoggingEventType.ACTIVITY"
257
+ },
258
+ originalCredential: {
259
+ type: "string"
260
+ },
261
+ credentialHash: {
262
+ type: "string"
263
+ },
264
+ parentCredentialHash: {
265
+ type: "string"
266
+ },
267
+ credentialType: {
268
+ $ref: "#/components/schemas/CredentialType"
269
+ },
270
+ sharePurpose: {
271
+ type: "string"
272
+ },
273
+ correlationId: {
274
+ type: "string"
275
+ },
276
+ system: {
277
+ $ref: "#/components/schemas/System"
278
+ },
279
+ subSystemType: {
280
+ $ref: "#/components/schemas/SubSystem"
281
+ },
282
+ actionType: {
283
+ $ref: "#/components/schemas/ActionType"
284
+ },
285
+ actionSubType: {
286
+ $ref: "#/components/schemas/ActionSubType"
287
+ },
288
+ initiatorType: {
289
+ $ref: "#/components/schemas/InitiatorType"
290
+ },
291
+ systemCorrelationIdType: {
292
+ $ref: "#/components/schemas/SystemCorrelationIdType"
293
+ },
294
+ systemCorrelationId: {
295
+ type: "string"
296
+ },
297
+ systemAlias: {
298
+ type: "string"
299
+ },
300
+ partyCorrelationType: {
301
+ $ref: "#/components/schemas/PartyCorrelationType"
302
+ },
303
+ partyCorrelationId: {
304
+ type: "string"
305
+ },
306
+ partyAlias: {
307
+ type: "string"
308
+ },
309
+ description: {
310
+ type: "string"
311
+ },
312
+ data: {},
313
+ level: {
314
+ $ref: "#/components/schemas/LogLevel"
315
+ },
316
+ timestamp: {
317
+ type: "string",
318
+ format: "date-time"
319
+ },
320
+ diagnosticData: {}
321
+ },
322
+ required: [
323
+ "actionSubType",
324
+ "actionType",
325
+ "correlationId",
326
+ "description",
327
+ "id",
328
+ "initiatorType",
329
+ "level",
330
+ "subSystemType",
331
+ "system",
332
+ "timestamp",
333
+ "type"
334
+ ]
335
+ },
336
+ GetAuditEventsArgs: {
337
+ type: "object",
338
+ properties: {
339
+ filter: {
340
+ $ref: "#/components/schemas/FindAuditLoggingEventArgs"
341
+ }
342
+ },
343
+ additionalProperties: false
344
+ },
345
+ FindAuditLoggingEventArgs: {
346
+ type: "array",
347
+ items: {
348
+ $ref: "#/components/schemas/PartialAuditLoggingEvent"
349
+ }
350
+ },
351
+ PartialAuditLoggingEvent: {
352
+ $ref: "#/components/schemas/Partial<AuditLoggingEvent>"
353
+ },
354
+ "Partial<AuditLoggingEvent>": {
355
+ type: "object",
356
+ properties: {
357
+ level: {
358
+ $ref: "#/components/schemas/LogLevel"
359
+ },
360
+ correlationId: {
361
+ type: "string"
362
+ },
363
+ timestamp: {
364
+ type: "string",
365
+ format: "date-time"
366
+ },
367
+ diagnosticData: {},
368
+ id: {
369
+ type: "string"
370
+ },
371
+ type: {
372
+ $ref: "#/components/schemas/LoggingEventType.AUDIT"
373
+ },
374
+ system: {
375
+ $ref: "#/components/schemas/System"
376
+ },
377
+ subSystemType: {
378
+ $ref: "#/components/schemas/SubSystem"
379
+ },
380
+ actionType: {
381
+ $ref: "#/components/schemas/ActionType"
382
+ },
383
+ actionSubType: {
384
+ $ref: "#/components/schemas/ActionSubType"
385
+ },
386
+ initiatorType: {
387
+ $ref: "#/components/schemas/InitiatorType"
388
+ },
389
+ systemCorrelationIdType: {
390
+ $ref: "#/components/schemas/SystemCorrelationIdType"
391
+ },
392
+ systemCorrelationId: {
393
+ type: "string"
394
+ },
395
+ systemAlias: {
396
+ type: "string"
397
+ },
398
+ partyCorrelationType: {
399
+ $ref: "#/components/schemas/PartyCorrelationType"
400
+ },
401
+ partyCorrelationId: {
402
+ type: "string"
403
+ },
404
+ partyAlias: {
405
+ type: "string"
406
+ },
407
+ description: {
408
+ type: "string"
409
+ },
410
+ data: {}
411
+ },
412
+ additionalProperties: false
413
+ },
414
+ "LoggingEventType.AUDIT": {
415
+ type: "string",
416
+ const: "audit"
417
+ },
418
+ AuditLoggingEvent: {
419
+ type: "object",
420
+ additionalProperties: false,
421
+ properties: {
422
+ id: {
423
+ type: "string"
424
+ },
425
+ type: {
426
+ $ref: "#/components/schemas/LoggingEventType.AUDIT"
427
+ },
428
+ correlationId: {
429
+ type: "string"
430
+ },
431
+ system: {
432
+ $ref: "#/components/schemas/System"
433
+ },
434
+ subSystemType: {
435
+ $ref: "#/components/schemas/SubSystem"
436
+ },
437
+ actionType: {
438
+ $ref: "#/components/schemas/ActionType"
439
+ },
440
+ actionSubType: {
441
+ $ref: "#/components/schemas/ActionSubType"
442
+ },
443
+ initiatorType: {
444
+ $ref: "#/components/schemas/InitiatorType"
445
+ },
446
+ systemCorrelationIdType: {
447
+ $ref: "#/components/schemas/SystemCorrelationIdType"
448
+ },
449
+ systemCorrelationId: {
450
+ type: "string"
451
+ },
452
+ systemAlias: {
453
+ type: "string"
454
+ },
455
+ partyCorrelationType: {
456
+ $ref: "#/components/schemas/PartyCorrelationType"
457
+ },
458
+ partyCorrelationId: {
459
+ type: "string"
460
+ },
461
+ partyAlias: {
462
+ type: "string"
463
+ },
464
+ description: {
465
+ type: "string"
466
+ },
467
+ data: {},
468
+ level: {
469
+ $ref: "#/components/schemas/LogLevel"
470
+ },
471
+ timestamp: {
472
+ type: "string",
473
+ format: "date-time"
474
+ },
475
+ diagnosticData: {}
476
+ },
477
+ required: [
478
+ "actionSubType",
479
+ "actionType",
480
+ "correlationId",
481
+ "description",
482
+ "id",
483
+ "initiatorType",
484
+ "level",
485
+ "subSystemType",
486
+ "system",
487
+ "timestamp",
488
+ "type"
489
+ ]
490
+ },
491
+ LogEventArgs: {
492
+ type: "object",
493
+ properties: {
494
+ event: {
495
+ $ref: "#/components/schemas/LogEventType"
496
+ }
497
+ },
498
+ required: [
499
+ "event"
500
+ ],
501
+ additionalProperties: false
502
+ },
503
+ LogEventType: {
504
+ anyOf: [
505
+ {
506
+ $ref: "#/components/schemas/NonPersistedAuditLoggingEvent"
507
+ },
508
+ {
509
+ $ref: "#/components/schemas/NonPersistedActivityLoggingEvent"
510
+ }
511
+ ]
512
+ },
513
+ NonPersistedAuditLoggingEvent: {
514
+ type: "object",
515
+ additionalProperties: false,
516
+ properties: {
517
+ system: {
518
+ $ref: "#/components/schemas/System"
519
+ },
520
+ subSystemType: {
521
+ $ref: "#/components/schemas/SubSystem"
522
+ },
523
+ initiatorType: {
524
+ $ref: "#/components/schemas/InitiatorType"
525
+ },
526
+ diagnosticData: {},
527
+ actionType: {
528
+ $ref: "#/components/schemas/ActionType"
529
+ },
530
+ actionSubType: {
531
+ $ref: "#/components/schemas/ActionSubType"
532
+ },
533
+ systemCorrelationIdType: {
534
+ $ref: "#/components/schemas/SystemCorrelationIdType"
535
+ },
536
+ systemCorrelationId: {
537
+ type: "string"
538
+ },
539
+ systemAlias: {
540
+ type: "string"
541
+ },
542
+ partyCorrelationType: {
543
+ $ref: "#/components/schemas/PartyCorrelationType"
544
+ },
545
+ partyCorrelationId: {
546
+ type: "string"
547
+ },
548
+ partyAlias: {
549
+ type: "string"
550
+ },
551
+ description: {
552
+ type: "string"
553
+ },
554
+ data: {},
555
+ level: {
556
+ $ref: "#/components/schemas/LogLevel"
557
+ },
558
+ correlationId: {
559
+ type: "string"
560
+ }
561
+ },
562
+ required: [
563
+ "actionSubType",
564
+ "actionType",
565
+ "description",
566
+ "initiatorType",
567
+ "subSystemType",
568
+ "system"
569
+ ]
570
+ },
571
+ NonPersistedActivityLoggingEvent: {
572
+ type: "object",
573
+ additionalProperties: false,
574
+ properties: {
575
+ system: {
576
+ $ref: "#/components/schemas/System"
577
+ },
578
+ subSystemType: {
579
+ $ref: "#/components/schemas/SubSystem"
580
+ },
581
+ initiatorType: {
582
+ $ref: "#/components/schemas/InitiatorType"
583
+ },
584
+ originalCredential: {
585
+ type: "string"
586
+ },
587
+ credentialHash: {
588
+ type: "string"
589
+ },
590
+ parentCredentialHash: {
591
+ type: "string"
592
+ },
593
+ credentialType: {
594
+ $ref: "#/components/schemas/CredentialType"
595
+ },
596
+ sharePurpose: {
597
+ type: "string"
598
+ },
599
+ data: {},
600
+ diagnosticData: {},
601
+ actionType: {
602
+ $ref: "#/components/schemas/ActionType"
603
+ },
604
+ actionSubType: {
605
+ $ref: "#/components/schemas/ActionSubType"
606
+ },
607
+ systemCorrelationIdType: {
608
+ $ref: "#/components/schemas/SystemCorrelationIdType"
609
+ },
610
+ systemCorrelationId: {
611
+ type: "string"
612
+ },
613
+ systemAlias: {
614
+ type: "string"
615
+ },
616
+ partyCorrelationType: {
617
+ $ref: "#/components/schemas/PartyCorrelationType"
618
+ },
619
+ partyCorrelationId: {
620
+ type: "string"
621
+ },
622
+ partyAlias: {
623
+ type: "string"
624
+ },
625
+ description: {
626
+ type: "string"
627
+ },
628
+ level: {
629
+ $ref: "#/components/schemas/LogLevel"
630
+ },
631
+ correlationId: {
632
+ type: "string"
633
+ }
634
+ },
635
+ required: [
636
+ "actionSubType",
637
+ "actionType",
638
+ "description",
639
+ "initiatorType",
640
+ "subSystemType",
641
+ "system"
642
+ ]
643
+ }
644
+ },
645
+ methods: {
646
+ loggerGetActivityEvents: {
647
+ description: "",
648
+ arguments: {
649
+ $ref: "#/components/schemas/GetActivityEventsArgs"
650
+ },
651
+ returnType: {
652
+ type: "array",
653
+ items: {
654
+ $ref: "#/components/schemas/ActivityLoggingEvent"
655
+ }
656
+ }
657
+ },
658
+ loggerGetAuditEvents: {
659
+ description: "",
660
+ arguments: {
661
+ $ref: "#/components/schemas/GetAuditEventsArgs"
662
+ },
663
+ returnType: {
664
+ type: "array",
665
+ items: {
666
+ $ref: "#/components/schemas/AuditLoggingEvent"
667
+ }
668
+ }
669
+ },
670
+ loggerLogActivityEvent: {
671
+ description: "",
672
+ arguments: {
673
+ $ref: "#/components/schemas/LogEventArgs"
674
+ },
675
+ returnType: {
676
+ $ref: "#/components/schemas/ActivityLoggingEvent"
677
+ }
678
+ },
679
+ loggerLogAuditEvent: {
680
+ description: "",
681
+ arguments: {
682
+ $ref: "#/components/schemas/LogEventArgs"
683
+ },
684
+ returnType: {
685
+ $ref: "#/components/schemas/AuditLoggingEvent"
686
+ }
687
+ },
688
+ loggerLogGeneralEvent: {
689
+ description: "",
690
+ arguments: {
691
+ $ref: "#/components/schemas/LogEventArgs"
692
+ },
693
+ returnType: {
694
+ $ref: "#/components/schemas/LogEventType"
695
+ }
696
+ }
697
+ }
698
+ }
699
+ }
700
+ };
701
+ }
702
+ });
703
+
704
+ // src/index.ts
705
+ var index_exports = {};
706
+ __export(index_exports, {
707
+ EventLogger: () => EventLogger,
708
+ eventLoggerAuditMethods: () => eventLoggerAuditMethods,
709
+ eventLoggerMethods: () => eventLoggerMethods,
710
+ schema: () => schema
711
+ });
712
+ module.exports = __toCommonJS(index_exports);
713
+
714
+ // src/agent/EventLogger.ts
715
+ var import_ssi_types = require("@sphereon/ssi-types");
716
+ var import_uuid = require("uuid");
717
+ var eventLoggerAuditMethods = [
718
+ "loggerGetAuditEvents",
719
+ "loggerLogAuditEvent",
720
+ "loggerLogGeneralEvent",
721
+ "loggerLogActivityEvent",
722
+ "loggerGetActivityEvents"
723
+ ];
724
+ var eventLoggerMethods = [
725
+ ...eventLoggerAuditMethods
726
+ ];
727
+ var EventLogger = class {
728
+ static {
729
+ __name(this, "EventLogger");
730
+ }
731
+ schema = schema.IEventLogger;
732
+ eventTypes = [];
733
+ store;
734
+ simpleLoggers;
735
+ methods = {
736
+ loggerGetAuditEvents: this.loggerGetAuditEvents.bind(this),
737
+ loggerLogAuditEvent: this.loggerLogAuditEvent.bind(this),
738
+ loggerLogGeneralEvent: this.loggerLogGeneralEvent.bind(this),
739
+ loggerLogActivityEvent: this.loggerLogActivityEvent.bind(this),
740
+ loggerGetActivityEvents: this.loggerGetActivityEvents.bind(this)
741
+ };
742
+ constructor(options) {
743
+ const { store, eventTypes } = options;
744
+ const generalOpts = options.general ?? {
745
+ debugPkg: true
746
+ };
747
+ this.store = store;
748
+ this.eventTypes = eventTypes;
749
+ const methods = [];
750
+ if (generalOpts.debugPkg) {
751
+ methods.push(import_ssi_types.LogMethod.DEBUG_PKG);
752
+ }
753
+ if (generalOpts.console) {
754
+ methods.push(import_ssi_types.LogMethod.CONSOLE);
755
+ }
756
+ if (generalOpts.events) {
757
+ methods.push(import_ssi_types.LogMethod.EVENT);
758
+ }
759
+ this.simpleLoggers = new import_ssi_types.Loggers({
760
+ methods,
761
+ eventName: generalOpts.eventName,
762
+ defaultLogLevel: generalOpts.defaultLogLevel
763
+ });
764
+ }
765
+ async onEvent(event, context) {
766
+ switch (event.type) {
767
+ case import_ssi_types.LoggingEventType.AUDIT:
768
+ await context.agent.loggerLogAuditEvent({
769
+ event: event.data
770
+ });
771
+ break;
772
+ case import_ssi_types.LoggingEventType.GENERAL:
773
+ await context.agent.loggerLogGeneralEvent({
774
+ event: event.data
775
+ });
776
+ break;
777
+ case import_ssi_types.LoggingEventType.ACTIVITY:
778
+ await context.agent.loggerLogActivityEvent({
779
+ event: event.data
780
+ });
781
+ break;
782
+ default:
783
+ return Promise.reject(Error(`Event type ${event.type} not supported`));
784
+ }
785
+ }
786
+ async loggerGetAuditEvents(args) {
787
+ const { filter } = args ?? {};
788
+ if (!this.store) {
789
+ return Promise.reject(Error("No store available in options"));
790
+ }
791
+ return this.store.getAuditEvents({
792
+ filter
793
+ });
794
+ }
795
+ async loggerGetActivityEvents(args) {
796
+ const { filter } = args ?? {};
797
+ if (!this.store) {
798
+ return Promise.reject(Error("No store available in options"));
799
+ }
800
+ return this.store.getActivityEvents({
801
+ filter
802
+ });
803
+ }
804
+ async loggerLogGeneralEvent(args) {
805
+ const { event } = args;
806
+ this.simpleLoggers.get(event.data.system).logl(event.data.level ?? import_ssi_types.LogLevel.INFO, event.data.data, event.data);
807
+ return args.event;
808
+ }
809
+ async loggerLogAuditEvent(args) {
810
+ const { event } = args;
811
+ if (!this.store) {
812
+ return Promise.reject(Error("No store available in options"));
813
+ }
814
+ return this.store.storeAuditEvent({
815
+ event: {
816
+ ...event,
817
+ system: event.system,
818
+ subSystemType: event.subSystemType,
819
+ initiatorType: event.initiatorType,
820
+ level: event.level ?? import_ssi_types.LogLevel.INFO,
821
+ correlationId: event.correlationId ?? (0, import_uuid.v4)(),
822
+ timestamp: /* @__PURE__ */ new Date()
823
+ }
824
+ });
825
+ }
826
+ async loggerLogActivityEvent(args) {
827
+ const { event } = args;
828
+ if (!this.store) {
829
+ return Promise.reject(Error("No store available in options"));
830
+ }
831
+ return this.store.storeActivityEvent({
832
+ event: {
833
+ ...event,
834
+ system: event.system,
835
+ subSystemType: event.subSystemType,
836
+ initiatorType: event.initiatorType,
837
+ level: event.level ?? import_ssi_types.LogLevel.INFO,
838
+ correlationId: event.correlationId ?? (0, import_uuid.v4)(),
839
+ timestamp: /* @__PURE__ */ new Date()
840
+ }
841
+ });
842
+ }
843
+ };
844
+
845
+ // src/index.ts
846
+ var schema = require_plugin_schema();
847
+ //# sourceMappingURL=index.cjs.map