@lssm/module.audit-trail 0.0.0-canary-20251221193616 → 0.0.0-canary-20251223010757

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 (187) hide show
  1. package/dist/contracts/index.d.ts +1 -1
  2. package/dist/contracts/index.js +55 -57
  3. package/dist/contracts/index.js.map +1 -1
  4. package/dist/entities/index.js +42 -42
  5. package/dist/entities/index.js.map +1 -1
  6. package/package.json +7 -7
  7. package/dist/libs/contracts/dist/_virtual/rolldown_runtime.js +0 -6
  8. package/dist/libs/contracts/dist/_virtual/rolldown_runtime.js.map +0 -1
  9. package/dist/libs/contracts/dist/capabilities/index.js +0 -1
  10. package/dist/libs/contracts/dist/capabilities/openbanking.js +0 -89
  11. package/dist/libs/contracts/dist/capabilities/openbanking.js.map +0 -1
  12. package/dist/libs/contracts/dist/client/index.js +0 -5
  13. package/dist/libs/contracts/dist/client/react/feature-render.js +0 -3
  14. package/dist/libs/contracts/dist/client/react/form-render.js +0 -5
  15. package/dist/libs/contracts/dist/client/react/index.js +0 -4
  16. package/dist/libs/contracts/dist/contract-registry/index.js +0 -1
  17. package/dist/libs/contracts/dist/contract-registry/schemas.js +0 -61
  18. package/dist/libs/contracts/dist/contract-registry/schemas.js.map +0 -1
  19. package/dist/libs/contracts/dist/data-views/data-views.js +0 -7
  20. package/dist/libs/contracts/dist/data-views/data-views.js.map +0 -1
  21. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -17
  22. package/dist/libs/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +0 -1
  23. package/dist/libs/contracts/dist/docs/index.js +0 -25
  24. package/dist/libs/contracts/dist/docs/meta.docs.js +0 -30
  25. package/dist/libs/contracts/dist/docs/meta.docs.js.map +0 -1
  26. package/dist/libs/contracts/dist/docs/presentations.js +0 -72
  27. package/dist/libs/contracts/dist/docs/presentations.js.map +0 -1
  28. package/dist/libs/contracts/dist/docs/registry.js +0 -45
  29. package/dist/libs/contracts/dist/docs/registry.js.map +0 -1
  30. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -81
  31. package/dist/libs/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +0 -1
  32. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -58
  33. package/dist/libs/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +0 -1
  34. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -17
  35. package/dist/libs/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +0 -1
  36. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -358
  37. package/dist/libs/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +0 -1
  38. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -38
  39. package/dist/libs/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +0 -1
  40. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -17
  41. package/dist/libs/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +0 -1
  42. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js +0 -21
  43. package/dist/libs/contracts/dist/docs/tech/schema/README.docblock.js.map +0 -1
  44. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -49
  45. package/dist/libs/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +0 -1
  46. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -80
  47. package/dist/libs/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +0 -1
  48. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -85
  49. package/dist/libs/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +0 -1
  50. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -46
  51. package/dist/libs/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +0 -1
  52. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -68
  53. package/dist/libs/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +0 -1
  54. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -41
  55. package/dist/libs/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +0 -1
  56. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -70
  57. package/dist/libs/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +0 -1
  58. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -48
  59. package/dist/libs/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +0 -1
  60. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -63
  61. package/dist/libs/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +0 -1
  62. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -156
  63. package/dist/libs/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +0 -1
  64. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -21
  65. package/dist/libs/contracts/dist/docs/tech/templates/runtime.docblock.js.map +0 -1
  66. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -102
  67. package/dist/libs/contracts/dist/docs/tech/vscode-extension.docblock.js.map +0 -1
  68. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -21
  69. package/dist/libs/contracts/dist/docs/tech/workflows/overview.docblock.js.map +0 -1
  70. package/dist/libs/contracts/dist/docs/tech-contracts.docs.js +0 -97
  71. package/dist/libs/contracts/dist/docs/tech-contracts.docs.js.map +0 -1
  72. package/dist/libs/contracts/dist/events.js +0 -1
  73. package/dist/libs/contracts/dist/experiments/evaluator.js +0 -1
  74. package/dist/libs/contracts/dist/features.js +0 -7
  75. package/dist/libs/contracts/dist/features.js.map +0 -1
  76. package/dist/libs/contracts/dist/forms/forms.js +0 -1
  77. package/dist/libs/contracts/dist/index.js +0 -88
  78. package/dist/libs/contracts/dist/index.js.map +0 -1
  79. package/dist/libs/contracts/dist/install.js +0 -2
  80. package/dist/libs/contracts/dist/integrations/index.js +0 -18
  81. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  82. package/dist/libs/contracts/dist/integrations/openbanking/contracts/accounts.js.map +0 -1
  83. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  84. package/dist/libs/contracts/dist/integrations/openbanking/contracts/balances.js.map +0 -1
  85. package/dist/libs/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  86. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  87. package/dist/libs/contracts/dist/integrations/openbanking/contracts/transactions.js.map +0 -1
  88. package/dist/libs/contracts/dist/integrations/openbanking/models.js +0 -241
  89. package/dist/libs/contracts/dist/integrations/openbanking/models.js.map +0 -1
  90. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js +0 -14
  91. package/dist/libs/contracts/dist/integrations/openbanking/telemetry.js.map +0 -1
  92. package/dist/libs/contracts/dist/integrations/operations.js +0 -377
  93. package/dist/libs/contracts/dist/integrations/operations.js.map +0 -1
  94. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js +0 -53
  95. package/dist/libs/contracts/dist/integrations/providers/elevenlabs.js.map +0 -1
  96. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js +0 -76
  97. package/dist/libs/contracts/dist/integrations/providers/gcs-storage.js.map +0 -1
  98. package/dist/libs/contracts/dist/integrations/providers/gmail.js +0 -88
  99. package/dist/libs/contracts/dist/integrations/providers/gmail.js.map +0 -1
  100. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js +0 -67
  101. package/dist/libs/contracts/dist/integrations/providers/google-calendar.js.map +0 -1
  102. package/dist/libs/contracts/dist/integrations/providers/index.js +0 -11
  103. package/dist/libs/contracts/dist/integrations/providers/mistral.js +0 -69
  104. package/dist/libs/contracts/dist/integrations/providers/mistral.js.map +0 -1
  105. package/dist/libs/contracts/dist/integrations/providers/postmark.js +0 -69
  106. package/dist/libs/contracts/dist/integrations/providers/postmark.js.map +0 -1
  107. package/dist/libs/contracts/dist/integrations/providers/powens.js +0 -117
  108. package/dist/libs/contracts/dist/integrations/providers/powens.js.map +0 -1
  109. package/dist/libs/contracts/dist/integrations/providers/qdrant.js +0 -74
  110. package/dist/libs/contracts/dist/integrations/providers/qdrant.js.map +0 -1
  111. package/dist/libs/contracts/dist/integrations/providers/registry.js +0 -10
  112. package/dist/libs/contracts/dist/integrations/providers/stripe.js +0 -84
  113. package/dist/libs/contracts/dist/integrations/providers/stripe.js.map +0 -1
  114. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js +0 -62
  115. package/dist/libs/contracts/dist/integrations/providers/twilio-sms.js.map +0 -1
  116. package/dist/libs/contracts/dist/jsonschema.js +0 -1
  117. package/dist/libs/contracts/dist/knowledge/index.js +0 -7
  118. package/dist/libs/contracts/dist/knowledge/operations.js +0 -306
  119. package/dist/libs/contracts/dist/knowledge/operations.js.map +0 -1
  120. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js +0 -35
  121. package/dist/libs/contracts/dist/knowledge/spaces/email-threads.js.map +0 -1
  122. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js +0 -35
  123. package/dist/libs/contracts/dist/knowledge/spaces/financial-docs.js.map +0 -1
  124. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js +0 -39
  125. package/dist/libs/contracts/dist/knowledge/spaces/financial-overview.js.map +0 -1
  126. package/dist/libs/contracts/dist/knowledge/spaces/index.js +0 -6
  127. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js +0 -35
  128. package/dist/libs/contracts/dist/knowledge/spaces/product-canon.js.map +0 -1
  129. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js +0 -38
  130. package/dist/libs/contracts/dist/knowledge/spaces/support-faq.js.map +0 -1
  131. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -35
  132. package/dist/libs/contracts/dist/knowledge/spaces/uploaded-docs.js.map +0 -1
  133. package/dist/libs/contracts/dist/llm/exporters.js +0 -21
  134. package/dist/libs/contracts/dist/llm/exporters.js.map +0 -1
  135. package/dist/libs/contracts/dist/llm/index.js +0 -2
  136. package/dist/libs/contracts/dist/llm/prompts.js +0 -1
  137. package/dist/libs/contracts/dist/onboarding-base.js +0 -196
  138. package/dist/libs/contracts/dist/onboarding-base.js.map +0 -1
  139. package/dist/libs/contracts/dist/openapi.js +0 -1
  140. package/dist/libs/contracts/dist/operations/index.js +0 -2
  141. package/dist/libs/contracts/dist/operations/operation.js +0 -35
  142. package/dist/libs/contracts/dist/operations/operation.js.map +0 -1
  143. package/dist/libs/contracts/dist/operations/registry.js +0 -8
  144. package/dist/libs/contracts/dist/operations/registry.js.map +0 -1
  145. package/dist/libs/contracts/dist/ownership.js +0 -24
  146. package/dist/libs/contracts/dist/ownership.js.map +0 -1
  147. package/dist/libs/contracts/dist/presentations/index.js +0 -2
  148. package/dist/libs/contracts/dist/presentations/presentations.js +0 -8
  149. package/dist/libs/contracts/dist/presentations/presentations.js.map +0 -1
  150. package/dist/libs/contracts/dist/presentations/transform-engine.js +0 -12
  151. package/dist/libs/contracts/dist/presentations/transform-engine.js.map +0 -1
  152. package/dist/libs/contracts/dist/prompt.js +0 -1
  153. package/dist/libs/contracts/dist/promptRegistry.js +0 -1
  154. package/dist/libs/contracts/dist/regenerator/index.js +0 -1
  155. package/dist/libs/contracts/dist/regenerator/service.js +0 -7
  156. package/dist/libs/contracts/dist/regenerator/service.js.map +0 -1
  157. package/dist/libs/contracts/dist/registry-utils.js +0 -24
  158. package/dist/libs/contracts/dist/registry-utils.js.map +0 -1
  159. package/dist/libs/contracts/dist/resources.js +0 -1
  160. package/dist/libs/contracts/dist/schema/dist/index.js +0 -3874
  161. package/dist/libs/contracts/dist/schema/dist/index.js.map +0 -1
  162. package/dist/libs/contracts/dist/server/graphql-pothos.js +0 -6
  163. package/dist/libs/contracts/dist/server/index.js +0 -8
  164. package/dist/libs/contracts/dist/server/mcp/createMcpServer.js +0 -4
  165. package/dist/libs/contracts/dist/server/mcp/registerPresentations.js +0 -3
  166. package/dist/libs/contracts/dist/server/mcp/registerPrompts.js +0 -1
  167. package/dist/libs/contracts/dist/server/mcp/registerResources.js +0 -2
  168. package/dist/libs/contracts/dist/server/mcp/registerTools.js +0 -1
  169. package/dist/libs/contracts/dist/server/provider-mcp.js +0 -1
  170. package/dist/libs/contracts/dist/server/rest-elysia.js +0 -1
  171. package/dist/libs/contracts/dist/server/rest-express.js +0 -1
  172. package/dist/libs/contracts/dist/server/rest-generic.js +0 -1
  173. package/dist/libs/contracts/dist/server/rest-next-app.js +0 -1
  174. package/dist/libs/contracts/dist/server/rest-next-pages.js +0 -1
  175. package/dist/libs/contracts/dist/telemetry/index.js +0 -1
  176. package/dist/libs/contracts/dist/telemetry/tracker.js +0 -1
  177. package/dist/libs/contracts/dist/tests/index.js +0 -1
  178. package/dist/libs/contracts/dist/tests/runner.js +0 -2
  179. package/dist/libs/contracts/dist/workflow/index.js +0 -2
  180. package/dist/libs/contracts/dist/workflow/runner.js +0 -1
  181. package/dist/libs/contracts/dist/workflow/spec.js +0 -7
  182. package/dist/libs/contracts/dist/workflow/spec.js.map +0 -1
  183. package/dist/libs/contracts/dist/workspace-config/contractsrc-schema.js +0 -122
  184. package/dist/libs/contracts/dist/workspace-config/contractsrc-schema.js.map +0 -1
  185. package/dist/libs/contracts/dist/workspace-config/index.js +0 -1
  186. package/dist/libs/schema/dist/index.js +0 -4896
  187. package/dist/libs/schema/dist/index.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
