@lssm/module.audit-trail 0.0.0-canary-20251217060834 → 0.0.0-canary-20251217072406
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/audit-trail.feature.js +57 -1
- package/dist/contracts/index.d.ts +1 -1
- package/dist/contracts/index.js +373 -1
- package/dist/entities/index.js +126 -1
- package/dist/index.js +6 -1
- package/dist/libs/contracts/dist/capabilities/openbanking.js +88 -0
- package/dist/libs/contracts/dist/client/index.js +5 -0
- package/dist/libs/contracts/dist/client/react/feature-render.js +2 -0
- package/dist/libs/contracts/dist/client/react/form-render.js +4 -0
- package/dist/libs/contracts/dist/client/react/index.js +4 -0
- package/dist/libs/contracts/dist/contract-registry/index.js +1 -0
- package/dist/libs/contracts/dist/contract-registry/schemas.js +60 -0
- package/dist/libs/contracts/dist/docs/PUBLISHING.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/index.js +29 -0
- package/dist/libs/contracts/dist/docs/presentations.js +71 -0
- package/dist/libs/contracts/dist/docs/registry.js +44 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +80 -0
- package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +57 -0
- package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +357 -0
- package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +37 -0
- package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +16 -0
- package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +48 -0
- package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +79 -0
- package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +84 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +45 -0
- package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +67 -0
- package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +40 -0
- package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +69 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +47 -0
- package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +62 -0
- package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +155 -0
- package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +20 -0
- package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +101 -0
- package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +20 -0
- package/dist/libs/contracts/dist/events.js +1 -0
- package/dist/libs/contracts/dist/experiments/evaluator.js +1 -0
- package/dist/libs/contracts/dist/index.js +71 -0
- package/dist/libs/contracts/dist/install.js +2 -0
- package/dist/libs/contracts/dist/integrations/contracts.js +377 -0
- package/dist/libs/contracts/dist/integrations/index.js +18 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +228 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +159 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +3 -0
- package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +210 -0
- package/dist/libs/contracts/dist/integrations/openbanking/models.js +242 -0
- package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +13 -0
- package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +52 -0
- package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +75 -0
- package/dist/libs/contracts/dist/integrations/providers/gmail.js +87 -0
- package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +66 -0
- package/dist/libs/contracts/dist/integrations/providers/index.js +11 -0
- package/dist/libs/contracts/dist/integrations/providers/mistral.js +68 -0
- package/dist/libs/contracts/dist/integrations/providers/postmark.js +68 -0
- package/dist/libs/contracts/dist/integrations/providers/powens.js +116 -0
- package/dist/libs/contracts/dist/integrations/providers/qdrant.js +73 -0
- package/dist/libs/contracts/dist/integrations/providers/registry.js +10 -0
- package/dist/libs/contracts/dist/integrations/providers/stripe.js +83 -0
- package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +61 -0
- package/dist/libs/contracts/dist/jsonschema.js +1 -0
- package/dist/libs/contracts/dist/knowledge/contracts.js +306 -0
- package/dist/libs/contracts/dist/knowledge/index.js +7 -0
- package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +38 -0
- package/dist/libs/contracts/dist/knowledge/spaces/index.js +6 -0
- package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +34 -0
- package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +37 -0
- package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +34 -0
- package/dist/libs/contracts/dist/llm/exporters.js +19 -0
- package/dist/libs/contracts/dist/llm/index.js +2 -0
- package/dist/libs/contracts/dist/llm/prompts.js +1 -0
- package/dist/libs/contracts/dist/onboarding-base.js +196 -0
- package/dist/libs/contracts/dist/openapi.js +1 -0
- package/dist/libs/contracts/dist/ownership.js +21 -0
- package/dist/libs/contracts/dist/presentations.js +1 -0
- package/dist/libs/contracts/dist/presentations.v2.js +11 -0
- package/dist/libs/contracts/dist/prompt.js +1 -0
- package/dist/libs/contracts/dist/promptRegistry.js +1 -0
- package/dist/libs/contracts/dist/regenerator/index.js +1 -0
- package/dist/libs/contracts/dist/regenerator/service.js +6 -0
- package/dist/libs/contracts/dist/registry.js +2 -0
- package/dist/libs/contracts/dist/resources.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/EnumType.js +2 -0
- package/dist/libs/contracts/dist/schema/dist/FieldType.js +49 -0
- package/dist/libs/contracts/dist/schema/dist/ScalarTypeEnum.js +236 -0
- package/dist/libs/contracts/dist/schema/dist/SchemaModel.js +39 -0
- package/dist/libs/contracts/dist/schema/dist/entity/defineEntity.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/entity/index.js +2 -0
- package/dist/libs/contracts/dist/schema/dist/entity/types.js +1 -0
- package/dist/libs/contracts/dist/schema/dist/index.js +6 -0
- package/dist/libs/contracts/dist/server/graphql-pothos.js +6 -0
- package/dist/libs/contracts/dist/server/index.js +8 -0
- package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +4 -0
- package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +2 -0
- package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +1 -0
- package/dist/libs/contracts/dist/server/mcp/registerResources.js +2 -0
- package/dist/libs/contracts/dist/server/mcp/registerTools.js +1 -0
- package/dist/libs/contracts/dist/server/provider-mcp.js +1 -0
- package/dist/libs/contracts/dist/server/rest-elysia.js +1 -0
- package/dist/libs/contracts/dist/server/rest-express.js +1 -0
- package/dist/libs/contracts/dist/server/rest-generic.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-app.js +1 -0
- package/dist/libs/contracts/dist/server/rest-next-pages.js +1 -0
- package/dist/libs/contracts/dist/spec.js +34 -0
- package/dist/libs/contracts/dist/telemetry/index.js +1 -0
- package/dist/libs/contracts/dist/telemetry/tracker.js +1 -0
- package/dist/libs/contracts/dist/tests/index.js +1 -0
- package/dist/libs/contracts/dist/tests/runner.js +2 -0
- package/dist/libs/contracts/dist/workflow/index.js +1 -0
- package/dist/libs/contracts/dist/workflow/runner.js +1 -0
- package/dist/libs/schema/dist/EnumType.js +56 -0
- package/dist/libs/schema/dist/FieldType.js +49 -0
- package/dist/libs/schema/dist/ScalarTypeEnum.js +236 -0
- package/dist/libs/schema/dist/SchemaModel.js +3 -0
- package/dist/libs/schema/dist/entity/defineEntity.js +230 -0
- package/dist/libs/schema/dist/entity/index.js +2 -0
- package/dist/libs/schema/dist/entity/types.js +1 -0
- package/dist/libs/schema/dist/index.js +6 -0
- package/dist/storage/index.js +105 -1
- package/package.json +6 -6
|
@@ -1 +1,57 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/audit-trail.feature.ts
|
|
2
|
+
/**
|
|
3
|
+
* Audit Trail feature module that bundles audit log querying,
|
|
4
|
+
* export, and statistics capabilities.
|
|
5
|
+
*/
|
|
6
|
+
const AuditTrailFeature = {
|
|
7
|
+
meta: {
|
|
8
|
+
key: "audit-trail",
|
|
9
|
+
title: "Audit Trail",
|
|
10
|
+
description: "Audit logging, querying, export, and compliance reporting",
|
|
11
|
+
domain: "platform",
|
|
12
|
+
owners: ["@platform.audit-trail"],
|
|
13
|
+
tags: [
|
|
14
|
+
"audit",
|
|
15
|
+
"compliance",
|
|
16
|
+
"logging",
|
|
17
|
+
"security"
|
|
18
|
+
],
|
|
19
|
+
stability: "stable"
|
|
20
|
+
},
|
|
21
|
+
operations: [
|
|
22
|
+
{
|
|
23
|
+
name: "audit.logs.export",
|
|
24
|
+
version: 1
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: "audit.logs.query",
|
|
28
|
+
version: 1
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "audit.logs.get",
|
|
32
|
+
version: 1
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "audit.trace.get",
|
|
36
|
+
version: 1
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "audit.stats",
|
|
40
|
+
version: 1
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
events: [],
|
|
44
|
+
presentations: [],
|
|
45
|
+
opToPresentation: [],
|
|
46
|
+
presentationsTargets: [],
|
|
47
|
+
capabilities: {
|
|
48
|
+
provides: [{
|
|
49
|
+
key: "audit-trail",
|
|
50
|
+
version: 1
|
|
51
|
+
}],
|
|
52
|
+
requires: []
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
//#endregion
|
|
57
|
+
export { AuditTrailFeature };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as _lssm_lib_schema0 from "@lssm/lib.schema";
|
|
2
1
|
import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
|
|
2
|
+
import * as _lssm_lib_schema0 from "@lssm/lib.schema";
|
|
3
3
|
|
|
4
4
|
//#region src/contracts/index.d.ts
|
|
5
5
|
declare const AuditLogModel: _lssm_lib_schema0.SchemaModel<{
|
package/dist/contracts/index.js
CHANGED
|
@@ -1 +1,373 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import { defineEnum } from "../libs/schema/dist/EnumType.js";
|
|
2
|
+
import { ScalarTypeEnum } from "../libs/schema/dist/ScalarTypeEnum.js";
|
|
3
|
+
import "../libs/schema/dist/index.js";
|
|
4
|
+
import { defineSchemaModel } from "../libs/contracts/dist/schema/dist/SchemaModel.js";
|
|
5
|
+
import { defineCommand, defineQuery } from "../libs/contracts/dist/spec.js";
|
|
6
|
+
import "../libs/contracts/dist/index.js";
|
|
7
|
+
|
|
8
|
+
//#region src/contracts/index.ts
|
|
9
|
+
const OWNERS = ["platform.audit-trail"];
|
|
10
|
+
const AuditLogModel = defineSchemaModel({
|
|
11
|
+
name: "AuditLog",
|
|
12
|
+
description: "Detailed audit log entry",
|
|
13
|
+
fields: {
|
|
14
|
+
id: {
|
|
15
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
16
|
+
isOptional: false
|
|
17
|
+
},
|
|
18
|
+
eventName: {
|
|
19
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
20
|
+
isOptional: false
|
|
21
|
+
},
|
|
22
|
+
eventVersion: {
|
|
23
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
24
|
+
isOptional: false
|
|
25
|
+
},
|
|
26
|
+
payload: {
|
|
27
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
28
|
+
isOptional: false
|
|
29
|
+
},
|
|
30
|
+
actorId: {
|
|
31
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
32
|
+
isOptional: true
|
|
33
|
+
},
|
|
34
|
+
actorType: {
|
|
35
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
36
|
+
isOptional: true
|
|
37
|
+
},
|
|
38
|
+
actorEmail: {
|
|
39
|
+
type: ScalarTypeEnum.EmailAddress(),
|
|
40
|
+
isOptional: true
|
|
41
|
+
},
|
|
42
|
+
targetId: {
|
|
43
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
44
|
+
isOptional: true
|
|
45
|
+
},
|
|
46
|
+
targetType: {
|
|
47
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
48
|
+
isOptional: true
|
|
49
|
+
},
|
|
50
|
+
orgId: {
|
|
51
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
52
|
+
isOptional: true
|
|
53
|
+
},
|
|
54
|
+
traceId: {
|
|
55
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
56
|
+
isOptional: true
|
|
57
|
+
},
|
|
58
|
+
clientIp: {
|
|
59
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
60
|
+
isOptional: true
|
|
61
|
+
},
|
|
62
|
+
occurredAt: {
|
|
63
|
+
type: ScalarTypeEnum.DateTime(),
|
|
64
|
+
isOptional: false
|
|
65
|
+
},
|
|
66
|
+
recordedAt: {
|
|
67
|
+
type: ScalarTypeEnum.DateTime(),
|
|
68
|
+
isOptional: false
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const AuditQueryInputModel = defineSchemaModel({
|
|
73
|
+
name: "AuditQueryInput",
|
|
74
|
+
description: "Input for querying audit logs",
|
|
75
|
+
fields: {
|
|
76
|
+
eventName: {
|
|
77
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
78
|
+
isOptional: true
|
|
79
|
+
},
|
|
80
|
+
actorId: {
|
|
81
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
82
|
+
isOptional: true
|
|
83
|
+
},
|
|
84
|
+
targetId: {
|
|
85
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
86
|
+
isOptional: true
|
|
87
|
+
},
|
|
88
|
+
targetType: {
|
|
89
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
90
|
+
isOptional: true
|
|
91
|
+
},
|
|
92
|
+
orgId: {
|
|
93
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
94
|
+
isOptional: true
|
|
95
|
+
},
|
|
96
|
+
traceId: {
|
|
97
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
98
|
+
isOptional: true
|
|
99
|
+
},
|
|
100
|
+
from: {
|
|
101
|
+
type: ScalarTypeEnum.DateTime(),
|
|
102
|
+
isOptional: true
|
|
103
|
+
},
|
|
104
|
+
to: {
|
|
105
|
+
type: ScalarTypeEnum.DateTime(),
|
|
106
|
+
isOptional: true
|
|
107
|
+
},
|
|
108
|
+
limit: {
|
|
109
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
110
|
+
isOptional: true,
|
|
111
|
+
defaultValue: 100
|
|
112
|
+
},
|
|
113
|
+
offset: {
|
|
114
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
115
|
+
isOptional: true,
|
|
116
|
+
defaultValue: 0
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
const AuditQueryOutputModel = defineSchemaModel({
|
|
121
|
+
name: "AuditQueryOutput",
|
|
122
|
+
description: "Output from querying audit logs",
|
|
123
|
+
fields: {
|
|
124
|
+
logs: {
|
|
125
|
+
type: AuditLogModel,
|
|
126
|
+
isArray: true,
|
|
127
|
+
isOptional: false
|
|
128
|
+
},
|
|
129
|
+
total: {
|
|
130
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
131
|
+
isOptional: false
|
|
132
|
+
},
|
|
133
|
+
hasMore: {
|
|
134
|
+
type: ScalarTypeEnum.Boolean(),
|
|
135
|
+
isOptional: false
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
const ExportFormatEnum = defineEnum("ExportFormat", [
|
|
140
|
+
"json",
|
|
141
|
+
"csv",
|
|
142
|
+
"parquet"
|
|
143
|
+
]);
|
|
144
|
+
const AuditExportInputModel = defineSchemaModel({
|
|
145
|
+
name: "AuditExportInput",
|
|
146
|
+
description: "Input for exporting audit logs",
|
|
147
|
+
fields: {
|
|
148
|
+
orgId: {
|
|
149
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
150
|
+
isOptional: false
|
|
151
|
+
},
|
|
152
|
+
from: {
|
|
153
|
+
type: ScalarTypeEnum.DateTime(),
|
|
154
|
+
isOptional: false
|
|
155
|
+
},
|
|
156
|
+
to: {
|
|
157
|
+
type: ScalarTypeEnum.DateTime(),
|
|
158
|
+
isOptional: false
|
|
159
|
+
},
|
|
160
|
+
format: {
|
|
161
|
+
type: ExportFormatEnum,
|
|
162
|
+
isOptional: true,
|
|
163
|
+
defaultValue: "json"
|
|
164
|
+
},
|
|
165
|
+
eventNames: {
|
|
166
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
167
|
+
isArray: true,
|
|
168
|
+
isOptional: true
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const ExportStatusEnum = defineEnum("ExportStatus", [
|
|
173
|
+
"pending",
|
|
174
|
+
"processing",
|
|
175
|
+
"completed",
|
|
176
|
+
"failed"
|
|
177
|
+
]);
|
|
178
|
+
const AuditExportOutputModel = defineSchemaModel({
|
|
179
|
+
name: "AuditExportOutput",
|
|
180
|
+
description: "Output from initiating an audit export",
|
|
181
|
+
fields: {
|
|
182
|
+
exportId: {
|
|
183
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
184
|
+
isOptional: false
|
|
185
|
+
},
|
|
186
|
+
status: {
|
|
187
|
+
type: ExportStatusEnum,
|
|
188
|
+
isOptional: false
|
|
189
|
+
},
|
|
190
|
+
downloadUrl: {
|
|
191
|
+
type: ScalarTypeEnum.URL(),
|
|
192
|
+
isOptional: true
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
const AuditStatsInputModel = defineSchemaModel({
|
|
197
|
+
name: "AuditStatsInput",
|
|
198
|
+
description: "Input for getting audit statistics",
|
|
199
|
+
fields: {
|
|
200
|
+
orgId: {
|
|
201
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
202
|
+
isOptional: true
|
|
203
|
+
},
|
|
204
|
+
from: {
|
|
205
|
+
type: ScalarTypeEnum.DateTime(),
|
|
206
|
+
isOptional: true
|
|
207
|
+
},
|
|
208
|
+
to: {
|
|
209
|
+
type: ScalarTypeEnum.DateTime(),
|
|
210
|
+
isOptional: true
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
const AuditStatsOutputModel = defineSchemaModel({
|
|
215
|
+
name: "AuditStatsOutput",
|
|
216
|
+
description: "Audit log statistics",
|
|
217
|
+
fields: {
|
|
218
|
+
totalLogs: {
|
|
219
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
220
|
+
isOptional: false
|
|
221
|
+
},
|
|
222
|
+
uniqueActors: {
|
|
223
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
224
|
+
isOptional: false
|
|
225
|
+
},
|
|
226
|
+
uniqueTargets: {
|
|
227
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
228
|
+
isOptional: false
|
|
229
|
+
},
|
|
230
|
+
eventCounts: {
|
|
231
|
+
type: ScalarTypeEnum.JSONObject(),
|
|
232
|
+
isOptional: false
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
/**
|
|
237
|
+
* Query audit logs.
|
|
238
|
+
*/
|
|
239
|
+
const QueryAuditLogsContract = defineQuery({
|
|
240
|
+
meta: {
|
|
241
|
+
name: "audit.logs.query",
|
|
242
|
+
version: 1,
|
|
243
|
+
stability: "stable",
|
|
244
|
+
owners: [...OWNERS],
|
|
245
|
+
tags: [
|
|
246
|
+
"audit",
|
|
247
|
+
"logs",
|
|
248
|
+
"query"
|
|
249
|
+
],
|
|
250
|
+
description: "Query audit logs with filters.",
|
|
251
|
+
goal: "Enable searching and filtering of audit history.",
|
|
252
|
+
context: "Admin dashboard, compliance reporting, debugging."
|
|
253
|
+
},
|
|
254
|
+
io: {
|
|
255
|
+
input: AuditQueryInputModel,
|
|
256
|
+
output: AuditQueryOutputModel
|
|
257
|
+
},
|
|
258
|
+
policy: { auth: "admin" }
|
|
259
|
+
});
|
|
260
|
+
/**
|
|
261
|
+
* Get audit log by ID.
|
|
262
|
+
*/
|
|
263
|
+
const GetAuditLogContract = defineQuery({
|
|
264
|
+
meta: {
|
|
265
|
+
name: "audit.logs.get",
|
|
266
|
+
version: 1,
|
|
267
|
+
stability: "stable",
|
|
268
|
+
owners: [...OWNERS],
|
|
269
|
+
tags: [
|
|
270
|
+
"audit",
|
|
271
|
+
"logs",
|
|
272
|
+
"get"
|
|
273
|
+
],
|
|
274
|
+
description: "Get a specific audit log by ID.",
|
|
275
|
+
goal: "View detailed audit log entry.",
|
|
276
|
+
context: "Log detail view."
|
|
277
|
+
},
|
|
278
|
+
io: {
|
|
279
|
+
input: defineSchemaModel({
|
|
280
|
+
name: "GetAuditLogInput",
|
|
281
|
+
fields: { logId: {
|
|
282
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
283
|
+
isOptional: false
|
|
284
|
+
} }
|
|
285
|
+
}),
|
|
286
|
+
output: AuditLogModel
|
|
287
|
+
},
|
|
288
|
+
policy: { auth: "admin" }
|
|
289
|
+
});
|
|
290
|
+
/**
|
|
291
|
+
* Get audit logs by trace ID.
|
|
292
|
+
*/
|
|
293
|
+
const GetAuditTraceContract = defineQuery({
|
|
294
|
+
meta: {
|
|
295
|
+
name: "audit.trace.get",
|
|
296
|
+
version: 1,
|
|
297
|
+
stability: "stable",
|
|
298
|
+
owners: [...OWNERS],
|
|
299
|
+
tags: [
|
|
300
|
+
"audit",
|
|
301
|
+
"trace",
|
|
302
|
+
"get"
|
|
303
|
+
],
|
|
304
|
+
description: "Get all audit logs for a trace.",
|
|
305
|
+
goal: "View complete request trace for debugging.",
|
|
306
|
+
context: "Request tracing, debugging."
|
|
307
|
+
},
|
|
308
|
+
io: {
|
|
309
|
+
input: defineSchemaModel({
|
|
310
|
+
name: "GetAuditTraceInput",
|
|
311
|
+
fields: { traceId: {
|
|
312
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
313
|
+
isOptional: false
|
|
314
|
+
} }
|
|
315
|
+
}),
|
|
316
|
+
output: defineSchemaModel({
|
|
317
|
+
name: "GetAuditTraceOutput",
|
|
318
|
+
fields: { logs: {
|
|
319
|
+
type: AuditLogModel,
|
|
320
|
+
isArray: true,
|
|
321
|
+
isOptional: false
|
|
322
|
+
} }
|
|
323
|
+
})
|
|
324
|
+
},
|
|
325
|
+
policy: { auth: "admin" }
|
|
326
|
+
});
|
|
327
|
+
/**
|
|
328
|
+
* Export audit logs.
|
|
329
|
+
*/
|
|
330
|
+
const ExportAuditLogsContract = defineCommand({
|
|
331
|
+
meta: {
|
|
332
|
+
name: "audit.logs.export",
|
|
333
|
+
version: 1,
|
|
334
|
+
stability: "stable",
|
|
335
|
+
owners: [...OWNERS],
|
|
336
|
+
tags: [
|
|
337
|
+
"audit",
|
|
338
|
+
"logs",
|
|
339
|
+
"export"
|
|
340
|
+
],
|
|
341
|
+
description: "Export audit logs for compliance reporting.",
|
|
342
|
+
goal: "Generate audit reports for compliance.",
|
|
343
|
+
context: "Compliance reporting, external audits."
|
|
344
|
+
},
|
|
345
|
+
io: {
|
|
346
|
+
input: AuditExportInputModel,
|
|
347
|
+
output: AuditExportOutputModel
|
|
348
|
+
},
|
|
349
|
+
policy: { auth: "admin" }
|
|
350
|
+
});
|
|
351
|
+
/**
|
|
352
|
+
* Get audit statistics.
|
|
353
|
+
*/
|
|
354
|
+
const GetAuditStatsContract = defineQuery({
|
|
355
|
+
meta: {
|
|
356
|
+
name: "audit.stats",
|
|
357
|
+
version: 1,
|
|
358
|
+
stability: "stable",
|
|
359
|
+
owners: [...OWNERS],
|
|
360
|
+
tags: ["audit", "stats"],
|
|
361
|
+
description: "Get audit log statistics.",
|
|
362
|
+
goal: "Monitor audit activity levels.",
|
|
363
|
+
context: "Admin dashboard, monitoring."
|
|
364
|
+
},
|
|
365
|
+
io: {
|
|
366
|
+
input: AuditStatsInputModel,
|
|
367
|
+
output: AuditStatsOutputModel
|
|
368
|
+
},
|
|
369
|
+
policy: { auth: "admin" }
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
//#endregion
|
|
373
|
+
export { AuditExportInputModel, AuditExportOutputModel, AuditLogModel, AuditQueryInputModel, AuditQueryOutputModel, AuditStatsInputModel, AuditStatsOutputModel, ExportAuditLogsContract, ExportFormatEnum, ExportStatusEnum, GetAuditLogContract, GetAuditStatsContract, GetAuditTraceContract, QueryAuditLogsContract };
|
package/dist/entities/index.js
CHANGED
|
@@ -1 +1,126 @@
|
|
|
1
|
-
import{defineEntity
|
|
1
|
+
import { defineEntity, field, index } from "../libs/schema/dist/entity/defineEntity.js";
|
|
2
|
+
import "../libs/schema/dist/index.js";
|
|
3
|
+
|
|
4
|
+
//#region src/entities/index.ts
|
|
5
|
+
/**
|
|
6
|
+
* AuditLog entity - main audit log entry.
|
|
7
|
+
*/
|
|
8
|
+
const AuditLogEntity = defineEntity({
|
|
9
|
+
name: "AuditLog",
|
|
10
|
+
description: "Audit log entry for tracking system events.",
|
|
11
|
+
schema: "lssm_audit",
|
|
12
|
+
map: "audit_log",
|
|
13
|
+
fields: {
|
|
14
|
+
id: field.id({ description: "Unique audit log ID" }),
|
|
15
|
+
eventName: field.string({ description: "Event name/type" }),
|
|
16
|
+
eventVersion: field.int({ description: "Event version" }),
|
|
17
|
+
payload: field.json({ description: "Event payload (may be redacted)" }),
|
|
18
|
+
actorId: field.string({
|
|
19
|
+
isOptional: true,
|
|
20
|
+
description: "User/service that triggered the event"
|
|
21
|
+
}),
|
|
22
|
+
actorType: field.string({
|
|
23
|
+
isOptional: true,
|
|
24
|
+
description: "Actor type (user, system, service)"
|
|
25
|
+
}),
|
|
26
|
+
actorEmail: field.string({
|
|
27
|
+
isOptional: true,
|
|
28
|
+
description: "Actor email (for searchability)"
|
|
29
|
+
}),
|
|
30
|
+
targetId: field.string({
|
|
31
|
+
isOptional: true,
|
|
32
|
+
description: "Resource affected by the event"
|
|
33
|
+
}),
|
|
34
|
+
targetType: field.string({
|
|
35
|
+
isOptional: true,
|
|
36
|
+
description: "Resource type"
|
|
37
|
+
}),
|
|
38
|
+
orgId: field.string({
|
|
39
|
+
isOptional: true,
|
|
40
|
+
description: "Organization context"
|
|
41
|
+
}),
|
|
42
|
+
tenantId: field.string({
|
|
43
|
+
isOptional: true,
|
|
44
|
+
description: "Tenant context"
|
|
45
|
+
}),
|
|
46
|
+
traceId: field.string({
|
|
47
|
+
isOptional: true,
|
|
48
|
+
description: "Distributed trace ID"
|
|
49
|
+
}),
|
|
50
|
+
spanId: field.string({
|
|
51
|
+
isOptional: true,
|
|
52
|
+
description: "Span ID"
|
|
53
|
+
}),
|
|
54
|
+
requestId: field.string({
|
|
55
|
+
isOptional: true,
|
|
56
|
+
description: "Request ID"
|
|
57
|
+
}),
|
|
58
|
+
sessionId: field.string({
|
|
59
|
+
isOptional: true,
|
|
60
|
+
description: "Session ID"
|
|
61
|
+
}),
|
|
62
|
+
clientIp: field.string({
|
|
63
|
+
isOptional: true,
|
|
64
|
+
description: "Client IP address"
|
|
65
|
+
}),
|
|
66
|
+
userAgent: field.string({
|
|
67
|
+
isOptional: true,
|
|
68
|
+
description: "User agent string"
|
|
69
|
+
}),
|
|
70
|
+
tags: field.json({
|
|
71
|
+
isOptional: true,
|
|
72
|
+
description: "Custom tags for filtering"
|
|
73
|
+
}),
|
|
74
|
+
metadata: field.json({
|
|
75
|
+
isOptional: true,
|
|
76
|
+
description: "Additional metadata"
|
|
77
|
+
}),
|
|
78
|
+
occurredAt: field.dateTime({ description: "When the event occurred" }),
|
|
79
|
+
recordedAt: field.createdAt({ description: "When the log was recorded" })
|
|
80
|
+
},
|
|
81
|
+
indexes: [
|
|
82
|
+
index.on(["actorId", "occurredAt"]),
|
|
83
|
+
index.on(["targetId", "occurredAt"]),
|
|
84
|
+
index.on(["orgId", "occurredAt"]),
|
|
85
|
+
index.on(["eventName", "occurredAt"]),
|
|
86
|
+
index.on(["traceId"]),
|
|
87
|
+
index.on(["occurredAt"])
|
|
88
|
+
]
|
|
89
|
+
});
|
|
90
|
+
/**
|
|
91
|
+
* AuditLogArchive entity - archived logs for long-term retention.
|
|
92
|
+
*/
|
|
93
|
+
const AuditLogArchiveEntity = defineEntity({
|
|
94
|
+
name: "AuditLogArchive",
|
|
95
|
+
description: "Archived audit logs for long-term retention.",
|
|
96
|
+
schema: "lssm_audit",
|
|
97
|
+
map: "audit_log_archive",
|
|
98
|
+
fields: {
|
|
99
|
+
id: field.id(),
|
|
100
|
+
batchId: field.string({ description: "Archive batch ID" }),
|
|
101
|
+
logCount: field.int({ description: "Number of logs in batch" }),
|
|
102
|
+
fromDate: field.dateTime({ description: "Earliest log in batch" }),
|
|
103
|
+
toDate: field.dateTime({ description: "Latest log in batch" }),
|
|
104
|
+
storagePath: field.string({ description: "Path to archived data" }),
|
|
105
|
+
storageType: field.string({ description: "Storage type (s3, gcs, file)" }),
|
|
106
|
+
compressedSize: field.int({ description: "Compressed size in bytes" }),
|
|
107
|
+
checksum: field.string({ description: "SHA-256 checksum" }),
|
|
108
|
+
retainUntil: field.dateTime({ description: "When archive can be deleted" }),
|
|
109
|
+
createdAt: field.createdAt()
|
|
110
|
+
},
|
|
111
|
+
indexes: [index.on(["fromDate", "toDate"]), index.on(["retainUntil"])]
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* All audit trail entities for schema composition.
|
|
115
|
+
*/
|
|
116
|
+
const auditTrailEntities = [AuditLogEntity, AuditLogArchiveEntity];
|
|
117
|
+
/**
|
|
118
|
+
* Module schema contribution for audit trail.
|
|
119
|
+
*/
|
|
120
|
+
const auditTrailSchemaContribution = {
|
|
121
|
+
moduleId: "@lssm/module.audit-trail",
|
|
122
|
+
entities: auditTrailEntities
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
//#endregion
|
|
126
|
+
export { AuditLogArchiveEntity, AuditLogEntity, auditTrailEntities, auditTrailSchemaContribution };
|
package/dist/index.js
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
import{AuditTrailFeature
|
|
1
|
+
import { AuditTrailFeature } from "./audit-trail.feature.js";
|
|
2
|
+
import { AuditLogArchiveEntity, AuditLogEntity, auditTrailEntities, auditTrailSchemaContribution } from "./entities/index.js";
|
|
3
|
+
import { AuditExportInputModel, AuditExportOutputModel, AuditLogModel, AuditQueryInputModel, AuditQueryOutputModel, AuditStatsInputModel, AuditStatsOutputModel, ExportAuditLogsContract, ExportFormatEnum, ExportStatusEnum, GetAuditLogContract, GetAuditStatsContract, GetAuditTraceContract, QueryAuditLogsContract } from "./contracts/index.js";
|
|
4
|
+
import { InMemoryAuditStorage, RetentionPolicy, createInMemoryAuditStorage } from "./storage/index.js";
|
|
5
|
+
|
|
6
|
+
export { AuditExportInputModel, AuditExportOutputModel, AuditLogArchiveEntity, AuditLogEntity, AuditLogModel, AuditQueryInputModel, AuditQueryOutputModel, AuditStatsInputModel, AuditStatsOutputModel, AuditTrailFeature, ExportAuditLogsContract, ExportFormatEnum, ExportStatusEnum, GetAuditLogContract, GetAuditStatsContract, GetAuditTraceContract, InMemoryAuditStorage, QueryAuditLogsContract, RetentionPolicy, auditTrailEntities, auditTrailSchemaContribution, createInMemoryAuditStorage };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { StabilityEnum } from "../ownership.js";
|
|
2
|
+
|
|
3
|
+
//#region ../../libs/contracts/dist/capabilities/openbanking.js
|
|
4
|
+
const OWNERS = ["platform.finance"];
|
|
5
|
+
const TAGS = ["open-banking", "finance"];
|
|
6
|
+
const openBankingAccountsReadCapability = {
|
|
7
|
+
meta: {
|
|
8
|
+
key: "openbanking.accounts.read",
|
|
9
|
+
version: 1,
|
|
10
|
+
kind: "integration",
|
|
11
|
+
title: "Open Banking Accounts (Read)",
|
|
12
|
+
description: "Provides read-only access to linked bank accounts, including account summaries and metadata.",
|
|
13
|
+
domain: "finance",
|
|
14
|
+
owners: [...OWNERS],
|
|
15
|
+
tags: [...TAGS],
|
|
16
|
+
stability: StabilityEnum.Experimental
|
|
17
|
+
},
|
|
18
|
+
provides: [
|
|
19
|
+
{
|
|
20
|
+
surface: "operation",
|
|
21
|
+
name: "openbanking.accounts.list",
|
|
22
|
+
version: 1,
|
|
23
|
+
description: "List bank accounts linked to a Powens open banking connection."
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
surface: "operation",
|
|
27
|
+
name: "openbanking.accounts.get",
|
|
28
|
+
version: 1,
|
|
29
|
+
description: "Retrieve the canonical bank account record for a specific account."
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
surface: "operation",
|
|
33
|
+
name: "openbanking.accounts.sync",
|
|
34
|
+
version: 1,
|
|
35
|
+
description: "Trigger a refresh of bank account metadata from the open banking provider."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
const openBankingTransactionsReadCapability = {
|
|
40
|
+
meta: {
|
|
41
|
+
key: "openbanking.transactions.read",
|
|
42
|
+
version: 1,
|
|
43
|
+
kind: "integration",
|
|
44
|
+
title: "Open Banking Transactions (Read)",
|
|
45
|
+
description: "Enables retrieval of transaction history for linked bank accounts via open banking providers.",
|
|
46
|
+
domain: "finance",
|
|
47
|
+
owners: [...OWNERS],
|
|
48
|
+
tags: [...TAGS, "transactions"],
|
|
49
|
+
stability: StabilityEnum.Experimental
|
|
50
|
+
},
|
|
51
|
+
provides: [{
|
|
52
|
+
surface: "operation",
|
|
53
|
+
name: "openbanking.transactions.list",
|
|
54
|
+
version: 1,
|
|
55
|
+
description: "List transactions for a given bank account with optional date filtering."
|
|
56
|
+
}, {
|
|
57
|
+
surface: "operation",
|
|
58
|
+
name: "openbanking.transactions.sync",
|
|
59
|
+
version: 1,
|
|
60
|
+
description: "Synchronise transactions from the open banking provider into the canonical ledger."
|
|
61
|
+
}]
|
|
62
|
+
};
|
|
63
|
+
const openBankingBalancesReadCapability = {
|
|
64
|
+
meta: {
|
|
65
|
+
key: "openbanking.balances.read",
|
|
66
|
+
version: 1,
|
|
67
|
+
kind: "integration",
|
|
68
|
+
title: "Open Banking Balances (Read)",
|
|
69
|
+
description: "Allows querying of current and available balances for linked bank accounts via open banking providers.",
|
|
70
|
+
domain: "finance",
|
|
71
|
+
owners: [...OWNERS],
|
|
72
|
+
tags: [...TAGS, "balances"],
|
|
73
|
+
stability: StabilityEnum.Experimental
|
|
74
|
+
},
|
|
75
|
+
provides: [{
|
|
76
|
+
surface: "operation",
|
|
77
|
+
name: "openbanking.balances.get",
|
|
78
|
+
version: 1,
|
|
79
|
+
description: "Retrieve the latest known balances for a specified bank account."
|
|
80
|
+
}, {
|
|
81
|
+
surface: "operation",
|
|
82
|
+
name: "openbanking.balances.refresh",
|
|
83
|
+
version: 1,
|
|
84
|
+
description: "Force a balance refresh from the open banking provider."
|
|
85
|
+
}]
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
//#endregion
|