Skip to content

Commit 03f6ecb

Browse files
Copilothotlong
andcommitted
Improve TenantSchema deprecation notice with migration guide
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 9d12637 commit 03f6ecb

1 file changed

Lines changed: 26 additions & 2 deletions

File tree

packages/spec/src/hub/tenant.zod.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,34 @@ export type TenantQuota = z.infer<typeof TenantQuotaSchema>;
5151
/**
5252
* Tenant Schema
5353
*
54-
* Legacy schema maintained for backward compatibility.
54+
* @deprecated This schema is maintained for backward compatibility only.
5555
* New implementations should use HubSpaceSchema which embeds tenant concepts.
5656
*
57-
* @deprecated Use HubSpaceSchema instead
57+
* **Migration Guide:**
58+
* ```typescript
59+
* // Old approach (deprecated):
60+
* const tenant: Tenant = {
61+
* id: 'tenant_123',
62+
* name: 'My Tenant',
63+
* isolationLevel: 'shared_schema',
64+
* quotas: { maxUsers: 100 }
65+
* };
66+
*
67+
* // New approach (recommended):
68+
* const space: HubSpace = {
69+
* id: '...uuid...',
70+
* name: 'My Tenant',
71+
* slug: 'my-tenant',
72+
* ownerId: 'user_id',
73+
* runtime: {
74+
* isolation: 'shared_schema',
75+
* quotas: { maxUsers: 100 }
76+
* },
77+
* bom: { ... }
78+
* };
79+
* ```
80+
*
81+
* See HubSpaceSchema in space.zod.ts for the recommended approach.
5882
*/
5983
export const TenantSchema = z.object({
6084
/**

0 commit comments

Comments
 (0)