@elevasis/core 0.10.0 → 0.11.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/dist/index.d.ts +69 -159
- package/dist/index.js +324 -613
- package/dist/organization-model/index.d.ts +69 -159
- package/dist/organization-model/index.js +324 -613
- package/dist/test-utils/index.d.ts +192 -45
- package/dist/test-utils/index.js +260 -600
- package/package.json +1 -1
- package/src/__tests__/template-core-compatibility.test.ts +73 -91
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +94 -182
- package/src/auth/multi-tenancy/index.ts +20 -17
- package/src/auth/multi-tenancy/memberships/api-schemas.ts +142 -126
- package/src/auth/multi-tenancy/memberships/index.ts +26 -22
- package/src/auth/multi-tenancy/permissions.test.ts +42 -0
- package/src/auth/multi-tenancy/permissions.ts +104 -0
- package/src/organization-model/README.md +102 -97
- package/src/organization-model/__tests__/defaults.test.ts +19 -6
- package/src/organization-model/__tests__/domains/resource-mappings.test.ts +24 -93
- package/src/organization-model/__tests__/graph.test.ts +82 -894
- package/src/organization-model/__tests__/resolve.test.ts +59 -690
- package/src/organization-model/__tests__/schema.test.ts +83 -407
- package/src/organization-model/contracts.ts +4 -3
- package/src/organization-model/defaults.ts +277 -141
- package/src/organization-model/domains/features.ts +31 -22
- package/src/organization-model/domains/navigation.ts +27 -20
- package/src/organization-model/foundation.ts +42 -54
- package/src/organization-model/graph/build.ts +42 -217
- package/src/organization-model/graph/index.ts +4 -4
- package/src/organization-model/graph/link.ts +10 -0
- package/src/organization-model/graph/schema.ts +21 -16
- package/src/organization-model/graph/types.ts +10 -10
- package/src/organization-model/helpers.ts +74 -0
- package/src/organization-model/index.ts +7 -7
- package/src/organization-model/organization-graph.mdx +89 -272
- package/src/organization-model/organization-model.mdx +152 -320
- package/src/organization-model/published.ts +20 -19
- package/src/organization-model/resolve.ts +8 -33
- package/src/organization-model/schema.ts +63 -205
- package/src/organization-model/types.ts +12 -11
- package/src/platform/constants/versions.ts +3 -3
- package/src/platform/registry/__tests__/command-view.test.ts +6 -5
- package/src/platform/registry/__tests__/resource-link.test.ts +30 -0
- package/src/platform/registry/__tests__/resource-registry.integration.test.ts +15 -15
- package/src/platform/registry/command-view.ts +10 -12
- package/src/platform/registry/index.ts +93 -93
- package/src/platform/registry/resource-link.ts +32 -0
- package/src/platform/registry/resource-registry.ts +917 -876
- package/src/platform/registry/serialization.ts +56 -73
- package/src/platform/registry/serialized-types.ts +17 -12
- package/src/platform/registry/types.ts +14 -43
- package/src/reference/_generated/contracts.md +94 -182
- package/src/reference/glossary.md +71 -105
- package/src/scaffold-registry/__tests__/index.test.ts +125 -1
- package/src/scaffold-registry/__tests__/schema.test.ts +48 -20
- package/src/scaffold-registry/index.ts +236 -188
- package/src/scaffold-registry/schema.ts +47 -22
- package/src/supabase/database.types.ts +2880 -2719
- package/src/test-utils/fixtures/memberships.ts +82 -80
- package/src/platform/registry/domains.ts +0 -165
|
@@ -1,93 +1,93 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resource Registry exports
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
WebhookProviderType,
|
|
39
|
-
WebhookTriggerConfig,
|
|
40
|
-
ScheduleTriggerConfig,
|
|
41
|
-
EventTriggerConfig,
|
|
42
|
-
TriggerConfig
|
|
43
|
-
} from './types'
|
|
44
|
-
|
|
45
|
-
// Serialized Types (for API responses)
|
|
46
|
-
export type {
|
|
47
|
-
SerializedAgentDefinition,
|
|
48
|
-
SerializedWorkflowDefinition,
|
|
49
|
-
SerializedExecutionInterface,
|
|
50
|
-
SerializedExecutionFormSchema,
|
|
51
|
-
SerializedFormField,
|
|
52
|
-
SerializedFormSchema,
|
|
53
|
-
SerializedOrganizationData
|
|
54
|
-
} from './serialized-types'
|
|
55
|
-
|
|
56
|
-
// Command View Types (for graph visualization)
|
|
57
|
-
export type {
|
|
58
|
-
CommandViewAgent,
|
|
59
|
-
CommandViewWorkflow,
|
|
60
|
-
CommandViewNode,
|
|
61
|
-
CommandViewNodeType,
|
|
62
|
-
CommandViewEdge,
|
|
63
|
-
CommandViewData,
|
|
64
|
-
RelationshipType
|
|
65
|
-
} from './command-view'
|
|
66
|
-
|
|
67
|
-
// Command View Utilities
|
|
68
|
-
export {
|
|
69
|
-
isAgent,
|
|
70
|
-
isWorkflow,
|
|
71
|
-
isTrigger,
|
|
72
|
-
isIntegration,
|
|
73
|
-
isExternalResource,
|
|
74
|
-
isHumanCheckpoint,
|
|
75
|
-
getNodeId,
|
|
76
|
-
getNodeType
|
|
77
|
-
} from './command-view'
|
|
78
|
-
|
|
79
|
-
// Command View Stats types (moved from command-view/)
|
|
80
|
-
export type {
|
|
81
|
-
StatsTimeRange,
|
|
82
|
-
ResourceStats,
|
|
83
|
-
ResourceErrorsResponse,
|
|
84
|
-
ErrorSummary,
|
|
85
|
-
CommandViewExecution,
|
|
86
|
-
ResourceExecutionsResponse,
|
|
87
|
-
HumanCheckpointStats,
|
|
88
|
-
CommandViewStatsResponse
|
|
89
|
-
} from './stats-types'
|
|
90
|
-
|
|
91
|
-
// Resource Metadata (icon names, colors)
|
|
92
|
-
export type { ResourceDefinitionType, NodeColorType } from './resource-metadata'
|
|
93
|
-
export { resourceTypeIconNames, resourceTypeColors, getResourceIconName, getResourceColor } from './resource-metadata'
|
|
1
|
+
/**
|
|
2
|
+
* Resource Registry exports
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { ResourceCategorySchema, ResourceLinkSchema, kindPrefix, validateNodeId } from './resource-link'
|
|
6
|
+
export type { ResourceCategory, ResourceLink } from './resource-link'
|
|
7
|
+
|
|
8
|
+
export { RESERVED_RESOURCE_IDS, SYSTEM_RESOURCE_IDS, isReservedResourceId } from './reserved'
|
|
9
|
+
|
|
10
|
+
export { ResourceRegistry } from './resource-registry'
|
|
11
|
+
export type { DeploymentSpec, OrganizationRegistry, RemoteOrgConfig, SystemConfig } from './resource-registry'
|
|
12
|
+
|
|
13
|
+
// Validation utilities
|
|
14
|
+
export {
|
|
15
|
+
validateDeploymentSpec,
|
|
16
|
+
validateRelationships,
|
|
17
|
+
validateExecutionInterface,
|
|
18
|
+
RegistryValidationError
|
|
19
|
+
} from './validation'
|
|
20
|
+
|
|
21
|
+
// Serialization utilities
|
|
22
|
+
export { serializeAllOrganizations, serializeOrganization, buildEdges } from './serialization'
|
|
23
|
+
|
|
24
|
+
// Types
|
|
25
|
+
export type {
|
|
26
|
+
ResourceStatus,
|
|
27
|
+
ResourceType,
|
|
28
|
+
ExecutableResourceType,
|
|
29
|
+
ResourceDefinition,
|
|
30
|
+
ResourceList,
|
|
31
|
+
TriggerDefinition,
|
|
32
|
+
IntegrationDefinition,
|
|
33
|
+
RelationshipDeclaration,
|
|
34
|
+
ResourceRelationships,
|
|
35
|
+
ExternalPlatform,
|
|
36
|
+
ExternalResourceDefinition,
|
|
37
|
+
HumanCheckpointDefinition,
|
|
38
|
+
WebhookProviderType,
|
|
39
|
+
WebhookTriggerConfig,
|
|
40
|
+
ScheduleTriggerConfig,
|
|
41
|
+
EventTriggerConfig,
|
|
42
|
+
TriggerConfig
|
|
43
|
+
} from './types'
|
|
44
|
+
|
|
45
|
+
// Serialized Types (for API responses)
|
|
46
|
+
export type {
|
|
47
|
+
SerializedAgentDefinition,
|
|
48
|
+
SerializedWorkflowDefinition,
|
|
49
|
+
SerializedExecutionInterface,
|
|
50
|
+
SerializedExecutionFormSchema,
|
|
51
|
+
SerializedFormField,
|
|
52
|
+
SerializedFormSchema,
|
|
53
|
+
SerializedOrganizationData
|
|
54
|
+
} from './serialized-types'
|
|
55
|
+
|
|
56
|
+
// Command View Types (for graph visualization)
|
|
57
|
+
export type {
|
|
58
|
+
CommandViewAgent,
|
|
59
|
+
CommandViewWorkflow,
|
|
60
|
+
CommandViewNode,
|
|
61
|
+
CommandViewNodeType,
|
|
62
|
+
CommandViewEdge,
|
|
63
|
+
CommandViewData,
|
|
64
|
+
RelationshipType
|
|
65
|
+
} from './command-view'
|
|
66
|
+
|
|
67
|
+
// Command View Utilities
|
|
68
|
+
export {
|
|
69
|
+
isAgent,
|
|
70
|
+
isWorkflow,
|
|
71
|
+
isTrigger,
|
|
72
|
+
isIntegration,
|
|
73
|
+
isExternalResource,
|
|
74
|
+
isHumanCheckpoint,
|
|
75
|
+
getNodeId,
|
|
76
|
+
getNodeType
|
|
77
|
+
} from './command-view'
|
|
78
|
+
|
|
79
|
+
// Command View Stats types (moved from command-view/)
|
|
80
|
+
export type {
|
|
81
|
+
StatsTimeRange,
|
|
82
|
+
ResourceStats,
|
|
83
|
+
ResourceErrorsResponse,
|
|
84
|
+
ErrorSummary,
|
|
85
|
+
CommandViewExecution,
|
|
86
|
+
ResourceExecutionsResponse,
|
|
87
|
+
HumanCheckpointStats,
|
|
88
|
+
CommandViewStatsResponse
|
|
89
|
+
} from './stats-types'
|
|
90
|
+
|
|
91
|
+
// Resource Metadata (icon names, colors)
|
|
92
|
+
export type { ResourceDefinitionType, NodeColorType } from './resource-metadata'
|
|
93
|
+
export { resourceTypeIconNames, resourceTypeColors, getResourceIconName, getResourceColor } from './resource-metadata'
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
import { LinkSchema } from '../../organization-model/graph/link'
|
|
3
|
+
import type { OrganizationGraph } from '../../organization-model/graph/types'
|
|
4
|
+
import type { Link } from '../../organization-model/graph/link'
|
|
5
|
+
|
|
6
|
+
export const ResourceCategorySchema = z.enum(['production', 'diagnostic', 'internal', 'testing'])
|
|
7
|
+
|
|
8
|
+
export type ResourceCategory = z.infer<typeof ResourceCategorySchema>
|
|
9
|
+
export type ResourceLink = Link
|
|
10
|
+
|
|
11
|
+
export const ResourceLinkSchema = LinkSchema
|
|
12
|
+
|
|
13
|
+
export function kindPrefix(kind: string, sourceId: string): string {
|
|
14
|
+
return `${kind}:${sourceId}`
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function validateNodeId(nodeId: string, graph: OrganizationGraph): void {
|
|
18
|
+
if (graph.nodes.some((node) => node.id === nodeId)) {
|
|
19
|
+
return
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const known = graph.nodes
|
|
23
|
+
.map((node) => node.id)
|
|
24
|
+
.filter((id) => id.includes(nodeId.split(':')[0] ?? ''))
|
|
25
|
+
.slice(0, 5)
|
|
26
|
+
|
|
27
|
+
throw new Error(
|
|
28
|
+
known.length > 0
|
|
29
|
+
? `Unknown organization graph node "${nodeId}". Nearby known nodes: ${known.join(', ')}`
|
|
30
|
+
: `Unknown organization graph node "${nodeId}".`
|
|
31
|
+
)
|
|
32
|
+
}
|