@lssm/lib.metering 0.0.0-canary-20251217083314 → 1.41.1

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 (138) hide show
  1. package/dist/aggregation/index.js +1 -271
  2. package/dist/contracts/index.js +1 -1034
  3. package/dist/docs/index.js +1 -1
  4. package/dist/docs/metering.docblock.js +2 -22
  5. package/dist/entities/index.js +1 -418
  6. package/dist/events.js +1 -379
  7. package/dist/index.js +1 -8
  8. package/dist/metering.feature.js +1 -125
  9. package/package.json +13 -13
  10. package/dist/aggregation/index.d.ts +0 -155
  11. package/dist/contracts/dist/capabilities/openbanking.js +0 -88
  12. package/dist/contracts/dist/client/index.js +0 -5
  13. package/dist/contracts/dist/client/react/feature-render.js +0 -2
  14. package/dist/contracts/dist/client/react/form-render.js +0 -4
  15. package/dist/contracts/dist/client/react/index.js +0 -4
  16. package/dist/contracts/dist/contract-registry/index.js +0 -1
  17. package/dist/contracts/dist/contract-registry/schemas.js +0 -60
  18. package/dist/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
  19. package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -16
  20. package/dist/contracts/dist/docs/index.js +0 -29
  21. package/dist/contracts/dist/docs/presentations.js +0 -71
  22. package/dist/contracts/dist/docs/registry.js +0 -44
  23. package/dist/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
  24. package/dist/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
  25. package/dist/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
  26. package/dist/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
  27. package/dist/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
  28. package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -80
  29. package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -57
  30. package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -16
  31. package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -357
  32. package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -37
  33. package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -16
  34. package/dist/contracts/dist/docs/tech/schema/README.docblock.js +0 -20
  35. package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -48
  36. package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -79
  37. package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -84
  38. package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -45
  39. package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -67
  40. package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -40
  41. package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -69
  42. package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -47
  43. package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -62
  44. package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -155
  45. package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -20
  46. package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -101
  47. package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -20
  48. package/dist/contracts/dist/events.js +0 -10
  49. package/dist/contracts/dist/experiments/evaluator.js +0 -1
  50. package/dist/contracts/dist/index.js +0 -71
  51. package/dist/contracts/dist/install.js +0 -2
  52. package/dist/contracts/dist/integrations/contracts.js +0 -377
  53. package/dist/contracts/dist/integrations/index.js +0 -18
  54. package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
  55. package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
  56. package/dist/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
  57. package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
  58. package/dist/contracts/dist/integrations/openbanking/models.js +0 -242
  59. package/dist/contracts/dist/integrations/openbanking/telemetry.js +0 -13
  60. package/dist/contracts/dist/integrations/providers/elevenlabs.js +0 -52
  61. package/dist/contracts/dist/integrations/providers/gcs-storage.js +0 -75
  62. package/dist/contracts/dist/integrations/providers/gmail.js +0 -87
  63. package/dist/contracts/dist/integrations/providers/google-calendar.js +0 -66
  64. package/dist/contracts/dist/integrations/providers/index.js +0 -11
  65. package/dist/contracts/dist/integrations/providers/mistral.js +0 -68
  66. package/dist/contracts/dist/integrations/providers/postmark.js +0 -68
  67. package/dist/contracts/dist/integrations/providers/powens.js +0 -116
  68. package/dist/contracts/dist/integrations/providers/qdrant.js +0 -73
  69. package/dist/contracts/dist/integrations/providers/registry.js +0 -10
  70. package/dist/contracts/dist/integrations/providers/stripe.js +0 -83
  71. package/dist/contracts/dist/integrations/providers/twilio-sms.js +0 -61
  72. package/dist/contracts/dist/jsonschema.js +0 -1
  73. package/dist/contracts/dist/knowledge/contracts.js +0 -306
  74. package/dist/contracts/dist/knowledge/index.js +0 -7
  75. package/dist/contracts/dist/knowledge/spaces/email-threads.js +0 -34
  76. package/dist/contracts/dist/knowledge/spaces/financial-docs.js +0 -34
  77. package/dist/contracts/dist/knowledge/spaces/financial-overview.js +0 -38
  78. package/dist/contracts/dist/knowledge/spaces/index.js +0 -6
  79. package/dist/contracts/dist/knowledge/spaces/product-canon.js +0 -34
  80. package/dist/contracts/dist/knowledge/spaces/support-faq.js +0 -37
  81. package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -34
  82. package/dist/contracts/dist/llm/exporters.js +0 -19
  83. package/dist/contracts/dist/llm/index.js +0 -2
  84. package/dist/contracts/dist/llm/prompts.js +0 -1
  85. package/dist/contracts/dist/onboarding-base.js +0 -196
  86. package/dist/contracts/dist/openapi.js +0 -1
  87. package/dist/contracts/dist/ownership.js +0 -21
  88. package/dist/contracts/dist/presentations.js +0 -1
  89. package/dist/contracts/dist/presentations.v2.js +0 -11
  90. package/dist/contracts/dist/prompt.js +0 -1
  91. package/dist/contracts/dist/promptRegistry.js +0 -1
  92. package/dist/contracts/dist/regenerator/index.js +0 -1
  93. package/dist/contracts/dist/regenerator/service.js +0 -6
  94. package/dist/contracts/dist/registry.js +0 -2
  95. package/dist/contracts/dist/resources.js +0 -1
  96. package/dist/contracts/dist/schema/dist/EnumType.js +0 -2
  97. package/dist/contracts/dist/schema/dist/FieldType.js +0 -49
  98. package/dist/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
  99. package/dist/contracts/dist/schema/dist/SchemaModel.js +0 -34
  100. package/dist/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
  101. package/dist/contracts/dist/schema/dist/entity/index.js +0 -2
  102. package/dist/contracts/dist/schema/dist/entity/types.js +0 -1
  103. package/dist/contracts/dist/schema/dist/index.js +0 -6
  104. package/dist/contracts/dist/server/graphql-pothos.js +0 -6
  105. package/dist/contracts/dist/server/index.js +0 -8
  106. package/dist/contracts/dist/server/mcp/createMcpServer.js +0 -4
  107. package/dist/contracts/dist/server/mcp/registerPresentations.js +0 -2
  108. package/dist/contracts/dist/server/mcp/registerPrompts.js +0 -1
  109. package/dist/contracts/dist/server/mcp/registerResources.js +0 -2
  110. package/dist/contracts/dist/server/mcp/registerTools.js +0 -1
  111. package/dist/contracts/dist/server/provider-mcp.js +0 -1
  112. package/dist/contracts/dist/server/rest-elysia.js +0 -1
  113. package/dist/contracts/dist/server/rest-express.js +0 -1
  114. package/dist/contracts/dist/server/rest-generic.js +0 -1
  115. package/dist/contracts/dist/server/rest-next-app.js +0 -1
  116. package/dist/contracts/dist/server/rest-next-pages.js +0 -1
  117. package/dist/contracts/dist/spec.js +0 -34
  118. package/dist/contracts/dist/telemetry/index.js +0 -1
  119. package/dist/contracts/dist/telemetry/tracker.js +0 -1
  120. package/dist/contracts/dist/tests/index.js +0 -1
  121. package/dist/contracts/dist/tests/runner.js +0 -2
  122. package/dist/contracts/dist/workflow/index.js +0 -1
  123. package/dist/contracts/dist/workflow/runner.js +0 -1
  124. package/dist/contracts/index.d.ts +0 -1138
  125. package/dist/docs/index.d.ts +0 -1
  126. package/dist/docs/metering.docblock.d.ts +0 -1
  127. package/dist/entities/index.d.ts +0 -230
  128. package/dist/events.d.ts +0 -539
  129. package/dist/index.d.ts +0 -6
  130. package/dist/metering.feature.d.ts +0 -11
  131. package/dist/schema/dist/EnumType.js +0 -2
  132. package/dist/schema/dist/FieldType.js +0 -49
  133. package/dist/schema/dist/ScalarTypeEnum.js +0 -236
  134. package/dist/schema/dist/SchemaModel.js +0 -39
  135. package/dist/schema/dist/entity/defineEntity.js +0 -236
  136. package/dist/schema/dist/entity/index.js +0 -2
  137. package/dist/schema/dist/entity/types.js +0 -1
  138. package/dist/schema/dist/index.js +0 -6
