@objectstack/spec 0.8.2 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -4
- package/dist/ai/devops-agent.zod.d.ts +1 -1
- package/dist/ai/feedback-loop.zod.d.ts +4293 -0
- package/dist/ai/feedback-loop.zod.d.ts.map +1 -0
- package/dist/ai/feedback-loop.zod.js +53 -0
- package/dist/ai/index.d.ts +1 -0
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +1 -0
- package/dist/api/documentation.zod.d.ts +1073 -0
- package/dist/api/documentation.zod.d.ts.map +1 -0
- package/dist/api/documentation.zod.js +487 -0
- package/dist/api/errors.zod.d.ts +6 -6
- package/dist/api/graphql.zod.d.ts +3 -3
- package/dist/api/hub.zod.d.ts +5239 -0
- package/dist/api/hub.zod.d.ts.map +1 -0
- package/dist/api/hub.zod.js +784 -0
- package/dist/api/index.d.ts +4 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +4 -0
- package/dist/api/odata.zod.d.ts +1 -1
- package/dist/api/registry.example.d.ts +411 -0
- package/dist/api/registry.example.d.ts.map +1 -0
- package/dist/api/registry.example.js +470 -0
- package/dist/api/registry.zod.d.ts +2095 -0
- package/dist/api/registry.zod.d.ts.map +1 -0
- package/dist/api/registry.zod.js +755 -0
- package/dist/api/websocket.zod.d.ts +8 -8
- package/dist/auth/scim.zod.d.ts +3 -3
- package/dist/automation/flow.zod.d.ts +3 -3
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.d.ts.map +1 -1
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/schema-driver.d.ts +21 -0
- package/dist/contracts/schema-driver.d.ts.map +1 -0
- package/dist/contracts/schema-driver.js +2 -0
- package/dist/hub/composer.zod.d.ts +226 -0
- package/dist/hub/composer.zod.d.ts.map +1 -1
- package/dist/hub/hub-federation.zod.d.ts +764 -0
- package/dist/hub/hub-federation.zod.d.ts.map +1 -0
- package/dist/hub/hub-federation.zod.js +441 -0
- package/dist/hub/index.d.ts +2 -0
- package/dist/hub/index.d.ts.map +1 -1
- package/dist/hub/index.js +3 -0
- package/dist/hub/plugin-security.zod.d.ts +1029 -0
- package/dist/hub/plugin-security.zod.d.ts.map +1 -0
- package/dist/hub/plugin-security.zod.js +637 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/integration/connector/vercel.zod.d.ts +2 -2
- package/dist/qa/index.d.ts +11 -0
- package/dist/qa/index.d.ts.map +1 -0
- package/dist/qa/index.js +26 -0
- package/dist/qa/testing.zod.d.ts +345 -0
- package/dist/qa/testing.zod.d.ts.map +1 -0
- package/dist/qa/testing.zod.js +69 -0
- package/dist/stack.zod.d.ts +3395 -596
- package/dist/stack.zod.d.ts.map +1 -1
- package/dist/stack.zod.js +20 -2
- package/dist/system/index.d.ts +2 -0
- package/dist/system/index.d.ts.map +1 -1
- package/dist/system/index.js +2 -0
- package/dist/system/manifest.zod.d.ts +226 -0
- package/dist/system/manifest.zod.d.ts.map +1 -1
- package/dist/system/manifest.zod.js +8 -0
- package/dist/system/message-queue.zod.d.ts +2 -2
- package/dist/system/metadata-loader.zod.d.ts +1 -1
- package/dist/system/migration.zod.d.ts +4205 -0
- package/dist/system/migration.zod.d.ts.map +1 -0
- package/dist/system/migration.zod.js +70 -0
- package/dist/system/plugin-loading.zod.d.ts +575 -0
- package/dist/system/plugin-loading.zod.d.ts.map +1 -0
- package/dist/system/plugin-loading.zod.js +612 -0
- package/json-schema/ai/FeedbackLoop.json +7 -0
- package/json-schema/ai/Issue.json +7 -0
- package/json-schema/ai/MetadataSource.json +7 -0
- package/json-schema/ai/Resolution.json +7 -0
- package/json-schema/api/ApiChangelogEntry.json +7 -0
- package/json-schema/api/ApiDiscoveryQuery.json +7 -0
- package/json-schema/api/ApiDiscoveryResponse.json +7 -0
- package/json-schema/api/ApiDocumentationConfig.json +7 -0
- package/json-schema/api/ApiEndpointRegistration.json +7 -0
- package/json-schema/api/ApiMetadata.json +7 -0
- package/json-schema/api/ApiParameter.json +7 -0
- package/json-schema/api/ApiProtocolType.json +7 -0
- package/json-schema/api/ApiRegistry.json +7 -0
- package/json-schema/api/ApiRegistryEntry.json +7 -0
- package/json-schema/api/ApiResponse.json +7 -0
- package/json-schema/api/ApiTestCollection.json +7 -0
- package/json-schema/api/ApiTestRequest.json +7 -0
- package/json-schema/api/ApiTestingUiConfig.json +7 -0
- package/json-schema/api/ApiTestingUiType.json +7 -0
- package/json-schema/api/BuildStatusResponse.json +7 -0
- package/json-schema/api/CodeGenerationTemplate.json +7 -0
- package/json-schema/api/CompileManifestRequest.json +7 -0
- package/json-schema/api/CompileManifestResponse.json +7 -0
- package/json-schema/api/ConflictResolutionStrategy.json +7 -0
- package/json-schema/api/CreateSpaceRequest.json +7 -0
- package/json-schema/api/CreateTenantRequest.json +7 -0
- package/json-schema/api/GeneratedApiDocumentation.json +7 -0
- package/json-schema/api/GetBuildStatusRequest.json +7 -0
- package/json-schema/api/GetMarketplacePluginRequest.json +7 -0
- package/json-schema/api/GetPluginVersionsRequest.json +7 -0
- package/json-schema/api/GetPluginVersionsResponse.json +7 -0
- package/json-schema/api/HttpStatusCode.json +7 -0
- package/json-schema/api/HubHealthResponse.json +7 -0
- package/json-schema/api/HubMetricsResponse.json +7 -0
- package/json-schema/api/IssueLicenseRequest.json +7 -0
- package/json-schema/api/LicenseResponse.json +7 -0
- package/json-schema/api/ListLicensesRequest.json +7 -0
- package/json-schema/api/ListLicensesResponse.json +7 -0
- package/json-schema/api/ListMarketplaceRequest.json +7 -0
- package/json-schema/api/ListMarketplaceResponse.json +7 -0
- package/json-schema/api/ListSpacesRequest.json +7 -0
- package/json-schema/api/ListSpacesResponse.json +7 -0
- package/json-schema/api/ListTenantsRequest.json +7 -0
- package/json-schema/api/ListTenantsResponse.json +7 -0
- package/json-schema/api/MarketplacePluginResponse.json +7 -0
- package/json-schema/api/ObjectQLReference.json +7 -0
- package/json-schema/api/OpenApiSecurityScheme.json +7 -0
- package/json-schema/api/OpenApiServer.json +7 -0
- package/json-schema/api/OpenApiSpec.json +7 -0
- package/json-schema/api/PaginationRequest.json +7 -0
- package/json-schema/api/PaginationResponse.json +7 -0
- package/json-schema/api/PluginResponse.json +7 -0
- package/json-schema/api/PluginVersionInfo.json +7 -0
- package/json-schema/api/PublishPluginRequest.json +7 -0
- package/json-schema/api/RevokeLicenseRequest.json +7 -0
- package/json-schema/api/SchemaDefinition.json +7 -0
- package/json-schema/api/SearchPluginsRequest.json +7 -0
- package/json-schema/api/SearchPluginsResponse.json +7 -0
- package/json-schema/api/SpaceResponse.json +7 -0
- package/json-schema/api/TenantResponse.json +7 -0
- package/json-schema/api/UpdatePluginRequest.json +7 -0
- package/json-schema/api/UpdateSpaceRequest.json +7 -0
- package/json-schema/api/UpdateTenantRequest.json +7 -0
- package/json-schema/api/ValidateLicenseRequest.json +7 -0
- package/json-schema/api/ValidateLicenseResponse.json +7 -0
- package/json-schema/hub/DependencyConflict.json +7 -0
- package/json-schema/hub/DependencyGraph.json +7 -0
- package/json-schema/hub/DependencyGraphNode.json +7 -0
- package/json-schema/hub/DependencyResolutionResult.json +7 -0
- package/json-schema/hub/EdgeLocation.json +7 -0
- package/json-schema/hub/FederationTopology.json +7 -0
- package/json-schema/hub/GlobalRegistryEntry.json +7 -0
- package/json-schema/hub/HubInstance.json +7 -0
- package/json-schema/hub/PackageDependency.json +7 -0
- package/json-schema/hub/PluginProvenance.json +7 -0
- package/json-schema/hub/PluginTrustScore.json +7 -0
- package/json-schema/hub/Region.json +7 -0
- package/json-schema/hub/ReplicationJob.json +7 -0
- package/json-schema/hub/SBOM.json +7 -0
- package/json-schema/hub/SBOMEntry.json +7 -0
- package/json-schema/hub/SecurityPolicy.json +7 -0
- package/json-schema/hub/SecurityScanResult.json +7 -0
- package/json-schema/hub/SecurityVulnerability.json +7 -0
- package/json-schema/hub/TenantPlacementPolicy.json +7 -0
- package/json-schema/hub/VulnerabilitySeverity.json +7 -0
- package/json-schema/qa/TestAction.json +7 -0
- package/json-schema/qa/TestActionType.json +7 -0
- package/json-schema/qa/TestAssertion.json +7 -0
- package/json-schema/qa/TestAssertionType.json +7 -0
- package/json-schema/qa/TestContext.json +7 -0
- package/json-schema/qa/TestScenario.json +7 -0
- package/json-schema/qa/TestStep.json +7 -0
- package/json-schema/qa/TestSuite.json +7 -0
- package/json-schema/system/AddFieldOperation.json +7 -0
- package/json-schema/system/ChangeSet.json +7 -0
- package/json-schema/system/CreateObjectOperation.json +7 -0
- package/json-schema/system/DeleteObjectOperation.json +7 -0
- package/json-schema/system/ExecuteSqlOperation.json +7 -0
- package/json-schema/system/MigrationDependency.json +7 -0
- package/json-schema/system/MigrationOperation.json +7 -0
- package/json-schema/system/ModifyFieldOperation.json +7 -0
- package/json-schema/system/PluginCaching.json +7 -0
- package/json-schema/system/PluginCodeSplitting.json +7 -0
- package/json-schema/system/PluginDependencyResolution.json +7 -0
- package/json-schema/system/PluginDynamicImport.json +7 -0
- package/json-schema/system/PluginHotReload.json +7 -0
- package/json-schema/system/PluginInitialization.json +7 -0
- package/json-schema/system/PluginLoadingConfig.json +7 -0
- package/json-schema/system/PluginLoadingEvent.json +7 -0
- package/json-schema/system/PluginLoadingState.json +7 -0
- package/json-schema/system/PluginLoadingStrategy.json +7 -0
- package/json-schema/system/PluginPerformanceMonitoring.json +7 -0
- package/json-schema/system/PluginPreloadConfig.json +7 -0
- package/json-schema/system/PluginSandboxing.json +7 -0
- package/json-schema/system/RemoveFieldOperation.json +7 -0
- package/json-schema/system/RenameObjectOperation.json +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub-federation.zod.d.ts","sourceRoot":"","sources":["../../src/hub/hub-federation.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AAMH;;GAEG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0DvB,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAElD;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoE5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAM5D;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoFnC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAM1E;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsEtC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAMhF;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqE/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;iBA0BpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAM5E;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwC7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQxB,CAAC"}
|
|
@@ -0,0 +1,441 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HubFederationProtocol = exports.EdgeLocationSchema = exports.GlobalRegistryEntrySchema = exports.ReplicationJobSchema = exports.TenantPlacementPolicySchema = exports.FederationTopologySchema = exports.HubInstanceSchema = exports.RegionSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
/**
|
|
6
|
+
* # Hub Federation Protocol
|
|
7
|
+
*
|
|
8
|
+
* Enables distributed ObjectStack Hub deployments across multiple regions,
|
|
9
|
+
* data centers, or cloud providers. Supports:
|
|
10
|
+
* - Multi-region plugin distribution
|
|
11
|
+
* - Federated identity and tenant management
|
|
12
|
+
* - Cross-region data replication
|
|
13
|
+
* - Global load balancing
|
|
14
|
+
* - Disaster recovery
|
|
15
|
+
*
|
|
16
|
+
* Use cases:
|
|
17
|
+
* - Global SaaS deployments with regional data residency
|
|
18
|
+
* - Multi-cloud resilience
|
|
19
|
+
* - Edge computing with central management
|
|
20
|
+
* - Hybrid cloud deployments
|
|
21
|
+
*/
|
|
22
|
+
// ============================================================================
|
|
23
|
+
// Region & Deployment Topology
|
|
24
|
+
// ============================================================================
|
|
25
|
+
/**
|
|
26
|
+
* Geographic Region
|
|
27
|
+
*/
|
|
28
|
+
exports.RegionSchema = zod_1.z.object({
|
|
29
|
+
/**
|
|
30
|
+
* Region identifier (e.g., us-east-1, eu-west-1, ap-southeast-1)
|
|
31
|
+
*/
|
|
32
|
+
id: zod_1.z.string().regex(/^[a-z]{2}-[a-z]+-\d+$/).describe('Region identifier'),
|
|
33
|
+
/**
|
|
34
|
+
* Display name
|
|
35
|
+
*/
|
|
36
|
+
name: zod_1.z.string().describe('Human-readable region name'),
|
|
37
|
+
/**
|
|
38
|
+
* Geographic location
|
|
39
|
+
*/
|
|
40
|
+
location: zod_1.z.object({
|
|
41
|
+
continent: zod_1.z.enum(['NA', 'SA', 'EU', 'AF', 'AS', 'OC', 'AN']),
|
|
42
|
+
country: zod_1.z.string().regex(/^[A-Z]{2}$/).describe('ISO 3166-1 alpha-2 country code'),
|
|
43
|
+
city: zod_1.z.string().optional(),
|
|
44
|
+
latitude: zod_1.z.number().min(-90).max(90).optional(),
|
|
45
|
+
longitude: zod_1.z.number().min(-180).max(180).optional(),
|
|
46
|
+
}),
|
|
47
|
+
/**
|
|
48
|
+
* Cloud provider and region mapping
|
|
49
|
+
*/
|
|
50
|
+
provider: zod_1.z.object({
|
|
51
|
+
name: zod_1.z.enum(['aws', 'azure', 'gcp', 'cloudflare', 'vercel', 'self-hosted']),
|
|
52
|
+
region: zod_1.z.string().describe('Provider-specific region identifier'),
|
|
53
|
+
}).optional(),
|
|
54
|
+
/**
|
|
55
|
+
* Region capabilities
|
|
56
|
+
*/
|
|
57
|
+
capabilities: zod_1.z.object({
|
|
58
|
+
databases: zod_1.z.array(zod_1.z.enum(['postgres', 'mysql', 'mongodb', 'redis'])).default([]),
|
|
59
|
+
storage: zod_1.z.array(zod_1.z.enum(['s3', 'azure-blob', 'gcs'])).default([]),
|
|
60
|
+
compute: zod_1.z.array(zod_1.z.enum(['containers', 'serverless', 'vm'])).default([]),
|
|
61
|
+
cdn: zod_1.z.boolean().default(false),
|
|
62
|
+
}).optional(),
|
|
63
|
+
/**
|
|
64
|
+
* Compliance and certifications
|
|
65
|
+
*/
|
|
66
|
+
compliance: zod_1.z.array(zod_1.z.enum(['gdpr', 'hipaa', 'soc2', 'iso27001', 'pci-dss'])).default([]),
|
|
67
|
+
/**
|
|
68
|
+
* Region status
|
|
69
|
+
*/
|
|
70
|
+
status: zod_1.z.enum(['active', 'read-only', 'maintenance', 'deprecated']).default('active'),
|
|
71
|
+
/**
|
|
72
|
+
* Resource limits for this region
|
|
73
|
+
*/
|
|
74
|
+
limits: zod_1.z.object({
|
|
75
|
+
maxSpaces: zod_1.z.number().int().positive().optional(),
|
|
76
|
+
maxTenants: zod_1.z.number().int().positive().optional(),
|
|
77
|
+
maxStorage: zod_1.z.number().int().positive().optional().describe('Bytes'),
|
|
78
|
+
}).optional(),
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* Hub Instance
|
|
82
|
+
* Represents a single Hub deployment in a region
|
|
83
|
+
*/
|
|
84
|
+
exports.HubInstanceSchema = zod_1.z.object({
|
|
85
|
+
/**
|
|
86
|
+
* Instance identifier
|
|
87
|
+
*/
|
|
88
|
+
id: zod_1.z.string().uuid(),
|
|
89
|
+
/**
|
|
90
|
+
* Region where this hub is deployed
|
|
91
|
+
*/
|
|
92
|
+
regionId: zod_1.z.string(),
|
|
93
|
+
/**
|
|
94
|
+
* Hub role in federation
|
|
95
|
+
*/
|
|
96
|
+
role: zod_1.z.enum([
|
|
97
|
+
'primary', // Primary/master hub
|
|
98
|
+
'secondary', // Read-replica hub
|
|
99
|
+
'edge', // Edge location for caching
|
|
100
|
+
]),
|
|
101
|
+
/**
|
|
102
|
+
* Endpoint URLs
|
|
103
|
+
*/
|
|
104
|
+
endpoints: zod_1.z.object({
|
|
105
|
+
api: zod_1.z.string().url().describe('Public API endpoint'),
|
|
106
|
+
admin: zod_1.z.string().url().optional().describe('Admin console'),
|
|
107
|
+
grpc: zod_1.z.string().optional().describe('gRPC endpoint for inter-hub communication'),
|
|
108
|
+
}),
|
|
109
|
+
/**
|
|
110
|
+
* Replication configuration
|
|
111
|
+
*/
|
|
112
|
+
replication: zod_1.z.object({
|
|
113
|
+
/**
|
|
114
|
+
* Source hub for replication (if this is a secondary)
|
|
115
|
+
*/
|
|
116
|
+
primaryHubId: zod_1.z.string().uuid().optional(),
|
|
117
|
+
/**
|
|
118
|
+
* Replication lag tolerance in seconds
|
|
119
|
+
*/
|
|
120
|
+
lagTolerance: zod_1.z.number().int().positive().default(5),
|
|
121
|
+
/**
|
|
122
|
+
* Replication mode
|
|
123
|
+
*/
|
|
124
|
+
mode: zod_1.z.enum(['sync', 'async', 'semi-sync']).default('async'),
|
|
125
|
+
}).optional(),
|
|
126
|
+
/**
|
|
127
|
+
* Health status
|
|
128
|
+
*/
|
|
129
|
+
health: zod_1.z.object({
|
|
130
|
+
status: zod_1.z.enum(['healthy', 'degraded', 'unhealthy']),
|
|
131
|
+
lastCheck: zod_1.z.string().datetime(),
|
|
132
|
+
uptime: zod_1.z.number().describe('Seconds'),
|
|
133
|
+
}).optional(),
|
|
134
|
+
/**
|
|
135
|
+
* Version
|
|
136
|
+
*/
|
|
137
|
+
version: zod_1.z.string(),
|
|
138
|
+
/**
|
|
139
|
+
* Metadata
|
|
140
|
+
*/
|
|
141
|
+
createdAt: zod_1.z.string().datetime(),
|
|
142
|
+
updatedAt: zod_1.z.string().datetime(),
|
|
143
|
+
});
|
|
144
|
+
// ============================================================================
|
|
145
|
+
// Federation Topology
|
|
146
|
+
// ============================================================================
|
|
147
|
+
/**
|
|
148
|
+
* Federation Topology
|
|
149
|
+
* Defines the global hub network architecture
|
|
150
|
+
*/
|
|
151
|
+
exports.FederationTopologySchema = zod_1.z.object({
|
|
152
|
+
/**
|
|
153
|
+
* Federation identifier
|
|
154
|
+
*/
|
|
155
|
+
id: zod_1.z.string().uuid(),
|
|
156
|
+
/**
|
|
157
|
+
* Federation name
|
|
158
|
+
*/
|
|
159
|
+
name: zod_1.z.string(),
|
|
160
|
+
/**
|
|
161
|
+
* Regions in this federation
|
|
162
|
+
*/
|
|
163
|
+
regions: zod_1.z.array(exports.RegionSchema),
|
|
164
|
+
/**
|
|
165
|
+
* Hub instances
|
|
166
|
+
*/
|
|
167
|
+
hubs: zod_1.z.array(exports.HubInstanceSchema),
|
|
168
|
+
/**
|
|
169
|
+
* Routing strategy
|
|
170
|
+
*/
|
|
171
|
+
routing: zod_1.z.object({
|
|
172
|
+
/**
|
|
173
|
+
* How to route tenant requests
|
|
174
|
+
*/
|
|
175
|
+
strategy: zod_1.z.enum([
|
|
176
|
+
'geo-proximity', // Route to nearest region
|
|
177
|
+
'data-residency', // Route based on tenant data location
|
|
178
|
+
'least-loaded', // Route to least busy hub
|
|
179
|
+
'custom', // Custom routing logic
|
|
180
|
+
]).default('geo-proximity'),
|
|
181
|
+
/**
|
|
182
|
+
* Failover behavior
|
|
183
|
+
*/
|
|
184
|
+
failover: zod_1.z.object({
|
|
185
|
+
enabled: zod_1.z.boolean().default(true),
|
|
186
|
+
maxRetries: zod_1.z.number().int().min(0).default(3),
|
|
187
|
+
timeout: zod_1.z.number().int().positive().default(5000).describe('Milliseconds'),
|
|
188
|
+
}),
|
|
189
|
+
}),
|
|
190
|
+
/**
|
|
191
|
+
* Data synchronization settings
|
|
192
|
+
*/
|
|
193
|
+
synchronization: zod_1.z.object({
|
|
194
|
+
/**
|
|
195
|
+
* What data to sync across regions
|
|
196
|
+
*/
|
|
197
|
+
scope: zod_1.z.object({
|
|
198
|
+
/**
|
|
199
|
+
* Sync plugin registry
|
|
200
|
+
*/
|
|
201
|
+
plugins: zod_1.z.boolean().default(true),
|
|
202
|
+
/**
|
|
203
|
+
* Sync tenant metadata (not data)
|
|
204
|
+
*/
|
|
205
|
+
tenants: zod_1.z.boolean().default(true),
|
|
206
|
+
/**
|
|
207
|
+
* Sync spaces metadata
|
|
208
|
+
*/
|
|
209
|
+
spaces: zod_1.z.boolean().default(false),
|
|
210
|
+
/**
|
|
211
|
+
* Sync licenses
|
|
212
|
+
*/
|
|
213
|
+
licenses: zod_1.z.boolean().default(true),
|
|
214
|
+
}),
|
|
215
|
+
/**
|
|
216
|
+
* Sync frequency
|
|
217
|
+
*/
|
|
218
|
+
frequency: zod_1.z.enum(['realtime', 'hourly', 'daily']).default('realtime'),
|
|
219
|
+
/**
|
|
220
|
+
* Conflict resolution
|
|
221
|
+
*/
|
|
222
|
+
conflictResolution: zod_1.z.enum(['last-write-wins', 'primary-wins', 'manual']).default('last-write-wins'),
|
|
223
|
+
}),
|
|
224
|
+
});
|
|
225
|
+
// ============================================================================
|
|
226
|
+
// Tenant Placement
|
|
227
|
+
// ============================================================================
|
|
228
|
+
/**
|
|
229
|
+
* Tenant Placement Policy
|
|
230
|
+
* Determines where a tenant's data and runtime reside
|
|
231
|
+
*/
|
|
232
|
+
exports.TenantPlacementPolicySchema = zod_1.z.object({
|
|
233
|
+
/**
|
|
234
|
+
* Tenant identifier
|
|
235
|
+
*/
|
|
236
|
+
tenantId: zod_1.z.string(),
|
|
237
|
+
/**
|
|
238
|
+
* Primary region (where tenant data lives)
|
|
239
|
+
*/
|
|
240
|
+
primaryRegion: zod_1.z.string(),
|
|
241
|
+
/**
|
|
242
|
+
* Replica regions (for disaster recovery)
|
|
243
|
+
*/
|
|
244
|
+
replicaRegions: zod_1.z.array(zod_1.z.string()).default([]),
|
|
245
|
+
/**
|
|
246
|
+
* Data residency constraints
|
|
247
|
+
*/
|
|
248
|
+
dataResidency: zod_1.z.object({
|
|
249
|
+
/**
|
|
250
|
+
* Allowed regions for data storage
|
|
251
|
+
*/
|
|
252
|
+
allowedRegions: zod_1.z.array(zod_1.z.string()).optional(),
|
|
253
|
+
/**
|
|
254
|
+
* Prohibited regions
|
|
255
|
+
*/
|
|
256
|
+
prohibitedRegions: zod_1.z.array(zod_1.z.string()).default([]),
|
|
257
|
+
/**
|
|
258
|
+
* Continent restriction
|
|
259
|
+
*/
|
|
260
|
+
continent: zod_1.z.enum(['NA', 'SA', 'EU', 'AF', 'AS', 'OC', 'AN']).optional(),
|
|
261
|
+
}).optional(),
|
|
262
|
+
/**
|
|
263
|
+
* Failover policy
|
|
264
|
+
*/
|
|
265
|
+
failover: zod_1.z.object({
|
|
266
|
+
/**
|
|
267
|
+
* Enable automatic failover
|
|
268
|
+
*/
|
|
269
|
+
enabled: zod_1.z.boolean().default(true),
|
|
270
|
+
/**
|
|
271
|
+
* Preferred failover order (region IDs)
|
|
272
|
+
*/
|
|
273
|
+
preferredOrder: zod_1.z.array(zod_1.z.string()).default([]),
|
|
274
|
+
/**
|
|
275
|
+
* Maximum acceptable latency for failover target (ms)
|
|
276
|
+
*/
|
|
277
|
+
maxLatency: zod_1.z.number().int().positive().default(100),
|
|
278
|
+
}).optional(),
|
|
279
|
+
/**
|
|
280
|
+
* Latency requirements
|
|
281
|
+
*/
|
|
282
|
+
latency: zod_1.z.object({
|
|
283
|
+
/**
|
|
284
|
+
* Maximum acceptable latency for primary region (ms)
|
|
285
|
+
*/
|
|
286
|
+
maxPrimaryLatency: zod_1.z.number().int().positive().default(50),
|
|
287
|
+
/**
|
|
288
|
+
* Maximum acceptable latency for replicas (ms)
|
|
289
|
+
*/
|
|
290
|
+
maxReplicaLatency: zod_1.z.number().int().positive().default(200),
|
|
291
|
+
}).optional(),
|
|
292
|
+
});
|
|
293
|
+
// ============================================================================
|
|
294
|
+
// Cross-Region Operations
|
|
295
|
+
// ============================================================================
|
|
296
|
+
/**
|
|
297
|
+
* Cross-Region Replication Job
|
|
298
|
+
*/
|
|
299
|
+
exports.ReplicationJobSchema = zod_1.z.object({
|
|
300
|
+
/**
|
|
301
|
+
* Job identifier
|
|
302
|
+
*/
|
|
303
|
+
id: zod_1.z.string().uuid(),
|
|
304
|
+
/**
|
|
305
|
+
* Job type
|
|
306
|
+
*/
|
|
307
|
+
type: zod_1.z.enum([
|
|
308
|
+
'initial-sync', // First-time full sync
|
|
309
|
+
'incremental', // Delta sync
|
|
310
|
+
'conflict-resolution', // Resolve conflicts
|
|
311
|
+
]),
|
|
312
|
+
/**
|
|
313
|
+
* Source hub
|
|
314
|
+
*/
|
|
315
|
+
sourceHubId: zod_1.z.string().uuid(),
|
|
316
|
+
/**
|
|
317
|
+
* Target hub(s)
|
|
318
|
+
*/
|
|
319
|
+
targetHubIds: zod_1.z.array(zod_1.z.string().uuid()),
|
|
320
|
+
/**
|
|
321
|
+
* Resource scope
|
|
322
|
+
*/
|
|
323
|
+
scope: zod_1.z.object({
|
|
324
|
+
/**
|
|
325
|
+
* Resource type
|
|
326
|
+
*/
|
|
327
|
+
resourceType: zod_1.z.enum(['plugin', 'tenant', 'space', 'license', 'all']),
|
|
328
|
+
/**
|
|
329
|
+
* Specific resource IDs (empty = all)
|
|
330
|
+
*/
|
|
331
|
+
resourceIds: zod_1.z.array(zod_1.z.string()).default([]),
|
|
332
|
+
}),
|
|
333
|
+
/**
|
|
334
|
+
* Job status
|
|
335
|
+
*/
|
|
336
|
+
status: zod_1.z.enum(['pending', 'running', 'completed', 'failed', 'cancelled']),
|
|
337
|
+
/**
|
|
338
|
+
* Progress
|
|
339
|
+
*/
|
|
340
|
+
progress: zod_1.z.object({
|
|
341
|
+
total: zod_1.z.number().int().min(0),
|
|
342
|
+
completed: zod_1.z.number().int().min(0),
|
|
343
|
+
failed: zod_1.z.number().int().min(0),
|
|
344
|
+
}).optional(),
|
|
345
|
+
/**
|
|
346
|
+
* Timestamps
|
|
347
|
+
*/
|
|
348
|
+
createdAt: zod_1.z.string().datetime(),
|
|
349
|
+
startedAt: zod_1.z.string().datetime().optional(),
|
|
350
|
+
completedAt: zod_1.z.string().datetime().optional(),
|
|
351
|
+
/**
|
|
352
|
+
* Errors
|
|
353
|
+
*/
|
|
354
|
+
errors: zod_1.z.array(zod_1.z.object({
|
|
355
|
+
timestamp: zod_1.z.string().datetime(),
|
|
356
|
+
resourceId: zod_1.z.string(),
|
|
357
|
+
error: zod_1.z.string(),
|
|
358
|
+
})).default([]),
|
|
359
|
+
});
|
|
360
|
+
/**
|
|
361
|
+
* Global Registry Entry
|
|
362
|
+
* Tracks where a resource exists across regions
|
|
363
|
+
*/
|
|
364
|
+
exports.GlobalRegistryEntrySchema = zod_1.z.object({
|
|
365
|
+
/**
|
|
366
|
+
* Resource identifier
|
|
367
|
+
*/
|
|
368
|
+
resourceId: zod_1.z.string(),
|
|
369
|
+
/**
|
|
370
|
+
* Resource type
|
|
371
|
+
*/
|
|
372
|
+
resourceType: zod_1.z.enum(['plugin', 'tenant', 'space', 'license']),
|
|
373
|
+
/**
|
|
374
|
+
* Regions where this resource exists
|
|
375
|
+
*/
|
|
376
|
+
locations: zod_1.z.array(zod_1.z.object({
|
|
377
|
+
regionId: zod_1.z.string(),
|
|
378
|
+
hubId: zod_1.z.string().uuid(),
|
|
379
|
+
isPrimary: zod_1.z.boolean().default(false),
|
|
380
|
+
lastSyncedAt: zod_1.z.string().datetime().optional(),
|
|
381
|
+
version: zod_1.z.string().optional(),
|
|
382
|
+
})),
|
|
383
|
+
/**
|
|
384
|
+
* Global version vector clock (for conflict detection)
|
|
385
|
+
*/
|
|
386
|
+
versionVector: zod_1.z.record(zod_1.z.string(), zod_1.z.number().int()).optional(),
|
|
387
|
+
});
|
|
388
|
+
// ============================================================================
|
|
389
|
+
// Edge Computing
|
|
390
|
+
// ============================================================================
|
|
391
|
+
/**
|
|
392
|
+
* Edge Location
|
|
393
|
+
* Represents a CDN/edge cache location
|
|
394
|
+
*/
|
|
395
|
+
exports.EdgeLocationSchema = zod_1.z.object({
|
|
396
|
+
/**
|
|
397
|
+
* Location identifier
|
|
398
|
+
*/
|
|
399
|
+
id: zod_1.z.string(),
|
|
400
|
+
/**
|
|
401
|
+
* Parent region
|
|
402
|
+
*/
|
|
403
|
+
regionId: zod_1.z.string(),
|
|
404
|
+
/**
|
|
405
|
+
* Location details
|
|
406
|
+
*/
|
|
407
|
+
location: exports.RegionSchema.shape.location,
|
|
408
|
+
/**
|
|
409
|
+
* Caching configuration
|
|
410
|
+
*/
|
|
411
|
+
cache: zod_1.z.object({
|
|
412
|
+
/**
|
|
413
|
+
* What to cache at edge
|
|
414
|
+
*/
|
|
415
|
+
resources: zod_1.z.array(zod_1.z.enum(['plugins', 'static-assets', 'api-responses'])).default([]),
|
|
416
|
+
/**
|
|
417
|
+
* TTL in seconds
|
|
418
|
+
*/
|
|
419
|
+
ttl: zod_1.z.number().int().positive().default(3600),
|
|
420
|
+
/**
|
|
421
|
+
* Cache size limit (bytes)
|
|
422
|
+
*/
|
|
423
|
+
maxSize: zod_1.z.number().int().positive().optional(),
|
|
424
|
+
}),
|
|
425
|
+
/**
|
|
426
|
+
* Status
|
|
427
|
+
*/
|
|
428
|
+
status: zod_1.z.enum(['active', 'inactive']).default('active'),
|
|
429
|
+
});
|
|
430
|
+
// ============================================================================
|
|
431
|
+
// Export All
|
|
432
|
+
// ============================================================================
|
|
433
|
+
exports.HubFederationProtocol = {
|
|
434
|
+
Region: exports.RegionSchema,
|
|
435
|
+
HubInstance: exports.HubInstanceSchema,
|
|
436
|
+
FederationTopology: exports.FederationTopologySchema,
|
|
437
|
+
TenantPlacementPolicy: exports.TenantPlacementPolicySchema,
|
|
438
|
+
ReplicationJob: exports.ReplicationJobSchema,
|
|
439
|
+
GlobalRegistryEntry: exports.GlobalRegistryEntrySchema,
|
|
440
|
+
EdgeLocation: exports.EdgeLocationSchema,
|
|
441
|
+
};
|
package/dist/hub/index.d.ts
CHANGED
package/dist/hub/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hub/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hub/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAG9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
|
package/dist/hub/index.js
CHANGED
|
@@ -21,3 +21,6 @@ __exportStar(require("./plugin-registry.zod"), exports);
|
|
|
21
21
|
__exportStar(require("./space.zod"), exports);
|
|
22
22
|
__exportStar(require("./tenant.zod"), exports);
|
|
23
23
|
__exportStar(require("./license.zod"), exports);
|
|
24
|
+
// Export Enhanced Hub Protocols
|
|
25
|
+
__exportStar(require("./hub-federation.zod"), exports);
|
|
26
|
+
__exportStar(require("./plugin-security.zod"), exports);
|