@elevasis/core 0.29.0 → 0.31.0
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/auth/index.d.ts +5289 -0
- package/dist/auth/index.js +595 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +4 -105
- package/dist/organization-model/index.d.ts +1 -2
- package/dist/organization-model/index.js +4 -105
- package/dist/test-utils/index.d.ts +20 -0
- package/dist/test-utils/index.js +3 -104
- package/package.json +5 -1
- package/src/__tests__/publish.test.ts +8 -7
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +376 -446
- package/src/auth/__tests__/access-key-coverage.test.ts +42 -0
- package/src/auth/__tests__/access-key-scan.ts +117 -0
- package/src/auth/__tests__/access-keys.test.ts +81 -0
- package/src/auth/__tests__/access-model.test.ts +257 -0
- package/src/auth/__tests__/access-test-fixtures.ts +50 -0
- package/src/auth/__tests__/key-catalog-drift.test.ts +33 -0
- package/src/auth/__tests__/platform-admin-bypass-parity.test.ts +67 -0
- package/src/auth/access-keys.ts +173 -0
- package/src/auth/access-model.ts +185 -0
- package/src/auth/index.ts +6 -2
- package/src/auth/multi-tenancy/memberships/membership.ts +2 -4
- package/src/auth/multi-tenancy/permissions.ts +1 -1
- package/src/auth/multi-tenancy/types.ts +3 -12
- package/src/business/acquisition/api-schemas.test.ts +69 -5
- package/src/business/acquisition/crm-state-actions.test.ts +24 -6
- package/src/business/pdf/sections/__tests__/proposal-document.test.ts +146 -0
- package/src/business/pdf/sections/acceptance.ts +114 -112
- package/src/business/pdf/sections/proposal-document.ts +206 -200
- package/src/execution/engine/index.ts +440 -439
- package/src/execution/engine/tools/integration/types/clickup.ts +57 -0
- package/src/execution/engine/tools/integration/types/index.ts +20 -19
- package/src/execution/engine/tools/tool-maps.ts +16 -0
- package/src/organization-model/__tests__/domains/entities.test.ts +35 -56
- package/src/organization-model/domains/entities.ts +0 -103
- package/src/organization-model/domains/sales.test.ts +35 -28
- package/src/organization-model/domains/sales.ts +0 -85
- package/src/organization-model/published.ts +0 -1
- package/src/organization-model/schema.ts +2 -2
- package/src/reference/_generated/contracts.md +0 -94
- package/src/reference/glossary.md +8 -6
- package/src/supabase/database.types.ts +10 -0
package/dist/index.js
CHANGED
|
@@ -831,107 +831,6 @@ var EntitySchema = z.object({
|
|
|
831
831
|
var EntitiesDomainSchema = z.record(z.string(), EntitySchema).refine((record) => Object.entries(record).every(([key, entry]) => entry.id === key), {
|
|
832
832
|
message: "Each entity entry id must match its map key"
|
|
833
833
|
}).default({});
|
|
834
|
-
var ENTITY_ENTRY_INPUTS = [
|
|
835
|
-
{
|
|
836
|
-
id: "crm.deal",
|
|
837
|
-
order: 10,
|
|
838
|
-
label: "Deal",
|
|
839
|
-
description: "A CRM opportunity or sales pipeline record.",
|
|
840
|
-
ownedBySystemId: "sales.crm",
|
|
841
|
-
table: "crm_deals",
|
|
842
|
-
stateCatalogId: "crm.pipeline",
|
|
843
|
-
links: [{ toEntity: "crm.contact", kind: "has-many", via: "deal_contacts", label: "contacts" }]
|
|
844
|
-
},
|
|
845
|
-
{
|
|
846
|
-
id: "crm.contact",
|
|
847
|
-
order: 20,
|
|
848
|
-
label: "CRM Contact",
|
|
849
|
-
description: "A person associated with a CRM relationship or deal.",
|
|
850
|
-
ownedBySystemId: "sales.crm",
|
|
851
|
-
table: "crm_contacts"
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
id: "leadgen.list",
|
|
855
|
-
order: 30,
|
|
856
|
-
label: "Lead List",
|
|
857
|
-
description: "A prospecting list that groups companies and contacts for acquisition workflows.",
|
|
858
|
-
ownedBySystemId: "sales.lead-gen",
|
|
859
|
-
table: "acq_lists",
|
|
860
|
-
links: [
|
|
861
|
-
{ toEntity: "leadgen.company", kind: "has-many", via: "acq_list_companies", label: "companies" },
|
|
862
|
-
{ toEntity: "leadgen.contact", kind: "has-many", via: "acq_list_members", label: "contacts" }
|
|
863
|
-
]
|
|
864
|
-
},
|
|
865
|
-
{
|
|
866
|
-
id: "leadgen.company",
|
|
867
|
-
order: 40,
|
|
868
|
-
label: "Lead Company",
|
|
869
|
-
description: "A company record sourced, enriched, and qualified during prospecting.",
|
|
870
|
-
ownedBySystemId: "sales.lead-gen",
|
|
871
|
-
table: "acq_list_companies",
|
|
872
|
-
stateCatalogId: "lead-gen.company",
|
|
873
|
-
links: [
|
|
874
|
-
{ toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
|
|
875
|
-
{ toEntity: "leadgen.contact", kind: "has-many", via: "company_id", label: "contacts" }
|
|
876
|
-
]
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
id: "leadgen.contact",
|
|
880
|
-
order: 50,
|
|
881
|
-
label: "Lead Contact",
|
|
882
|
-
description: "A prospect contact discovered or enriched during lead generation.",
|
|
883
|
-
ownedBySystemId: "sales.lead-gen",
|
|
884
|
-
table: "acq_list_members",
|
|
885
|
-
stateCatalogId: "lead-gen.contact",
|
|
886
|
-
links: [
|
|
887
|
-
{ toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
|
|
888
|
-
{ toEntity: "leadgen.company", kind: "belongs-to", via: "company_id", label: "company" }
|
|
889
|
-
]
|
|
890
|
-
},
|
|
891
|
-
{
|
|
892
|
-
id: "delivery.project",
|
|
893
|
-
order: 60,
|
|
894
|
-
label: "Project",
|
|
895
|
-
description: "A client delivery project.",
|
|
896
|
-
ownedBySystemId: "projects",
|
|
897
|
-
table: "projects",
|
|
898
|
-
links: [
|
|
899
|
-
{ toEntity: "delivery.milestone", kind: "has-many", via: "project_id", label: "milestones" },
|
|
900
|
-
{ toEntity: "delivery.task", kind: "has-many", via: "project_id", label: "tasks" }
|
|
901
|
-
]
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
id: "delivery.milestone",
|
|
905
|
-
order: 70,
|
|
906
|
-
label: "Milestone",
|
|
907
|
-
description: "A delivery checkpoint within a project.",
|
|
908
|
-
ownedBySystemId: "projects",
|
|
909
|
-
table: "project_milestones",
|
|
910
|
-
links: [
|
|
911
|
-
{ toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
|
|
912
|
-
{ toEntity: "delivery.task", kind: "has-many", via: "milestone_id", label: "tasks" }
|
|
913
|
-
]
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
id: "delivery.task",
|
|
917
|
-
order: 80,
|
|
918
|
-
label: "Task",
|
|
919
|
-
description: "A delivery task that can move through the task status catalog.",
|
|
920
|
-
ownedBySystemId: "projects",
|
|
921
|
-
table: "project_tasks",
|
|
922
|
-
stateCatalogId: "delivery.task",
|
|
923
|
-
links: [
|
|
924
|
-
{ toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
|
|
925
|
-
{ toEntity: "delivery.milestone", kind: "belongs-to", via: "milestone_id", label: "milestone" }
|
|
926
|
-
]
|
|
927
|
-
}
|
|
928
|
-
];
|
|
929
|
-
var DEFAULT_ORGANIZATION_MODEL_ENTITIES = Object.fromEntries(
|
|
930
|
-
ENTITY_ENTRY_INPUTS.map((entity) => {
|
|
931
|
-
const parsed = EntitySchema.parse(entity);
|
|
932
|
-
return [parsed.id, parsed];
|
|
933
|
-
})
|
|
934
|
-
);
|
|
935
834
|
function defineEntity(entry) {
|
|
936
835
|
return EntitySchema.parse(entry);
|
|
937
836
|
}
|
|
@@ -2428,7 +2327,7 @@ var OrganizationModelSchemaBase = z.object({
|
|
|
2428
2327
|
resources: ResourcesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_RESOURCES),
|
|
2429
2328
|
topology: OmTopologyDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_TOPOLOGY),
|
|
2430
2329
|
actions: ActionsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ACTIONS),
|
|
2431
|
-
entities: EntitiesDomainSchema.default(
|
|
2330
|
+
entities: EntitiesDomainSchema.default({}),
|
|
2432
2331
|
policies: PoliciesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_POLICIES),
|
|
2433
2332
|
// D3: flat Record<id, OrgKnowledgeNode> — no wrapper object
|
|
2434
2333
|
knowledge: KnowledgeDomainSchema.default({})
|
|
@@ -2534,7 +2433,7 @@ var SETTINGS_ROLES_SURFACE_ID = "settings.roles";
|
|
|
2534
2433
|
|
|
2535
2434
|
// src/organization-model/defaults.ts
|
|
2536
2435
|
var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {};
|
|
2537
|
-
var
|
|
2436
|
+
var DEFAULT_ORGANIZATION_MODEL_ENTITIES = {};
|
|
2538
2437
|
var DEFAULT_ORGANIZATION_MODEL_NAVIGATION2 = {
|
|
2539
2438
|
sidebar: {
|
|
2540
2439
|
primary: {},
|
|
@@ -2562,7 +2461,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
2562
2461
|
// Generic empty actions map. Elevasis-specific action entries have been relocated to
|
|
2563
2462
|
// `@repo/elevasis-core/src/organization-model/actions.ts`.
|
|
2564
2463
|
actions: {},
|
|
2565
|
-
entities:
|
|
2464
|
+
entities: DEFAULT_ORGANIZATION_MODEL_ENTITIES,
|
|
2566
2465
|
policies: DEFAULT_ORGANIZATION_MODEL_POLICIES,
|
|
2567
2466
|
knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
|
|
2568
2467
|
};
|
|
@@ -3442,4 +3341,4 @@ function scaffoldOrganizationModel(model, spec) {
|
|
|
3442
3341
|
return scaffoldKnowledgeNode(model, spec);
|
|
3443
3342
|
}
|
|
3444
3343
|
|
|
3445
|
-
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA,
|
|
3344
|
+
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, OntologySurfaceTypeSchema, OntologyValueTypeSchema, OrgKnowledgeKindSchema, OrgKnowledgeNodeSchema, OrganizationModelBuiltinIconTokenSchema, OrganizationModelDomainKeySchema, OrganizationModelDomainMetadataByDomainSchema, OrganizationModelDomainMetadataSchema, OrganizationModelIconTokenSchema, OrganizationModelNavigationSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, PROJECTS_SYSTEM_ID, PROJECTS_VIEW_ACTION_ID, PROSPECTING_FEATURE_ID, PROSPECTING_LISTS_SURFACE_ID, PROSPECTING_SYSTEM_ID, PoliciesDomainSchema, PolicyApplicabilitySchema, PolicyEffectSchema, PolicyIdSchema, PolicyPredicateSchema, PolicySchema, PolicyTriggerSchema, PricingModelSchema, ProductSchema, ResourceEntrySchema, ResourceGovernanceStatusSchema, ResourceIdSchema, ResourceKindSchema, ResourceOntologyBindingSchema, ResourcesDomainSchema, RoleHolderSchema, RoleHoldersSchema, RoleIdSchema, RoleSchema, RolesDomainSchema, SALES_FEATURE_ID, SALES_PIPELINE_SURFACE_ID, SALES_SYSTEM_ID, SEO_FEATURE_ID, SEO_SYSTEM_ID, SETTINGS_FEATURE_ID, SETTINGS_ROLES_SURFACE_ID, SETTINGS_SYSTEM_ID, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemEntrySchema, SystemIdSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
|
|
@@ -3013,7 +3013,6 @@ declare const EntitiesDomainSchema: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodO
|
|
|
3013
3013
|
label: z.ZodOptional<z.ZodString>;
|
|
3014
3014
|
}, z.core.$strip>>>;
|
|
3015
3015
|
}, z.core.$strip>>>;
|
|
3016
|
-
declare const DEFAULT_ORGANIZATION_MODEL_ENTITIES: z.infer<typeof EntitiesDomainSchema>;
|
|
3017
3016
|
/** Validate and return a single entity entry. */
|
|
3018
3017
|
declare function defineEntity(entry: z.input<typeof EntitySchema>): z.infer<typeof EntitySchema>;
|
|
3019
3018
|
/** Validate and return an id-keyed map of entity entries. */
|
|
@@ -4796,5 +4795,5 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
4796
4795
|
}, z.core.$strip>>>>;
|
|
4797
4796
|
}, z.core.$strip>;
|
|
4798
4797
|
|
|
4799
|
-
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA,
|
|
4798
|
+
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, OntologySurfaceTypeSchema, OntologyValueTypeSchema, OrgKnowledgeKindSchema, OrgKnowledgeNodeSchema, OrganizationModelBuiltinIconTokenSchema, OrganizationModelDomainKeySchema, OrganizationModelDomainMetadataByDomainSchema, OrganizationModelDomainMetadataSchema, OrganizationModelIconTokenSchema, OrganizationModelNavigationSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, PROJECTS_SYSTEM_ID, PROJECTS_VIEW_ACTION_ID, PROSPECTING_FEATURE_ID, PROSPECTING_LISTS_SURFACE_ID, PROSPECTING_SYSTEM_ID, PoliciesDomainSchema, PolicyApplicabilitySchema, PolicyEffectSchema, PolicyIdSchema, PolicyPredicateSchema, PolicySchema, PolicyTriggerSchema, PricingModelSchema, ProductSchema, ResourceEntrySchema, ResourceGovernanceStatusSchema, ResourceIdSchema, ResourceKindSchema, ResourceOntologyBindingSchema, ResourcesDomainSchema, RoleHolderSchema, RoleHoldersSchema, RoleIdSchema, RoleSchema, RolesDomainSchema, SALES_FEATURE_ID, SALES_PIPELINE_SURFACE_ID, SALES_SYSTEM_ID, SEO_FEATURE_ID, SEO_SYSTEM_ID, SETTINGS_FEATURE_ID, SETTINGS_ROLES_SURFACE_ID, SETTINGS_SYSTEM_ID, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemEntrySchema, SystemIdSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
|
|
4800
4799
|
export type { BaseOmScaffoldSpec, DeepPartial, Entity, EntityId, EntityLink, EventDescriptor, EventEmissionDescriptor, EventId, FoundationBranding, FoundationNavigationSurface, FoundationOrganizationModel, FoundationSurfaceIcon, FoundationSurfaceType, KnowledgeLink, KnowledgeNodeScaffoldSpec, KnowledgeTargetKind, KnowledgeTargetRef, LeadGenStageCatalogEntry, NodeIdPath, NodeIdString, OmScaffoldEdit, OmScaffoldIntent, OmScaffoldPlan, OmScaffoldSpec, OmScaffoldWrite, OntologyActionType, OntologyCatalogType, OntologyCompilation, OntologyDiagnostic, OntologyEventType, OntologyGroup, OntologyId, OntologyInterfaceType, OntologyKind, OntologyLinkType, OntologyObjectType, OntologyRecordOrigin, OntologyRecordScaffoldSpec, OntologyScope, OntologySharedProperty, OntologySurfaceType, OntologyValueType, OrgKnowledgeKind, OrgKnowledgeNode, OrgKnowledgeNodeInput, OrganizationModel, OrganizationModelAction, OrganizationModelActionId, OrganizationModelActionInvocation, OrganizationModelActionInvocationKind, OrganizationModelActionRef, OrganizationModelActionScope, OrganizationModelActions, OrganizationModelAgentKind, OrganizationModelAgentResourceEntry, OrganizationModelAgentRoleHolder, OrganizationModelBranding, OrganizationModelBuiltinIconToken, OrganizationModelCodeReference, OrganizationModelCodeReferenceRole, OrganizationModelContractRef, OrganizationModelCustomerFirmographics, OrganizationModelCustomerSegment, OrganizationModelCustomers, OrganizationModelDomainKey, OrganizationModelDomainMetadata, OrganizationModelDomainMetadataByDomain, OrganizationModelEntities, OrganizationModelEntity, OrganizationModelGoals, OrganizationModelHumanRoleHolder, OrganizationModelIconToken, OrganizationModelIntegrationResourceEntry, OrganizationModelKeyResult, OrganizationModelKnowledge, OrganizationModelNavigation, OrganizationModelObjective, OrganizationModelOfferings, OrganizationModelPolicies, OrganizationModelPolicy, OrganizationModelPolicyApplicability, OrganizationModelPolicyEffect, OrganizationModelPolicyId, OrganizationModelPolicyPredicate, OrganizationModelPolicyTrigger, OrganizationModelPricingModel, OrganizationModelProduct, OrganizationModelResourceEntry, OrganizationModelResourceGovernanceStatus, OrganizationModelResourceId, OrganizationModelResourceKind, OrganizationModelResourceOntologyBinding, OrganizationModelResourceOntologyBindingContract, OrganizationModelResources, OrganizationModelRole, OrganizationModelRoleHolder, OrganizationModelRoleId, OrganizationModelRoles, OrganizationModelScriptResourceEntry, OrganizationModelScriptResourceLanguage, OrganizationModelScriptResourceSource, OrganizationModelSidebar, OrganizationModelSidebarGroupNode, OrganizationModelSidebarNode, OrganizationModelSidebarSection, OrganizationModelSidebarSurfaceNode, OrganizationModelSidebarSurfaceTargets, OrganizationModelStatusEntry, OrganizationModelStatusSemanticClass, OrganizationModelStatuses, OrganizationModelSystemEntry, OrganizationModelSystemId, OrganizationModelSystemKind, OrganizationModelSystemLifecycle, OrganizationModelSystemStatus, OrganizationModelSystems, OrganizationModelTeamRoleHolder, OrganizationModelTechStackEntry, OrganizationModelTopology, OrganizationModelTopologyMetadata, OrganizationModelTopologyNodeKind, OrganizationModelTopologyNodeRef, OrganizationModelTopologyRelationship, OrganizationModelTopologyRelationshipKind, OrganizationModelWorkflowResourceEntry, OrganizationSurfaceProjection, OrganizationSurfaceProjectionIssue, OrganizationSurfaceProjectionIssueCode, ParsedContractRef, ParsedOntologyId, ResolvedOntologyIndex, ResolvedOntologyRecord, ResolvedOntologyRecordEntry, ResolvedOrganizationModel, ResolvedSystemEntry, ResourceScaffoldSpec, SystemEntryWithTree, SystemScaffoldSpec };
|
|
@@ -831,107 +831,6 @@ var EntitySchema = z.object({
|
|
|
831
831
|
var EntitiesDomainSchema = z.record(z.string(), EntitySchema).refine((record) => Object.entries(record).every(([key, entry]) => entry.id === key), {
|
|
832
832
|
message: "Each entity entry id must match its map key"
|
|
833
833
|
}).default({});
|
|
834
|
-
var ENTITY_ENTRY_INPUTS = [
|
|
835
|
-
{
|
|
836
|
-
id: "crm.deal",
|
|
837
|
-
order: 10,
|
|
838
|
-
label: "Deal",
|
|
839
|
-
description: "A CRM opportunity or sales pipeline record.",
|
|
840
|
-
ownedBySystemId: "sales.crm",
|
|
841
|
-
table: "crm_deals",
|
|
842
|
-
stateCatalogId: "crm.pipeline",
|
|
843
|
-
links: [{ toEntity: "crm.contact", kind: "has-many", via: "deal_contacts", label: "contacts" }]
|
|
844
|
-
},
|
|
845
|
-
{
|
|
846
|
-
id: "crm.contact",
|
|
847
|
-
order: 20,
|
|
848
|
-
label: "CRM Contact",
|
|
849
|
-
description: "A person associated with a CRM relationship or deal.",
|
|
850
|
-
ownedBySystemId: "sales.crm",
|
|
851
|
-
table: "crm_contacts"
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
id: "leadgen.list",
|
|
855
|
-
order: 30,
|
|
856
|
-
label: "Lead List",
|
|
857
|
-
description: "A prospecting list that groups companies and contacts for acquisition workflows.",
|
|
858
|
-
ownedBySystemId: "sales.lead-gen",
|
|
859
|
-
table: "acq_lists",
|
|
860
|
-
links: [
|
|
861
|
-
{ toEntity: "leadgen.company", kind: "has-many", via: "acq_list_companies", label: "companies" },
|
|
862
|
-
{ toEntity: "leadgen.contact", kind: "has-many", via: "acq_list_members", label: "contacts" }
|
|
863
|
-
]
|
|
864
|
-
},
|
|
865
|
-
{
|
|
866
|
-
id: "leadgen.company",
|
|
867
|
-
order: 40,
|
|
868
|
-
label: "Lead Company",
|
|
869
|
-
description: "A company record sourced, enriched, and qualified during prospecting.",
|
|
870
|
-
ownedBySystemId: "sales.lead-gen",
|
|
871
|
-
table: "acq_list_companies",
|
|
872
|
-
stateCatalogId: "lead-gen.company",
|
|
873
|
-
links: [
|
|
874
|
-
{ toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
|
|
875
|
-
{ toEntity: "leadgen.contact", kind: "has-many", via: "company_id", label: "contacts" }
|
|
876
|
-
]
|
|
877
|
-
},
|
|
878
|
-
{
|
|
879
|
-
id: "leadgen.contact",
|
|
880
|
-
order: 50,
|
|
881
|
-
label: "Lead Contact",
|
|
882
|
-
description: "A prospect contact discovered or enriched during lead generation.",
|
|
883
|
-
ownedBySystemId: "sales.lead-gen",
|
|
884
|
-
table: "acq_list_members",
|
|
885
|
-
stateCatalogId: "lead-gen.contact",
|
|
886
|
-
links: [
|
|
887
|
-
{ toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
|
|
888
|
-
{ toEntity: "leadgen.company", kind: "belongs-to", via: "company_id", label: "company" }
|
|
889
|
-
]
|
|
890
|
-
},
|
|
891
|
-
{
|
|
892
|
-
id: "delivery.project",
|
|
893
|
-
order: 60,
|
|
894
|
-
label: "Project",
|
|
895
|
-
description: "A client delivery project.",
|
|
896
|
-
ownedBySystemId: "projects",
|
|
897
|
-
table: "projects",
|
|
898
|
-
links: [
|
|
899
|
-
{ toEntity: "delivery.milestone", kind: "has-many", via: "project_id", label: "milestones" },
|
|
900
|
-
{ toEntity: "delivery.task", kind: "has-many", via: "project_id", label: "tasks" }
|
|
901
|
-
]
|
|
902
|
-
},
|
|
903
|
-
{
|
|
904
|
-
id: "delivery.milestone",
|
|
905
|
-
order: 70,
|
|
906
|
-
label: "Milestone",
|
|
907
|
-
description: "A delivery checkpoint within a project.",
|
|
908
|
-
ownedBySystemId: "projects",
|
|
909
|
-
table: "project_milestones",
|
|
910
|
-
links: [
|
|
911
|
-
{ toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
|
|
912
|
-
{ toEntity: "delivery.task", kind: "has-many", via: "milestone_id", label: "tasks" }
|
|
913
|
-
]
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
id: "delivery.task",
|
|
917
|
-
order: 80,
|
|
918
|
-
label: "Task",
|
|
919
|
-
description: "A delivery task that can move through the task status catalog.",
|
|
920
|
-
ownedBySystemId: "projects",
|
|
921
|
-
table: "project_tasks",
|
|
922
|
-
stateCatalogId: "delivery.task",
|
|
923
|
-
links: [
|
|
924
|
-
{ toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
|
|
925
|
-
{ toEntity: "delivery.milestone", kind: "belongs-to", via: "milestone_id", label: "milestone" }
|
|
926
|
-
]
|
|
927
|
-
}
|
|
928
|
-
];
|
|
929
|
-
var DEFAULT_ORGANIZATION_MODEL_ENTITIES = Object.fromEntries(
|
|
930
|
-
ENTITY_ENTRY_INPUTS.map((entity) => {
|
|
931
|
-
const parsed = EntitySchema.parse(entity);
|
|
932
|
-
return [parsed.id, parsed];
|
|
933
|
-
})
|
|
934
|
-
);
|
|
935
834
|
function defineEntity(entry) {
|
|
936
835
|
return EntitySchema.parse(entry);
|
|
937
836
|
}
|
|
@@ -2428,7 +2327,7 @@ var OrganizationModelSchemaBase = z.object({
|
|
|
2428
2327
|
resources: ResourcesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_RESOURCES),
|
|
2429
2328
|
topology: OmTopologyDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_TOPOLOGY),
|
|
2430
2329
|
actions: ActionsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ACTIONS),
|
|
2431
|
-
entities: EntitiesDomainSchema.default(
|
|
2330
|
+
entities: EntitiesDomainSchema.default({}),
|
|
2432
2331
|
policies: PoliciesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_POLICIES),
|
|
2433
2332
|
// D3: flat Record<id, OrgKnowledgeNode> — no wrapper object
|
|
2434
2333
|
knowledge: KnowledgeDomainSchema.default({})
|
|
@@ -2534,7 +2433,7 @@ var SETTINGS_ROLES_SURFACE_ID = "settings.roles";
|
|
|
2534
2433
|
|
|
2535
2434
|
// src/organization-model/defaults.ts
|
|
2536
2435
|
var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {};
|
|
2537
|
-
var
|
|
2436
|
+
var DEFAULT_ORGANIZATION_MODEL_ENTITIES = {};
|
|
2538
2437
|
var DEFAULT_ORGANIZATION_MODEL_NAVIGATION2 = {
|
|
2539
2438
|
sidebar: {
|
|
2540
2439
|
primary: {},
|
|
@@ -2562,7 +2461,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
2562
2461
|
// Generic empty actions map. Elevasis-specific action entries have been relocated to
|
|
2563
2462
|
// `@repo/elevasis-core/src/organization-model/actions.ts`.
|
|
2564
2463
|
actions: {},
|
|
2565
|
-
entities:
|
|
2464
|
+
entities: DEFAULT_ORGANIZATION_MODEL_ENTITIES,
|
|
2566
2465
|
policies: DEFAULT_ORGANIZATION_MODEL_POLICIES,
|
|
2567
2466
|
knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
|
|
2568
2467
|
};
|
|
@@ -3442,4 +3341,4 @@ function scaffoldOrganizationModel(model, spec) {
|
|
|
3442
3341
|
return scaffoldKnowledgeNode(model, spec);
|
|
3443
3342
|
}
|
|
3444
3343
|
|
|
3445
|
-
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA,
|
|
3344
|
+
export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, OntologySurfaceTypeSchema, OntologyValueTypeSchema, OrgKnowledgeKindSchema, OrgKnowledgeNodeSchema, OrganizationModelBuiltinIconTokenSchema, OrganizationModelDomainKeySchema, OrganizationModelDomainMetadataByDomainSchema, OrganizationModelDomainMetadataSchema, OrganizationModelIconTokenSchema, OrganizationModelNavigationSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, PROJECTS_SYSTEM_ID, PROJECTS_VIEW_ACTION_ID, PROSPECTING_FEATURE_ID, PROSPECTING_LISTS_SURFACE_ID, PROSPECTING_SYSTEM_ID, PoliciesDomainSchema, PolicyApplicabilitySchema, PolicyEffectSchema, PolicyIdSchema, PolicyPredicateSchema, PolicySchema, PolicyTriggerSchema, PricingModelSchema, ProductSchema, ResourceEntrySchema, ResourceGovernanceStatusSchema, ResourceIdSchema, ResourceKindSchema, ResourceOntologyBindingSchema, ResourcesDomainSchema, RoleHolderSchema, RoleHoldersSchema, RoleIdSchema, RoleSchema, RolesDomainSchema, SALES_FEATURE_ID, SALES_PIPELINE_SURFACE_ID, SALES_SYSTEM_ID, SEO_FEATURE_ID, SEO_SYSTEM_ID, SETTINGS_FEATURE_ID, SETTINGS_ROLES_SURFACE_ID, SETTINGS_SYSTEM_ID, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemEntrySchema, SystemIdSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
|
|
@@ -2985,6 +2985,12 @@ type Database = {
|
|
|
2985
2985
|
Args: never;
|
|
2986
2986
|
Returns: boolean;
|
|
2987
2987
|
};
|
|
2988
|
+
current_user_shares_org_with: {
|
|
2989
|
+
Args: {
|
|
2990
|
+
other_user_id: string;
|
|
2991
|
+
};
|
|
2992
|
+
Returns: boolean;
|
|
2993
|
+
};
|
|
2988
2994
|
current_user_supabase_id: {
|
|
2989
2995
|
Args: never;
|
|
2990
2996
|
Returns: string;
|
|
@@ -3024,6 +3030,20 @@ type Database = {
|
|
|
3024
3030
|
Args: never;
|
|
3025
3031
|
Returns: string;
|
|
3026
3032
|
};
|
|
3033
|
+
has_org_access: {
|
|
3034
|
+
Args: {
|
|
3035
|
+
action?: string;
|
|
3036
|
+
org_id: string;
|
|
3037
|
+
system_path: string;
|
|
3038
|
+
};
|
|
3039
|
+
Returns: boolean;
|
|
3040
|
+
} | {
|
|
3041
|
+
Args: {
|
|
3042
|
+
action?: string;
|
|
3043
|
+
system_path: string;
|
|
3044
|
+
};
|
|
3045
|
+
Returns: boolean;
|
|
3046
|
+
};
|
|
3027
3047
|
has_org_permission: {
|
|
3028
3048
|
Args: {
|
|
3029
3049
|
org_id: string;
|
package/dist/test-utils/index.js
CHANGED
|
@@ -20173,107 +20173,6 @@ var EntitySchema = z.object({
|
|
|
20173
20173
|
var EntitiesDomainSchema = z.record(z.string(), EntitySchema).refine((record) => Object.entries(record).every(([key, entry]) => entry.id === key), {
|
|
20174
20174
|
message: "Each entity entry id must match its map key"
|
|
20175
20175
|
}).default({});
|
|
20176
|
-
var ENTITY_ENTRY_INPUTS = [
|
|
20177
|
-
{
|
|
20178
|
-
id: "crm.deal",
|
|
20179
|
-
order: 10,
|
|
20180
|
-
label: "Deal",
|
|
20181
|
-
description: "A CRM opportunity or sales pipeline record.",
|
|
20182
|
-
ownedBySystemId: "sales.crm",
|
|
20183
|
-
table: "crm_deals",
|
|
20184
|
-
stateCatalogId: "crm.pipeline",
|
|
20185
|
-
links: [{ toEntity: "crm.contact", kind: "has-many", via: "deal_contacts", label: "contacts" }]
|
|
20186
|
-
},
|
|
20187
|
-
{
|
|
20188
|
-
id: "crm.contact",
|
|
20189
|
-
order: 20,
|
|
20190
|
-
label: "CRM Contact",
|
|
20191
|
-
description: "A person associated with a CRM relationship or deal.",
|
|
20192
|
-
ownedBySystemId: "sales.crm",
|
|
20193
|
-
table: "crm_contacts"
|
|
20194
|
-
},
|
|
20195
|
-
{
|
|
20196
|
-
id: "leadgen.list",
|
|
20197
|
-
order: 30,
|
|
20198
|
-
label: "Lead List",
|
|
20199
|
-
description: "A prospecting list that groups companies and contacts for acquisition workflows.",
|
|
20200
|
-
ownedBySystemId: "sales.lead-gen",
|
|
20201
|
-
table: "acq_lists",
|
|
20202
|
-
links: [
|
|
20203
|
-
{ toEntity: "leadgen.company", kind: "has-many", via: "acq_list_companies", label: "companies" },
|
|
20204
|
-
{ toEntity: "leadgen.contact", kind: "has-many", via: "acq_list_members", label: "contacts" }
|
|
20205
|
-
]
|
|
20206
|
-
},
|
|
20207
|
-
{
|
|
20208
|
-
id: "leadgen.company",
|
|
20209
|
-
order: 40,
|
|
20210
|
-
label: "Lead Company",
|
|
20211
|
-
description: "A company record sourced, enriched, and qualified during prospecting.",
|
|
20212
|
-
ownedBySystemId: "sales.lead-gen",
|
|
20213
|
-
table: "acq_list_companies",
|
|
20214
|
-
stateCatalogId: "lead-gen.company",
|
|
20215
|
-
links: [
|
|
20216
|
-
{ toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
|
|
20217
|
-
{ toEntity: "leadgen.contact", kind: "has-many", via: "company_id", label: "contacts" }
|
|
20218
|
-
]
|
|
20219
|
-
},
|
|
20220
|
-
{
|
|
20221
|
-
id: "leadgen.contact",
|
|
20222
|
-
order: 50,
|
|
20223
|
-
label: "Lead Contact",
|
|
20224
|
-
description: "A prospect contact discovered or enriched during lead generation.",
|
|
20225
|
-
ownedBySystemId: "sales.lead-gen",
|
|
20226
|
-
table: "acq_list_members",
|
|
20227
|
-
stateCatalogId: "lead-gen.contact",
|
|
20228
|
-
links: [
|
|
20229
|
-
{ toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
|
|
20230
|
-
{ toEntity: "leadgen.company", kind: "belongs-to", via: "company_id", label: "company" }
|
|
20231
|
-
]
|
|
20232
|
-
},
|
|
20233
|
-
{
|
|
20234
|
-
id: "delivery.project",
|
|
20235
|
-
order: 60,
|
|
20236
|
-
label: "Project",
|
|
20237
|
-
description: "A client delivery project.",
|
|
20238
|
-
ownedBySystemId: "projects",
|
|
20239
|
-
table: "projects",
|
|
20240
|
-
links: [
|
|
20241
|
-
{ toEntity: "delivery.milestone", kind: "has-many", via: "project_id", label: "milestones" },
|
|
20242
|
-
{ toEntity: "delivery.task", kind: "has-many", via: "project_id", label: "tasks" }
|
|
20243
|
-
]
|
|
20244
|
-
},
|
|
20245
|
-
{
|
|
20246
|
-
id: "delivery.milestone",
|
|
20247
|
-
order: 70,
|
|
20248
|
-
label: "Milestone",
|
|
20249
|
-
description: "A delivery checkpoint within a project.",
|
|
20250
|
-
ownedBySystemId: "projects",
|
|
20251
|
-
table: "project_milestones",
|
|
20252
|
-
links: [
|
|
20253
|
-
{ toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
|
|
20254
|
-
{ toEntity: "delivery.task", kind: "has-many", via: "milestone_id", label: "tasks" }
|
|
20255
|
-
]
|
|
20256
|
-
},
|
|
20257
|
-
{
|
|
20258
|
-
id: "delivery.task",
|
|
20259
|
-
order: 80,
|
|
20260
|
-
label: "Task",
|
|
20261
|
-
description: "A delivery task that can move through the task status catalog.",
|
|
20262
|
-
ownedBySystemId: "projects",
|
|
20263
|
-
table: "project_tasks",
|
|
20264
|
-
stateCatalogId: "delivery.task",
|
|
20265
|
-
links: [
|
|
20266
|
-
{ toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
|
|
20267
|
-
{ toEntity: "delivery.milestone", kind: "belongs-to", via: "milestone_id", label: "milestone" }
|
|
20268
|
-
]
|
|
20269
|
-
}
|
|
20270
|
-
];
|
|
20271
|
-
var DEFAULT_ORGANIZATION_MODEL_ENTITIES = Object.fromEntries(
|
|
20272
|
-
ENTITY_ENTRY_INPUTS.map((entity) => {
|
|
20273
|
-
const parsed = EntitySchema.parse(entity);
|
|
20274
|
-
return [parsed.id, parsed];
|
|
20275
|
-
})
|
|
20276
|
-
);
|
|
20277
20176
|
|
|
20278
20177
|
// src/organization-model/domains/actions.ts
|
|
20279
20178
|
var ActionResourceIdSchema = z.string().trim().min(1).max(255).regex(/^[A-Za-z0-9]+(?:[-._][A-Za-z0-9]+)*$/, "Resource IDs must use letters, numbers, -, _, or . separators");
|
|
@@ -21579,7 +21478,7 @@ var OrganizationModelSchemaBase = z.object({
|
|
|
21579
21478
|
resources: ResourcesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_RESOURCES),
|
|
21580
21479
|
topology: OmTopologyDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_TOPOLOGY),
|
|
21581
21480
|
actions: ActionsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ACTIONS),
|
|
21582
|
-
entities: EntitiesDomainSchema.default(
|
|
21481
|
+
entities: EntitiesDomainSchema.default({}),
|
|
21583
21482
|
policies: PoliciesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_POLICIES),
|
|
21584
21483
|
// D3: flat Record<id, OrgKnowledgeNode> — no wrapper object
|
|
21585
21484
|
knowledge: KnowledgeDomainSchema.default({})
|
|
@@ -21588,7 +21487,7 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine(refineOrga
|
|
|
21588
21487
|
|
|
21589
21488
|
// src/organization-model/defaults.ts
|
|
21590
21489
|
var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {};
|
|
21591
|
-
var
|
|
21490
|
+
var DEFAULT_ORGANIZATION_MODEL_ENTITIES = {};
|
|
21592
21491
|
var DEFAULT_ORGANIZATION_MODEL_NAVIGATION = {
|
|
21593
21492
|
sidebar: {
|
|
21594
21493
|
primary: {},
|
|
@@ -21616,7 +21515,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
|
|
|
21616
21515
|
// Generic empty actions map. Elevasis-specific action entries have been relocated to
|
|
21617
21516
|
// `@repo/elevasis-core/src/organization-model/actions.ts`.
|
|
21618
21517
|
actions: {},
|
|
21619
|
-
entities:
|
|
21518
|
+
entities: DEFAULT_ORGANIZATION_MODEL_ENTITIES,
|
|
21620
21519
|
policies: DEFAULT_ORGANIZATION_MODEL_POLICIES,
|
|
21621
21520
|
knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
|
|
21622
21521
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Minimal shared constants across Elevasis monorepo",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -16,6 +16,10 @@
|
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js"
|
|
18
18
|
},
|
|
19
|
+
"./auth": {
|
|
20
|
+
"types": "./dist/auth/index.d.ts",
|
|
21
|
+
"import": "./dist/auth/index.js"
|
|
22
|
+
},
|
|
19
23
|
"./test-utils": {
|
|
20
24
|
"types": "./dist/test-utils/index.d.ts",
|
|
21
25
|
"import": "./dist/test-utils/index.js"
|
|
@@ -13,12 +13,13 @@ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8')) as {
|
|
|
13
13
|
describe('core publish surface', () => {
|
|
14
14
|
it('publishes the curated @elevasis/core organization-model wrapper', () => {
|
|
15
15
|
expect(packageJson.publishConfig?.name).toBe('@elevasis/core')
|
|
16
|
-
expect(Object.keys(packageJson.publishConfig?.exports ?? {})).toEqual([
|
|
17
|
-
'.',
|
|
18
|
-
'./
|
|
19
|
-
'./
|
|
20
|
-
'./
|
|
21
|
-
'./
|
|
22
|
-
|
|
16
|
+
expect(Object.keys(packageJson.publishConfig?.exports ?? {})).toEqual([
|
|
17
|
+
'.',
|
|
18
|
+
'./auth',
|
|
19
|
+
'./test-utils',
|
|
20
|
+
'./organization-model',
|
|
21
|
+
'./entities',
|
|
22
|
+
'./knowledge'
|
|
23
|
+
])
|
|
23
24
|
})
|
|
24
25
|
})
|