2
1
  import * as _lssm_lib_schema0 from "@lssm/lib.schema";
2
+ import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
3
3
 
4
4
  //#region src/contracts/index.d.ts
5
5
  declare const AuditLogModel: _lssm_lib_schema0.SchemaModel<{
@@ -1,121 +1,119 @@
1
- import { E5, N5 } from "../libs/schema/dist/index.js";
2
- import { K5 } from "../libs/contracts/dist/schema/dist/index.js";
3
- import { defineCommand, defineQuery } from "../libs/contracts/dist/operations/operation.js";
4
- import "../libs/contracts/dist/index.js";
1
+ import { ScalarTypeEnum, defineEnum } from "@lssm/lib.schema";
2
+ import { defineCommand, defineQuery, defineSchemaModel } from "@lssm/lib.contracts";
5
3
 
6
4
  //#region src/contracts/index.ts
7
5
  const OWNERS = ["platform.audit-trail"];
8
- const AuditLogModel = K5({
6
+ const AuditLogModel = defineSchemaModel({
9
7
  name: "AuditLog",
10
8
  description: "Detailed audit log entry",
11
9
  fields: {
12
10
  id: {
13
- type: E5.String_unsecure(),
11
+ type: ScalarTypeEnum.String_unsecure(),
14
12
  isOptional: false
15
13
  },
16
14
  eventName: {
17
- type: E5.String_unsecure(),
15
+ type: ScalarTypeEnum.String_unsecure(),
18
16
  isOptional: false
19
17
  },
20
18
  eventVersion: {
21
- type: E5.Int_unsecure(),
19
+ type: ScalarTypeEnum.Int_unsecure(),
22
20
  isOptional: false
23
21
  },
24
22
  payload: {
25
- type: E5.JSONObject(),
23
+ type: ScalarTypeEnum.JSONObject(),
26
24
  isOptional: false
27
25
  },
28
26
  actorId: {
29
- type: E5.String_unsecure(),
27
+ type: ScalarTypeEnum.String_unsecure(),
30
28
  isOptional: true
31
29
  },
32
30
  actorType: {
33
- type: E5.String_unsecure(),
31
+ type: ScalarTypeEnum.String_unsecure(),
34
32
  isOptional: true
35
33
  },
36
34
  actorEmail: {
37
- type: E5.EmailAddress(),
35
+ type: ScalarTypeEnum.EmailAddress(),
38
36
  isOptional: true
39
37
  },
40
38
  targetId: {
41
- type: E5.String_unsecure(),
39
+ type: ScalarTypeEnum.String_unsecure(),
42
40
  isOptional: true
43
41
  },
44
42
  targetType: {
45
- type: E5.String_unsecure(),
43
+ type: ScalarTypeEnum.String_unsecure(),
46
44
  isOptional: true
47
45
  },
48
46
  orgId: {
49
- type: E5.String_unsecure(),
47
+ type: ScalarTypeEnum.String_unsecure(),
50
48
  isOptional: true
51
49
  },
52
50
  traceId: {
53
- type: E5.String_unsecure(),
51
+ type: ScalarTypeEnum.String_unsecure(),
54
52
  isOptional: true
55
53
  },
56
54
  clientIp: {
57
- type: E5.String_unsecure(),
55
+ type: ScalarTypeEnum.String_unsecure(),
58
56
  isOptional: true
59
57
  },
60
58
  occurredAt: {
61
- type: E5.DateTime(),
59
+ type: ScalarTypeEnum.DateTime(),
62
60
  isOptional: false
63
61
  },
64
62
  recordedAt: {
65
- type: E5.DateTime(),
63
+ type: ScalarTypeEnum.DateTime(),
66
64
  isOptional: false
67
65
  }
68
66
  }
69
67
  });
70
- const AuditQueryInputModel = K5({
68
+ const AuditQueryInputModel = defineSchemaModel({
71
69
  name: "AuditQueryInput",
72
70
  description: "Input for querying audit logs",
73
71
  fields: {
74
72
  eventName: {
75
- type: E5.String_unsecure(),
73
+ type: ScalarTypeEnum.String_unsecure(),
76
74
  isOptional: true
77
75
  },
78
76
  actorId: {
79
- type: E5.String_unsecure(),
77
+ type: ScalarTypeEnum.String_unsecure(),
80
78
  isOptional: true
81
79
  },
82
80
  targetId: {
83
- type: E5.String_unsecure(),
81
+ type: ScalarTypeEnum.String_unsecure(),
84
82
  isOptional: true
85
83
  },
86
84
  targetType: {
87
- type: E5.String_unsecure(),
85
+ type: ScalarTypeEnum.String_unsecure(),
88
86
  isOptional: true
89
87
  },
90
88
  orgId: {
91
- type: E5.String_unsecure(),
89
+ type: ScalarTypeEnum.String_unsecure(),
92
90
  isOptional: true
93
91
  },
94
92
  traceId: {
95
- type: E5.String_unsecure(),
93
+ type: ScalarTypeEnum.String_unsecure(),
96
94
  isOptional: true
97
95
  },
98
96
  from: {
99
- type: E5.DateTime(),
97
+ type: ScalarTypeEnum.DateTime(),
100
98
  isOptional: true
101
99
  },
102
100
  to: {
103
- type: E5.DateTime(),
101
+ type: ScalarTypeEnum.DateTime(),
104
102
  isOptional: true
105
103
  },
106
104
  limit: {
107
- type: E5.Int_unsecure(),
105
+ type: ScalarTypeEnum.Int_unsecure(),
108
106
  isOptional: true,
109
107
  defaultValue: 100
110
108
  },
111
109
  offset: {
112
- type: E5.Int_unsecure(),
110
+ type: ScalarTypeEnum.Int_unsecure(),
113
111
  isOptional: true,
114
112
  defaultValue: 0
115
113
  }
116
114
  }
117
115
  });
118
- const AuditQueryOutputModel = K5({
116
+ const AuditQueryOutputModel = defineSchemaModel({
119
117
  name: "AuditQueryOutput",
120
118
  description: "Output from querying audit logs",
121
119
  fields: {
@@ -125,34 +123,34 @@ const AuditQueryOutputModel = K5({
125
123
  isOptional: false
126
124
  },
127
125
  total: {
128
- type: E5.Int_unsecure(),
126
+ type: ScalarTypeEnum.Int_unsecure(),
129
127
  isOptional: false
130
128
  },
131
129
  hasMore: {
132
- type: E5.Boolean(),
130
+ type: ScalarTypeEnum.Boolean(),
133
131
  isOptional: false
134
132
  }
135
133
  }
136
134
  });
137
- const ExportFormatEnum = N5("ExportFormat", [
135
+ const ExportFormatEnum = defineEnum("ExportFormat", [
138
136
  "json",
139
137
  "csv",
140
138
  "parquet"
141
139
  ]);
142
- const AuditExportInputModel = K5({
140
+ const AuditExportInputModel = defineSchemaModel({
143
141
  name: "AuditExportInput",
144
142
  description: "Input for exporting audit logs",
145
143
  fields: {
146
144
  orgId: {
147
- type: E5.String_unsecure(),
145
+ type: ScalarTypeEnum.String_unsecure(),
148
146
  isOptional: false
149
147
  },
150
148
  from: {
151
- type: E5.DateTime(),
149
+ type: ScalarTypeEnum.DateTime(),
152
150
  isOptional: false
153
151
  },
154
152
  to: {
155
- type: E5.DateTime(),
153
+ type: ScalarTypeEnum.DateTime(),
156
154
  isOptional: false
157
155
  },
158
156
  format: {
@@ -161,24 +159,24 @@ const AuditExportInputModel = K5({
161
159
  defaultValue: "json"
162
160
  },
163
161
  eventNames: {
164
- type: E5.String_unsecure(),
162
+ type: ScalarTypeEnum.String_unsecure(),
165
163
  isArray: true,
166
164
  isOptional: true
167
165
  }
168
166
  }
169
167
  });
170
- const ExportStatusEnum = N5("ExportStatus", [
168
+ const ExportStatusEnum = defineEnum("ExportStatus", [
171
169
  "pending",
172
170
  "processing",
173
171
  "completed",
174
172
  "failed"
175
173
  ]);
176
- const AuditExportOutputModel = K5({
174
+ const AuditExportOutputModel = defineSchemaModel({
177
175
  name: "AuditExportOutput",
178
176
  description: "Output from initiating an audit export",
179
177
  fields: {
180
178
  exportId: {
181
- type: E5.String_unsecure(),
179
+ type: ScalarTypeEnum.String_unsecure(),
182
180
  isOptional: false
183
181
  },
184
182
  status: {
@@ -186,47 +184,47 @@ const AuditExportOutputModel = K5({
186
184
  isOptional: false
187
185
  },
188
186
  downloadUrl: {
189
- type: E5.URL(),
187
+ type: ScalarTypeEnum.URL(),
190
188
  isOptional: true
191
189
  }
192
190
  }
193
191
  });
194
- const AuditStatsInputModel = K5({
192
+ const AuditStatsInputModel = defineSchemaModel({
195
193
  name: "AuditStatsInput",
196
194
  description: "Input for getting audit statistics",
197
195
  fields: {
198
196
  orgId: {
199
- type: E5.String_unsecure(),
197
+ type: ScalarTypeEnum.String_unsecure(),
200
198
  isOptional: true
201
199
  },
202
200
  from: {
203
- type: E5.DateTime(),
201
+ type: ScalarTypeEnum.DateTime(),
204
202
  isOptional: true
205
203
  },
206
204
  to: {
207
- type: E5.DateTime(),
205
+ type: ScalarTypeEnum.DateTime(),
208
206
  isOptional: true
209
207
  }
210
208
  }
211
209
  });
212
- const AuditStatsOutputModel = K5({
210
+ const AuditStatsOutputModel = defineSchemaModel({
213
211
  name: "AuditStatsOutput",
214
212
  description: "Audit log statistics",
215
213
  fields: {
216
214
  totalLogs: {
217
- type: E5.Int_unsecure(),
215
+ type: ScalarTypeEnum.Int_unsecure(),
218
216
  isOptional: false
219
217
  },
220
218
  uniqueActors: {
221
- type: E5.Int_unsecure(),
219
+ type: ScalarTypeEnum.Int_unsecure(),
222
220
  isOptional: false
223
221
  },
224
222
  uniqueTargets: {
225
- type: E5.Int_unsecure(),
223
+ type: ScalarTypeEnum.Int_unsecure(),
226
224
  isOptional: false
227
225
  },
228
226
  eventCounts: {
229
- type: E5.JSONObject(),
227
+ type: ScalarTypeEnum.JSONObject(),
230
228
  isOptional: false
231
229
  }
232
230
  }
@@ -274,10 +272,10 @@ const GetAuditLogContract = defineQuery({
274
272
  context: "Log detail view."
275
273
  },
276
274
  io: {
277
- input: K5({
275
+ input: defineSchemaModel({
278
276
  name: "GetAuditLogInput",
279
277
  fields: { logId: {
280
- type: E5.String_unsecure(),
278
+ type: ScalarTypeEnum.String_unsecure(),
281
279
  isOptional: false
282
280
  } }
283
281
  }),
@@ -304,14 +302,14 @@ const GetAuditTraceContract = defineQuery({
304
302
  context: "Request tracing, debugging."
305
303
  },
306
304
  io: {
307
- input: K5({
305
+ input: defineSchemaModel({
308
306
  name: "GetAuditTraceInput",
309
307
  fields: { traceId: {
310
- type: E5.String_unsecure(),
308
+ type: ScalarTypeEnum.String_unsecure(),
311
309
  isOptional: false
312
310
  } }
313
311
  }),
314
- output: K5({
312
+ output: defineSchemaModel({
315
313
  name: "GetAuditTraceOutput",
316
314
  fields: { logs: {
317
315
  type: AuditLogModel,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["defineSchemaModel","ScalarTypeEnum","defineEnum"],"sources":["../../src/contracts/index.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n defineSchemaModel,\n} from '@lssm/lib.contracts';\nimport { ScalarTypeEnum, defineEnum } from '@lssm/lib.schema';\n\nconst OWNERS = ['platform.audit-trail'] as const;\n\n// ============ Schemas ============\n\nexport const AuditLogModel = defineSchemaModel({\n name: 'AuditLog',\n description: 'Detailed audit log entry',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n eventVersion: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n payload: { type: ScalarTypeEnum.JSONObject(), isOptional: false },\n actorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n actorType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n actorEmail: { type: ScalarTypeEnum.EmailAddress(), isOptional: true },\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n clientIp: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n recordedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const AuditQueryInputModel = defineSchemaModel({\n name: 'AuditQueryInput',\n description: 'Input for querying audit logs',\n fields: {\n eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n actorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n from: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n to: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 100,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\nexport const AuditQueryOutputModel = defineSchemaModel({\n name: 'AuditQueryOutput',\n description: 'Output from querying audit logs',\n fields: {\n logs: { type: AuditLogModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\nexport const ExportFormatEnum = defineEnum('ExportFormat', [\n 'json',\n 'csv',\n 'parquet',\n]);\n\nexport const AuditExportInputModel = defineSchemaModel({\n name: 'AuditExportInput',\n description: 'Input for exporting audit logs',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n from: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n to: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n format: { type: ExportFormatEnum, isOptional: true, defaultValue: 'json' },\n eventNames: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: true,\n },\n },\n});\n\nexport const ExportStatusEnum = defineEnum('ExportStatus', [\n 'pending',\n 'processing',\n 'completed',\n 'failed',\n]);\n\nexport const AuditExportOutputModel = defineSchemaModel({\n name: 'AuditExportOutput',\n description: 'Output from initiating an audit export',\n fields: {\n exportId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ExportStatusEnum, isOptional: false },\n downloadUrl: { type: ScalarTypeEnum.URL(), isOptional: true },\n },\n});\n\nexport const AuditStatsInputModel = defineSchemaModel({\n name: 'AuditStatsInput',\n description: 'Input for getting audit statistics',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n from: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n to: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\nexport const AuditStatsOutputModel = defineSchemaModel({\n name: 'AuditStatsOutput',\n description: 'Audit log statistics',\n fields: {\n totalLogs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n uniqueActors: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n uniqueTargets: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n eventCounts: { type: ScalarTypeEnum.JSONObject(), isOptional: false },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Query audit logs.\n */\nexport const QueryAuditLogsContract = defineQuery({\n meta: {\n name: 'audit.logs.query',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'logs', 'query'],\n description: 'Query audit logs with filters.',\n goal: 'Enable searching and filtering of audit history.',\n context: 'Admin dashboard, compliance reporting, debugging.',\n },\n io: {\n input: AuditQueryInputModel,\n output: AuditQueryOutputModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Get audit log by ID.\n */\nexport const GetAuditLogContract = defineQuery({\n meta: {\n name: 'audit.logs.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'logs', 'get'],\n description: 'Get a specific audit log by ID.',\n goal: 'View detailed audit log entry.',\n context: 'Log detail view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetAuditLogInput',\n fields: {\n logId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: AuditLogModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Get audit logs by trace ID.\n */\nexport const GetAuditTraceContract = defineQuery({\n meta: {\n name: 'audit.trace.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'trace', 'get'],\n description: 'Get all audit logs for a trace.',\n goal: 'View complete request trace for debugging.',\n context: 'Request tracing, debugging.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetAuditTraceInput',\n fields: {\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'GetAuditTraceOutput',\n fields: {\n logs: { type: AuditLogModel, isArray: true, isOptional: false },\n },\n }),\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Export audit logs.\n */\nexport const ExportAuditLogsContract = defineCommand({\n meta: {\n name: 'audit.logs.export',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'logs', 'export'],\n description: 'Export audit logs for compliance reporting.',\n goal: 'Generate audit reports for compliance.',\n context: 'Compliance reporting, external audits.',\n },\n io: {\n input: AuditExportInputModel,\n output: AuditExportOutputModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Get audit statistics.\n */\nexport const GetAuditStatsContract = defineQuery({\n meta: {\n name: 'audit.stats',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'stats'],\n description: 'Get audit log statistics.',\n goal: 'Monitor audit activity levels.',\n context: 'Admin dashboard, monitoring.',\n },\n io: {\n input: AuditStatsInputModel,\n output: AuditStatsOutputModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n"],"mappings":";;;;;;AAOA,MAAM,SAAS,CAAC,uBAAuB;AAIvC,MAAa,gBAAgBA,GAAkB;CAC7C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,WAAW;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,cAAc;GAAE,MAAMA,GAAe,cAAc;GAAE,YAAY;GAAO;EACxE,SAAS;GAAE,MAAMA,GAAe,YAAY;GAAE,YAAY;GAAO;EACjE,SAAS;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,WAAW;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,YAAY;GAAE,MAAMA,GAAe,cAAc;GAAE,YAAY;GAAM;EACrE,UAAU;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,YAAY;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACxE,OAAO;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACnE,SAAS;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,UAAU;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,YAAY;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAO;EAClE,YAAY;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAO;EACnE;CACF,CAAC;AAEF,MAAa,uBAAuBD,GAAkB;CACpD,MAAM;CACN,aAAa;CAC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,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,SACP;CACF,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/contracts/index.ts"],"sourcesContent":["import {\n defineCommand,\n defineQuery,\n defineSchemaModel,\n} from '@lssm/lib.contracts';\nimport { ScalarTypeEnum, defineEnum } from '@lssm/lib.schema';\n\nconst OWNERS = ['platform.audit-trail'] as const;\n\n// ============ Schemas ============\n\nexport const AuditLogModel = defineSchemaModel({\n name: 'AuditLog',\n description: 'Detailed audit log entry',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n eventVersion: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n payload: { type: ScalarTypeEnum.JSONObject(), isOptional: false },\n actorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n actorType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n actorEmail: { type: ScalarTypeEnum.EmailAddress(), isOptional: true },\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n clientIp: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n occurredAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n recordedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const AuditQueryInputModel = defineSchemaModel({\n name: 'AuditQueryInput',\n description: 'Input for querying audit logs',\n fields: {\n eventName: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n actorId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n targetId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n targetType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n from: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n to: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n limit: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 100,\n },\n offset: {\n type: ScalarTypeEnum.Int_unsecure(),\n isOptional: true,\n defaultValue: 0,\n },\n },\n});\n\nexport const AuditQueryOutputModel = defineSchemaModel({\n name: 'AuditQueryOutput',\n description: 'Output from querying audit logs',\n fields: {\n logs: { type: AuditLogModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n hasMore: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\nexport const ExportFormatEnum = defineEnum('ExportFormat', [\n 'json',\n 'csv',\n 'parquet',\n]);\n\nexport const AuditExportInputModel = defineSchemaModel({\n name: 'AuditExportInput',\n description: 'Input for exporting audit logs',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n from: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n to: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n format: { type: ExportFormatEnum, isOptional: true, defaultValue: 'json' },\n eventNames: {\n type: ScalarTypeEnum.String_unsecure(),\n isArray: true,\n isOptional: true,\n },\n },\n});\n\nexport const ExportStatusEnum = defineEnum('ExportStatus', [\n 'pending',\n 'processing',\n 'completed',\n 'failed',\n]);\n\nexport const AuditExportOutputModel = defineSchemaModel({\n name: 'AuditExportOutput',\n description: 'Output from initiating an audit export',\n fields: {\n exportId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n status: { type: ExportStatusEnum, isOptional: false },\n downloadUrl: { type: ScalarTypeEnum.URL(), isOptional: true },\n },\n});\n\nexport const AuditStatsInputModel = defineSchemaModel({\n name: 'AuditStatsInput',\n description: 'Input for getting audit statistics',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n from: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n to: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\nexport const AuditStatsOutputModel = defineSchemaModel({\n name: 'AuditStatsOutput',\n description: 'Audit log statistics',\n fields: {\n totalLogs: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n uniqueActors: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n uniqueTargets: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n eventCounts: { type: ScalarTypeEnum.JSONObject(), isOptional: false },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Query audit logs.\n */\nexport const QueryAuditLogsContract = defineQuery({\n meta: {\n name: 'audit.logs.query',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'logs', 'query'],\n description: 'Query audit logs with filters.',\n goal: 'Enable searching and filtering of audit history.',\n context: 'Admin dashboard, compliance reporting, debugging.',\n },\n io: {\n input: AuditQueryInputModel,\n output: AuditQueryOutputModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Get audit log by ID.\n */\nexport const GetAuditLogContract = defineQuery({\n meta: {\n name: 'audit.logs.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'logs', 'get'],\n description: 'Get a specific audit log by ID.',\n goal: 'View detailed audit log entry.',\n context: 'Log detail view.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetAuditLogInput',\n fields: {\n logId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: AuditLogModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Get audit logs by trace ID.\n */\nexport const GetAuditTraceContract = defineQuery({\n meta: {\n name: 'audit.trace.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'trace', 'get'],\n description: 'Get all audit logs for a trace.',\n goal: 'View complete request trace for debugging.',\n context: 'Request tracing, debugging.',\n },\n io: {\n input: defineSchemaModel({\n name: 'GetAuditTraceInput',\n fields: {\n traceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n }),\n output: defineSchemaModel({\n name: 'GetAuditTraceOutput',\n fields: {\n logs: { type: AuditLogModel, isArray: true, isOptional: false },\n },\n }),\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Export audit logs.\n */\nexport const ExportAuditLogsContract = defineCommand({\n meta: {\n name: 'audit.logs.export',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'logs', 'export'],\n description: 'Export audit logs for compliance reporting.',\n goal: 'Generate audit reports for compliance.',\n context: 'Compliance reporting, external audits.',\n },\n io: {\n input: AuditExportInputModel,\n output: AuditExportOutputModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Get audit statistics.\n */\nexport const GetAuditStatsContract = defineQuery({\n meta: {\n name: 'audit.stats',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['audit', 'stats'],\n description: 'Get audit log statistics.',\n goal: 'Monitor audit activity levels.',\n context: 'Admin dashboard, monitoring.',\n },\n io: {\n input: AuditStatsInputModel,\n output: AuditStatsOutputModel,\n },\n policy: {\n auth: 'admin',\n },\n});\n"],"mappings":";;;;AAOA,MAAM,SAAS,CAAC,uBAAuB;AAIvC,MAAa,gBAAgB,kBAAkB;CAC7C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,cAAc;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAO;EACxE,SAAS;GAAE,MAAM,eAAe,YAAY;GAAE,YAAY;GAAO;EACjE,SAAS;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACrE,WAAW;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,YAAY;GAAE,MAAM,eAAe,cAAc;GAAE,YAAY;GAAM;EAC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cAAc;CACnD,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM;GAAC;GAAS;GAAQ;GAAS;EACjC,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,SACP;CACF,CAAC;;;;AAKF,MAAa,wBAAwB,YAAY;CAC/C,MAAM;EACJ,MAAM;EACN,SAAS;EACT,WAAW;EACX,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,SAAS,QAAQ;EACxB,aAAa;EACb,MAAM;EACN,SAAS;EACV;CACD,IAAI;EACF,OAAO;EACP,QAAQ;EACT;CACD,QAAQ,EACN,MAAM,SACP;CACF,CAAC"}
@@ -1,113 +1,113 @@
1
- import { L5, _5, b5 } from "../libs/schema/dist/index.js";
1
+ import { defineEntity, field, index } from "@lssm/lib.schema";
2
2
 
3
3
  //#region src/entities/index.ts
4
4
  /**
5
5
  * AuditLog entity - main audit log entry.
6
6
  */
7
- const AuditLogEntity = L5({
7
+ const AuditLogEntity = defineEntity({
8
8
  name: "AuditLog",
9
9
  description: "Audit log entry for tracking system events.",
10
10
  schema: "lssm_audit",
11
11
  map: "audit_log",
12
12
  fields: {
13
- id: _5.id({ description: "Unique audit log ID" }),
14
- eventName: _5.string({ description: "Event name/type" }),
15
- eventVersion: _5.int({ description: "Event version" }),
16
- payload: _5.json({ description: "Event payload (may be redacted)" }),
17
- actorId: _5.string({
13
+ id: field.id({ description: "Unique audit log ID" }),
14
+ eventName: field.string({ description: "Event name/type" }),
15
+ eventVersion: field.int({ description: "Event version" }),
16
+ payload: field.json({ description: "Event payload (may be redacted)" }),
17
+ actorId: field.string({
18
18
  isOptional: true,
19
19
  description: "User/service that triggered the event"
20
20
  }),
21
- actorType: _5.string({
21
+ actorType: field.string({
22
22
  isOptional: true,
23
23
  description: "Actor type (user, system, service)"
24
24
  }),
25
- actorEmail: _5.string({
25
+ actorEmail: field.string({
26
26
  isOptional: true,
27
27
  description: "Actor email (for searchability)"
28
28
  }),
29
- targetId: _5.string({
29
+ targetId: field.string({
30
30
  isOptional: true,
31
31
  description: "Resource affected by the event"
32
32
  }),
33
- targetType: _5.string({
33
+ targetType: field.string({
34
34
  isOptional: true,
35
35
  description: "Resource type"
36
36
  }),
37
- orgId: _5.string({
37
+ orgId: field.string({
38
38
  isOptional: true,
39
39
  description: "Organization context"
40
40
  }),
41
- tenantId: _5.string({
41
+ tenantId: field.string({
42
42
  isOptional: true,
43
43
  description: "Tenant context"
44
44
  }),
45
- traceId: _5.string({
45
+ traceId: field.string({
46
46
  isOptional: true,
47
47
  description: "Distributed trace ID"
48
48
  }),
49
- spanId: _5.string({
49
+ spanId: field.string({
50
50
  isOptional: true,
51
51
  description: "Span ID"
52
52
  }),
53
- requestId: _5.string({
53
+ requestId: field.string({
54
54
  isOptional: true,
55
55
  description: "Request ID"
56
56
  }),
57
- sessionId: _5.string({
57
+ sessionId: field.string({
58
58
  isOptional: true,
59
59
  description: "Session ID"
60
60
  }),
61
- clientIp: _5.string({
61
+ clientIp: field.string({
62
62
  isOptional: true,
63
63
  description: "Client IP address"
64
64
  }),
65
- userAgent: _5.string({
65
+ userAgent: field.string({
66
66
  isOptional: true,
67
67
  description: "User agent string"
68
68
  }),
69
- tags: _5.json({
69
+ tags: field.json({
70
70
  isOptional: true,
71
71
  description: "Custom tags for filtering"
72
72
  }),
73
- metadata: _5.json({
73
+ metadata: field.json({
74
74
  isOptional: true,
75
75
  description: "Additional metadata"
76
76
  }),
77
- occurredAt: _5.dateTime({ description: "When the event occurred" }),
78
- recordedAt: _5.createdAt({ description: "When the log was recorded" })
77
+ occurredAt: field.dateTime({ description: "When the event occurred" }),
78
+ recordedAt: field.createdAt({ description: "When the log was recorded" })
79
79
  },
80
80
  indexes: [
81
- b5.on(["actorId", "occurredAt"]),
82
- b5.on(["targetId", "occurredAt"]),
83
- b5.on(["orgId", "occurredAt"]),
84
- b5.on(["eventName", "occurredAt"]),
85
- b5.on(["traceId"]),
86
- b5.on(["occurredAt"])
81
+ index.on(["actorId", "occurredAt"]),
82
+ index.on(["targetId", "occurredAt"]),
83
+ index.on(["orgId", "occurredAt"]),
84
+ index.on(["eventName", "occurredAt"]),
85
+ index.on(["traceId"]),
86
+ index.on(["occurredAt"])
87
87
  ]
88
88
  });
89
89
  /**
90
90
  * AuditLogArchive entity - archived logs for long-term retention.
91
91
  */
92
- const AuditLogArchiveEntity = L5({
92
+ const AuditLogArchiveEntity = defineEntity({
93
93
  name: "AuditLogArchive",
94
94
  description: "Archived audit logs for long-term retention.",
95
95
  schema: "lssm_audit",
96
96
  map: "audit_log_archive",
97
97
  fields: {
98
- id: _5.id(),
99
- batchId: _5.string({ description: "Archive batch ID" }),
100
- logCount: _5.int({ description: "Number of logs in batch" }),
101
- fromDate: _5.dateTime({ description: "Earliest log in batch" }),
102
- toDate: _5.dateTime({ description: "Latest log in batch" }),
103
- storagePath: _5.string({ description: "Path to archived data" }),
104
- storageType: _5.string({ description: "Storage type (s3, gcs, file)" }),
105
- compressedSize: _5.int({ description: "Compressed size in bytes" }),
106
- checksum: _5.string({ description: "SHA-256 checksum" }),
107
- retainUntil: _5.dateTime({ description: "When archive can be deleted" }),
108
- createdAt: _5.createdAt()
98
+ id: field.id(),
99
+ batchId: field.string({ description: "Archive batch ID" }),
100
+ logCount: field.int({ description: "Number of logs in batch" }),
101
+ fromDate: field.dateTime({ description: "Earliest log in batch" }),
102
+ toDate: field.dateTime({ description: "Latest log in batch" }),
103
+ storagePath: field.string({ description: "Path to archived data" }),
104
+ storageType: field.string({ description: "Storage type (s3, gcs, file)" }),
105
+ compressedSize: field.int({ description: "Compressed size in bytes" }),
106
+ checksum: field.string({ description: "SHA-256 checksum" }),
107
+ retainUntil: field.dateTime({ description: "When archive can be deleted" }),
108
+ createdAt: field.createdAt()
109
109
  },
110
- indexes: [b5.on(["fromDate", "toDate"]), b5.on(["retainUntil"])]
110
+ indexes: [index.on(["fromDate", "toDate"]), index.on(["retainUntil"])]
111
111
  });
112
112
  /**
113
113
  * All audit trail entities for schema composition.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["defineEntity","field","index","auditTrailSchemaContribution: ModuleSchemaContribution"],"sources":["../../src/entities/index.ts"],"sourcesContent":["import { defineEntity, field, index } from '@lssm/lib.schema';\nimport type { ModuleSchemaContribution } from '@lssm/lib.schema';\n\n/**\n * AuditLog entity - main audit log entry.\n */\nexport const AuditLogEntity = defineEntity({\n name: 'AuditLog',\n description: 'Audit log entry for tracking system events.',\n schema: 'lssm_audit',\n map: 'audit_log',\n fields: {\n id: field.id({ description: 'Unique audit log ID' }),\n\n // Event info\n eventName: field.string({ description: 'Event name/type' }),\n eventVersion: field.int({ description: 'Event version' }),\n payload: field.json({ description: 'Event payload (may be redacted)' }),\n\n // Actor info\n actorId: field.string({\n isOptional: true,\n description: 'User/service that triggered the event',\n }),\n actorType: field.string({\n isOptional: true,\n description: 'Actor type (user, system, service)',\n }),\n actorEmail: field.string({\n isOptional: true,\n description: 'Actor email (for searchability)',\n }),\n\n // Target info\n targetId: field.string({\n isOptional: true,\n description: 'Resource affected by the event',\n }),\n targetType: field.string({\n isOptional: true,\n description: 'Resource type',\n }),\n\n // Context\n orgId: field.string({\n isOptional: true,\n description: 'Organization context',\n }),\n tenantId: field.string({ isOptional: true, description: 'Tenant context' }),\n\n // Tracing\n traceId: field.string({\n isOptional: true,\n description: 'Distributed trace ID',\n }),\n spanId: field.string({ isOptional: true, description: 'Span ID' }),\n requestId: field.string({ isOptional: true, description: 'Request ID' }),\n sessionId: field.string({ isOptional: true, description: 'Session ID' }),\n\n // Client info\n clientIp: field.string({\n isOptional: true,\n description: 'Client IP address',\n }),\n userAgent: field.string({\n isOptional: true,\n description: 'User agent string',\n }),\n\n // Metadata\n tags: field.json({\n isOptional: true,\n description: 'Custom tags for filtering',\n }),\n metadata: field.json({\n isOptional: true,\n description: 'Additional metadata',\n }),\n\n // Timestamps\n occurredAt: field.dateTime({ description: 'When the event occurred' }),\n recordedAt: field.createdAt({ description: 'When the log was recorded' }),\n },\n indexes: [\n index.on(['actorId', 'occurredAt']),\n index.on(['targetId', 'occurredAt']),\n index.on(['orgId', 'occurredAt']),\n index.on(['eventName', 'occurredAt']),\n index.on(['traceId']),\n index.on(['occurredAt']),\n ],\n});\n\n/**\n * AuditLogArchive entity - archived logs for long-term retention.\n */\nexport const AuditLogArchiveEntity = defineEntity({\n name: 'AuditLogArchive',\n description: 'Archived audit logs for long-term retention.',\n schema: 'lssm_audit',\n map: 'audit_log_archive',\n fields: {\n id: field.id(),\n\n // Batch info\n batchId: field.string({ description: 'Archive batch ID' }),\n logCount: field.int({ description: 'Number of logs in batch' }),\n\n // Time range\n fromDate: field.dateTime({ description: 'Earliest log in batch' }),\n toDate: field.dateTime({ description: 'Latest log in batch' }),\n\n // Storage\n storagePath: field.string({ description: 'Path to archived data' }),\n storageType: field.string({ description: 'Storage type (s3, gcs, file)' }),\n compressedSize: field.int({ description: 'Compressed size in bytes' }),\n\n // Integrity\n checksum: field.string({ description: 'SHA-256 checksum' }),\n\n // Retention\n retainUntil: field.dateTime({ description: 'When archive can be deleted' }),\n\n // Timestamps\n createdAt: field.createdAt(),\n },\n indexes: [index.on(['fromDate', 'toDate']), index.on(['retainUntil'])],\n});\n\n/**\n * All audit trail entities for schema composition.\n */\nexport const auditTrailEntities = [AuditLogEntity, AuditLogArchiveEntity];\n\n/**\n * Module schema contribution for audit trail.\n */\nexport const auditTrailSchemaContribution: ModuleSchemaContribution = {\n moduleId: '@lssm/module.audit-trail',\n entities: auditTrailEntities,\n};\n"],"mappings":";;;;;;AAMA,MAAa,iBAAiBA,GAAa;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;CACR,KAAK;CACL,QAAQ;EACN,IAAIC,GAAM,GAAG,EAAE,aAAa,uBAAuB,CAAC;EAGpD,WAAWA,GAAM,OAAO,EAAE,aAAa,mBAAmB,CAAC;EAC3D,cAAcA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a,CAAC;EACjCA,GAAM,GAAG,CAAC,aAAa,aAAa,CAAC;EACrCA,GAAM,GAAG,CAAC,UAAU,CAAC;EACrBA,GAAM,GAAG,CAAC,aAAa,CAAC;EACzB;CACF,CAAC;;;;AAKF,MAAa,wBAAwBF,GAAa;CAChD,MAAM;CACN,aAAa;CACb,QAAQ;CACR,KAAK;CACL,QAAQ;EACN,IAAIC,GAAM,IAAI;EAGd,SAASA,GAAM,OAAO,EAAE,aAAa,oBAAoB,CAAC;EAC1D,UAAUA,GAAM,IAAI,EAAE,aAAa,2BAA2B,CAAC;EAG/D,UAAUA,GAAM,SAAS,EAAE,aAAa,yBAAyB,CAAC;EAClE,QAAQA,GAAM,SAAS,EAAE,aAAa,uBAAuB,CAAC;EAG9D,aAAaA,GAAM,OAAO,EAAE,aAAa,yBAAyB,CAAC;EACnE,aAAaA,GAAM,OAAO,EAAE,aAAa,gCAAgC,CAAC;EAC1E,gBAAgBA,GAAM,IAAI,EAAE,aAAa,4BAA4B,CAAC;EAGtE,UAAUA,GAAM,OAAO,EAAE,aAAa,oBAAoB,CAAC;EAG3D,aAAaA,GAAM,SAAS,EAAE,aAAa,+BAA+B,CAAC;EAG3E,WAAWA,GAAM,WAAW;EAC7B;CACD,SAAS,CAACC,GAAM,GAAG,CAAC,YAAY,SAAS,CAAC,EAAEA,GAAM,GAAG,CAAC,cAAc,CAAC,CAAC;CACvE,CAAC;;;;AAKF,MAAa,qBAAqB,CAAC,gBAAgB,sBAAsB;;;;AAKzE,MAAaC,+BAAyD;CACpE,UAAU;CACV,UAAU;CACX"}
1
+ {"version":3,"file":"index.js","names":["auditTrailSchemaContribution: ModuleSchemaContribution"],"sources":["../../src/entities/index.ts"],"sourcesContent":["import { defineEntity, field, index } from '@lssm/lib.schema';\nimport type { ModuleSchemaContribution } from '@lssm/lib.schema';\n\n/**\n * AuditLog entity - main audit log entry.\n */\nexport const AuditLogEntity = defineEntity({\n name: 'AuditLog',\n description: 'Audit log entry for tracking system events.',\n schema: 'lssm_audit',\n map: 'audit_log',\n fields: {\n id: field.id({ description: 'Unique audit log ID' }),\n\n // Event info\n eventName: field.string({ description: 'Event name/type' }),\n eventVersion: field.int({ description: 'Event version' }),\n payload: field.json({ description: 'Event payload (may be redacted)' }),\n\n // Actor info\n actorId: field.string({\n isOptional: true,\n description: 'User/service that triggered the event',\n }),\n actorType: field.string({\n isOptional: true,\n description: 'Actor type (user, system, service)',\n }),\n actorEmail: field.string({\n isOptional: true,\n description: 'Actor email (for searchability)',\n }),\n\n // Target info\n targetId: field.string({\n isOptional: true,\n description: 'Resource affected by the event',\n }),\n targetType: field.string({\n isOptional: true,\n description: 'Resource type',\n }),\n\n // Context\n orgId: field.string({\n isOptional: true,\n description: 'Organization context',\n }),\n tenantId: field.string({ isOptional: true, description: 'Tenant context' }),\n\n // Tracing\n traceId: field.string({\n isOptional: true,\n description: 'Distributed trace ID',\n }),\n spanId: field.string({ isOptional: true, description: 'Span ID' }),\n requestId: field.string({ isOptional: true, description: 'Request ID' }),\n sessionId: field.string({ isOptional: true, description: 'Session ID' }),\n\n // Client info\n clientIp: field.string({\n isOptional: true,\n description: 'Client IP address',\n }),\n userAgent: field.string({\n isOptional: true,\n description: 'User agent string',\n }),\n\n // Metadata\n tags: field.json({\n isOptional: true,\n description: 'Custom tags for filtering',\n }),\n metadata: field.json({\n isOptional: true,\n description: 'Additional metadata',\n }),\n\n // Timestamps\n occurredAt: field.dateTime({ description: 'When the event occurred' }),\n recordedAt: field.createdAt({ description: 'When the log was recorded' }),\n },\n indexes: [\n index.on(['actorId', 'occurredAt']),\n index.on(['targetId', 'occurredAt']),\n index.on(['orgId', 'occurredAt']),\n index.on(['eventName', 'occurredAt']),\n index.on(['traceId']),\n index.on(['occurredAt']),\n ],\n});\n\n/**\n * AuditLogArchive entity - archived logs for long-term retention.\n */\nexport const AuditLogArchiveEntity = defineEntity({\n name: 'AuditLogArchive',\n description: 'Archived audit logs for long-term retention.',\n schema: 'lssm_audit',\n map: 'audit_log_archive',\n fields: {\n id: field.id(),\n\n // Batch info\n batchId: field.string({ description: 'Archive batch ID' }),\n logCount: field.int({ description: 'Number of logs in batch' }),\n\n // Time range\n fromDate: field.dateTime({ description: 'Earliest log in batch' }),\n toDate: field.dateTime({ description: 'Latest log in batch' }),\n\n // Storage\n storagePath: field.string({ description: 'Path to archived data' }),\n storageType: field.string({ description: 'Storage type (s3, gcs, file)' }),\n compressedSize: field.int({ description: 'Compressed size in bytes' }),\n\n // Integrity\n checksum: field.string({ description: 'SHA-256 checksum' }),\n\n // Retention\n retainUntil: field.dateTime({ description: 'When archive can be deleted' }),\n\n // Timestamps\n createdAt: field.createdAt(),\n },\n indexes: [index.on(['fromDate', 'toDate']), index.on(['retainUntil'])],\n});\n\n/**\n * All audit trail entities for schema composition.\n */\nexport const auditTrailEntities = [AuditLogEntity, AuditLogArchiveEntity];\n\n/**\n * Module schema contribution for audit trail.\n */\nexport const auditTrailSchemaContribution: ModuleSchemaContribution = {\n moduleId: '@lssm/module.audit-trail',\n entities: auditTrailEntities,\n};\n"],"mappings":";;;;;;AAMA,MAAa,iBAAiB,aAAa;CACzC,MAAM;CACN,aAAa;CACb,QAAQ;CACR,KAAK;CACL,QAAQ;EACN,IAAI,MAAM,GAAG,EAAE,aAAa,uBAAuB,CAAC;EAGpD,WAAW,MAAM,OAAO,EAAE,aAAa,mBAAmB,CAAC;EAC3D,cAAc,MAAM,IAAI,EAAE,aAAa,iBAAiB,CAAC;EACzD,SAAS,MAAM,KAAK,EAAE,aAAa,mCAAmC,CAAC;EAGvE,SAAS,MAAM,OAAO;GACpB,YAAY;GACZ,aAAa;GACd,CAAC;EACF,WAAW,MAAM,OAAO;GACtB,YAAY;GACZ,aAAa;GACd,CAAC;EACF,YAAY,MAAM,OAAO;GACvB,YAAY;GACZ,aAAa;GACd,CAAC;EAGF,UAAU,MAAM,OAAO;GACrB,YAAY;GACZ,aAAa;GACd,CAAC;EACF,YAAY,MAAM,OAAO;GACvB,YAAY;GACZ,aAAa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BAAyB,CAAC;EAClE,QAAQ,MAAM,SAAS,EAAE,aAAa,uBAAuB,CAAC;EAG9D,aAAa,MAAM,OAAO,EAAE,aAAa,yBAAyB,CAAC;EACnE,aAAa,MAAM,OAAO,EAAE,aAAa,gCAAgC,CAAC;EAC1E,gBAAgB,MAAM,IAAI,EAAE,aAAa,4BAA4B,CAAC;EAGtE,UAAU,MAAM,OAAO,EAAE,aAAa,oBAAoB,CAAC;EAG3D,aAAa,MAAM,SAAS,EAAE,aAAa,+BAA+B,CAAC;EAG3E,WAAW,MAAM,WAAW;EAC7B;CACD,SAAS,CAAC,MAAM,GAAG,CAAC,YAAY,SAAS,CAAC,EAAE,MAAM,GAAG,CAAC,cAAc,CAAC,CAAC;CACvE,CAAC;;;;AAKF,MAAa,qBAAqB,CAAC,gBAAgB,sBAAsB;;;;AAKzE,MAAaA,+BAAyD;CACpE,UAAU;CACV,UAAU;CACX"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/module.audit-trail",
3
- "version": "0.0.0-canary-20251221193616",
3
+ "version": "0.0.0-canary-20251223010757",
4
4
  "description": "Audit trail module for tracking and querying system events",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -8,7 +8,7 @@
8
8
  "scripts": {
9
9
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
10
10
  "publish:pkg:canary": "bun publish:pkg --tag canary",
11
- "build": "bun build:bundle && bun build:types",
11
+ "build": "bun build:types && bun build:bundle",
12
12
  "build:bundle": "tsdown",
13
13
  "build:types": "tsc --noEmit",
14
14
  "dev": "bun build:bundle --watch",
@@ -18,14 +18,14 @@
18
18
  "lint:check": "eslint src"
19
19
  },
20
20
  "dependencies": {
21
- "@lssm/lib.schema": "0.0.0-canary-20251221193616",
22
- "@lssm/lib.contracts": "0.0.0-canary-20251221193616",
23
- "@lssm/lib.bus": "0.0.0-canary-20251221193616",
21
+ "@lssm/lib.schema": "0.0.0-canary-20251223010757",
22
+ "@lssm/lib.contracts": "0.0.0-canary-20251223010757",
23
+ "@lssm/lib.bus": "0.0.0-canary-20251223010757",
24
24
  "zod": "^4.1.13"
25
25
  },
26
26
  "devDependencies": {
27
- "@lssm/tool.typescript": "0.0.0-canary-20251221193616",
28
- "@lssm/tool.tsdown": "0.0.0-canary-20251221193616",
27
+ "@lssm/tool.typescript": "0.0.0-canary-20251223010757",
28
+ "@lssm/tool.tsdown": "0.0.0-canary-20251223010757",
29
29
  "typescript": "^5.9.3"
30
30
  },
31
31
  "exports": {
@@ -1,6 +0,0 @@
1
- //#region ../../libs/contracts/dist/_virtual/rolldown_runtime.js
2
- var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
3
-
4
- //#endregion
5
- export { __esmMin };
6
- //# sourceMappingURL=rolldown_runtime.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rolldown_runtime.js","names":[],"sources":["../../../../../../../libs/contracts/dist/_virtual/rolldown_runtime.js"],"sourcesContent":["//#region rolldown:runtime\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);\nvar __export = (all, symbols) => {\n\tlet target = {};\n\tfor (var name in all) {\n\t\t__defProp(target, name, {\n\t\t\tget: all[name],\n\t\t\tenumerable: true\n\t\t});\n\t}\n\tif (symbols) {\n\t\t__defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\t}\n\treturn target;\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\t\tkey = keys[i];\n\t\t\tif (!__hasOwnProp.call(to, key) && key !== except) {\n\t\t\t\t__defProp(to, key, {\n\t\t\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\treturn to;\n};\nvar __toCommonJS = (mod) => __hasOwnProp.call(mod, \"module.exports\") ? mod[\"module.exports\"] : __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n//#endregion\nexport { __esmMin, __export, __toCommonJS };"],"mappings":";AAKA,IAAI,YAAY,IAAI,eAAe,OAAO,MAAM,GAAG,KAAK,EAAE,GAAG"}
@@ -1 +0,0 @@
1
- import "./openbanking.js";