@lssm/lib.metering 0.0.0-canary-20251217054315 → 0.0.0-canary-20251217060804
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/aggregation/index.d.ts +155 -0
- package/dist/contracts/index.d.ts +1138 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/metering.docblock.d.ts +1 -0
- package/dist/entities/index.d.ts +230 -0
- package/dist/events.d.ts +539 -0
- package/dist/index.d.ts +6 -0
- package/dist/metering.feature.d.ts +11 -0
- package/package.json +13 -13
package/dist/events.d.ts
ADDED
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import * as _lssm_lib_schema183 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_schema183.SchemaModel<{
|
|
9
|
+
metricId: {
|
|
10
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
11
|
+
isOptional: false;
|
|
12
|
+
};
|
|
13
|
+
key: {
|
|
14
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
15
|
+
isOptional: false;
|
|
16
|
+
};
|
|
17
|
+
name: {
|
|
18
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
19
|
+
isOptional: false;
|
|
20
|
+
};
|
|
21
|
+
unit: {
|
|
22
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
23
|
+
isOptional: false;
|
|
24
|
+
};
|
|
25
|
+
aggregationType: {
|
|
26
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
27
|
+
isOptional: false;
|
|
28
|
+
};
|
|
29
|
+
orgId: {
|
|
30
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
31
|
+
isOptional: true;
|
|
32
|
+
};
|
|
33
|
+
createdBy: {
|
|
34
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
35
|
+
isOptional: true;
|
|
36
|
+
};
|
|
37
|
+
createdAt: {
|
|
38
|
+
type: _lssm_lib_schema183.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_schema183.SchemaModel<{
|
|
46
|
+
metricId: {
|
|
47
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
key: {
|
|
51
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
changes: {
|
|
55
|
+
type: _lssm_lib_schema183.FieldType<unknown, unknown>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
updatedBy: {
|
|
59
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
60
|
+
isOptional: true;
|
|
61
|
+
};
|
|
62
|
+
updatedAt: {
|
|
63
|
+
type: _lssm_lib_schema183.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_schema183.SchemaModel<{
|
|
71
|
+
recordId: {
|
|
72
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
73
|
+
isOptional: false;
|
|
74
|
+
};
|
|
75
|
+
metricKey: {
|
|
76
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
77
|
+
isOptional: false;
|
|
78
|
+
};
|
|
79
|
+
subjectType: {
|
|
80
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
81
|
+
isOptional: false;
|
|
82
|
+
};
|
|
83
|
+
subjectId: {
|
|
84
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
85
|
+
isOptional: false;
|
|
86
|
+
};
|
|
87
|
+
quantity: {
|
|
88
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
89
|
+
isOptional: false;
|
|
90
|
+
};
|
|
91
|
+
source: {
|
|
92
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
93
|
+
isOptional: true;
|
|
94
|
+
};
|
|
95
|
+
timestamp: {
|
|
96
|
+
type: _lssm_lib_schema183.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_schema183.SchemaModel<{
|
|
104
|
+
recordCount: {
|
|
105
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
106
|
+
isOptional: false;
|
|
107
|
+
};
|
|
108
|
+
metricKeys: {
|
|
109
|
+
type: _lssm_lib_schema183.FieldType<unknown, unknown>;
|
|
110
|
+
isOptional: false;
|
|
111
|
+
};
|
|
112
|
+
totalQuantity: {
|
|
113
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
114
|
+
isOptional: false;
|
|
115
|
+
};
|
|
116
|
+
timestamp: {
|
|
117
|
+
type: _lssm_lib_schema183.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_schema183.SchemaModel<{
|
|
125
|
+
summaryId: {
|
|
126
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
127
|
+
isOptional: false;
|
|
128
|
+
};
|
|
129
|
+
metricKey: {
|
|
130
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
131
|
+
isOptional: false;
|
|
132
|
+
};
|
|
133
|
+
subjectType: {
|
|
134
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
135
|
+
isOptional: false;
|
|
136
|
+
};
|
|
137
|
+
subjectId: {
|
|
138
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
139
|
+
isOptional: false;
|
|
140
|
+
};
|
|
141
|
+
periodType: {
|
|
142
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
143
|
+
isOptional: false;
|
|
144
|
+
};
|
|
145
|
+
periodStart: {
|
|
146
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
147
|
+
isOptional: false;
|
|
148
|
+
};
|
|
149
|
+
periodEnd: {
|
|
150
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
151
|
+
isOptional: false;
|
|
152
|
+
};
|
|
153
|
+
totalQuantity: {
|
|
154
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
155
|
+
isOptional: false;
|
|
156
|
+
};
|
|
157
|
+
recordCount: {
|
|
158
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
159
|
+
isOptional: false;
|
|
160
|
+
};
|
|
161
|
+
aggregatedAt: {
|
|
162
|
+
type: _lssm_lib_schema183.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_schema183.SchemaModel<{
|
|
170
|
+
thresholdId: {
|
|
171
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
172
|
+
isOptional: false;
|
|
173
|
+
};
|
|
174
|
+
metricKey: {
|
|
175
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
176
|
+
isOptional: false;
|
|
177
|
+
};
|
|
178
|
+
subjectType: {
|
|
179
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
180
|
+
isOptional: true;
|
|
181
|
+
};
|
|
182
|
+
subjectId: {
|
|
183
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
184
|
+
isOptional: true;
|
|
185
|
+
};
|
|
186
|
+
threshold: {
|
|
187
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
188
|
+
isOptional: false;
|
|
189
|
+
};
|
|
190
|
+
action: {
|
|
191
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
192
|
+
isOptional: false;
|
|
193
|
+
};
|
|
194
|
+
createdAt: {
|
|
195
|
+
type: _lssm_lib_schema183.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_schema183.SchemaModel<{
|
|
203
|
+
alertId: {
|
|
204
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
205
|
+
isOptional: false;
|
|
206
|
+
};
|
|
207
|
+
thresholdId: {
|
|
208
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
209
|
+
isOptional: false;
|
|
210
|
+
};
|
|
211
|
+
metricKey: {
|
|
212
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
213
|
+
isOptional: false;
|
|
214
|
+
};
|
|
215
|
+
subjectType: {
|
|
216
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
217
|
+
isOptional: true;
|
|
218
|
+
};
|
|
219
|
+
subjectId: {
|
|
220
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
221
|
+
isOptional: true;
|
|
222
|
+
};
|
|
223
|
+
threshold: {
|
|
224
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
225
|
+
isOptional: false;
|
|
226
|
+
};
|
|
227
|
+
actualValue: {
|
|
228
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
229
|
+
isOptional: false;
|
|
230
|
+
};
|
|
231
|
+
percentageUsed: {
|
|
232
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
233
|
+
isOptional: false;
|
|
234
|
+
};
|
|
235
|
+
action: {
|
|
236
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
237
|
+
isOptional: false;
|
|
238
|
+
};
|
|
239
|
+
triggeredAt: {
|
|
240
|
+
type: _lssm_lib_schema183.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_schema183.SchemaModel<{
|
|
248
|
+
thresholdId: {
|
|
249
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
250
|
+
isOptional: false;
|
|
251
|
+
};
|
|
252
|
+
metricKey: {
|
|
253
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
254
|
+
isOptional: false;
|
|
255
|
+
};
|
|
256
|
+
subjectType: {
|
|
257
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
258
|
+
isOptional: true;
|
|
259
|
+
};
|
|
260
|
+
subjectId: {
|
|
261
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
262
|
+
isOptional: true;
|
|
263
|
+
};
|
|
264
|
+
threshold: {
|
|
265
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
266
|
+
isOptional: false;
|
|
267
|
+
};
|
|
268
|
+
currentValue: {
|
|
269
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
270
|
+
isOptional: false;
|
|
271
|
+
};
|
|
272
|
+
percentageUsed: {
|
|
273
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
274
|
+
isOptional: false;
|
|
275
|
+
};
|
|
276
|
+
triggeredAt: {
|
|
277
|
+
type: _lssm_lib_schema183.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_schema183.SchemaModel<{
|
|
286
|
+
metricId: {
|
|
287
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
288
|
+
isOptional: false;
|
|
289
|
+
};
|
|
290
|
+
key: {
|
|
291
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
292
|
+
isOptional: false;
|
|
293
|
+
};
|
|
294
|
+
name: {
|
|
295
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
296
|
+
isOptional: false;
|
|
297
|
+
};
|
|
298
|
+
unit: {
|
|
299
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
300
|
+
isOptional: false;
|
|
301
|
+
};
|
|
302
|
+
aggregationType: {
|
|
303
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
304
|
+
isOptional: false;
|
|
305
|
+
};
|
|
306
|
+
orgId: {
|
|
307
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
308
|
+
isOptional: true;
|
|
309
|
+
};
|
|
310
|
+
createdBy: {
|
|
311
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
312
|
+
isOptional: true;
|
|
313
|
+
};
|
|
314
|
+
createdAt: {
|
|
315
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
316
|
+
isOptional: false;
|
|
317
|
+
};
|
|
318
|
+
}>>;
|
|
319
|
+
MetricUpdatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema183.SchemaModel<{
|
|
320
|
+
metricId: {
|
|
321
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
322
|
+
isOptional: false;
|
|
323
|
+
};
|
|
324
|
+
key: {
|
|
325
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
326
|
+
isOptional: false;
|
|
327
|
+
};
|
|
328
|
+
changes: {
|
|
329
|
+
type: _lssm_lib_schema183.FieldType<unknown, unknown>;
|
|
330
|
+
isOptional: false;
|
|
331
|
+
};
|
|
332
|
+
updatedBy: {
|
|
333
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
334
|
+
isOptional: true;
|
|
335
|
+
};
|
|
336
|
+
updatedAt: {
|
|
337
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
338
|
+
isOptional: false;
|
|
339
|
+
};
|
|
340
|
+
}>>;
|
|
341
|
+
UsageRecordedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema183.SchemaModel<{
|
|
342
|
+
recordId: {
|
|
343
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
344
|
+
isOptional: false;
|
|
345
|
+
};
|
|
346
|
+
metricKey: {
|
|
347
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
348
|
+
isOptional: false;
|
|
349
|
+
};
|
|
350
|
+
subjectType: {
|
|
351
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
352
|
+
isOptional: false;
|
|
353
|
+
};
|
|
354
|
+
subjectId: {
|
|
355
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
356
|
+
isOptional: false;
|
|
357
|
+
};
|
|
358
|
+
quantity: {
|
|
359
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
360
|
+
isOptional: false;
|
|
361
|
+
};
|
|
362
|
+
source: {
|
|
363
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
364
|
+
isOptional: true;
|
|
365
|
+
};
|
|
366
|
+
timestamp: {
|
|
367
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
368
|
+
isOptional: false;
|
|
369
|
+
};
|
|
370
|
+
}>>;
|
|
371
|
+
UsageBatchRecordedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema183.SchemaModel<{
|
|
372
|
+
recordCount: {
|
|
373
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
374
|
+
isOptional: false;
|
|
375
|
+
};
|
|
376
|
+
metricKeys: {
|
|
377
|
+
type: _lssm_lib_schema183.FieldType<unknown, unknown>;
|
|
378
|
+
isOptional: false;
|
|
379
|
+
};
|
|
380
|
+
totalQuantity: {
|
|
381
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
382
|
+
isOptional: false;
|
|
383
|
+
};
|
|
384
|
+
timestamp: {
|
|
385
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
386
|
+
isOptional: false;
|
|
387
|
+
};
|
|
388
|
+
}>>;
|
|
389
|
+
UsageAggregatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema183.SchemaModel<{
|
|
390
|
+
summaryId: {
|
|
391
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
392
|
+
isOptional: false;
|
|
393
|
+
};
|
|
394
|
+
metricKey: {
|
|
395
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
396
|
+
isOptional: false;
|
|
397
|
+
};
|
|
398
|
+
subjectType: {
|
|
399
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
400
|
+
isOptional: false;
|
|
401
|
+
};
|
|
402
|
+
subjectId: {
|
|
403
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
404
|
+
isOptional: false;
|
|
405
|
+
};
|
|
406
|
+
periodType: {
|
|
407
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
408
|
+
isOptional: false;
|
|
409
|
+
};
|
|
410
|
+
periodStart: {
|
|
411
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
412
|
+
isOptional: false;
|
|
413
|
+
};
|
|
414
|
+
periodEnd: {
|
|
415
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
416
|
+
isOptional: false;
|
|
417
|
+
};
|
|
418
|
+
totalQuantity: {
|
|
419
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
420
|
+
isOptional: false;
|
|
421
|
+
};
|
|
422
|
+
recordCount: {
|
|
423
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
424
|
+
isOptional: false;
|
|
425
|
+
};
|
|
426
|
+
aggregatedAt: {
|
|
427
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
428
|
+
isOptional: false;
|
|
429
|
+
};
|
|
430
|
+
}>>;
|
|
431
|
+
ThresholdCreatedEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema183.SchemaModel<{
|
|
432
|
+
thresholdId: {
|
|
433
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
434
|
+
isOptional: false;
|
|
435
|
+
};
|
|
436
|
+
metricKey: {
|
|
437
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
438
|
+
isOptional: false;
|
|
439
|
+
};
|
|
440
|
+
subjectType: {
|
|
441
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
442
|
+
isOptional: true;
|
|
443
|
+
};
|
|
444
|
+
subjectId: {
|
|
445
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
446
|
+
isOptional: true;
|
|
447
|
+
};
|
|
448
|
+
threshold: {
|
|
449
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
450
|
+
isOptional: false;
|
|
451
|
+
};
|
|
452
|
+
action: {
|
|
453
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
454
|
+
isOptional: false;
|
|
455
|
+
};
|
|
456
|
+
createdAt: {
|
|
457
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
458
|
+
isOptional: false;
|
|
459
|
+
};
|
|
460
|
+
}>>;
|
|
461
|
+
ThresholdExceededEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema183.SchemaModel<{
|
|
462
|
+
alertId: {
|
|
463
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
464
|
+
isOptional: false;
|
|
465
|
+
};
|
|
466
|
+
thresholdId: {
|
|
467
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
468
|
+
isOptional: false;
|
|
469
|
+
};
|
|
470
|
+
metricKey: {
|
|
471
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
472
|
+
isOptional: false;
|
|
473
|
+
};
|
|
474
|
+
subjectType: {
|
|
475
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
476
|
+
isOptional: true;
|
|
477
|
+
};
|
|
478
|
+
subjectId: {
|
|
479
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
480
|
+
isOptional: true;
|
|
481
|
+
};
|
|
482
|
+
threshold: {
|
|
483
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
484
|
+
isOptional: false;
|
|
485
|
+
};
|
|
486
|
+
actualValue: {
|
|
487
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
488
|
+
isOptional: false;
|
|
489
|
+
};
|
|
490
|
+
percentageUsed: {
|
|
491
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
492
|
+
isOptional: false;
|
|
493
|
+
};
|
|
494
|
+
action: {
|
|
495
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
496
|
+
isOptional: false;
|
|
497
|
+
};
|
|
498
|
+
triggeredAt: {
|
|
499
|
+
type: _lssm_lib_schema183.FieldType<Date, string>;
|
|
500
|
+
isOptional: false;
|
|
501
|
+
};
|
|
502
|
+
}>>;
|
|
503
|
+
ThresholdApproachingEvent: _lssm_lib_contracts0.EventSpec<_lssm_lib_schema183.SchemaModel<{
|
|
504
|
+
thresholdId: {
|
|
505
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
506
|
+
isOptional: false;
|
|
507
|
+
};
|
|
508
|
+
metricKey: {
|
|
509
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
510
|
+
isOptional: false;
|
|
511
|
+
};
|
|
512
|
+
subjectType: {
|
|
513
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
514
|
+
isOptional: true;
|
|
515
|
+
};
|
|
516
|
+
subjectId: {
|
|
517
|
+
type: _lssm_lib_schema183.FieldType<string, string>;
|
|
518
|
+
isOptional: true;
|
|
519
|
+
};
|
|
520
|
+
threshold: {
|
|
521
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
522
|
+
isOptional: false;
|
|
523
|
+
};
|
|
524
|
+
currentValue: {
|
|
525
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
526
|
+
isOptional: false;
|
|
527
|
+
};
|
|
528
|
+
percentageUsed: {
|
|
529
|
+
type: _lssm_lib_schema183.FieldType<number, number>;
|
|
530
|
+
isOptional: false;
|
|
531
|
+
};
|
|
532
|
+
triggeredAt: {
|
|
533
|
+
type: _lssm_lib_schema183.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
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
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 };
|
|
@@ -0,0 +1,11 @@
|
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lssm/lib.metering",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20251217060804",
|
|
4
4
|
"description": "Usage metering and billing core module for ContractSpec applications",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
"lint:check": "eslint src"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@lssm/lib.schema": "0.0.0-canary-
|
|
22
|
-
"@lssm/lib.contracts": "0.0.0-canary-
|
|
21
|
+
"@lssm/lib.schema": "0.0.0-canary-20251217060804",
|
|
22
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251217060804",
|
|
23
23
|
"zod": "^4.1.13"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@lssm/tool.typescript": "0.0.0-canary-
|
|
27
|
-
"@lssm/tool.tsdown": "0.0.0-canary-
|
|
26
|
+
"@lssm/tool.typescript": "0.0.0-canary-20251217060804",
|
|
27
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251217060804",
|
|
28
28
|
"typescript": "^5.9.3"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
|
-
".": "./
|
|
32
|
-
"./aggregation": "./
|
|
33
|
-
"./contracts": "./
|
|
34
|
-
"./docs": "./
|
|
35
|
-
"./docs/metering.docblock": "./
|
|
36
|
-
"./entities": "./
|
|
37
|
-
"./events": "./
|
|
38
|
-
"./metering.feature": "./
|
|
31
|
+
".": "./dist/index.js",
|
|
32
|
+
"./aggregation": "./dist/aggregation/index.js",
|
|
33
|
+
"./contracts": "./dist/contracts/index.js",
|
|
34
|
+
"./docs": "./dist/docs/index.js",
|
|
35
|
+
"./docs/metering.docblock": "./dist/docs/metering.docblock.js",
|
|
36
|
+
"./entities": "./dist/entities/index.js",
|
|
37
|
+
"./events": "./dist/events.js",
|
|
38
|
+
"./metering.feature": "./dist/metering.feature.js",
|
|
39
39
|
"./*": "./*"
|
|
40
40
|
},
|
|
41
41
|
"module": "./dist/index.js",
|