@elevasis/core 0.24.1 → 0.26.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/index.d.ts +239 -86
- package/dist/index.js +474 -1346
- package/dist/knowledge/index.d.ts +57 -39
- package/dist/knowledge/index.js +1 -1
- package/dist/organization-model/index.d.ts +239 -86
- package/dist/organization-model/index.js +474 -1346
- package/dist/test-utils/index.d.ts +24 -31
- package/dist/test-utils/index.js +76 -1238
- package/package.json +1 -1
- package/src/_gen/__tests__/__snapshots__/contracts.md.snap +108 -96
- package/src/business/acquisition/api-schemas.test.ts +70 -77
- package/src/business/acquisition/api-schemas.ts +21 -42
- package/src/business/acquisition/derive-actions.test.ts +11 -21
- package/src/business/acquisition/derive-actions.ts +61 -14
- package/src/business/acquisition/ontology-validation.ts +4 -4
- package/src/business/acquisition/types.ts +7 -8
- package/src/execution/engine/llm/adapters/__tests__/openrouter.integration.test.ts +10 -10
- package/src/knowledge/__tests__/queries.test.ts +960 -546
- package/src/knowledge/format.ts +322 -100
- package/src/knowledge/index.ts +18 -5
- package/src/knowledge/queries.ts +1004 -240
- package/src/organization-model/__tests__/content-kinds-registry.test.ts +35 -210
- package/src/organization-model/__tests__/defaults.test.ts +4 -4
- package/src/organization-model/__tests__/deprecate-helpers.test.ts +71 -0
- package/src/organization-model/__tests__/domains/actions.test.ts +12 -36
- package/src/organization-model/__tests__/domains/offerings.test.ts +13 -6
- package/src/organization-model/__tests__/domains/resources.test.ts +497 -350
- package/src/organization-model/__tests__/domains/systems.test.ts +6 -7
- package/src/organization-model/__tests__/flatten-additive-merge.test.ts +68 -80
- package/src/organization-model/__tests__/foundation.test.ts +81 -14
- package/src/organization-model/__tests__/graph.test.ts +662 -694
- package/src/organization-model/__tests__/knowledge.test.ts +31 -17
- package/src/organization-model/__tests__/lookup-helpers.test.ts +128 -438
- package/src/organization-model/__tests__/migration-helpers.test.ts +362 -591
- package/src/organization-model/__tests__/prospecting-ssot.test.ts +68 -103
- package/src/organization-model/__tests__/published-zero-leak.test.ts +17 -0
- package/src/organization-model/__tests__/recursive-system-schema.test.ts +159 -532
- package/src/organization-model/__tests__/resolve.test.ts +88 -49
- package/src/organization-model/__tests__/scaffolders.test.ts +93 -0
- package/src/organization-model/__tests__/schema.test.ts +65 -56
- package/src/organization-model/catalogs/lead-gen.ts +0 -103
- package/src/organization-model/defaults.ts +17 -702
- package/src/organization-model/domains/actions.ts +116 -333
- package/src/organization-model/domains/knowledge.ts +15 -7
- package/src/organization-model/domains/projects.ts +4 -4
- package/src/organization-model/domains/prospecting.ts +405 -395
- package/src/organization-model/domains/resources.ts +206 -135
- package/src/organization-model/domains/sales.ts +5 -5
- package/src/organization-model/domains/systems.ts +8 -23
- package/src/organization-model/graph/build.ts +223 -294
- package/src/organization-model/graph/schema.ts +2 -3
- package/src/organization-model/graph/types.ts +12 -14
- package/src/organization-model/helpers.ts +120 -141
- package/src/organization-model/icons.ts +1 -0
- package/src/organization-model/index.ts +107 -126
- package/src/organization-model/migration-helpers.ts +211 -249
- package/src/organization-model/ontology.ts +0 -60
- package/src/organization-model/organization-graph.mdx +4 -5
- package/src/organization-model/organization-model.mdx +1 -1
- package/src/organization-model/published.ts +251 -228
- package/src/organization-model/resolve.ts +4 -5
- package/src/organization-model/scaffolders/helpers.ts +84 -0
- package/src/organization-model/scaffolders/index.ts +19 -0
- package/src/organization-model/scaffolders/scaffoldKnowledgeNode.ts +48 -0
- package/src/organization-model/scaffolders/scaffoldOntologyRecord.ts +38 -0
- package/src/organization-model/scaffolders/scaffoldResource.ts +59 -0
- package/src/organization-model/scaffolders/scaffoldSystem.ts +110 -0
- package/src/organization-model/scaffolders/types.ts +81 -0
- package/src/organization-model/schema.ts +610 -704
- package/src/organization-model/types.ts +167 -161
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/registry/__tests__/validation.test.ts +23 -0
- package/src/platform/registry/validation.ts +13 -2
- package/src/reference/_generated/contracts.md +108 -96
- package/src/reference/glossary.md +71 -69
- package/src/organization-model/content-kinds/config.ts +0 -36
- package/src/organization-model/content-kinds/index.ts +0 -78
- package/src/organization-model/content-kinds/pipeline.ts +0 -68
- package/src/organization-model/content-kinds/registry.ts +0 -44
- package/src/organization-model/content-kinds/status.ts +0 -71
- package/src/organization-model/content-kinds/template.ts +0 -83
- package/src/organization-model/content-kinds/types.ts +0 -117
|
@@ -1,103 +1,68 @@
|
|
|
1
|
-
import { describe, expect, it } from 'vitest'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
for (const templateSteps of Object.values(PROSPECTING_STEPS)) {
|
|
70
|
-
for (const step of Object.values(templateSteps)) {
|
|
71
|
-
expect(actionKeys.has(step.actionKey), step.id).toBe(true)
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
|
|
76
|
-
// Phase 4 (D3): DEFAULT_ORGANIZATION_MODEL_PROSPECTING.companyStages and
|
|
77
|
-
// .contactStages were removed — lifecycle stages now live in system.content.
|
|
78
|
-
// Use getAllProspectingStages(model, 'company' | 'contact') from migration-helpers.
|
|
79
|
-
it.skip('derives prospecting lifecycle stages from the stage catalog by entity (deferred — Phase 4: use getAllProspectingStages())', () => {
|
|
80
|
-
// Previously: expect(DEFAULT_ORGANIZATION_MODEL_PROSPECTING.companyStages).toEqual(...)
|
|
81
|
-
// Re-enable when the canonical OM authors stage content nodes and the test
|
|
82
|
-
// verifies getAllProspectingStages() returns the expected catalog-derived set.
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
// Phase 4 (D8): DEFAULT_ORGANIZATION_MODEL_PROSPECTING.buildTemplates removed.
|
|
86
|
-
// Build templates now live in system.content as (schema:template) + (schema:template-step).
|
|
87
|
-
// Use getAllBuildTemplates(model) from migration-helpers.
|
|
88
|
-
it.skip('build templates reference PROSPECTING_STEPS entries (deferred — Phase 4: use getAllBuildTemplates())', () => {
|
|
89
|
-
// Previously: expect(DEFAULT_ORGANIZATION_MODEL_PROSPECTING.buildTemplates).toEqual(...)
|
|
90
|
-
// Re-enable when the canonical OM authors template content nodes and the test
|
|
91
|
-
// verifies getAllBuildTemplates() returns the expected template/step shapes.
|
|
92
|
-
})
|
|
93
|
-
|
|
94
|
-
it('covers all known lead-gen action registry entries', () => {
|
|
95
|
-
expect(ACTION_REGISTRY).toHaveLength(13)
|
|
96
|
-
const actualResourceById = Object.fromEntries(ACTION_REGISTRY.map((c) => [c.id, c.resourceId]))
|
|
97
|
-
expect(actualResourceById).toEqual(EXPECTED_ACTION_RESOURCE_BY_ID)
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
it('bridges the legacy prospecting action registry from the top-level actions domain', () => {
|
|
101
|
-
expect(ACTION_REGISTRY).toEqual(Object.values(LEAD_GEN_ACTION_ENTRIES))
|
|
102
|
-
})
|
|
103
|
-
})
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { ACTION_REGISTRY } from '../domains/prospecting'
|
|
3
|
+
import { getLeadGenStageCatalog } from '../migration-helpers'
|
|
4
|
+
import { resolveOrganizationModel } from '../resolve'
|
|
5
|
+
|
|
6
|
+
describe('prospecting organization-model SSOT', () => {
|
|
7
|
+
it('reads lead-gen processing stages from model-owned ontology catalogs', () => {
|
|
8
|
+
const model = resolveOrganizationModel({
|
|
9
|
+
systems: {
|
|
10
|
+
sales: {
|
|
11
|
+
id: 'sales',
|
|
12
|
+
order: 10,
|
|
13
|
+
label: 'Sales',
|
|
14
|
+
lifecycle: 'active',
|
|
15
|
+
systems: {
|
|
16
|
+
'lead-gen': {
|
|
17
|
+
id: 'sales.lead-gen',
|
|
18
|
+
order: 20,
|
|
19
|
+
label: 'Lead Gen',
|
|
20
|
+
lifecycle: 'active',
|
|
21
|
+
ontology: {
|
|
22
|
+
objectTypes: {
|
|
23
|
+
'sales.lead-gen:object/company': {
|
|
24
|
+
id: 'sales.lead-gen:object/company',
|
|
25
|
+
label: 'Lead Company',
|
|
26
|
+
ownerSystemId: 'sales.lead-gen'
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
catalogTypes: {
|
|
30
|
+
'sales.lead-gen:catalog/company-stage': {
|
|
31
|
+
id: 'sales.lead-gen:catalog/company-stage',
|
|
32
|
+
label: 'Company Stages',
|
|
33
|
+
kind: 'stage',
|
|
34
|
+
appliesTo: 'sales.lead-gen:object/company',
|
|
35
|
+
entries: {
|
|
36
|
+
'decision-makers-enriched': {
|
|
37
|
+
label: 'Decision-makers found',
|
|
38
|
+
description: 'Decision-maker contacts discovered and attached to a qualified company.',
|
|
39
|
+
order: 6,
|
|
40
|
+
entity: 'company',
|
|
41
|
+
recordEntity: 'contact',
|
|
42
|
+
recordStageKey: 'discovered'
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
expect(getLeadGenStageCatalog(model)['decision-makers-enriched']).toEqual({
|
|
55
|
+
key: 'decision-makers-enriched',
|
|
56
|
+
label: 'Decision-makers found',
|
|
57
|
+
description: 'Decision-maker contacts discovered and attached to a qualified company.',
|
|
58
|
+
order: 6,
|
|
59
|
+
entity: 'company',
|
|
60
|
+
recordEntity: 'contact',
|
|
61
|
+
recordStageKey: 'discovered'
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('keeps the generic core prospecting action registry empty', () => {
|
|
66
|
+
expect(ACTION_REGISTRY).toEqual([])
|
|
67
|
+
})
|
|
68
|
+
})
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import * as publishedOrganizationModel from '../published'
|
|
3
|
+
|
|
4
|
+
describe('published organization-model barrel zero-leak guard', () => {
|
|
5
|
+
it('does not export Elevasis instance data through @repo/core/organization-model', () => {
|
|
6
|
+
expect(Object.keys(publishedOrganizationModel)).not.toEqual(
|
|
7
|
+
expect.arrayContaining(['LEAD_GEN_STAGE_CATALOG', 'CRM_ACTION_ENTRIES', 'LEAD_GEN_ACTION_ENTRIES'])
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
const serializedExports = JSON.stringify(publishedOrganizationModel)
|
|
11
|
+
|
|
12
|
+
expect(serializedExports).not.toContain('lgn-01c-apollo-import-workflow')
|
|
13
|
+
expect(serializedExports).not.toContain('lgn-05-email-verification-workflow')
|
|
14
|
+
expect(serializedExports).not.toContain('localServices')
|
|
15
|
+
expect(serializedExports).not.toContain('dtcApolloClickup')
|
|
16
|
+
})
|
|
17
|
+
})
|