UNPKG

supa-seed

Version:

A constraint-aware, framework-agnostic database seeding framework with deep PostgreSQL business logic discovery and MakerKit integration support

72 lines 2.17 kB
"use strict"; /** * Multi-Tenant Architecture Types * Types and interfaces for tenant-aware seeding */ Object.defineProperty(exports, "__esModule", { value: true }); exports.DEFAULT_TENANT_GENERATION_OPTIONS = exports.MAKERKIT_TENANT_PATTERN = exports.COMMON_TENANT_COLUMNS = void 0; // Constants for common tenant patterns exports.COMMON_TENANT_COLUMNS = [ 'account_id', 'tenant_id', 'org_id', 'organization_id', 'team_id', 'workspace_id', 'company_id' ]; exports.MAKERKIT_TENANT_PATTERN = { accountsTable: 'accounts', profilesTable: 'profiles', accountIdColumn: 'account_id', personalAccountConstraint: 'accounts_slug_null_if_personal_account_true', slugConstraint: 'accounts_slug_check', setupFunction: 'kit.setup_new_user' }; exports.DEFAULT_TENANT_GENERATION_OPTIONS = { generatePersonalAccounts: true, generateTeamAccounts: true, personalAccountRatio: 0.6, // 60% personal, 40% team dataDistributionStrategy: 'realistic', crossTenantDataAllowed: false, sharedResourcesEnabled: true, accountTypes: [ { type: 'personal', weight: 0.6, settings: { defaultPlan: 'free', features: ['basic_features'] } }, { type: 'team', weight: 0.35, settings: { minMembers: 2, maxMembers: 10, defaultPlan: 'pro', features: ['team_features', 'collaboration'] } }, { type: 'organization', weight: 0.05, settings: { minMembers: 10, maxMembers: 100, defaultPlan: 'enterprise', features: ['enterprise_features', 'advanced_security'] } } ], minUsersPerTenant: 1, maxUsersPerTenant: 5, minProjectsPerTenant: 1, maxProjectsPerTenant: 3, allowCrossTenantRelationships: false, sharedTables: ['plans', 'features', 'regions'], respectTenantPlans: true, enforceTenantLimits: true }; //# sourceMappingURL=tenant-types.js.map