| title | Provisioning |
|---|---|
| description | Provisioning protocol schemas |
{/*
Tenant Provisioning Protocol
Defines the schemas for the "Register → Instant ObjectOS" provisioning pipeline:
-
User registers → ProvisioningRequest created
-
Turso database created → Schema synced → Seed data applied
-
Tenant status transitions: provisioning → active
Provisioning is designed to be:
-
Idempotent: Re-running the same request produces the same result
-
Observable: Each step has explicit status tracking
-
Fast: Target 2-5 seconds for complete provisioning
import { ProvisioningStepSchema, TenantPlanSchema, TenantProvisioningRequestSchema, TenantProvisioningResultSchema, TenantProvisioningStatusEnum, TenantRegionSchema } from '@objectstack/spec/system';
import type { ProvisioningStep, TenantPlan, TenantProvisioningRequest, TenantProvisioningResult, TenantRegion } from '@objectstack/spec/system';
// Validate data
const result = ProvisioningStepSchema.parse(data);Individual provisioning step status
| Property | Type | Required | Description |
|---|---|---|---|
| name | string |
✅ | Step name (e.g., create_database, sync_schema) |
| status | Enum<'pending' | 'running' | 'completed' | 'failed' | 'skipped'> |
✅ | Step status |
| startedAt | string |
optional | Step start time |
| completedAt | string |
optional | Step completion time |
| durationMs | integer |
optional | Step duration in ms |
| error | string |
optional | Error message on failure |
Tenant subscription plan
freeproenterprise
Tenant provisioning request
| Property | Type | Required | Description |
|---|---|---|---|
| orgId | string |
✅ | Organization ID |
| plan | Enum<'free' | 'pro' | 'enterprise'> |
✅ | Tenant subscription plan |
| region | Enum<'us-east' | 'us-west' | 'eu-west' | 'eu-central' | 'ap-southeast' | 'ap-northeast'> |
✅ | Available deployment region |
| displayName | string |
optional | Tenant display name |
| adminEmail | string |
optional | Initial admin user email |
| metadata | Record<string, any> |
optional | Additional metadata |
Tenant provisioning result
| Property | Type | Required | Description |
|---|---|---|---|
| tenantId | string |
✅ | Provisioned tenant ID |
| connectionUrl | string |
✅ | Database connection URL |
| status | Enum<'provisioning' | 'active' | 'suspended' | 'failed' | 'destroying'> |
✅ | Tenant provisioning lifecycle status |
| region | Enum<'us-east' | 'us-west' | 'eu-west' | 'eu-central' | 'ap-southeast' | 'ap-northeast'> |
✅ | Available deployment region |
| plan | Enum<'free' | 'pro' | 'enterprise'> |
✅ | Tenant subscription plan |
| steps | { name: string; status: Enum<'pending' | 'running' | 'completed' | 'failed' | 'skipped'>; startedAt?: string; completedAt?: string; … }[] |
✅ | Pipeline step statuses |
| totalDurationMs | integer |
optional | Total provisioning duration |
| provisionedAt | string |
optional | Provisioning completion time |
| error | string |
optional | Error message on failure |
Tenant provisioning lifecycle status
provisioningactivesuspendedfaileddestroying
Available deployment region
us-eastus-westeu-westeu-centralap-southeastap-northeast