@lssm/lib.metering 0.0.0-canary-20251222120211 → 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.
- package/dist/contracts/index.d.ts +290 -290
- package/dist/contracts/index.js +150 -151
- package/dist/contracts/index.js.map +1 -1
- package/dist/docs/metering.docblock.js +1 -2
- package/dist/docs/metering.docblock.js.map +1 -1
- package/dist/entities/index.d.ts +185 -185
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +112 -112
- package/dist/entities/index.js.map +1 -1
- package/dist/events.d.ts +135 -135
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +69 -70
- package/dist/events.js.map +1 -1
- package/package.json +6 -6
- package/dist/contracts/dist/_virtual/rolldown_runtime.js +0 -6
- package/dist/contracts/dist/_virtual/rolldown_runtime.js.map +0 -1
- package/dist/contracts/dist/capabilities/index.js +0 -1
- package/dist/contracts/dist/capabilities/openbanking.js +0 -89
- package/dist/contracts/dist/capabilities/openbanking.js.map +0 -1
- package/dist/contracts/dist/client/index.js +0 -5
- package/dist/contracts/dist/client/react/feature-render.js +0 -3
- package/dist/contracts/dist/client/react/form-render.js +0 -5
- package/dist/contracts/dist/client/react/index.js +0 -4
- package/dist/contracts/dist/contract-registry/index.js +0 -1
- package/dist/contracts/dist/contract-registry/schemas.js +0 -61
- package/dist/contracts/dist/contract-registry/schemas.js.map +0 -1
- package/dist/contracts/dist/data-views/data-views.js +0 -7
- package/dist/contracts/dist/data-views/data-views.js.map +0 -1
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +0 -17
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/index.js +0 -25
- package/dist/contracts/dist/docs/meta.docs.js +0 -30
- package/dist/contracts/dist/docs/meta.docs.js.map +0 -1
- package/dist/contracts/dist/docs/presentations.js +0 -72
- package/dist/contracts/dist/docs/presentations.js.map +0 -1
- package/dist/contracts/dist/docs/registry.js +0 -45
- package/dist/contracts/dist/docs/registry.js.map +0 -1
- package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +0 -81
- package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +0 -58
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +0 -17
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +0 -358
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +0 -38
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +0 -17
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js +0 -21
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +0 -49
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +0 -80
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +0 -85
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +0 -46
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +0 -68
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +0 -41
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +0 -70
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +0 -48
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +0 -63
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +0 -156
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +0 -21
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +0 -102
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +0 -21
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js.map +0 -1
- package/dist/contracts/dist/docs/tech-contracts.docs.js +0 -97
- package/dist/contracts/dist/docs/tech-contracts.docs.js.map +0 -1
- package/dist/contracts/dist/events.js +0 -11
- package/dist/contracts/dist/events.js.map +0 -1
- package/dist/contracts/dist/experiments/evaluator.js +0 -1
- package/dist/contracts/dist/features.js +0 -7
- package/dist/contracts/dist/features.js.map +0 -1
- package/dist/contracts/dist/forms/forms.js +0 -1
- package/dist/contracts/dist/index.js +0 -88
- package/dist/contracts/dist/index.js.map +0 -1
- package/dist/contracts/dist/install.js +0 -2
- package/dist/contracts/dist/integrations/index.js +0 -18
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +0 -228
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js.map +0 -1
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +0 -159
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js.map +0 -1
- package/dist/contracts/dist/integrations/openbanking/contracts/index.js +0 -3
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +0 -210
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js.map +0 -1
- package/dist/contracts/dist/integrations/openbanking/models.js +0 -241
- package/dist/contracts/dist/integrations/openbanking/models.js.map +0 -1
- package/dist/contracts/dist/integrations/openbanking/telemetry.js +0 -14
- package/dist/contracts/dist/integrations/openbanking/telemetry.js.map +0 -1
- package/dist/contracts/dist/integrations/operations.js +0 -377
- package/dist/contracts/dist/integrations/operations.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/elevenlabs.js +0 -53
- package/dist/contracts/dist/integrations/providers/elevenlabs.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/gcs-storage.js +0 -76
- package/dist/contracts/dist/integrations/providers/gcs-storage.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/gmail.js +0 -88
- package/dist/contracts/dist/integrations/providers/gmail.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/google-calendar.js +0 -67
- package/dist/contracts/dist/integrations/providers/google-calendar.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/index.js +0 -11
- package/dist/contracts/dist/integrations/providers/mistral.js +0 -69
- package/dist/contracts/dist/integrations/providers/mistral.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/postmark.js +0 -69
- package/dist/contracts/dist/integrations/providers/postmark.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/powens.js +0 -117
- package/dist/contracts/dist/integrations/providers/powens.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/qdrant.js +0 -74
- package/dist/contracts/dist/integrations/providers/qdrant.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/registry.js +0 -10
- package/dist/contracts/dist/integrations/providers/stripe.js +0 -84
- package/dist/contracts/dist/integrations/providers/stripe.js.map +0 -1
- package/dist/contracts/dist/integrations/providers/twilio-sms.js +0 -62
- package/dist/contracts/dist/integrations/providers/twilio-sms.js.map +0 -1
- package/dist/contracts/dist/jsonschema.js +0 -1
- package/dist/contracts/dist/knowledge/index.js +0 -7
- package/dist/contracts/dist/knowledge/operations.js +0 -306
- package/dist/contracts/dist/knowledge/operations.js.map +0 -1
- package/dist/contracts/dist/knowledge/spaces/email-threads.js +0 -35
- package/dist/contracts/dist/knowledge/spaces/email-threads.js.map +0 -1
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js +0 -35
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js.map +0 -1
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js +0 -39
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js.map +0 -1
- package/dist/contracts/dist/knowledge/spaces/index.js +0 -6
- package/dist/contracts/dist/knowledge/spaces/product-canon.js +0 -35
- package/dist/contracts/dist/knowledge/spaces/product-canon.js.map +0 -1
- package/dist/contracts/dist/knowledge/spaces/support-faq.js +0 -38
- package/dist/contracts/dist/knowledge/spaces/support-faq.js.map +0 -1
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +0 -35
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js.map +0 -1
- package/dist/contracts/dist/llm/exporters.js +0 -21
- package/dist/contracts/dist/llm/exporters.js.map +0 -1
- package/dist/contracts/dist/llm/index.js +0 -2
- package/dist/contracts/dist/llm/prompts.js +0 -1
- package/dist/contracts/dist/onboarding-base.js +0 -196
- package/dist/contracts/dist/onboarding-base.js.map +0 -1
- package/dist/contracts/dist/openapi.js +0 -1
- package/dist/contracts/dist/operations/index.js +0 -2
- package/dist/contracts/dist/operations/operation.js +0 -35
- package/dist/contracts/dist/operations/operation.js.map +0 -1
- package/dist/contracts/dist/operations/registry.js +0 -8
- package/dist/contracts/dist/operations/registry.js.map +0 -1
- package/dist/contracts/dist/ownership.js +0 -24
- package/dist/contracts/dist/ownership.js.map +0 -1
- package/dist/contracts/dist/presentations/index.js +0 -2
- package/dist/contracts/dist/presentations/presentations.js +0 -8
- package/dist/contracts/dist/presentations/presentations.js.map +0 -1
- package/dist/contracts/dist/presentations/transform-engine.js +0 -12
- package/dist/contracts/dist/presentations/transform-engine.js.map +0 -1
- package/dist/contracts/dist/prompt.js +0 -1
- package/dist/contracts/dist/promptRegistry.js +0 -1
- package/dist/contracts/dist/regenerator/index.js +0 -1
- package/dist/contracts/dist/regenerator/service.js +0 -7
- package/dist/contracts/dist/regenerator/service.js.map +0 -1
- package/dist/contracts/dist/registry-utils.js +0 -24
- package/dist/contracts/dist/registry-utils.js.map +0 -1
- package/dist/contracts/dist/resources.js +0 -1
- package/dist/contracts/dist/schema/dist/index.js +0 -3873
- package/dist/contracts/dist/schema/dist/index.js.map +0 -1
- package/dist/contracts/dist/server/graphql-pothos.js +0 -6
- package/dist/contracts/dist/server/index.js +0 -8
- package/dist/contracts/dist/server/mcp/createMcpServer.js +0 -4
- package/dist/contracts/dist/server/mcp/registerPresentations.js +0 -3
- package/dist/contracts/dist/server/mcp/registerPrompts.js +0 -1
- package/dist/contracts/dist/server/mcp/registerResources.js +0 -2
- package/dist/contracts/dist/server/mcp/registerTools.js +0 -1
- package/dist/contracts/dist/server/provider-mcp.js +0 -1
- package/dist/contracts/dist/server/rest-elysia.js +0 -1
- package/dist/contracts/dist/server/rest-express.js +0 -1
- package/dist/contracts/dist/server/rest-generic.js +0 -1
- package/dist/contracts/dist/server/rest-next-app.js +0 -1
- package/dist/contracts/dist/server/rest-next-pages.js +0 -1
- package/dist/contracts/dist/telemetry/index.js +0 -1
- package/dist/contracts/dist/telemetry/tracker.js +0 -1
- package/dist/contracts/dist/tests/index.js +0 -1
- package/dist/contracts/dist/tests/runner.js +0 -2
- package/dist/contracts/dist/workflow/index.js +0 -2
- package/dist/contracts/dist/workflow/runner.js +0 -1
- package/dist/contracts/dist/workflow/spec.js +0 -7
- package/dist/contracts/dist/workflow/spec.js.map +0 -1
- package/dist/contracts/dist/workspace-config/contractsrc-schema.js +0 -164
- package/dist/contracts/dist/workspace-config/contractsrc-schema.js.map +0 -1
- package/dist/contracts/dist/workspace-config/index.js +0 -1
- package/dist/schema/dist/index.js +0 -4889
- package/dist/schema/dist/index.js.map +0 -1
package/dist/events.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;;;;cAsIa,oBAAkB,oBAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"events.d.ts","names":[],"sources":["../src/events.ts"],"sourcesContent":[],"mappings":";;;;;;;cAsIa,oBAAkB,oBAAA,CAAA,4BAAA;EAAlB,QAAA,EAAA;IAKX,IAAA,EAAA,iBAAA,CAAA,SAAA,CAAA,MAAA,EAAA,MAAA,CAAA;;;;;;;;;gBAL6B,KAAA;EAAA,CAAA;EAAA,IAAA,EAAA;IAUlB,IAAA,6BAKX,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;;;;;;;IAL6B,IAAA,6BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,IAAA;EAUlB,CAAA;EAKX,SAAA,EAAA;;;;;;;;;;;AAKF;AAKE,cAzBW,kBAyBX,EAzB6B,oBAAA,CAAA,SAyB7B,mBAzB6B,WAyB7B,CAAA;;UApBA,iBAAA,CAAA;;;;IAekC,IAAA,6BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAUvB,CAAA;EAKX,OAAA,EAAA;;;;;;;;;;;;;;;;AAKW,cA9BA,kBAmCX,EAnC6B,oBAAA,CAAA,SAmC7B,mBAnC6B,WAmC7B,CAAA;EAAA,QAAA,EAAA;UA9BA,iBAAA,CAAA;;;;;;;;IAyBgC,IAAA,6BAAA,CAAA,MAAA,EAAA,MAAA,CAAA;IAAA,UAAA,EAAA,KAAA;EAUrB,CAAA;EAKX,SAAA,EAAA;;;;;;;;;;;;EALiC,SAAA,EAAA;IAAA,IAAA,6BAAA,KAAA,EAAA,MAAA,CAAA;IAUtB,UAAA,EAAA,KAAA;EAKX,CAAA;;;;;cA7CW,yBAAuB,oBAAA,CAAA,4BAAA;;UAKlC,iBAAA,CAAA;;;EAmCoC,UAAA,EAAA;IAAA,IAAA,6BAAA,CAAA,OAAA,EAAA,OAAA,CAAA;IAUzB,UAAA,EAAA,KASZ;EAAA,CAAA;;;;;;;;;;;;;cAjDY,sBAAoB,oBAAA,CAAA,4BAAA;;UAK/B,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,uBAAqB,oBAAA,CAAA,4BAAA;;UAKhC,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,wBAAsB,oBAAA,CAAA,4BAAA;;UAKjC,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW,2BAAyB,oBAAA,CAAA,4BAAA;;UAKpC,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAKW;;;YASZ,iBAAA,CAAA"}
|
package/dist/events.js
CHANGED
|
@@ -1,288 +1,287 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineEvent } from "
|
|
3
|
-
import "./contracts/dist/index.js";
|
|
1
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@lssm/lib.schema";
|
|
2
|
+
import { defineEvent } from "@lssm/lib.contracts";
|
|
4
3
|
|
|
5
4
|
//#region src/events.ts
|
|
6
|
-
const MetricDefinedPayload =
|
|
5
|
+
const MetricDefinedPayload = defineSchemaModel({
|
|
7
6
|
name: "MetricDefinedEventPayload",
|
|
8
7
|
description: "Payload when a metric is defined",
|
|
9
8
|
fields: {
|
|
10
9
|
metricId: {
|
|
11
|
-
type:
|
|
10
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
12
11
|
isOptional: false
|
|
13
12
|
},
|
|
14
13
|
key: {
|
|
15
|
-
type:
|
|
14
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
16
15
|
isOptional: false
|
|
17
16
|
},
|
|
18
17
|
name: {
|
|
19
|
-
type:
|
|
18
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
20
19
|
isOptional: false
|
|
21
20
|
},
|
|
22
21
|
unit: {
|
|
23
|
-
type:
|
|
22
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
24
23
|
isOptional: false
|
|
25
24
|
},
|
|
26
25
|
aggregationType: {
|
|
27
|
-
type:
|
|
26
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
28
27
|
isOptional: false
|
|
29
28
|
},
|
|
30
29
|
orgId: {
|
|
31
|
-
type:
|
|
30
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
32
31
|
isOptional: true
|
|
33
32
|
},
|
|
34
33
|
createdBy: {
|
|
35
|
-
type:
|
|
34
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
36
35
|
isOptional: true
|
|
37
36
|
},
|
|
38
37
|
createdAt: {
|
|
39
|
-
type:
|
|
38
|
+
type: ScalarTypeEnum.DateTime(),
|
|
40
39
|
isOptional: false
|
|
41
40
|
}
|
|
42
41
|
}
|
|
43
42
|
});
|
|
44
|
-
const MetricUpdatedPayload =
|
|
43
|
+
const MetricUpdatedPayload = defineSchemaModel({
|
|
45
44
|
name: "MetricUpdatedEventPayload",
|
|
46
45
|
description: "Payload when a metric is updated",
|
|
47
46
|
fields: {
|
|
48
47
|
metricId: {
|
|
49
|
-
type:
|
|
48
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
50
49
|
isOptional: false
|
|
51
50
|
},
|
|
52
51
|
key: {
|
|
53
|
-
type:
|
|
52
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
54
53
|
isOptional: false
|
|
55
54
|
},
|
|
56
55
|
changes: {
|
|
57
|
-
type:
|
|
56
|
+
type: ScalarTypeEnum.JSON(),
|
|
58
57
|
isOptional: false
|
|
59
58
|
},
|
|
60
59
|
updatedBy: {
|
|
61
|
-
type:
|
|
60
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
62
61
|
isOptional: true
|
|
63
62
|
},
|
|
64
63
|
updatedAt: {
|
|
65
|
-
type:
|
|
64
|
+
type: ScalarTypeEnum.DateTime(),
|
|
66
65
|
isOptional: false
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
});
|
|
70
|
-
const UsageRecordedPayload =
|
|
69
|
+
const UsageRecordedPayload = defineSchemaModel({
|
|
71
70
|
name: "UsageRecordedEventPayload",
|
|
72
71
|
description: "Payload when usage is recorded",
|
|
73
72
|
fields: {
|
|
74
73
|
recordId: {
|
|
75
|
-
type:
|
|
74
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
76
75
|
isOptional: false
|
|
77
76
|
},
|
|
78
77
|
metricKey: {
|
|
79
|
-
type:
|
|
78
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
80
79
|
isOptional: false
|
|
81
80
|
},
|
|
82
81
|
subjectType: {
|
|
83
|
-
type:
|
|
82
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
84
83
|
isOptional: false
|
|
85
84
|
},
|
|
86
85
|
subjectId: {
|
|
87
|
-
type:
|
|
86
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
88
87
|
isOptional: false
|
|
89
88
|
},
|
|
90
89
|
quantity: {
|
|
91
|
-
type:
|
|
90
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
92
91
|
isOptional: false
|
|
93
92
|
},
|
|
94
93
|
source: {
|
|
95
|
-
type:
|
|
94
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
96
95
|
isOptional: true
|
|
97
96
|
},
|
|
98
97
|
timestamp: {
|
|
99
|
-
type:
|
|
98
|
+
type: ScalarTypeEnum.DateTime(),
|
|
100
99
|
isOptional: false
|
|
101
100
|
}
|
|
102
101
|
}
|
|
103
102
|
});
|
|
104
|
-
const UsageBatchRecordedPayload =
|
|
103
|
+
const UsageBatchRecordedPayload = defineSchemaModel({
|
|
105
104
|
name: "UsageBatchRecordedEventPayload",
|
|
106
105
|
description: "Payload when a batch of usage is recorded",
|
|
107
106
|
fields: {
|
|
108
107
|
recordCount: {
|
|
109
|
-
type:
|
|
108
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
110
109
|
isOptional: false
|
|
111
110
|
},
|
|
112
111
|
metricKeys: {
|
|
113
|
-
type:
|
|
112
|
+
type: ScalarTypeEnum.JSON(),
|
|
114
113
|
isOptional: false
|
|
115
114
|
},
|
|
116
115
|
totalQuantity: {
|
|
117
|
-
type:
|
|
116
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
118
117
|
isOptional: false
|
|
119
118
|
},
|
|
120
119
|
timestamp: {
|
|
121
|
-
type:
|
|
120
|
+
type: ScalarTypeEnum.DateTime(),
|
|
122
121
|
isOptional: false
|
|
123
122
|
}
|
|
124
123
|
}
|
|
125
124
|
});
|
|
126
|
-
const UsageAggregatedPayload =
|
|
125
|
+
const UsageAggregatedPayload = defineSchemaModel({
|
|
127
126
|
name: "UsageAggregatedEventPayload",
|
|
128
127
|
description: "Payload when usage is aggregated",
|
|
129
128
|
fields: {
|
|
130
129
|
summaryId: {
|
|
131
|
-
type:
|
|
130
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
132
131
|
isOptional: false
|
|
133
132
|
},
|
|
134
133
|
metricKey: {
|
|
135
|
-
type:
|
|
134
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
136
135
|
isOptional: false
|
|
137
136
|
},
|
|
138
137
|
subjectType: {
|
|
139
|
-
type:
|
|
138
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
140
139
|
isOptional: false
|
|
141
140
|
},
|
|
142
141
|
subjectId: {
|
|
143
|
-
type:
|
|
142
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
144
143
|
isOptional: false
|
|
145
144
|
},
|
|
146
145
|
periodType: {
|
|
147
|
-
type:
|
|
146
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
148
147
|
isOptional: false
|
|
149
148
|
},
|
|
150
149
|
periodStart: {
|
|
151
|
-
type:
|
|
150
|
+
type: ScalarTypeEnum.DateTime(),
|
|
152
151
|
isOptional: false
|
|
153
152
|
},
|
|
154
153
|
periodEnd: {
|
|
155
|
-
type:
|
|
154
|
+
type: ScalarTypeEnum.DateTime(),
|
|
156
155
|
isOptional: false
|
|
157
156
|
},
|
|
158
157
|
totalQuantity: {
|
|
159
|
-
type:
|
|
158
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
160
159
|
isOptional: false
|
|
161
160
|
},
|
|
162
161
|
recordCount: {
|
|
163
|
-
type:
|
|
162
|
+
type: ScalarTypeEnum.Int_unsecure(),
|
|
164
163
|
isOptional: false
|
|
165
164
|
},
|
|
166
165
|
aggregatedAt: {
|
|
167
|
-
type:
|
|
166
|
+
type: ScalarTypeEnum.DateTime(),
|
|
168
167
|
isOptional: false
|
|
169
168
|
}
|
|
170
169
|
}
|
|
171
170
|
});
|
|
172
|
-
const ThresholdCreatedPayload =
|
|
171
|
+
const ThresholdCreatedPayload = defineSchemaModel({
|
|
173
172
|
name: "ThresholdCreatedEventPayload",
|
|
174
173
|
description: "Payload when a threshold is created",
|
|
175
174
|
fields: {
|
|
176
175
|
thresholdId: {
|
|
177
|
-
type:
|
|
176
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
178
177
|
isOptional: false
|
|
179
178
|
},
|
|
180
179
|
metricKey: {
|
|
181
|
-
type:
|
|
180
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
182
181
|
isOptional: false
|
|
183
182
|
},
|
|
184
183
|
subjectType: {
|
|
185
|
-
type:
|
|
184
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
186
185
|
isOptional: true
|
|
187
186
|
},
|
|
188
187
|
subjectId: {
|
|
189
|
-
type:
|
|
188
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
190
189
|
isOptional: true
|
|
191
190
|
},
|
|
192
191
|
threshold: {
|
|
193
|
-
type:
|
|
192
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
194
193
|
isOptional: false
|
|
195
194
|
},
|
|
196
195
|
action: {
|
|
197
|
-
type:
|
|
196
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
198
197
|
isOptional: false
|
|
199
198
|
},
|
|
200
199
|
createdAt: {
|
|
201
|
-
type:
|
|
200
|
+
type: ScalarTypeEnum.DateTime(),
|
|
202
201
|
isOptional: false
|
|
203
202
|
}
|
|
204
203
|
}
|
|
205
204
|
});
|
|
206
|
-
const ThresholdExceededPayload =
|
|
205
|
+
const ThresholdExceededPayload = defineSchemaModel({
|
|
207
206
|
name: "ThresholdExceededEventPayload",
|
|
208
207
|
description: "Payload when a threshold is exceeded",
|
|
209
208
|
fields: {
|
|
210
209
|
alertId: {
|
|
211
|
-
type:
|
|
210
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
212
211
|
isOptional: false
|
|
213
212
|
},
|
|
214
213
|
thresholdId: {
|
|
215
|
-
type:
|
|
214
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
216
215
|
isOptional: false
|
|
217
216
|
},
|
|
218
217
|
metricKey: {
|
|
219
|
-
type:
|
|
218
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
220
219
|
isOptional: false
|
|
221
220
|
},
|
|
222
221
|
subjectType: {
|
|
223
|
-
type:
|
|
222
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
224
223
|
isOptional: true
|
|
225
224
|
},
|
|
226
225
|
subjectId: {
|
|
227
|
-
type:
|
|
226
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
228
227
|
isOptional: true
|
|
229
228
|
},
|
|
230
229
|
threshold: {
|
|
231
|
-
type:
|
|
230
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
232
231
|
isOptional: false
|
|
233
232
|
},
|
|
234
233
|
actualValue: {
|
|
235
|
-
type:
|
|
234
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
236
235
|
isOptional: false
|
|
237
236
|
},
|
|
238
237
|
percentageUsed: {
|
|
239
|
-
type:
|
|
238
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
240
239
|
isOptional: false
|
|
241
240
|
},
|
|
242
241
|
action: {
|
|
243
|
-
type:
|
|
242
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
244
243
|
isOptional: false
|
|
245
244
|
},
|
|
246
245
|
triggeredAt: {
|
|
247
|
-
type:
|
|
246
|
+
type: ScalarTypeEnum.DateTime(),
|
|
248
247
|
isOptional: false
|
|
249
248
|
}
|
|
250
249
|
}
|
|
251
250
|
});
|
|
252
|
-
const ThresholdApproachingPayload =
|
|
251
|
+
const ThresholdApproachingPayload = defineSchemaModel({
|
|
253
252
|
name: "ThresholdApproachingEventPayload",
|
|
254
253
|
description: "Payload when usage is approaching a threshold",
|
|
255
254
|
fields: {
|
|
256
255
|
thresholdId: {
|
|
257
|
-
type:
|
|
256
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
258
257
|
isOptional: false
|
|
259
258
|
},
|
|
260
259
|
metricKey: {
|
|
261
|
-
type:
|
|
260
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
262
261
|
isOptional: false
|
|
263
262
|
},
|
|
264
263
|
subjectType: {
|
|
265
|
-
type:
|
|
264
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
266
265
|
isOptional: true
|
|
267
266
|
},
|
|
268
267
|
subjectId: {
|
|
269
|
-
type:
|
|
268
|
+
type: ScalarTypeEnum.String_unsecure(),
|
|
270
269
|
isOptional: true
|
|
271
270
|
},
|
|
272
271
|
threshold: {
|
|
273
|
-
type:
|
|
272
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
274
273
|
isOptional: false
|
|
275
274
|
},
|
|
276
275
|
currentValue: {
|
|
277
|
-
type:
|
|
276
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
278
277
|
isOptional: false
|
|
279
278
|
},
|
|
280
279
|
percentageUsed: {
|
|
281
|
-
type:
|
|
280
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
282
281
|
isOptional: false
|
|
283
282
|
},
|
|
284
283
|
triggeredAt: {
|
|
285
|
-
type:
|
|
284
|
+
type: ScalarTypeEnum.DateTime(),
|
|
286
285
|
isOptional: false
|
|
287
286
|
}
|
|
288
287
|
}
|
package/dist/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":["defineSchemaModel","ScalarTypeEnum"],"sources":["../src/events.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@lssm/lib.schema';\nimport { defineEvent } from '@lssm/lib.contracts';\n\n// ============ Event Payloads ============\n\nconst MetricDefinedPayload = defineSchemaModel({\n name: 'MetricDefinedEventPayload',\n description: 'Payload when a metric is defined',\n fields: {\n metricId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n unit: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n aggregationType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst MetricUpdatedPayload = defineSchemaModel({\n name: 'MetricUpdatedEventPayload',\n description: 'Payload when a metric is updated',\n fields: {\n metricId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changes: { type: ScalarTypeEnum.JSON(), isOptional: false },\n updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UsageRecordedPayload = defineSchemaModel({\n name: 'UsageRecordedEventPayload',\n description: 'Payload when usage is recorded',\n fields: {\n recordId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n quantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n source: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UsageBatchRecordedPayload = defineSchemaModel({\n name: 'UsageBatchRecordedEventPayload',\n description: 'Payload when a batch of usage is recorded',\n fields: {\n recordCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n metricKeys: { type: ScalarTypeEnum.JSON(), isOptional: false },\n totalQuantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UsageAggregatedPayload = defineSchemaModel({\n name: 'UsageAggregatedEventPayload',\n description: 'Payload when usage is aggregated',\n fields: {\n summaryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n periodType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n periodStart: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n periodEnd: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n totalQuantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n recordCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n aggregatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst ThresholdCreatedPayload = defineSchemaModel({\n name: 'ThresholdCreatedEventPayload',\n description: 'Payload when a threshold is created',\n fields: {\n thresholdId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n action: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst ThresholdExceededPayload = defineSchemaModel({\n name: 'ThresholdExceededEventPayload',\n description: 'Payload when a threshold is exceeded',\n fields: {\n alertId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n thresholdId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n actualValue: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n percentageUsed: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n action: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n triggeredAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst ThresholdApproachingPayload = defineSchemaModel({\n name: 'ThresholdApproachingEventPayload',\n description: 'Payload when usage is approaching a threshold',\n fields: {\n thresholdId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currentValue: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n percentageUsed: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n triggeredAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Events ============\n\n/**\n * Emitted when a metric is defined.\n */\nexport const MetricDefinedEvent = defineEvent({\n name: 'metric.defined',\n version: 1,\n description: 'A metric has been defined.',\n payload: MetricDefinedPayload,\n});\n\n/**\n * Emitted when a metric is updated.\n */\nexport const MetricUpdatedEvent = defineEvent({\n name: 'metric.updated',\n version: 1,\n description: 'A metric has been updated.',\n payload: MetricUpdatedPayload,\n});\n\n/**\n * Emitted when usage is recorded.\n */\nexport const UsageRecordedEvent = defineEvent({\n name: 'usage.recorded',\n version: 1,\n description: 'Usage has been recorded.',\n payload: UsageRecordedPayload,\n});\n\n/**\n * Emitted when a batch of usage is recorded.\n */\nexport const UsageBatchRecordedEvent = defineEvent({\n name: 'usage.batch_recorded',\n version: 1,\n description: 'A batch of usage has been recorded.',\n payload: UsageBatchRecordedPayload,\n});\n\n/**\n * Emitted when usage is aggregated.\n */\nexport const UsageAggregatedEvent = defineEvent({\n name: 'usage.aggregated',\n version: 1,\n description: 'Usage has been aggregated into a summary.',\n payload: UsageAggregatedPayload,\n});\n\n/**\n * Emitted when a threshold is created.\n */\nexport const ThresholdCreatedEvent = defineEvent({\n name: 'threshold.created',\n version: 1,\n description: 'A usage threshold has been created.',\n payload: ThresholdCreatedPayload,\n});\n\n/**\n * Emitted when a threshold is exceeded.\n */\nexport const ThresholdExceededEvent = defineEvent({\n name: 'threshold.exceeded',\n version: 1,\n description: 'Usage has exceeded a threshold.',\n payload: ThresholdExceededPayload,\n});\n\n/**\n * Emitted when usage is approaching a threshold.\n */\nexport const ThresholdApproachingEvent = defineEvent({\n name: 'threshold.approaching',\n version: 1,\n description: 'Usage is approaching a threshold.',\n payload: ThresholdApproachingPayload,\n});\n\n/**\n * All metering events.\n */\nexport const MeteringEvents = {\n MetricDefinedEvent,\n MetricUpdatedEvent,\n UsageRecordedEvent,\n UsageBatchRecordedEvent,\n UsageAggregatedEvent,\n ThresholdC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GAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,aAAa;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,WAAW;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACvE,WAAW;GAAE,MAAMA,GAAe,gBAAgB;GAAE,YAAY;GAAO;EACvE,cAAc;GAAE,MAAMA,GAAe,gBAAgB;GAAE,YAAY;GAAO;EAC1E,gBAAgB;GACd,MAAMA,GAAe,gBAAgB;GACrC,YAAY;GACb;EACD,aAAa;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAO;EACpE;CACF,CAAC;;;;AAOF,MAAa,qBAAqB,YAAY;CAC5C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,qBAAqB,YAAY;CAC5C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,qBAAqB,YAAY;CAC5C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,0BAA0B,YAAY;CACjD,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,uBAAuB,YAAY;CAC9C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,wBAAwB,YAAY;CAC/C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,yBAAyB,YAAY;CAChD,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,4BAA4B,YAAY;CACnD,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../src/events.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@lssm/lib.schema';\nimport { defineEvent } from '@lssm/lib.contracts';\n\n// ============ Event Payloads ============\n\nconst MetricDefinedPayload = defineSchemaModel({\n name: 'MetricDefinedEventPayload',\n description: 'Payload when a metric is defined',\n fields: {\n metricId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n unit: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n aggregationType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst MetricUpdatedPayload = defineSchemaModel({\n name: 'MetricUpdatedEventPayload',\n description: 'Payload when a metric is updated',\n fields: {\n metricId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n changes: { type: ScalarTypeEnum.JSON(), isOptional: false },\n updatedBy: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UsageRecordedPayload = defineSchemaModel({\n name: 'UsageRecordedEventPayload',\n description: 'Payload when usage is recorded',\n fields: {\n recordId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n quantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n source: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UsageBatchRecordedPayload = defineSchemaModel({\n name: 'UsageBatchRecordedEventPayload',\n description: 'Payload when a batch of usage is recorded',\n fields: {\n recordCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n metricKeys: { type: ScalarTypeEnum.JSON(), isOptional: false },\n totalQuantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst UsageAggregatedPayload = defineSchemaModel({\n name: 'UsageAggregatedEventPayload',\n description: 'Payload when usage is aggregated',\n fields: {\n summaryId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n periodType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n periodStart: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n periodEnd: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n totalQuantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n recordCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n aggregatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst ThresholdCreatedPayload = defineSchemaModel({\n name: 'ThresholdCreatedEventPayload',\n description: 'Payload when a threshold is created',\n fields: {\n thresholdId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n action: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst ThresholdExceededPayload = defineSchemaModel({\n name: 'ThresholdExceededEventPayload',\n description: 'Payload when a threshold is exceeded',\n fields: {\n alertId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n thresholdId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n actualValue: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n percentageUsed: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n action: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n triggeredAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nconst ThresholdApproachingPayload = defineSchemaModel({\n name: 'ThresholdApproachingEventPayload',\n description: 'Payload when usage is approaching a threshold',\n fields: {\n thresholdId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n currentValue: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n percentageUsed: {\n type: ScalarTypeEnum.Float_unsecure(),\n isOptional: false,\n },\n triggeredAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Events ============\n\n/**\n * Emitted when a metric is defined.\n */\nexport const MetricDefinedEvent = defineEvent({\n name: 'metric.defined',\n version: 1,\n description: 'A metric has been defined.',\n payload: MetricDefinedPayload,\n});\n\n/**\n * Emitted when a metric is updated.\n */\nexport const MetricUpdatedEvent = defineEvent({\n name: 'metric.updated',\n version: 1,\n description: 'A metric has been updated.',\n payload: MetricUpdatedPayload,\n});\n\n/**\n * Emitted when usage is recorded.\n */\nexport const UsageRecordedEvent = defineEvent({\n name: 'usage.recorded',\n version: 1,\n description: 'Usage has been recorded.',\n payload: UsageRecordedPayload,\n});\n\n/**\n * Emitted when a batch of usage is recorded.\n */\nexport const UsageBatchRecordedEvent = defineEvent({\n name: 'usage.batch_recorded',\n version: 1,\n description: 'A batch of usage has been recorded.',\n payload: UsageBatchRecordedPayload,\n});\n\n/**\n * Emitted when usage is aggregated.\n */\nexport const UsageAggregatedEvent = defineEvent({\n name: 'usage.aggregated',\n version: 1,\n description: 'Usage has been aggregated into a summary.',\n payload: UsageAggregatedPayload,\n});\n\n/**\n * Emitted when a threshold is created.\n */\nexport const ThresholdCreatedEvent = defineEvent({\n name: 'threshold.created',\n version: 1,\n description: 'A usage threshold has been created.',\n payload: ThresholdCreatedPayload,\n});\n\n/**\n * Emitted when a threshold is exceeded.\n */\nexport const ThresholdExceededEvent = defineEvent({\n name: 'threshold.exceeded',\n version: 1,\n description: 'Usage has exceeded a threshold.',\n payload: ThresholdExceededPayload,\n});\n\n/**\n * Emitted when usage is approaching a threshold.\n */\nexport const ThresholdApproachingEvent = defineEvent({\n name: 'threshold.approaching',\n version: 1,\n description: 'Usage is approaching a threshold.',\n payload: ThresholdApproachingPayload,\n});\n\n/**\n * All metering events.\n */\nexport const MeteringEvents = {\n MetricDefinedEvent,\n MetricUpdatedEvent,\n UsageRecordedEvent,\n UsageBatchRecordedEvent,\n UsageAggregatedEvent,\n ThresholdCreatedEvent,\n ThresholdExceededEvent,\n ThresholdApproachingEvent,\n};\n"],"mappings":";;;;AAKA,MAAM,uBAAuB,kBAAkB;CAC7C,MAAM;CACN,aAAa;CACb,QAAQ;EACN,UAAU;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACvE,KAAK;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EAClE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,MAAM;GAAE,MAAM,eAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,iBAAiB;GACf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AAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,qBAAqB,YAAY;CAC5C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,qBAAqB,YAAY;CAC5C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,0BAA0B,YAAY;CACjD,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,uBAAuB,YAAY;CAC9C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,wBAAwB,YAAY;CAC/C,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,yBAAyB,YAAY;CAChD,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,4BAA4B,YAAY;CACnD,MAAM;CACN,SAAS;CACT,aAAa;CACb,SAAS;CACV,CAAC;;;;AAKF,MAAa,iBAAiB;CAC5B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
|
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-20251223010757",
|
|
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",
|
|
@@ -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:
|
|
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,13 +18,13 @@
|
|
|
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-20251223010757",
|
|
22
|
+
"@lssm/lib.contracts": "0.0.0-canary-20251223010757",
|
|
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-20251223010757",
|
|
27
|
+
"@lssm/tool.tsdown": "0.0.0-canary-20251223010757",
|
|
28
28
|
"typescript": "^5.9.3"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rolldown_runtime.js","names":[],"sources":["../../../../../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";
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { StabilityEnum } from "../ownership.js";
|
|
2
|
-
|
|
3
|
-
//#region ../contracts/dist/capabilities/openbanking.js
|
|
4
|
-
const OWNERS = ["platform.finance"];
|
|
5
|
-
const TAGS = ["open-banking", "finance"];
|
|
6
|
-
const openBankingAccountsReadCapability = {
|
|
7
|
-
meta: {
|
|
8
|
-
key: "openbanking.accounts.read",
|
|
9
|
-
version: 1,
|
|
10
|
-
kind: "integration",
|
|
11
|
-
title: "Open Banking Accounts (Read)",
|
|
12
|
-
description: "Provides read-only access to linked bank accounts, including account summaries and metadata.",
|
|
13
|
-
domain: "finance",
|
|
14
|
-
owners: [...OWNERS],
|
|
15
|
-
tags: [...TAGS],
|
|
16
|
-
stability: StabilityEnum.Experimental
|
|
17
|
-
},
|
|
18
|
-
provides: [
|
|
19
|
-
{
|
|
20
|
-
surface: "operation",
|
|
21
|
-
name: "openbanking.accounts.list",
|
|
22
|
-
version: 1,
|
|
23
|
-
description: "List bank accounts linked to a Powens open banking connection."
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
surface: "operation",
|
|
27
|
-
name: "openbanking.accounts.get",
|
|
28
|
-
version: 1,
|
|
29
|
-
description: "Retrieve the canonical bank account record for a specific account."
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
surface: "operation",
|
|
33
|
-
name: "openbanking.accounts.sync",
|
|
34
|
-
version: 1,
|
|
35
|
-
description: "Trigger a refresh of bank account metadata from the open banking provider."
|
|
36
|
-
}
|
|
37
|
-
]
|
|
38
|
-
};
|
|
39
|
-
const openBankingTransactionsReadCapability = {
|
|
40
|
-
meta: {
|
|
41
|
-
key: "openbanking.transactions.read",
|
|
42
|
-
version: 1,
|
|
43
|
-
kind: "integration",
|
|
44
|
-
title: "Open Banking Transactions (Read)",
|
|
45
|
-
description: "Enables retrieval of transaction history for linked bank accounts via open banking providers.",
|
|
46
|
-
domain: "finance",
|
|
47
|
-
owners: [...OWNERS],
|
|
48
|
-
tags: [...TAGS, "transactions"],
|
|
49
|
-
stability: StabilityEnum.Experimental
|
|
50
|
-
},
|
|
51
|
-
provides: [{
|
|
52
|
-
surface: "operation",
|
|
53
|
-
name: "openbanking.transactions.list",
|
|
54
|
-
version: 1,
|
|
55
|
-
description: "List transactions for a given bank account with optional date filtering."
|
|
56
|
-
}, {
|
|
57
|
-
surface: "operation",
|
|
58
|
-
name: "openbanking.transactions.sync",
|
|
59
|
-
version: 1,
|
|
60
|
-
description: "Synchronise transactions from the open banking provider into the canonical ledger."
|
|
61
|
-
}]
|
|
62
|
-
};
|
|
63
|
-
const openBankingBalancesReadCapability = {
|
|
64
|
-
meta: {
|
|
65
|
-
key: "openbanking.balances.read",
|
|
66
|
-
version: 1,
|
|
67
|
-
kind: "integration",
|
|
68
|
-
title: "Open Banking Balances (Read)",
|
|
69
|
-
description: "Allows querying of current and available balances for linked bank accounts via open banking providers.",
|
|
70
|
-
domain: "finance",
|
|
71
|
-
owners: [...OWNERS],
|
|
72
|
-
tags: [...TAGS, "balances"],
|
|
73
|
-
stability: StabilityEnum.Experimental
|
|
74
|
-
},
|
|
75
|
-
provides: [{
|
|
76
|
-
surface: "operation",
|
|
77
|
-
name: "openbanking.balances.get",
|
|
78
|
-
version: 1,
|
|
79
|
-
description: "Retrieve the latest known balances for a specified bank account."
|
|
80
|
-
}, {
|
|
81
|
-
surface: "operation",
|
|
82
|
-
name: "openbanking.balances.refresh",
|
|
83
|
-
version: 1,
|
|
84
|
-
description: "Force a balance refresh from the open banking provider."
|
|
85
|
-
}]
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
//#endregion
|
|
89
|
-
//# sourceMappingURL=openbanking.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"openbanking.js","names":[],"sources":["../../../../../contracts/dist/capabilities/openbanking.js"],"sourcesContent":["import { StabilityEnum } from \"../ownership.js\";\n\n//#region src/capabilities/openbanking.ts\nconst OWNERS = [\"platform.finance\"];\nconst TAGS = [\"open-banking\", \"finance\"];\nconst openBankingAccountsReadCapability = {\n\tmeta: {\n\t\tkey: \"openbanking.accounts.read\",\n\t\tversion: 1,\n\t\tkind: \"integration\",\n\t\ttitle: \"Open Banking Accounts (Read)\",\n\t\tdescription: \"Provides read-only access to linked bank accounts, including account summaries and metadata.\",\n\t\tdomain: \"finance\",\n\t\towners: [...OWNERS],\n\t\ttags: [...TAGS],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tprovides: [\n\t\t{\n\t\t\tsurface: \"operation\",\n\t\t\tname: \"openbanking.accounts.list\",\n\t\t\tversion: 1,\n\t\t\tdescription: \"List bank accounts linked to a Powens open banking connection.\"\n\t\t},\n\t\t{\n\t\t\tsurface: \"operation\",\n\t\t\tname: \"openbanking.accounts.get\",\n\t\t\tversion: 1,\n\t\t\tdescription: \"Retrieve the canonical bank account record for a specific account.\"\n\t\t},\n\t\t{\n\t\t\tsurface: \"operation\",\n\t\t\tname: \"openbanking.accounts.sync\",\n\t\t\tversion: 1,\n\t\t\tdescription: \"Trigger a refresh of bank account metadata from the open banking provider.\"\n\t\t}\n\t]\n};\nconst openBankingTransactionsReadCapability = {\n\tmeta: {\n\t\tkey: \"openbanking.transactions.read\",\n\t\tversion: 1,\n\t\tkind: \"integration\",\n\t\ttitle: \"Open Banking Transactions (Read)\",\n\t\tdescription: \"Enables retrieval of transaction history for linked bank accounts via open banking providers.\",\n\t\tdomain: \"finance\",\n\t\towners: [...OWNERS],\n\t\ttags: [...TAGS, \"transactions\"],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tprovides: [{\n\t\tsurface: \"operation\",\n\t\tname: \"openbanking.transactions.list\",\n\t\tversion: 1,\n\t\tdescription: \"List transactions for a given bank account with optional date filtering.\"\n\t}, {\n\t\tsurface: \"operation\",\n\t\tname: \"openbanking.transactions.sync\",\n\t\tversion: 1,\n\t\tdescription: \"Synchronise transactions from the open banking provider into the canonical ledger.\"\n\t}]\n};\nconst openBankingBalancesReadCapability = {\n\tmeta: {\n\t\tkey: \"openbanking.balances.read\",\n\t\tversion: 1,\n\t\tkind: \"integration\",\n\t\ttitle: \"Open Banking Balances (Read)\",\n\t\tdescription: \"Allows querying of current and available balances for linked bank accounts via open banking providers.\",\n\t\tdomain: \"finance\",\n\t\towners: [...OWNERS],\n\t\ttags: [...TAGS, \"balances\"],\n\t\tstability: StabilityEnum.Experimental\n\t},\n\tprovides: [{\n\t\tsurface: \"operation\",\n\t\tname: \"openbanking.balances.get\",\n\t\tversion: 1,\n\t\tdescription: \"Retrieve the latest known balances for a specified bank account.\"\n\t}, {\n\t\tsurface: \"operation\",\n\t\tname: \"openbanking.balances.refresh\",\n\t\tversion: 1,\n\t\tdescription: \"Force a balance refresh from the open banking provider.\"\n\t}]\n};\nfunction registerOpenBankingCapabilities(registry) {\n\treturn registry.register(openBankingAccountsReadCapability).register(openBankingTransactionsReadCapability).register(openBankingBalancesReadCapability);\n}\n\n//#endregion\nexport { openBankingAccountsReadCapability, openBankingBalancesReadCapability, openBankingTransactionsReadCapability, registerOpenBankingCapabilities };"],"mappings":";;;AAGA,MAAM,SAAS,CAAC,mBAAmB;AACnC,MAAM,OAAO,CAAC,gBAAgB,UAAU;AACxC,MAAM,oCAAoC;CACzC,MAAM;EACL,KAAK;EACL,SAAS;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,GAAG,KAAK;EACf,WAAW,cAAc;EACzB;CACD,UAAU;EACT;GACC,SAAS;GACT,MAAM;GACN,SAAS;GACT,aAAa;GACb;EACD;GACC,SAAS;GACT,MAAM;GACN,SAAS;GACT,aAAa;GACb;EACD;GACC,SAAS;GACT,MAAM;GACN,SAAS;GACT,aAAa;GACb;EACD;CACD;AACD,MAAM,wCAAwC;CAC7C,MAAM;EACL,KAAK;EACL,SAAS;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,GAAG,MAAM,eAAe;EAC/B,WAAW,cAAc;EACzB;CACD,UAAU,CAAC;EACV,SAAS;EACT,MAAM;EACN,SAAS;EACT,aAAa;EACb,EAAE;EACF,SAAS;EACT,MAAM;EACN,SAAS;EACT,aAAa;EACb,CAAC;CACF;AACD,MAAM,oCAAoC;CACzC,MAAM;EACL,KAAK;EACL,SAAS;EACT,MAAM;EACN,OAAO;EACP,aAAa;EACb,QAAQ;EACR,QAAQ,CAAC,GAAG,OAAO;EACnB,MAAM,CAAC,GAAG,MAAM,WAAW;EAC3B,WAAW,cAAc;EACzB;CACD,UAAU,CAAC;EACV,SAAS;EACT,MAAM;EACN,SAAS;EACT,aAAa;EACb,EAAE;EACF,SAAS;EACT,MAAM;EACN,SAAS;EACT,aAAa;EACb,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import { ContractRegistryFileSchema, ContractRegistryItemSchema, ContractRegistryItemTypeSchema } from "./schemas.js";
|