@lssm/lib.metering 0.0.0-canary-20251217083314 → 0.0.0-canary-20251220002821
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/LICENSE +21 -0
- package/README.md +3 -0
- package/dist/aggregation/index.d.ts +2 -1
- package/dist/aggregation/index.d.ts.map +1 -0
- package/dist/aggregation/index.js +8 -5
- package/dist/aggregation/index.js.map +1 -0
- package/dist/contracts/dist/capabilities/openbanking.js +2 -1
- package/dist/contracts/dist/capabilities/openbanking.js.map +1 -0
- package/dist/contracts/dist/contract-registry/schemas.js +2 -1
- package/dist/contracts/dist/contract-registry/schemas.js.map +1 -0
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js +2 -1
- package/dist/contracts/dist/docs/accessibility_wcag_compliance_specs.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/index.js +2 -6
- package/dist/contracts/dist/docs/meta.docs.js +30 -0
- package/dist/contracts/dist/docs/meta.docs.js.map +1 -0
- package/dist/contracts/dist/docs/presentations.js +2 -1
- package/dist/contracts/dist/docs/presentations.js.map +1 -0
- package/dist/contracts/dist/docs/registry.js +2 -1
- package/dist/contracts/dist/docs/registry.js.map +1 -0
- package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/auth/better-auth-nextjs.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/contracts/openapi-export.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/lifecycle-stage-system.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/llm/llm-integration.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/mcp-endpoints.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/presentation-runtime.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/schema/README.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/learning-events.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/learning-journeys.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/platform-admin-panel.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/project-access-teams.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/project-routing.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/sandbox-unlogged.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/team-invitations.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/workspace-ops.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/studio/workspaces.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/telemetry-ingest.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/templates/runtime.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/vscode-extension.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js +2 -1
- package/dist/contracts/dist/docs/tech/workflows/overview.docblock.js.map +1 -0
- package/dist/contracts/dist/docs/tech-contracts.docs.js +97 -0
- package/dist/contracts/dist/docs/tech-contracts.docs.js.map +1 -0
- package/dist/contracts/dist/events.js +2 -1
- package/dist/contracts/dist/events.js.map +1 -0
- package/dist/contracts/dist/index.js +2 -1
- package/dist/contracts/dist/integrations/contracts.js +65 -66
- package/dist/contracts/dist/integrations/contracts.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js +31 -32
- package/dist/contracts/dist/integrations/openbanking/contracts/accounts.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js +18 -19
- package/dist/contracts/dist/integrations/openbanking/contracts/balances.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js +32 -33
- package/dist/contracts/dist/integrations/openbanking/contracts/transactions.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/models.js +60 -61
- package/dist/contracts/dist/integrations/openbanking/models.js.map +1 -0
- package/dist/contracts/dist/integrations/openbanking/telemetry.js +2 -1
- package/dist/contracts/dist/integrations/openbanking/telemetry.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/elevenlabs.js +2 -1
- package/dist/contracts/dist/integrations/providers/elevenlabs.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/gcs-storage.js +2 -1
- package/dist/contracts/dist/integrations/providers/gcs-storage.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/gmail.js +2 -1
- package/dist/contracts/dist/integrations/providers/gmail.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/google-calendar.js +2 -1
- package/dist/contracts/dist/integrations/providers/google-calendar.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/mistral.js +2 -1
- package/dist/contracts/dist/integrations/providers/mistral.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/postmark.js +2 -1
- package/dist/contracts/dist/integrations/providers/postmark.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/powens.js +2 -1
- package/dist/contracts/dist/integrations/providers/powens.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/qdrant.js +2 -1
- package/dist/contracts/dist/integrations/providers/qdrant.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/stripe.js +2 -1
- package/dist/contracts/dist/integrations/providers/stripe.js.map +1 -0
- package/dist/contracts/dist/integrations/providers/twilio-sms.js +2 -1
- package/dist/contracts/dist/integrations/providers/twilio-sms.js.map +1 -0
- package/dist/contracts/dist/knowledge/contracts.js +44 -45
- package/dist/contracts/dist/knowledge/contracts.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/email-threads.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/email-threads.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/financial-docs.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/financial-overview.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/product-canon.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/product-canon.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/support-faq.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/support-faq.js.map +1 -0
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js +2 -1
- package/dist/contracts/dist/knowledge/spaces/uploaded-docs.js.map +1 -0
- package/dist/contracts/dist/llm/exporters.js +2 -1
- package/dist/contracts/dist/llm/exporters.js.map +1 -0
- package/dist/contracts/dist/onboarding-base.js +22 -23
- package/dist/contracts/dist/onboarding-base.js.map +1 -0
- package/dist/contracts/dist/ownership.js +4 -2
- package/dist/contracts/dist/ownership.js.map +1 -0
- package/dist/contracts/dist/presentations.v2.js +2 -1
- package/dist/contracts/dist/presentations.v2.js.map +1 -0
- package/dist/contracts/dist/regenerator/service.js +2 -1
- package/dist/contracts/dist/regenerator/service.js.map +1 -0
- package/dist/contracts/dist/schema/dist/index.js +3873 -6
- package/dist/contracts/dist/schema/dist/index.js.map +1 -0
- package/dist/contracts/dist/spec.js +2 -1
- package/dist/contracts/dist/spec.js.map +1 -0
- package/dist/contracts/index.d.ts +292 -291
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +151 -152
- package/dist/contracts/index.js.map +1 -0
- package/dist/docs/metering.docblock.js +2 -1
- package/dist/docs/metering.docblock.js.map +1 -0
- package/dist/entities/index.d.ts +187 -186
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +114 -114
- package/dist/entities/index.js.map +1 -0
- package/dist/events.d.ts +137 -136
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +70 -71
- package/dist/events.js.map +1 -0
- package/dist/metering.feature.d.ts +2 -1
- package/dist/metering.feature.d.ts.map +1 -0
- package/dist/metering.feature.js +2 -1
- package/dist/metering.feature.js.map +1 -0
- package/dist/schema/dist/index.js +4889 -6
- package/dist/schema/dist/index.js.map +1 -0
- package/package.json +13 -6
- package/dist/contracts/dist/docs/PUBLISHING.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_1_QUICKSTART.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_2_AI_NATIVE_OPERATIONS.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_3_AUTO_EVOLUTION.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_4_PERSONALIZATION_ENGINE.docblock.js +0 -16
- package/dist/contracts/dist/docs/tech/PHASE_5_ZERO_TOUCH_OPERATIONS.docblock.js +0 -16
- package/dist/contracts/dist/schema/dist/EnumType.js +0 -2
- package/dist/contracts/dist/schema/dist/FieldType.js +0 -49
- package/dist/contracts/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/contracts/dist/schema/dist/SchemaModel.js +0 -34
- package/dist/contracts/dist/schema/dist/entity/defineEntity.js +0 -1
- package/dist/contracts/dist/schema/dist/entity/index.js +0 -2
- package/dist/contracts/dist/schema/dist/entity/types.js +0 -1
- package/dist/schema/dist/EnumType.js +0 -2
- package/dist/schema/dist/FieldType.js +0 -49
- package/dist/schema/dist/ScalarTypeEnum.js +0 -236
- package/dist/schema/dist/SchemaModel.js +0 -39
- package/dist/schema/dist/entity/defineEntity.js +0 -236
- package/dist/schema/dist/entity/index.js +0 -2
- package/dist/schema/dist/entity/types.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["defineSchemaModel","ScalarTypeEnum"],"sources":["../../src/contracts/index.ts"],"sourcesContent":["import { ScalarTypeEnum, defineSchemaModel } from '@lssm/lib.schema';\nimport { defineCommand, defineQuery } from '@lssm/lib.contracts';\n\nconst OWNERS = ['platform.metering'] as const;\n\n// ============ Schema Models ============\n\nexport const MetricDefinitionModel = defineSchemaModel({\n name: 'MetricDefinition',\n description: 'Represents a metric definition',\n fields: {\n id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n unit: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n aggregationType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: false,\n },\n resetPeriod: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n category: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n updatedAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const UsageRecordModel = defineSchemaModel({\n name: 'UsageRecord',\n description: 'Represents a usage record',\n fields: {\n id: { 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 resourceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n resourceType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\nexport const UsageSummaryModel = defineSchemaModel({\n name: 'UsageSummary',\n description: 'Represents aggregated usage',\n fields: {\n id: { 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 minQuantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },\n maxQuantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },\n avgQuantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },\n },\n});\n\nexport const UsageThresholdModel = defineSchemaModel({\n name: 'UsageThreshold',\n description: 'Represents a usage threshold',\n fields: {\n id: { 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 name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n warnThreshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },\n periodType: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n action: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n currentValue: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n createdAt: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n },\n});\n\n// ============ Input/Output Models ============\n\nconst DefineMetricInput = defineSchemaModel({\n name: 'DefineMetricInput',\n description: 'Input for defining a metric',\n fields: {\n key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n unit: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n aggregationType: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n resetPeriod: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n category: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nconst UpdateMetricInput = defineSchemaModel({\n name: 'UpdateMetricInput',\n description: 'Input for updating a metric',\n fields: {\n metricId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n description: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n category: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n },\n});\n\nconst DeleteMetricInput = defineSchemaModel({\n name: 'DeleteMetricInput',\n description: 'Input for deleting a metric',\n fields: {\n metricId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst GetMetricInput = defineSchemaModel({\n name: 'GetMetricInput',\n description: 'Input for getting a metric',\n fields: {\n key: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nconst ListMetricsInput = defineSchemaModel({\n name: 'ListMetricsInput',\n description: 'Input for listing metrics',\n fields: {\n orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n category: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst ListMetricsOutput = defineSchemaModel({\n name: 'ListMetricsOutput',\n description: 'Output for listing metrics',\n fields: {\n metrics: { type: MetricDefinitionModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst RecordUsageInput = defineSchemaModel({\n name: 'RecordUsageInput',\n description: 'Input for recording usage',\n fields: {\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 timestamp: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n source: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n resourceId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n resourceType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n metadata: { type: ScalarTypeEnum.JSON(), isOptional: true },\n idempotencyKey: {\n type: ScalarTypeEnum.String_unsecure(),\n isOptional: true,\n },\n },\n});\n\nconst RecordBatchUsageInput = defineSchemaModel({\n name: 'RecordBatchUsageInput',\n description: 'Input for recording batch usage',\n fields: {\n records: { type: RecordUsageInput, isArray: true, isOptional: false },\n },\n});\n\nconst RecordBatchUsageOutput = defineSchemaModel({\n name: 'RecordBatchUsageOutput',\n description: 'Output for recording batch usage',\n fields: {\n recordedCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n skippedCount: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n recordIds: { type: ScalarTypeEnum.JSON(), isOptional: false },\n },\n});\n\nconst GetUsageInput = defineSchemaModel({\n name: 'GetUsageInput',\n description: 'Input for getting usage',\n fields: {\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 startDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n endDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n limit: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n offset: { type: ScalarTypeEnum.Int_unsecure(), isOptional: true },\n },\n});\n\nconst GetUsageOutput = defineSchemaModel({\n name: 'GetUsageOutput',\n description: 'Output for getting usage',\n fields: {\n records: { type: UsageRecordModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n totalQuantity: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n },\n});\n\nconst GetUsageSummaryInput = defineSchemaModel({\n name: 'GetUsageSummaryInput',\n description: 'Input for getting usage summary',\n fields: {\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 startDate: { type: ScalarTypeEnum.DateTime(), isOptional: false },\n endDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },\n },\n});\n\nconst GetUsageSummaryOutput = defineSchemaModel({\n name: 'GetUsageSummaryOutput',\n description: 'Output for getting usage summary',\n fields: {\n summaries: { type: UsageSummaryModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst CreateThresholdInput = defineSchemaModel({\n name: 'CreateThresholdInput',\n description: 'Input for creating a threshold',\n fields: {\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 name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },\n warnThreshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },\n periodType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n action: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n notifyEmails: { type: ScalarTypeEnum.JSON(), isOptional: true },\n notifyWebhook: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n },\n});\n\nconst UpdateThresholdInput = defineSchemaModel({\n name: 'UpdateThresholdInput',\n description: 'Input for updating a threshold',\n fields: {\n thresholdId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n name: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n threshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },\n warnThreshold: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },\n action: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n notifyEmails: { type: ScalarTypeEnum.JSON(), isOptional: true },\n notifyWebhook: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n});\n\nconst DeleteThresholdInput = defineSchemaModel({\n name: 'DeleteThresholdInput',\n description: 'Input for deleting a threshold',\n fields: {\n thresholdId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },\n },\n});\n\nconst ListThresholdsInput = defineSchemaModel({\n name: 'ListThresholdsInput',\n description: 'Input for listing thresholds',\n fields: {\n metricKey: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n subjectType: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n subjectId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },\n isActive: { type: ScalarTypeEnum.Boolean(), isOptional: true },\n },\n});\n\nconst ListThresholdsOutput = defineSchemaModel({\n name: 'ListThresholdsOutput',\n description: 'Output for listing thresholds',\n fields: {\n thresholds: { type: UsageThresholdModel, isArray: true, isOptional: false },\n total: { type: ScalarTypeEnum.Int_unsecure(), isOptional: false },\n },\n});\n\nconst SuccessOutput = defineSchemaModel({\n name: 'SuccessOutput',\n description: 'Generic success output',\n fields: {\n success: { type: ScalarTypeEnum.Boolean(), isOptional: false },\n },\n});\n\n// ============ Contracts ============\n\n/**\n * Define a metric.\n */\nexport const DefineMetricContract = defineCommand({\n meta: {\n name: 'metric.define',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'metric', 'define'],\n description: 'Define a new usage metric.',\n goal: 'Create a new metric for tracking usage.',\n context: 'Called when setting up metering.',\n },\n io: {\n input: DefineMetricInput,\n output: MetricDefinitionModel,\n errors: {\n METRIC_KEY_EXISTS: {\n description: 'Metric key already exists',\n http: 409,\n gqlCode: 'METRIC_KEY_EXISTS',\n when: 'A metric with this key already exists',\n },\n },\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Update a metric.\n */\nexport const UpdateMetricContract = defineCommand({\n meta: {\n name: 'metric.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'metric', 'update'],\n description: 'Update a metric definition.',\n goal: 'Modify metric configuration.',\n context: 'Called when updating metric settings.',\n },\n io: {\n input: UpdateMetricInput,\n output: MetricDefinitionModel,\n errors: {\n METRIC_NOT_FOUND: {\n description: 'Metric does not exist',\n http: 404,\n gqlCode: 'METRIC_NOT_FOUND',\n when: 'Metric ID is invalid',\n },\n },\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Delete a metric.\n */\nexport const DeleteMetricContract = defineCommand({\n meta: {\n name: 'metric.delete',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'metric', 'delete'],\n description: 'Delete a metric definition.',\n goal: 'Remove a metric and its data.',\n context: 'Called when removing a metric.',\n },\n io: {\n input: DeleteMetricInput,\n output: SuccessOutput,\n errors: {\n METRIC_NOT_FOUND: {\n description: 'Metric does not exist',\n http: 404,\n gqlCode: 'METRIC_NOT_FOUND',\n when: 'Metric ID is invalid',\n },\n },\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Get a metric by key.\n */\nexport const GetMetricContract = defineQuery({\n meta: {\n name: 'metric.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'metric', 'get'],\n description: 'Get a metric by key.',\n goal: 'Retrieve metric definition.',\n context: 'Called to inspect metric details.',\n },\n io: {\n input: GetMetricInput,\n output: MetricDefinitionModel,\n errors: {\n METRIC_NOT_FOUND: {\n description: 'Metric does not exist',\n http: 404,\n gqlCode: 'METRIC_NOT_FOUND',\n when: 'Metric key is invalid',\n },\n },\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * List metrics.\n */\nexport const ListMetricsContract = defineQuery({\n meta: {\n name: 'metric.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'metric', 'list'],\n description: 'List all metrics.',\n goal: 'View configured metrics.',\n context: 'Called to browse metrics.',\n },\n io: {\n input: ListMetricsInput,\n output: ListMetricsOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Record usage.\n */\nexport const RecordUsageContract = defineCommand({\n meta: {\n name: 'usage.record',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'usage', 'record'],\n description: 'Record a usage event.',\n goal: 'Track usage for billing and monitoring.',\n context: 'Called when usage occurs.',\n },\n io: {\n input: RecordUsageInput,\n output: UsageRecordModel,\n errors: {\n METRIC_NOT_FOUND: {\n description: 'Metric does not exist',\n http: 404,\n gqlCode: 'METRIC_NOT_FOUND',\n when: 'Metric key is invalid',\n },\n DUPLICATE_RECORD: {\n description: 'Record already exists',\n http: 409,\n gqlCode: 'DUPLICATE_RECORD',\n when: 'Idempotency key already used',\n },\n },\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Record batch usage.\n */\nexport const RecordBatchUsageContract = defineCommand({\n meta: {\n name: 'usage.recordBatch',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'usage', 'batch'],\n description: 'Record multiple usage events.',\n goal: 'Efficiently track bulk usage.',\n context: 'Called for batch processing.',\n },\n io: {\n input: RecordBatchUsageInput,\n output: RecordBatchUsageOutput,\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Get usage records.\n */\nexport const GetUsageContract = defineQuery({\n meta: {\n name: 'usage.get',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'usage', 'get'],\n description: 'Get usage records for a subject.',\n goal: 'View detailed usage history.',\n context: 'Called to analyze usage.',\n },\n io: {\n input: GetUsageInput,\n output: GetUsageOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Get usage summary.\n */\nexport const GetUsageSummaryContract = defineQuery({\n meta: {\n name: 'usage.getSummary',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'usage', 'summary'],\n description: 'Get aggregated usage summary.',\n goal: 'View usage totals for billing.',\n context: 'Called for billing and reporting.',\n },\n io: {\n input: GetUsageSummaryInput,\n output: GetUsageSummaryOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n\n/**\n * Create a threshold.\n */\nexport const CreateThresholdContract = defineCommand({\n meta: {\n name: 'threshold.create',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'threshold', 'create'],\n description: 'Create a usage threshold.',\n goal: 'Set up usage limits and alerts.',\n context: 'Called when configuring limits.',\n },\n io: {\n input: CreateThresholdInput,\n output: UsageThresholdModel,\n errors: {\n METRIC_NOT_FOUND: {\n description: 'Metric does not exist',\n http: 404,\n gqlCode: 'METRIC_NOT_FOUND',\n when: 'Metric key is invalid',\n },\n },\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Update a threshold.\n */\nexport const UpdateThresholdContract = defineCommand({\n meta: {\n name: 'threshold.update',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'threshold', 'update'],\n description: 'Update a threshold.',\n goal: 'Modify threshold configuration.',\n context: 'Called when adjusting limits.',\n },\n io: {\n input: UpdateThresholdInput,\n output: UsageThresholdModel,\n errors: {\n THRESHOLD_NOT_FOUND: {\n description: 'Threshold does not exist',\n http: 404,\n gqlCode: 'THRESHOLD_NOT_FOUND',\n when: 'Threshold ID is invalid',\n },\n },\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * Delete a threshold.\n */\nexport const DeleteThresholdContract = defineCommand({\n meta: {\n name: 'threshold.delete',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'threshold', 'delete'],\n description: 'Delete a threshold.',\n goal: 'Remove a usage threshold.',\n context: 'Called when removing limits.',\n },\n io: {\n input: DeleteThresholdInput,\n output: SuccessOutput,\n errors: {\n THRESHOLD_NOT_FOUND: {\n description: 'Threshold does not exist',\n http: 404,\n gqlCode: 'THRESHOLD_NOT_FOUND',\n when: 'Threshold ID is invalid',\n },\n },\n },\n policy: {\n auth: 'admin',\n },\n});\n\n/**\n * List thresholds.\n */\nexport const ListThresholdsContract = defineQuery({\n meta: {\n name: 'threshold.list',\n version: 1,\n stability: 'stable',\n owners: [...OWNERS],\n tags: ['metering', 'threshold', 'list'],\n description: 'List usage thresholds.',\n goal: 'View configured limits.',\n context: 'Called to browse thresholds.',\n },\n io: {\n input: ListThresholdsInput,\n output: ListThresholdsOutput,\n },\n policy: {\n auth: 'user',\n },\n});\n"],"mappings":";;;;;AAGA,MAAM,SAAS,CAAC,oBAAoB;AAIpC,MAAa,wBAAwBA,GAAkB;CACrD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,KAAK;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EAClE,MAAM;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,aAAa;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACzE,MAAM;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACnE,iBAAiB;GACf,MAAMA,GAAe,iBAAiB;GACtC,YAAY;GACb;EACD,aAAa;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,UAAU;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACtE,UAAU;GAAE,MAAMA,GAAe,SAAS;GAAE,YAAY;GAAO;EAC/D,OAAO;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAM;EACnE,WAAW;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAO;EACjE,WAAW;GAAE,MAAMA,GAAe,UAAU;GAAE,YAAY;GAAO;EAClE;CACF,CAAC;AAEF,MAAa,mBAAmBD,GAAkB;CAChD,MAAM;CACN,aAAa;CACb,QAAQ;EACN,IAAI;GAAE,MAAMC,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACjE,WAAW;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EACxE,aAAa;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAAO;EAC1E,WAAW;GAAE,MAAMA,GAAe,iBAAiB;GAAE,YAAY;GAA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1
|
+
{"version":3,"file":"metering.docblock.js","names":[],"sources":["../../src/docs/metering.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@lssm/lib.contracts/docs';\nimport { registerDocBlocks } from '@lssm/lib.contracts/docs';\n\nconst meteringDocBlocks: DocBlock[] = [\n {\n id: 'docs.metering.usage',\n title: 'Usage Metering & Billing Core',\n summary:\n 'Reusable usage/metering layer with metric definitions, usage ingestion, aggregation, thresholds, and alerts for billing or quotas.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/metering/usage',\n tags: ['metering', 'usage', 'billing', 'quotas'],\n body: `## Capabilities\n\n- **Entities**: MetricDefinition, UsageRecord, UsageSummary, UsageThreshold, UsageAlert.\n- **Contracts**: define/list metrics; record usage (batch + idempotent); retrieve usage by subject; manage thresholds and alerts.\n- **Aggregation**: hourly/daily/weekly/monthly rollups with SUM/COUNT/AVG/MIN/MAX/LAST strategies.\n- **Events**: usage.recorded, usage.aggregated, threshold.exceeded (see events export).\n\n## Usage\n\n1) Compose schema\n- Add \\`meteringSchemaContribution\\` to your schema composition.\n\n2) Register contracts/events\n- Import from \\`@lssm/lib.metering\\` into your spec registry.\n\n3) Ingest usage\n- Use \\`recordUsage\\` contract (see contracts export) from application services whenever a billable/important action happens (e.g., agent run, API call).\n\n4) Aggregate + thresholds\n- Run scheduled jobs using \\`aggregateUsage\\` helper to roll up summaries.\n- Configure \\`UsageThreshold\\` to emit alerts or blocking actions; pipe alerts into Notifications/Audit.\n\n## Example\n\n${'```'}ts\nimport { meteringSchemaContribution } from '@lssm/lib.metering';\nimport { aggregateUsage } from '@lssm/lib.metering/aggregation';\n\n// schema composition\nconst schema = {\n modules: [meteringSchemaContribution],\n};\n\n// aggregation job\nawait aggregateUsage({\n metrics: metricRepository,\n usage: usageRepository,\n period: 'DAILY',\n});\n${'```'},\n\n## Guardrails\n\n- Keep metric keys stable; store quantities as decimals for currency/units.\n- Use idempotency keys for external ingestion; avoid PII in metric metadata.\n- Scope by org/user for multi-tenant isolation; emit audit + analytics events on changes.\n`,\n },\n];\n\nregisterDocBlocks(meteringDocBlocks);\n"],"mappings":";;;;AA+DA,kBA5DsC,CACpC;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAY;EAAS;EAAW;EAAS;CAChD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CP,CACF,CAEmC"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -1,230 +1,231 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _lssm_lib_schema0 from "@lssm/lib.schema";
|
|
2
2
|
import { ModuleSchemaContribution } from "@lssm/lib.schema";
|
|
3
3
|
|
|
4
4
|
//#region src/entities/index.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Aggregation type enum.
|
|
7
7
|
*/
|
|
8
|
-
declare const AggregationTypeEnum:
|
|
8
|
+
declare const AggregationTypeEnum: _lssm_lib_schema0.EntityEnumDef;
|
|
9
9
|
/**
|
|
10
10
|
* Reset period enum.
|
|
11
11
|
*/
|
|
12
|
-
declare const ResetPeriodEnum:
|
|
12
|
+
declare const ResetPeriodEnum: _lssm_lib_schema0.EntityEnumDef;
|
|
13
13
|
/**
|
|
14
14
|
* Period type enum.
|
|
15
15
|
*/
|
|
16
|
-
declare const PeriodTypeEnum:
|
|
16
|
+
declare const PeriodTypeEnum: _lssm_lib_schema0.EntityEnumDef;
|
|
17
17
|
/**
|
|
18
18
|
* Threshold action enum.
|
|
19
19
|
*/
|
|
20
|
-
declare const ThresholdActionEnum:
|
|
20
|
+
declare const ThresholdActionEnum: _lssm_lib_schema0.EntityEnumDef;
|
|
21
21
|
/**
|
|
22
22
|
* MetricDefinition entity - defines a trackable metric.
|
|
23
23
|
*/
|
|
24
|
-
declare const MetricDefinitionEntity:
|
|
25
|
-
id:
|
|
26
|
-
key:
|
|
27
|
-
name:
|
|
28
|
-
description:
|
|
29
|
-
unit:
|
|
30
|
-
aggregationType:
|
|
31
|
-
resetPeriod:
|
|
32
|
-
precision:
|
|
33
|
-
orgId:
|
|
34
|
-
category:
|
|
35
|
-
displayOrder:
|
|
36
|
-
metadata:
|
|
37
|
-
isActive:
|
|
38
|
-
createdAt:
|
|
39
|
-
updatedAt:
|
|
40
|
-
usageRecords:
|
|
41
|
-
usageSummaries:
|
|
42
|
-
thresholds:
|
|
24
|
+
declare const MetricDefinitionEntity: _lssm_lib_schema0.EntitySpec<{
|
|
25
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
26
|
+
key: _lssm_lib_schema0.EntityScalarField;
|
|
27
|
+
name: _lssm_lib_schema0.EntityScalarField;
|
|
28
|
+
description: _lssm_lib_schema0.EntityScalarField;
|
|
29
|
+
unit: _lssm_lib_schema0.EntityScalarField;
|
|
30
|
+
aggregationType: _lssm_lib_schema0.EntityEnumField;
|
|
31
|
+
resetPeriod: _lssm_lib_schema0.EntityEnumField;
|
|
32
|
+
precision: _lssm_lib_schema0.EntityScalarField;
|
|
33
|
+
orgId: _lssm_lib_schema0.EntityScalarField;
|
|
34
|
+
category: _lssm_lib_schema0.EntityScalarField;
|
|
35
|
+
displayOrder: _lssm_lib_schema0.EntityScalarField;
|
|
36
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
37
|
+
isActive: _lssm_lib_schema0.EntityScalarField;
|
|
38
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
39
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
40
|
+
usageRecords: _lssm_lib_schema0.EntityRelationField;
|
|
41
|
+
usageSummaries: _lssm_lib_schema0.EntityRelationField;
|
|
42
|
+
thresholds: _lssm_lib_schema0.EntityRelationField;
|
|
43
43
|
}>;
|
|
44
44
|
/**
|
|
45
45
|
* UsageRecord entity - individual usage event.
|
|
46
46
|
*/
|
|
47
|
-
declare const UsageRecordEntity:
|
|
48
|
-
id:
|
|
49
|
-
metricKey:
|
|
50
|
-
metricId:
|
|
51
|
-
subjectType:
|
|
52
|
-
subjectId:
|
|
53
|
-
quantity:
|
|
54
|
-
source:
|
|
55
|
-
resourceId:
|
|
56
|
-
resourceType:
|
|
57
|
-
metadata:
|
|
58
|
-
idempotencyKey:
|
|
59
|
-
timestamp:
|
|
60
|
-
createdAt:
|
|
61
|
-
aggregated:
|
|
62
|
-
aggregatedAt:
|
|
47
|
+
declare const UsageRecordEntity: _lssm_lib_schema0.EntitySpec<{
|
|
48
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
49
|
+
metricKey: _lssm_lib_schema0.EntityScalarField;
|
|
50
|
+
metricId: _lssm_lib_schema0.EntityScalarField;
|
|
51
|
+
subjectType: _lssm_lib_schema0.EntityScalarField;
|
|
52
|
+
subjectId: _lssm_lib_schema0.EntityScalarField;
|
|
53
|
+
quantity: _lssm_lib_schema0.EntityScalarField;
|
|
54
|
+
source: _lssm_lib_schema0.EntityScalarField;
|
|
55
|
+
resourceId: _lssm_lib_schema0.EntityScalarField;
|
|
56
|
+
resourceType: _lssm_lib_schema0.EntityScalarField;
|
|
57
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
58
|
+
idempotencyKey: _lssm_lib_schema0.EntityScalarField;
|
|
59
|
+
timestamp: _lssm_lib_schema0.EntityScalarField;
|
|
60
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
61
|
+
aggregated: _lssm_lib_schema0.EntityScalarField;
|
|
62
|
+
aggregatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
63
63
|
}>;
|
|
64
64
|
/**
|
|
65
65
|
* UsageSummary entity - pre-aggregated usage.
|
|
66
66
|
*/
|
|
67
|
-
declare const UsageSummaryEntity:
|
|
68
|
-
id:
|
|
69
|
-
metricKey:
|
|
70
|
-
metricId:
|
|
71
|
-
subjectType:
|
|
72
|
-
subjectId:
|
|
73
|
-
periodType:
|
|
74
|
-
periodStart:
|
|
75
|
-
periodEnd:
|
|
76
|
-
totalQuantity:
|
|
77
|
-
recordCount:
|
|
78
|
-
minQuantity:
|
|
79
|
-
maxQuantity:
|
|
80
|
-
avgQuantity:
|
|
81
|
-
metadata:
|
|
82
|
-
createdAt:
|
|
83
|
-
updatedAt:
|
|
67
|
+
declare const UsageSummaryEntity: _lssm_lib_schema0.EntitySpec<{
|
|
68
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
69
|
+
metricKey: _lssm_lib_schema0.EntityScalarField;
|
|
70
|
+
metricId: _lssm_lib_schema0.EntityScalarField;
|
|
71
|
+
subjectType: _lssm_lib_schema0.EntityScalarField;
|
|
72
|
+
subjectId: _lssm_lib_schema0.EntityScalarField;
|
|
73
|
+
periodType: _lssm_lib_schema0.EntityEnumField;
|
|
74
|
+
periodStart: _lssm_lib_schema0.EntityScalarField;
|
|
75
|
+
periodEnd: _lssm_lib_schema0.EntityScalarField;
|
|
76
|
+
totalQuantity: _lssm_lib_schema0.EntityScalarField;
|
|
77
|
+
recordCount: _lssm_lib_schema0.EntityScalarField;
|
|
78
|
+
minQuantity: _lssm_lib_schema0.EntityScalarField;
|
|
79
|
+
maxQuantity: _lssm_lib_schema0.EntityScalarField;
|
|
80
|
+
avgQuantity: _lssm_lib_schema0.EntityScalarField;
|
|
81
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
82
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
83
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
84
84
|
}>;
|
|
85
85
|
/**
|
|
86
86
|
* UsageThreshold entity - threshold configuration.
|
|
87
87
|
*/
|
|
88
|
-
declare const UsageThresholdEntity:
|
|
89
|
-
id:
|
|
90
|
-
metricKey:
|
|
91
|
-
metricId:
|
|
92
|
-
subjectType:
|
|
93
|
-
subjectId:
|
|
94
|
-
name:
|
|
95
|
-
threshold:
|
|
96
|
-
warnThreshold:
|
|
97
|
-
periodType:
|
|
98
|
-
action:
|
|
99
|
-
notifyEmails:
|
|
100
|
-
notifyWebhook:
|
|
101
|
-
currentValue:
|
|
102
|
-
lastCheckedAt:
|
|
103
|
-
lastExceededAt:
|
|
104
|
-
isActive:
|
|
105
|
-
metadata:
|
|
106
|
-
createdAt:
|
|
107
|
-
updatedAt:
|
|
88
|
+
declare const UsageThresholdEntity: _lssm_lib_schema0.EntitySpec<{
|
|
89
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
90
|
+
metricKey: _lssm_lib_schema0.EntityScalarField;
|
|
91
|
+
metricId: _lssm_lib_schema0.EntityScalarField;
|
|
92
|
+
subjectType: _lssm_lib_schema0.EntityScalarField;
|
|
93
|
+
subjectId: _lssm_lib_schema0.EntityScalarField;
|
|
94
|
+
name: _lssm_lib_schema0.EntityScalarField;
|
|
95
|
+
threshold: _lssm_lib_schema0.EntityScalarField;
|
|
96
|
+
warnThreshold: _lssm_lib_schema0.EntityScalarField;
|
|
97
|
+
periodType: _lssm_lib_schema0.EntityEnumField;
|
|
98
|
+
action: _lssm_lib_schema0.EntityEnumField;
|
|
99
|
+
notifyEmails: _lssm_lib_schema0.EntityScalarField;
|
|
100
|
+
notifyWebhook: _lssm_lib_schema0.EntityScalarField;
|
|
101
|
+
currentValue: _lssm_lib_schema0.EntityScalarField;
|
|
102
|
+
lastCheckedAt: _lssm_lib_schema0.EntityScalarField;
|
|
103
|
+
lastExceededAt: _lssm_lib_schema0.EntityScalarField;
|
|
104
|
+
isActive: _lssm_lib_schema0.EntityScalarField;
|
|
105
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
106
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
107
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
108
108
|
}>;
|
|
109
109
|
/**
|
|
110
110
|
* UsageAlert entity - threshold violation alerts.
|
|
111
111
|
*/
|
|
112
|
-
declare const UsageAlertEntity:
|
|
113
|
-
id:
|
|
114
|
-
thresholdId:
|
|
115
|
-
metricKey:
|
|
116
|
-
subjectType:
|
|
117
|
-
subjectId:
|
|
118
|
-
alertType:
|
|
119
|
-
threshold:
|
|
120
|
-
actualValue:
|
|
121
|
-
percentageUsed:
|
|
122
|
-
status:
|
|
123
|
-
acknowledgedBy:
|
|
124
|
-
acknowledgedAt:
|
|
125
|
-
resolvedAt:
|
|
126
|
-
notificationsSent:
|
|
127
|
-
triggeredAt:
|
|
128
|
-
createdAt:
|
|
129
|
-
thresholdRelation:
|
|
112
|
+
declare const UsageAlertEntity: _lssm_lib_schema0.EntitySpec<{
|
|
113
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
114
|
+
thresholdId: _lssm_lib_schema0.EntityScalarField;
|
|
115
|
+
metricKey: _lssm_lib_schema0.EntityScalarField;
|
|
116
|
+
subjectType: _lssm_lib_schema0.EntityScalarField;
|
|
117
|
+
subjectId: _lssm_lib_schema0.EntityScalarField;
|
|
118
|
+
alertType: _lssm_lib_schema0.EntityScalarField;
|
|
119
|
+
threshold: _lssm_lib_schema0.EntityScalarField;
|
|
120
|
+
actualValue: _lssm_lib_schema0.EntityScalarField;
|
|
121
|
+
percentageUsed: _lssm_lib_schema0.EntityScalarField;
|
|
122
|
+
status: _lssm_lib_schema0.EntityScalarField;
|
|
123
|
+
acknowledgedBy: _lssm_lib_schema0.EntityScalarField;
|
|
124
|
+
acknowledgedAt: _lssm_lib_schema0.EntityScalarField;
|
|
125
|
+
resolvedAt: _lssm_lib_schema0.EntityScalarField;
|
|
126
|
+
notificationsSent: _lssm_lib_schema0.EntityScalarField;
|
|
127
|
+
triggeredAt: _lssm_lib_schema0.EntityScalarField;
|
|
128
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
129
|
+
thresholdRelation: _lssm_lib_schema0.EntityRelationField;
|
|
130
130
|
}>;
|
|
131
131
|
/**
|
|
132
132
|
* All metering entities for schema composition.
|
|
133
133
|
*/
|
|
134
|
-
declare const meteringEntities: (
|
|
135
|
-
id:
|
|
136
|
-
key:
|
|
137
|
-
name:
|
|
138
|
-
description:
|
|
139
|
-
unit:
|
|
140
|
-
aggregationType:
|
|
141
|
-
resetPeriod:
|
|
142
|
-
precision:
|
|
143
|
-
orgId:
|
|
144
|
-
category:
|
|
145
|
-
displayOrder:
|
|
146
|
-
metadata:
|
|
147
|
-
isActive:
|
|
148
|
-
createdAt:
|
|
149
|
-
updatedAt:
|
|
150
|
-
usageRecords:
|
|
151
|
-
usageSummaries:
|
|
152
|
-
thresholds:
|
|
153
|
-
}> |
|
|
154
|
-
id:
|
|
155
|
-
metricKey:
|
|
156
|
-
metricId:
|
|
157
|
-
subjectType:
|
|
158
|
-
subjectId:
|
|
159
|
-
quantity:
|
|
160
|
-
source:
|
|
161
|
-
resourceId:
|
|
162
|
-
resourceType:
|
|
163
|
-
metadata:
|
|
164
|
-
idempotencyKey:
|
|
165
|
-
timestamp:
|
|
166
|
-
createdAt:
|
|
167
|
-
aggregated:
|
|
168
|
-
aggregatedAt:
|
|
169
|
-
}> |
|
|
170
|
-
id:
|
|
171
|
-
metricKey:
|
|
172
|
-
metricId:
|
|
173
|
-
subjectType:
|
|
174
|
-
subjectId:
|
|
175
|
-
periodType:
|
|
176
|
-
periodStart:
|
|
177
|
-
periodEnd:
|
|
178
|
-
totalQuantity:
|
|
179
|
-
recordCount:
|
|
180
|
-
minQuantity:
|
|
181
|
-
maxQuantity:
|
|
182
|
-
avgQuantity:
|
|
183
|
-
metadata:
|
|
184
|
-
createdAt:
|
|
185
|
-
updatedAt:
|
|
186
|
-
}> |
|
|
187
|
-
id:
|
|
188
|
-
metricKey:
|
|
189
|
-
metricId:
|
|
190
|
-
subjectType:
|
|
191
|
-
subjectId:
|
|
192
|
-
name:
|
|
193
|
-
threshold:
|
|
194
|
-
warnThreshold:
|
|
195
|
-
periodType:
|
|
196
|
-
action:
|
|
197
|
-
notifyEmails:
|
|
198
|
-
notifyWebhook:
|
|
199
|
-
currentValue:
|
|
200
|
-
lastCheckedAt:
|
|
201
|
-
lastExceededAt:
|
|
202
|
-
isActive:
|
|
203
|
-
metadata:
|
|
204
|
-
createdAt:
|
|
205
|
-
updatedAt:
|
|
206
|
-
}> |
|
|
207
|
-
id:
|
|
208
|
-
thresholdId:
|
|
209
|
-
metricKey:
|
|
210
|
-
subjectType:
|
|
211
|
-
subjectId:
|
|
212
|
-
alertType:
|
|
213
|
-
threshold:
|
|
214
|
-
actualValue:
|
|
215
|
-
percentageUsed:
|
|
216
|
-
status:
|
|
217
|
-
acknowledgedBy:
|
|
218
|
-
acknowledgedAt:
|
|
219
|
-
resolvedAt:
|
|
220
|
-
notificationsSent:
|
|
221
|
-
triggeredAt:
|
|
222
|
-
createdAt:
|
|
223
|
-
thresholdRelation:
|
|
134
|
+
declare const meteringEntities: (_lssm_lib_schema0.EntitySpec<{
|
|
135
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
136
|
+
key: _lssm_lib_schema0.EntityScalarField;
|
|
137
|
+
name: _lssm_lib_schema0.EntityScalarField;
|
|
138
|
+
description: _lssm_lib_schema0.EntityScalarField;
|
|
139
|
+
unit: _lssm_lib_schema0.EntityScalarField;
|
|
140
|
+
aggregationType: _lssm_lib_schema0.EntityEnumField;
|
|
141
|
+
resetPeriod: _lssm_lib_schema0.EntityEnumField;
|
|
142
|
+
precision: _lssm_lib_schema0.EntityScalarField;
|
|
143
|
+
orgId: _lssm_lib_schema0.EntityScalarField;
|
|
144
|
+
category: _lssm_lib_schema0.EntityScalarField;
|
|
145
|
+
displayOrder: _lssm_lib_schema0.EntityScalarField;
|
|
146
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
147
|
+
isActive: _lssm_lib_schema0.EntityScalarField;
|
|
148
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
149
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
150
|
+
usageRecords: _lssm_lib_schema0.EntityRelationField;
|
|
151
|
+
usageSummaries: _lssm_lib_schema0.EntityRelationField;
|
|
152
|
+
thresholds: _lssm_lib_schema0.EntityRelationField;
|
|
153
|
+
}> | _lssm_lib_schema0.EntitySpec<{
|
|
154
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
155
|
+
metricKey: _lssm_lib_schema0.EntityScalarField;
|
|
156
|
+
metricId: _lssm_lib_schema0.EntityScalarField;
|
|
157
|
+
subjectType: _lssm_lib_schema0.EntityScalarField;
|
|
158
|
+
subjectId: _lssm_lib_schema0.EntityScalarField;
|
|
159
|
+
quantity: _lssm_lib_schema0.EntityScalarField;
|
|
160
|
+
source: _lssm_lib_schema0.EntityScalarField;
|
|
161
|
+
resourceId: _lssm_lib_schema0.EntityScalarField;
|
|
162
|
+
resourceType: _lssm_lib_schema0.EntityScalarField;
|
|
163
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
164
|
+
idempotencyKey: _lssm_lib_schema0.EntityScalarField;
|
|
165
|
+
timestamp: _lssm_lib_schema0.EntityScalarField;
|
|
166
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
167
|
+
aggregated: _lssm_lib_schema0.EntityScalarField;
|
|
168
|
+
aggregatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
169
|
+
}> | _lssm_lib_schema0.EntitySpec<{
|
|
170
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
171
|
+
metricKey: _lssm_lib_schema0.EntityScalarField;
|
|
172
|
+
metricId: _lssm_lib_schema0.EntityScalarField;
|
|
173
|
+
subjectType: _lssm_lib_schema0.EntityScalarField;
|
|
174
|
+
subjectId: _lssm_lib_schema0.EntityScalarField;
|
|
175
|
+
periodType: _lssm_lib_schema0.EntityEnumField;
|
|
176
|
+
periodStart: _lssm_lib_schema0.EntityScalarField;
|
|
177
|
+
periodEnd: _lssm_lib_schema0.EntityScalarField;
|
|
178
|
+
totalQuantity: _lssm_lib_schema0.EntityScalarField;
|
|
179
|
+
recordCount: _lssm_lib_schema0.EntityScalarField;
|
|
180
|
+
minQuantity: _lssm_lib_schema0.EntityScalarField;
|
|
181
|
+
maxQuantity: _lssm_lib_schema0.EntityScalarField;
|
|
182
|
+
avgQuantity: _lssm_lib_schema0.EntityScalarField;
|
|
183
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
184
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
185
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
186
|
+
}> | _lssm_lib_schema0.EntitySpec<{
|
|
187
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
188
|
+
metricKey: _lssm_lib_schema0.EntityScalarField;
|
|
189
|
+
metricId: _lssm_lib_schema0.EntityScalarField;
|
|
190
|
+
subjectType: _lssm_lib_schema0.EntityScalarField;
|
|
191
|
+
subjectId: _lssm_lib_schema0.EntityScalarField;
|
|
192
|
+
name: _lssm_lib_schema0.EntityScalarField;
|
|
193
|
+
threshold: _lssm_lib_schema0.EntityScalarField;
|
|
194
|
+
warnThreshold: _lssm_lib_schema0.EntityScalarField;
|
|
195
|
+
periodType: _lssm_lib_schema0.EntityEnumField;
|
|
196
|
+
action: _lssm_lib_schema0.EntityEnumField;
|
|
197
|
+
notifyEmails: _lssm_lib_schema0.EntityScalarField;
|
|
198
|
+
notifyWebhook: _lssm_lib_schema0.EntityScalarField;
|
|
199
|
+
currentValue: _lssm_lib_schema0.EntityScalarField;
|
|
200
|
+
lastCheckedAt: _lssm_lib_schema0.EntityScalarField;
|
|
201
|
+
lastExceededAt: _lssm_lib_schema0.EntityScalarField;
|
|
202
|
+
isActive: _lssm_lib_schema0.EntityScalarField;
|
|
203
|
+
metadata: _lssm_lib_schema0.EntityScalarField;
|
|
204
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
205
|
+
updatedAt: _lssm_lib_schema0.EntityScalarField;
|
|
206
|
+
}> | _lssm_lib_schema0.EntitySpec<{
|
|
207
|
+
id: _lssm_lib_schema0.EntityScalarField;
|
|
208
|
+
thresholdId: _lssm_lib_schema0.EntityScalarField;
|
|
209
|
+
metricKey: _lssm_lib_schema0.EntityScalarField;
|
|
210
|
+
subjectType: _lssm_lib_schema0.EntityScalarField;
|
|
211
|
+
subjectId: _lssm_lib_schema0.EntityScalarField;
|
|
212
|
+
alertType: _lssm_lib_schema0.EntityScalarField;
|
|
213
|
+
threshold: _lssm_lib_schema0.EntityScalarField;
|
|
214
|
+
actualValue: _lssm_lib_schema0.EntityScalarField;
|
|
215
|
+
percentageUsed: _lssm_lib_schema0.EntityScalarField;
|
|
216
|
+
status: _lssm_lib_schema0.EntityScalarField;
|
|
217
|
+
acknowledgedBy: _lssm_lib_schema0.EntityScalarField;
|
|
218
|
+
acknowledgedAt: _lssm_lib_schema0.EntityScalarField;
|
|
219
|
+
resolvedAt: _lssm_lib_schema0.EntityScalarField;
|
|
220
|
+
notificationsSent: _lssm_lib_schema0.EntityScalarField;
|
|
221
|
+
triggeredAt: _lssm_lib_schema0.EntityScalarField;
|
|
222
|
+
createdAt: _lssm_lib_schema0.EntityScalarField;
|
|
223
|
+
thresholdRelation: _lssm_lib_schema0.EntityRelationField;
|
|
224
224
|
}>)[];
|
|
225
225
|
/**
|
|
226
226
|
* Module schema contribution for metering.
|
|
227
227
|
*/
|
|
228
228
|
declare const meteringSchemaContribution: ModuleSchemaContribution;
|
|
229
229
|
//#endregion
|
|
230
|
-
export { AggregationTypeEnum, MetricDefinitionEntity, PeriodTypeEnum, ResetPeriodEnum, ThresholdActionEnum, UsageAlertEntity, UsageRecordEntity, UsageSummaryEntity, UsageThresholdEntity, meteringEntities, meteringSchemaContribution };
|
|
230
|
+
export { AggregationTypeEnum, MetricDefinitionEntity, PeriodTypeEnum, ResetPeriodEnum, ThresholdActionEnum, UsageAlertEntity, UsageRecordEntity, UsageSummaryEntity, UsageThresholdEntity, meteringEntities, meteringSchemaContribution };
|
|
231
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/entities/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAMa,cAAA,mBAKX,EAAA,iBAAA,CAL8B,aAK9B;AAKF;AAUA;AAUA;AAUa,cA9BA,eAuGX,EAlGA,iBAAA,CAL0B,aAuG1B;;;;cA7FW,gBAKX,iBAAA,CALyB;;;;cAUd,qBAKX,iBAAA,CAL8B;;;;cAUnB,0CAAsB;MAyEjC,iBAAA,CAAA;;;;;;gDAzEiC;EAAA,SAAA,qCAAA;EA8EtB,KAAA,qCAuEX;EAAA,QAAA,qCAAA;;;;;;;;;;;;;cAvEW,qCAAiB;MAuE5B,iBAAA,CAAA;gDAvE4B;EAAA,QAAA,qCAAA;EA4EjB,WAAA,qCAgEX;EAAA,SAAA,qCAAA;;;;;;;;;;;;;;;cAhEW,sCAAkB;MAgE7B,iBAAA,CAAA,iBAhE6B;EAAA,SAAA,qCAAA;EAqElB,QAAA,qCAyFX;EAAA,WAAA,qCAAA;;;;;;;;;;;;;;;;;cAzFW,wCAAoB;MAyF/B,iBAAA,CAAA;gDAzF+B;EAAA,QAAA,qCAAA;EA8FpB,WAAA,qCAyEX;EAAA,SAAA,qCAAA;;;;;;;;;;;;;;;;;;;AAKW,cA9EA,gBAoFZ,oBApF4B,UAoF5B,CAAA;EAAA,EAAA,EAXC,iBAAA,CAAA,iBAWD;;;;;;;;;;;;;;;;;;;;;cANY,qCAAgB;MAM5B,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;MAN4B,iBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWhB,SAAA,qCAA4B;;;;;;;;;;;;;;;;;;;;;;;;cAA5B,4BAA4B"}
|