Provisioning
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
Source: packages/spec/src/system/provisioning.zod.ts
TypeScript Usage
import { ProvisioningStep, TenantPlan, TenantProvisioningRequest, TenantProvisioningResult, TenantProvisioningStatusEnum, TenantRegion } from '@objectstack/spec/system';
import type { ProvisioningStep, TenantPlan, TenantProvisioningRequest, TenantProvisioningResult, TenantProvisioningStatusEnum, TenantRegion } from '@objectstack/spec/system';
// Validate data
const result = ProvisioningStep.parse(data);ProvisioningStep
Individual provisioning step status
Properties
| 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 |
TenantPlan
Tenant subscription plan
Allowed Values
freeproenterprise
TenantProvisioningRequest
Tenant provisioning request
Properties
| 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 |
TenantProvisioningResult
Tenant provisioning result
Properties
| 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 | Object[] | ✅ | Pipeline step statuses |
| totalDurationMs | integer | optional | Total provisioning duration |
| provisionedAt | string | optional | Provisioning completion time |
| error | string | optional | Error message on failure |
TenantProvisioningStatusEnum
Tenant provisioning lifecycle status
Allowed Values
provisioningactivesuspendedfaileddestroying
TenantRegion
Available deployment region
Allowed Values
us-eastus-westeu-westeu-centralap-southeastap-northeast