package/dist/events.d.ts DELETED
@@ -1,539 +0,0 @@
1
- import * as _lssm_lib_schema0 from "@lssm/lib.schema";
2
- import * as _lssm_lib_contracts0 from "@lssm/lib.contracts";
3
-
4
- //#region src/events.d.ts
5
- /**
6
- * Emitted when a metric is defined.
7
- */
8
- declare const MetricDefinedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
9
- metricId: {
10
- type: _lssm_lib_schema0.FieldType<string, string>;
11
- isOptional: false;
12
- };
13
- key: {
14
- type: _lssm_lib_schema0.FieldType<string, string>;
15
- isOptional: false;
16
- };
17
- name: {
18
- type: _lssm_lib_schema0.FieldType<string, string>;
19
- isOptional: false;
20
- };
21
- unit: {
22
- type: _lssm_lib_schema0.FieldType<string, string>;
23
- isOptional: false;
24
- };
25
- aggregationType: {
26
- type: _lssm_lib_schema0.FieldType<string, string>;
27
- isOptional: false;
28
- };
29
- orgId: {
30
- type: _lssm_lib_schema0.FieldType<string, string>;
31
- isOptional: true;
32
- };
33
- createdBy: {
34
- type: _lssm_lib_schema0.FieldType<string, string>;
35
- isOptional: true;
36
- };
37
- createdAt: {
38
- type: _lssm_lib_schema0.FieldType<Date, string>;
39
- isOptional: false;
40
- };
41
- }>>;
42
- /**
43
- * Emitted when a metric is updated.
44
- */
45
- declare const MetricUpdatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
46
- metricId: {
47
- type: _lssm_lib_schema0.FieldType<string, string>;
48
- isOptional: false;
49
- };
50
- key: {
51
- type: _lssm_lib_schema0.FieldType<string, string>;
52
- isOptional: false;
53
- };
54
- changes: {
55
- type: _lssm_lib_schema0.FieldType<unknown, unknown>;
56
- isOptional: false;
57
- };
58
- updatedBy: {
59
- type: _lssm_lib_schema0.FieldType<string, string>;
60
- isOptional: true;
61
- };
62
- updatedAt: {
63
- type: _lssm_lib_schema0.FieldType<Date, string>;
64
- isOptional: false;
65
- };
66
- }>>;
67
- /**
68
- * Emitted when usage is recorded.
69
- */
70
- declare const UsageRecordedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
71
- recordId: {
72
- type: _lssm_lib_schema0.FieldType<string, string>;
73
- isOptional: false;
74
- };
75
- metricKey: {
76
- type: _lssm_lib_schema0.FieldType<string, string>;
77
- isOptional: false;
78
- };
79
- subjectType: {
80
- type: _lssm_lib_schema0.FieldType<string, string>;
81
- isOptional: false;
82
- };
83
- subjectId: {
84
- type: _lssm_lib_schema0.FieldType<string, string>;
85
- isOptional: false;
86
- };
87
- quantity: {
88
- type: _lssm_lib_schema0.FieldType<number, number>;
89
- isOptional: false;
90
- };
91
- source: {
92
- type: _lssm_lib_schema0.FieldType<string, string>;
93
- isOptional: true;
94
- };
95
- timestamp: {
96
- type: _lssm_lib_schema0.FieldType<Date, string>;
97
- isOptional: false;
98
- };
99
- }>>;
100
- /**
101
- * Emitted when a batch of usage is recorded.
102
- */
103
- declare const UsageBatchRecordedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
104
- recordCount: {
105
- type: _lssm_lib_schema0.FieldType<number, number>;
106
- isOptional: false;
107
- };
108
- metricKeys: {
109
- type: _lssm_lib_schema0.FieldType<unknown, unknown>;
110
- isOptional: false;
111
- };
112
- totalQuantity: {
113
- type: _lssm_lib_schema0.FieldType<number, number>;
114
- isOptional: false;
115
- };
116
- timestamp: {
117
- type: _lssm_lib_schema0.FieldType<Date, string>;
118
- isOptional: false;
119
- };
120
- }>>;
121
- /**
122
- * Emitted when usage is aggregated.
123
- */
124
- declare const UsageAggregatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
125
- summaryId: {
126
- type: _lssm_lib_schema0.FieldType<string, string>;
127
- isOptional: false;
128
- };
129
- metricKey: {
130
- type: _lssm_lib_schema0.FieldType<string, string>;
131
- isOptional: false;
132
- };
133
- subjectType: {
134
- type: _lssm_lib_schema0.FieldType<string, string>;
135
- isOptional: false;
136
- };
137
- subjectId: {
138
- type: _lssm_lib_schema0.FieldType<string, string>;
139
- isOptional: false;
140
- };
141
- periodType: {
142
- type: _lssm_lib_schema0.FieldType<string, string>;
143
- isOptional: false;
144
- };
145
- periodStart: {
146
- type: _lssm_lib_schema0.FieldType<Date, string>;
147
- isOptional: false;
148
- };
149
- periodEnd: {
150
- type: _lssm_lib_schema0.FieldType<Date, string>;
151
- isOptional: false;
152
- };
153
- totalQuantity: {
154
- type: _lssm_lib_schema0.FieldType<number, number>;
155
- isOptional: false;
156
- };
157
- recordCount: {
158
- type: _lssm_lib_schema0.FieldType<number, number>;
159
- isOptional: false;
160
- };
161
- aggregatedAt: {
162
- type: _lssm_lib_schema0.FieldType<Date, string>;
163
- isOptional: false;
164
- };
165
- }>>;
166
- /**
167
- * Emitted when a threshold is created.
168
- */
169
- declare const ThresholdCreatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
170
- thresholdId: {
171
- type: _lssm_lib_schema0.FieldType<string, string>;
172
- isOptional: false;
173
- };
174
- metricKey: {
175
- type: _lssm_lib_schema0.FieldType<string, string>;
176
- isOptional: false;
177
- };
178
- subjectType: {
179
- type: _lssm_lib_schema0.FieldType<string, string>;
180
- isOptional: true;
181
- };
182
- subjectId: {
183
- type: _lssm_lib_schema0.FieldType<string, string>;
184
- isOptional: true;
185
- };
186
- threshold: {
187
- type: _lssm_lib_schema0.FieldType<number, number>;
188
- isOptional: false;
189
- };
190
- action: {
191
- type: _lssm_lib_schema0.FieldType<string, string>;
192
- isOptional: false;
193
- };
194
- createdAt: {
195
- type: _lssm_lib_schema0.FieldType<Date, string>;
196
- isOptional: false;
197
- };
198
- }>>;
199
- /**
200
- * Emitted when a threshold is exceeded.
201
- */
202
- declare const ThresholdExceededEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
203
- alertId: {
204
- type: _lssm_lib_schema0.FieldType<string, string>;
205
- isOptional: false;
206
- };
207
- thresholdId: {
208
- type: _lssm_lib_schema0.FieldType<string, string>;
209
- isOptional: false;
210
- };
211
- metricKey: {
212
- type: _lssm_lib_schema0.FieldType<string, string>;
213
- isOptional: false;
214
- };
215
- subjectType: {
216
- type: _lssm_lib_schema0.FieldType<string, string>;
217
- isOptional: true;
218
- };
219
- subjectId: {
220
- type: _lssm_lib_schema0.FieldType<string, string>;
221
- isOptional: true;
222
- };
223
- threshold: {
224
- type: _lssm_lib_schema0.FieldType<number, number>;
225
- isOptional: false;
226
- };
227
- actualValue: {
228
- type: _lssm_lib_schema0.FieldType<number, number>;
229
- isOptional: false;
230
- };
231
- percentageUsed: {
232
- type: _lssm_lib_schema0.FieldType<number, number>;
233
- isOptional: false;
234
- };
235
- action: {
236
- type: _lssm_lib_schema0.FieldType<string, string>;
237
- isOptional: false;
238
- };
239
- triggeredAt: {
240
- type: _lssm_lib_schema0.FieldType<Date, string>;
241
- isOptional: false;
242
- };
243
- }>>;
244
- /**
245
- * Emitted when usage is approaching a threshold.
246
- */
247
- declare const ThresholdApproachingEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
248
- thresholdId: {
249
- type: _lssm_lib_schema0.FieldType<string, string>;
250
- isOptional: false;
251
- };
252
- metricKey: {
253
- type: _lssm_lib_schema0.FieldType<string, string>;
254
- isOptional: false;
255
- };
256
- subjectType: {
257
- type: _lssm_lib_schema0.FieldType<string, string>;
258
- isOptional: true;
259
- };
260
- subjectId: {
261
- type: _lssm_lib_schema0.FieldType<string, string>;
262
- isOptional: true;
263
- };
264
- threshold: {
265
- type: _lssm_lib_schema0.FieldType<number, number>;
266
- isOptional: false;
267
- };
268
- currentValue: {
269
- type: _lssm_lib_schema0.FieldType<number, number>;
270
- isOptional: false;
271
- };
272
- percentageUsed: {
273
- type: _lssm_lib_schema0.FieldType<number, number>;
274
- isOptional: false;
275
- };
276
- triggeredAt: {
277
- type: _lssm_lib_schema0.FieldType<Date, string>;
278
- isOptional: false;
279
- };
280
- }>>;
281
- /**
282
- * All metering events.
283
- */
284
- declare const MeteringEvents: {
285
- MetricDefinedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
286
- metricId: {
287
- type: _lssm_lib_schema0.FieldType<string, string>;
288
- isOptional: false;
289
- };
290
- key: {
291
- type: _lssm_lib_schema0.FieldType<string, string>;
292
- isOptional: false;
293
- };
294
- name: {
295
- type: _lssm_lib_schema0.FieldType<string, string>;
296
- isOptional: false;
297
- };
298
- unit: {
299
- type: _lssm_lib_schema0.FieldType<string, string>;
300
- isOptional: false;
301
- };
302
- aggregationType: {
303
- type: _lssm_lib_schema0.FieldType<string, string>;
304
- isOptional: false;
305
- };
306
- orgId: {
307
- type: _lssm_lib_schema0.FieldType<string, string>;
308
- isOptional: true;
309
- };
310
- createdBy: {
311
- type: _lssm_lib_schema0.FieldType<string, string>;
312
- isOptional: true;
313
- };
314
- createdAt: {
315
- type: _lssm_lib_schema0.FieldType<Date, string>;
316
- isOptional: false;
317
- };
318
- }>>;
319
- MetricUpdatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
320
- metricId: {
321
- type: _lssm_lib_schema0.FieldType<string, string>;
322
- isOptional: false;
323
- };
324
- key: {
325
- type: _lssm_lib_schema0.FieldType<string, string>;
326
- isOptional: false;
327
- };
328
- changes: {
329
- type: _lssm_lib_schema0.FieldType<unknown, unknown>;
330
- isOptional: false;
331
- };
332
- updatedBy: {
333
- type: _lssm_lib_schema0.FieldType<string, string>;
334
- isOptional: true;
335
- };
336
- updatedAt: {
337
- type: _lssm_lib_schema0.FieldType<Date, string>;
338
- isOptional: false;
339
- };
340
- }>>;
341
- UsageRecordedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
342
- recordId: {
343
- type: _lssm_lib_schema0.FieldType<string, string>;
344
- isOptional: false;
345
- };
346
- metricKey: {
347
- type: _lssm_lib_schema0.FieldType<string, string>;
348
- isOptional: false;
349
- };
350
- subjectType: {
351
- type: _lssm_lib_schema0.FieldType<string, string>;
352
- isOptional: false;
353
- };
354
- subjectId: {
355
- type: _lssm_lib_schema0.FieldType<string, string>;
356
- isOptional: false;
357
- };
358
- quantity: {
359
- type: _lssm_lib_schema0.FieldType<number, number>;
360
- isOptional: false;
361
- };
362
- source: {
363
- type: _lssm_lib_schema0.FieldType<string, string>;
364
- isOptional: true;
365
- };
366
- timestamp: {
367
- type: _lssm_lib_schema0.FieldType<Date, string>;
368
- isOptional: false;
369
- };
370
- }>>;
371
- UsageBatchRecordedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
372
- recordCount: {
373
- type: _lssm_lib_schema0.FieldType<number, number>;
374
- isOptional: false;
375
- };
376
- metricKeys: {
377
- type: _lssm_lib_schema0.FieldType<unknown, unknown>;
378
- isOptional: false;
379
- };
380
- totalQuantity: {
381
- type: _lssm_lib_schema0.FieldType<number, number>;
382
- isOptional: false;
383
- };
384
- timestamp: {
385
- type: _lssm_lib_schema0.FieldType<Date, string>;
386
- isOptional: false;
387
- };
388
- }>>;
389
- UsageAggregatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
390
- summaryId: {
391
- type: _lssm_lib_schema0.FieldType<string, string>;
392
- isOptional: false;
393
- };
394
- metricKey: {
395
- type: _lssm_lib_schema0.FieldType<string, string>;
396
- isOptional: false;
397
- };
398
- subjectType: {
399
- type: _lssm_lib_schema0.FieldType<string, string>;
400
- isOptional: false;
401
- };
402
- subjectId: {
403
- type: _lssm_lib_schema0.FieldType<string, string>;
404
- isOptional: false;
405
- };
406
- periodType: {
407
- type: _lssm_lib_schema0.FieldType<string, string>;
408
- isOptional: false;
409
- };
410
- periodStart: {
411
- type: _lssm_lib_schema0.FieldType<Date, string>;
412
- isOptional: false;
413
- };
414
- periodEnd: {
415
- type: _lssm_lib_schema0.FieldType<Date, string>;
416
- isOptional: false;
417
- };
418
- totalQuantity: {
419
- type: _lssm_lib_schema0.FieldType<number, number>;
420
- isOptional: false;
421
- };
422
- recordCount: {
423
- type: _lssm_lib_schema0.FieldType<number, number>;
424
- isOptional: false;
425
- };
426
- aggregatedAt: {
427
- type: _lssm_lib_schema0.FieldType<Date, string>;
428
- isOptional: false;
429
- };
430
- }>>;
431
- ThresholdCreatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
432
- thresholdId: {
433
- type: _lssm_lib_schema0.FieldType<string, string>;
434
- isOptional: false;
435
- };
436
- metricKey: {
437
- type: _lssm_lib_schema0.FieldType<string, string>;
438
- isOptional: false;
439
- };
440
- subjectType: {
441
- type: _lssm_lib_schema0.FieldType<string, string>;
442
- isOptional: true;
443
- };
444
- subjectId: {
445
- type: _lssm_lib_schema0.FieldType<string, string>;
446
- isOptional: true;
447
- };
448
- threshold: {
449
- type: _lssm_lib_schema0.FieldType<number, number>;
450
- isOptional: false;
451
- };
452
- action: {
453
- type: _lssm_lib_schema0.FieldType<string, string>;
454
- isOptional: false;
455
- };
456
- createdAt: {
457
- type: _lssm_lib_schema0.FieldType<Date, string>;
458
- isOptional: false;
459
- };
460
- }>>;
461
- ThresholdExceededEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
462
- alertId: {
463
- type: _lssm_lib_schema0.FieldType<string, string>;
464
- isOptional: false;
465
- };
466
- thresholdId: {
467
- type: _lssm_lib_schema0.FieldType<string, string>;
468
- isOptional: false;
469
- };
470
- metricKey: {
471
- type: _lssm_lib_schema0.FieldType<string, string>;
472
- isOptional: false;
473
- };
474
- subjectType: {
475
- type: _lssm_lib_schema0.FieldType<string, string>;
476
- isOptional: true;
477
- };
478
- subjectId: {
479
- type: _lssm_lib_schema0.FieldType<string, string>;
480
- isOptional: true;
481
- };
482
- threshold: {
483
- type: _lssm_lib_schema0.FieldType<number, number>;
484
- isOptional: false;
485
- };
486
- actualValue: {
487
- type: _lssm_lib_schema0.FieldType<number, number>;
488
- isOptional: false;
489
- };
490
- percentageUsed: {
491
- type: _lssm_lib_schema0.FieldType<number, number>;
492
- isOptional: false;
493
- };
494
- action: {
495
- type: _lssm_lib_schema0.FieldType<string, string>;
496
- isOptional: false;
497
- };
498
- triggeredAt: {
499
- type: _lssm_lib_schema0.FieldType<Date, string>;
500
- isOptional: false;
501
- };
502
- }>>;
503
- ThresholdApproachingEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema0.SchemaModel<{
504
- thresholdId: {
505
- type: _lssm_lib_schema0.FieldType<string, string>;
506
- isOptional: false;
507
- };
508
- metricKey: {
509
- type: _lssm_lib_schema0.FieldType<string, string>;
510
- isOptional: false;
511
- };
512
- subjectType: {
513
- type: _lssm_lib_schema0.FieldType<string, string>;
514
- isOptional: true;
515
- };
516
- subjectId: {
517
- type: _lssm_lib_schema0.FieldType<string, string>;
518
- isOptional: true;
519
- };
520
- threshold: {
521
- type: _lssm_lib_schema0.FieldType<number, number>;
522
- isOptional: false;
523
- };
524
- currentValue: {
525
- type: _lssm_lib_schema0.FieldType<number, number>;
526
- isOptional: false;
527
- };
528
- percentageUsed: {
529
- type: _lssm_lib_schema0.FieldType<number, number>;
530
- isOptional: false;
531
- };
532
- triggeredAt: {
533
- type: _lssm_lib_schema0.FieldType<Date, string>;
534
- isOptional: false;
535
- };
536
- }>>;
537
- };
538
- //#endregion
539
- export { MeteringEvents, MetricDefinedEvent, MetricUpdatedEvent, ThresholdApproachingEvent, ThresholdCreatedEvent, ThresholdExceededEvent, UsageAggregatedEvent, UsageBatchRecordedEvent, UsageRecordedEvent };
package/dist/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { AggregateParams, AggregationError, AggregationOptions, AggregationResult, AggregationType, InMemoryUsageStorage, MetricDefinition, PeriodType, UsageAggregator, UsageRecord, UsageStorage, UsageSummary, formatPeriodKey, getPeriodEnd, getPeriodStart } from "./aggregation/index.js";
2
- import { CreateThresholdContract, DefineMetricContract, DeleteMetricContract, DeleteThresholdContract, GetMetricContract, GetUsageContract, GetUsageSummaryContract, ListMetricsContract, ListThresholdsContract, MetricDefinitionModel, RecordBatchUsageContract, RecordUsageContract, UpdateMetricContract, UpdateThresholdContract, UsageRecordModel, UsageSummaryModel, UsageThresholdModel } from "./contracts/index.js";
3
- import { AggregationTypeEnum, MetricDefinitionEntity, PeriodTypeEnum, ResetPeriodEnum, ThresholdActionEnum, UsageAlertEntity, UsageRecordEntity, UsageSummaryEntity, UsageThresholdEntity, meteringEntities, meteringSchemaContribution } from "./entities/index.js";
4
- import { MeteringEvents, MetricDefinedEvent, MetricUpdatedEvent, ThresholdApproachingEvent, ThresholdCreatedEvent, ThresholdExceededEvent, UsageAggregatedEvent, UsageBatchRecordedEvent, UsageRecordedEvent } from "./events.js";
5
- import { MeteringFeature } from "./metering.feature.js";
6
- export { AggregateParams, AggregationError, AggregationOptions, AggregationResult, AggregationType, AggregationTypeEnum, CreateThresholdContract, DefineMetricContract, DeleteMetricContract, DeleteThresholdContract, GetMetricContract, GetUsageContract, GetUsageSummaryContract, InMemoryUsageStorage, ListMetricsContract, ListThresholdsContract, MeteringEvents, MeteringFeature, MetricDefinedEvent, MetricDefinition, MetricDefinitionEntity, MetricDefinitionModel, MetricUpdatedEvent, PeriodType, PeriodTypeEnum, RecordBatchUsageContract, RecordUsageContract, ResetPeriodEnum, ThresholdActionEnum, ThresholdApproachingEvent, ThresholdCreatedEvent, ThresholdExceededEvent, UpdateMetricContract, UpdateThresholdContract, UsageAggregatedEvent, UsageAggregator, UsageAlertEntity, UsageBatchRecordedEvent, UsageRecord, UsageRecordEntity, UsageRecordModel, UsageRecordedEvent, UsageStorage, UsageSummary, UsageSummaryEntity, UsageSummaryModel, UsageThresholdEntity, UsageThresholdModel, formatPeriodKey, getPeriodEnd, getPeriodStart, meteringEntities, meteringSchemaContribution };
@@ -1,11 +0,0 @@
1
- import { FeatureModuleSpec } from "@lssm/lib.contracts";
2
-
3
- //#region src/metering.feature.d.ts
4
-
5
- /**
6
- * Metering feature module that bundles metric definitions,
7
- * usage tracking, and threshold alerting capabilities.
8
- */
9
- declare const MeteringFeature: FeatureModuleSpec;
10
- //#endregion
11
- export { MeteringFeature };
@@ -1,2 +0,0 @@
1
- import "zod";
2
- import "graphql";
@@ -1,49 +0,0 @@
1
- import "zod";
2
- import { GraphQLScalarType } from "graphql";
3
-
4
- //#region ../schema/dist/FieldType.js
5
- /**
6
- * GraphQL scalar wrapper that carries zod and JSON Schema metadata.
7
- *
8
- * TInternal is the runtime representation; TExternal is the GraphQL output.
9
- */
10
- var FieldType = class extends GraphQLScalarType {
11
- zodSchema;
12
- jsonSchemaDef;
13
- constructor(config) {
14
- super(config);
15
- this.zodSchema = config.zod;
16
- this.jsonSchemaDef = config.jsonSchema;
17
- }
18
- /** Return the attached zod schema for validation. */
19
- getZod() {
20
- return this.zodSchema;
21
- }
22
- /** GraphQL scalar instance usable by Pothos or vanilla GraphQL. */
23
- getPothos() {
24
- return this;
25
- }
26
- /** Return the JSON Schema (evaluates factory if provided). */
27
- getJson() {
28
- return typeof this.jsonSchemaDef === "function" ? this.jsonSchemaDef() : this.jsonSchemaDef;
29
- }
30
- getJsonSchemaDef() {
31
- return this.jsonSchemaDef;
32
- }
33
- getJsonSchema() {
34
- const deepResolve = (v) => {
35
- const value = typeof v === "function" ? v() : v;
36
- if (Array.isArray(value)) return value.map((item) => deepResolve(item));
37
- if (value && typeof value === "object") {
38
- const obj = {};
39
- for (const [k, val] of Object.entries(value)) obj[k] = deepResolve(val);
40
- return obj;
41
- }
42
- return value;
43
- };
44
- return deepResolve(this.getJson());
45
- }
46
- };
47
-
48
- //#endregion
49
- export { FieldType };