@elevasis/core 0.27.0 → 0.29.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 +146 -89
- package/dist/index.js +116 -46
- package/dist/knowledge/index.d.ts +21 -21
- package/dist/organization-model/index.d.ts +146 -89
- package/dist/organization-model/index.js +116 -46
- package/dist/test-utils/index.d.ts +20 -17
- package/dist/test-utils/index.js +22 -20
- package/package.json +1 -1
- package/src/business/acquisition/api-schemas.test.ts +59 -8
- package/src/business/acquisition/api-schemas.ts +10 -5
- package/src/business/acquisition/build-templates.test.ts +187 -240
- package/src/business/acquisition/build-templates.ts +87 -98
- package/src/business/acquisition/types.ts +390 -389
- package/src/execution/engine/index.ts +6 -4
- package/src/execution/engine/tools/lead-service-types.ts +63 -34
- package/src/execution/engine/tools/platform/acquisition/types.ts +7 -8
- package/src/execution/engine/tools/registry.ts +6 -4
- package/src/execution/engine/tools/tool-maps.ts +23 -1
- package/src/organization-model/__tests__/define-domain-record.test.ts +289 -0
- package/src/organization-model/__tests__/om-spine-doc-contract.test.ts +56 -0
- package/src/organization-model/domains/actions.ts +13 -0
- package/src/organization-model/domains/customers.ts +95 -78
- package/src/organization-model/domains/entities.ts +157 -144
- package/src/organization-model/domains/goals.ts +100 -83
- package/src/organization-model/domains/knowledge.ts +106 -93
- package/src/organization-model/domains/offerings.ts +88 -71
- package/src/organization-model/domains/policies.ts +115 -102
- package/src/organization-model/domains/prospecting.ts +2 -327
- package/src/organization-model/domains/roles.ts +109 -96
- package/src/organization-model/domains/statuses.ts +351 -339
- package/src/organization-model/domains/systems.ts +176 -164
- package/src/organization-model/helpers.ts +331 -306
- package/src/organization-model/index.ts +42 -0
- package/src/organization-model/migration-helpers.ts +16 -12
- package/src/organization-model/published.ts +27 -2
- package/src/platform/constants/versions.ts +1 -1
- package/src/reference/_generated/contracts.md +376 -352
- package/src/supabase/database.types.ts +3 -0
|
@@ -1,98 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
? {
|
|
89
|
-
contact: step.recordColumns.contact.map((column: RecordColumnConfig) => ({ ...column }))
|
|
90
|
-
}
|
|
91
|
-
: {})
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
return snapshotStep
|
|
96
|
-
})
|
|
97
|
-
}
|
|
98
|
-
}
|
|
1
|
+
import type {
|
|
2
|
+
CredentialRequirement,
|
|
3
|
+
ListBuilderStep,
|
|
4
|
+
ProspectingBuildTemplate,
|
|
5
|
+
RecordColumnConfig
|
|
6
|
+
} from '../../organization-model/domains/prospecting'
|
|
7
|
+
import type { BuildPlanSnapshot, BuildPlanSnapshotStep } from './types'
|
|
8
|
+
|
|
9
|
+
export interface ProspectingBuildTemplateOption {
|
|
10
|
+
id: string
|
|
11
|
+
label: string
|
|
12
|
+
description?: string | undefined
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function getProspectingBuildTemplateOptions(
|
|
16
|
+
templates: readonly ProspectingBuildTemplate[]
|
|
17
|
+
): ProspectingBuildTemplateOption[] {
|
|
18
|
+
return templates.map(({ id, label, description }) => ({
|
|
19
|
+
id,
|
|
20
|
+
label,
|
|
21
|
+
description
|
|
22
|
+
}))
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function isProspectingBuildTemplateId(
|
|
26
|
+
value: string,
|
|
27
|
+
templates: readonly ProspectingBuildTemplate[] = []
|
|
28
|
+
): boolean {
|
|
29
|
+
return templates.some((template) => template.id === value)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function createBuildPlanSnapshotFromTemplate(template: ProspectingBuildTemplate): BuildPlanSnapshot {
|
|
33
|
+
return {
|
|
34
|
+
templateId: template.id,
|
|
35
|
+
templateLabel: template.label,
|
|
36
|
+
steps: template.steps.map((step: ListBuilderStep): BuildPlanSnapshotStep => {
|
|
37
|
+
const snapshotStep: BuildPlanSnapshotStep = {
|
|
38
|
+
id: step.id,
|
|
39
|
+
label: step.label,
|
|
40
|
+
primaryEntity: step.primaryEntity,
|
|
41
|
+
outputs: [...step.outputs],
|
|
42
|
+
stageKey: step.stageKey,
|
|
43
|
+
recordsStageKey: step.recordsStageKey ?? step.stageKey,
|
|
44
|
+
recordSourceStageKey: step.recordSourceStageKey ?? step.recordsStageKey ?? step.stageKey,
|
|
45
|
+
dependencyMode: step.dependencyMode,
|
|
46
|
+
actionKey: step.actionKey,
|
|
47
|
+
defaultBatchSize: step.defaultBatchSize,
|
|
48
|
+
maxBatchSize: step.maxBatchSize
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (step.description) snapshotStep.description = step.description
|
|
52
|
+
if (step.recordEntity) snapshotStep.recordEntity = step.recordEntity
|
|
53
|
+
if (step.dependsOn?.length) snapshotStep.dependsOn = [...step.dependsOn]
|
|
54
|
+
if (step.credentialRequirements?.length) {
|
|
55
|
+
snapshotStep.credentialRequirements = step.credentialRequirements.map((requirement: CredentialRequirement) => ({
|
|
56
|
+
...requirement
|
|
57
|
+
}))
|
|
58
|
+
}
|
|
59
|
+
if (step.recordColumns) {
|
|
60
|
+
snapshotStep.recordColumns = {
|
|
61
|
+
...(step.recordColumns.company
|
|
62
|
+
? {
|
|
63
|
+
company: step.recordColumns.company.map((column: RecordColumnConfig) => ({ ...column }))
|
|
64
|
+
}
|
|
65
|
+
: {}),
|
|
66
|
+
...(step.recordColumns.contact
|
|
67
|
+
? {
|
|
68
|
+
contact: step.recordColumns.contact.map((column: RecordColumnConfig) => ({ ...column }))
|
|
69
|
+
}
|
|
70
|
+
: {})
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return snapshotStep
|
|
75
|
+
})
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function createBuildPlanSnapshotFromTemplateId(
|
|
80
|
+
templateId: string,
|
|
81
|
+
templates: readonly ProspectingBuildTemplate[] = []
|
|
82
|
+
): BuildPlanSnapshot | null {
|
|
83
|
+
const template = templates.find((item) => item.id === templateId)
|
|
84
|
+
if (!template) return null
|
|
85
|
+
|
|
86
|
+
return createBuildPlanSnapshotFromTemplate(template)
|
|
87
|
+
}
|