License
License protocol schemas
Metric Type Classification
Source: packages/spec/src/system/license.zod.ts
TypeScript Usage
import { Feature, License, LicenseMetricType, Plan } from '@objectstack/spec/system';
import type { Feature, License, LicenseMetricType, Plan } from '@objectstack/spec/system';
// Validate data
const result = Feature.parse(data);Feature
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| code | string | ✅ | Feature code (e.g. core.api_access) |
| label | string | ✅ | |
| description | string | optional | |
| type | Enum<'boolean' | 'counter' | 'gauge'> | ✅ | License metric type |
| unit | Enum<'count' | 'bytes' | 'seconds' | 'percent'> | optional | |
| requires | string[] | optional |
License
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| spaceId | string | ✅ | Target Space ID |
| planCode | string | ✅ | |
| issuedAt | string | ✅ | |
| expiresAt | string | optional | |
| status | Enum<'active' | 'expired' | 'suspended' | 'trial'> | ✅ | |
| customFeatures | string[] | optional | |
| customLimits | Record<string, number> | optional | |
| plugins | string[] | optional | List of enabled plugin package IDs |
| signature | string | optional | Cryptographic signature of the license |
LicenseMetricType
License metric type
Allowed Values
booleancountergauge
Plan
Properties
| Property | Type | Required | Description |
|---|---|---|---|
| code | string | ✅ | Plan code (e.g. pro_v1) |
| label | string | ✅ | |
| active | boolean | ✅ | |
| features | string[] | ✅ | List of enabled boolean features |
| limits | Record<string, number> | ✅ | Map of metric codes to limit values (e.g. { storage_gb: 10 }) |
| currency | string | optional | |
| priceMonthly | number | optional | |
| priceYearly | number | optional |