@elevasis/sdk 1.55.0 → 1.57.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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/{chunk-72ZGICTR.js → chunk-3XEHBMWM.js} +1 -1
- package/dist/{chunk-R3J6BEPO.js → chunk-HDMMMDIR.js} +225 -67
- package/dist/cli.cjs +209 -109
- package/dist/index.d.ts +82 -20
- package/dist/index.js +1 -1
- package/dist/node/index.d.ts +1 -8
- package/dist/node/index.js +3 -14
- package/dist/test-utils/index.js +2 -2
- package/dist/worker/index.js +2 -2
- package/package.json +2 -2
- package/reference/_navigation.md +4 -4
- package/reference/_reference-manifest.json +3 -3
- package/reference/index.mdx +1 -1
- package/reference/packages/ui/src/knowledge/README.md +32 -32
- package/reference/rules/agent-start-here.md +1 -1
- package/reference/rules/error-handling.md +50 -1
- package/reference/rules/execution.md +63 -7
- package/reference/rules/organization-model.md +3 -2
- package/reference/scaffold/recipes/customize-crm-actions.md +231 -223
- package/reference/scaffold/recipes/customize-organization-model.md +3 -1
- package/reference/scaffold/recipes/extend-crm.md +4 -2
- package/reference/scaffold/recipes/extend-lead-gen.md +2 -2
- package/reference/scaffold/recipes/index.md +2 -2
- package/reference/scaffold/reference/contracts.md +49 -12
- package/reference/scaffold/reference/system-interface-capabilities.md +4 -4
- package/reference/sdk/cli-management.mdx +0 -4
- package/reference/sdk/cli.mdx +0 -4
- package/reference/sdk/concepts.mdx +0 -4
- package/reference/sdk/deployment/command-center.mdx +0 -4
- package/reference/sdk/framework/agent.mdx +0 -4
- package/reference/sdk/framework/index.mdx +0 -4
- package/reference/sdk/framework/project-structure.mdx +1 -7
- package/reference/sdk/getting-started.mdx +0 -4
- package/reference/sdk/index.mdx +4 -8
- package/reference/sdk/platform-tools/index.mdx +0 -4
- package/reference/sdk/resources/index.mdx +0 -4
- package/reference/sdk/resources/patterns.mdx +0 -4
- package/reference/sdk/runtime.mdx +0 -4
- package/reference/sdk/templates/data-enrichment.mdx +0 -4
- package/reference/sdk/templates/email-sender.mdx +0 -4
- package/reference/sdk/templates/index.mdx +0 -4
- package/reference/sdk/templates/lead-scorer.mdx +0 -4
- package/reference/sdk/templates/pdf-generator.mdx +0 -4
- package/reference/sdk/templates/recurring-job.mdx +0 -4
- package/reference/sdk/templates/text-classifier.mdx +0 -4
- package/reference/sdk/templates/web-scraper.mdx +0 -4
- package/reference/sdk/troubleshooting.mdx +0 -4
- package/reference/ui/exports.mdx +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -22654,7 +22654,7 @@ function compileOrganizationOntology(model) {
|
|
|
22654
22654
|
addLegacyActionProjections(ontology, diagnostics, sourcesById, model.actions ?? {}, model.entities ?? {});
|
|
22655
22655
|
return { ontology: sortResolvedOntologyIndex(ontology), diagnostics };
|
|
22656
22656
|
}
|
|
22657
|
-
var OntologyKindSchema, SYSTEM_PATH_PATTERN, LOCAL_ID_PATTERN, ONTOLOGY_ID_PATTERN, ONTOLOGY_ID_REGEX, OntologyIdSchema, OntologyReferenceListSchema, OntologyRecordBaseSchema, OntologyObjectTypeSchema, OntologyLinkTypeSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyInterfaceTypeSchema, OntologyValueTypeSchema, OntologySharedPropertySchema, OntologyGroupSchema, OntologyEndpointTypeSchema, OntologyScopeSchema, DEFAULT_ONTOLOGY_SCOPE, SCOPE_KIND, SCOPE_KEYS;
|
|
22657
|
+
var OntologyKindSchema, SYSTEM_PATH_PATTERN, LOCAL_ID_PATTERN, ONTOLOGY_ID_PATTERN, ONTOLOGY_ID_REGEX, OntologyIdSchema, OntologyReferenceListSchema, OntologyRecordBaseSchema, OntologyObjectTypeSchema, OntologyLinkTypeSchema, OntologyActionAvailabilityConditionSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyInterfaceTypeSchema, OntologyValueTypeSchema, OntologySharedPropertySchema, OntologyGroupSchema, OntologyEndpointTypeSchema, OntologyScopeSchema, DEFAULT_ONTOLOGY_SCOPE, SCOPE_KIND, SCOPE_KEYS;
|
|
22658
22658
|
var init_ontology = __esm({
|
|
22659
22659
|
"../core/src/organization-model/ontology.ts"() {
|
|
22660
22660
|
"use strict";
|
|
@@ -22698,8 +22698,18 @@ var init_ontology = __esm({
|
|
|
22698
22698
|
cardinality: external_exports.string().trim().min(1).max(80).optional(),
|
|
22699
22699
|
via: external_exports.string().trim().min(1).max(255).optional()
|
|
22700
22700
|
}).strict();
|
|
22701
|
+
OntologyActionAvailabilityConditionSchema = external_exports.object({
|
|
22702
|
+
stageKeys: external_exports.array(external_exports.string().trim().min(1).max(200)).min(1),
|
|
22703
|
+
stateKeys: external_exports.array(external_exports.string().trim().min(1).max(200)).optional(),
|
|
22704
|
+
nextActionKeys: external_exports.array(external_exports.string().trim().min(1).max(200)).optional()
|
|
22705
|
+
}).strict();
|
|
22701
22706
|
OntologyActionTypeSchema = OntologyRecordBaseSchema.extend({
|
|
22702
22707
|
actsOn: OntologyReferenceListSchema,
|
|
22708
|
+
// Presentation order for surfaces that list actions (the CRM deal action
|
|
22709
|
+
// bar). Same meaning as the legacy `ActionSchema.order` it replaces; without
|
|
22710
|
+
// it a compiled catalog falls back to the index's alphabetical id sort,
|
|
22711
|
+
// which silently reorders the buttons.
|
|
22712
|
+
order: external_exports.number().optional(),
|
|
22703
22713
|
input: external_exports.record(external_exports.string().trim().min(1).max(200), external_exports.unknown()).optional(),
|
|
22704
22714
|
effects: external_exports.array(external_exports.record(external_exports.string(), external_exports.unknown())).optional(),
|
|
22705
22715
|
resourceId: external_exports.string().trim().min(1).optional(),
|
|
@@ -22707,7 +22717,14 @@ var init_ontology = __esm({
|
|
|
22707
22717
|
lifecycle: external_exports.string().trim().min(1).optional(),
|
|
22708
22718
|
// Carried by the legacy action projection (`addLegacyActionProjections`); not
|
|
22709
22719
|
// authored directly, but a real key an authored record must not collide with.
|
|
22710
|
-
legacyActionId: external_exports.string().trim().min(1).optional()
|
|
22720
|
+
legacyActionId: external_exports.string().trim().min(1).optional(),
|
|
22721
|
+
// Lets a tenant author which deal stage/state/next-action combination makes
|
|
22722
|
+
// this action selectable, instead of hardcoding the predicate in TypeScript.
|
|
22723
|
+
// `compileCrmActionCatalog` reads it; paired with `resourceId` above,
|
|
22724
|
+
// `resourceId` says what to dispatch and `availableFrom` says when.
|
|
22725
|
+
// Absent entirely for action records that are not deal actions — the
|
|
22726
|
+
// compiler skips those rather than erroring.
|
|
22727
|
+
availableFrom: OntologyActionAvailabilityConditionSchema.optional()
|
|
22711
22728
|
}).strict();
|
|
22712
22729
|
OntologyCatalogTypeSchema = OntologyRecordBaseSchema.extend({
|
|
22713
22730
|
kind: external_exports.string().trim().min(1).max(120).optional(),
|
|
@@ -23606,13 +23623,24 @@ function isSystemLifecycleVisible(lifecycle, enabled) {
|
|
|
23606
23623
|
if (enabled === false) return false;
|
|
23607
23624
|
return lifecycle !== "draft" && lifecycle !== "deprecated" && lifecycle !== "archived";
|
|
23608
23625
|
}
|
|
23626
|
+
function requireSystemInterfaceProfile(readinessProfile) {
|
|
23627
|
+
const profile = SYSTEM_INTERFACE_PROFILES.find(
|
|
23628
|
+
(candidate) => candidate.readinessProfile === readinessProfile
|
|
23629
|
+
);
|
|
23630
|
+
if (profile === void 0) {
|
|
23631
|
+
throw new Error(
|
|
23632
|
+
`"${readinessProfile}" is not a member of SYSTEM_INTERFACE_PROFILES. Adoptable ids: ${SYSTEM_INTERFACE_PROFILES.map((candidate) => `"${candidate.readinessProfile}"`).join(", ")}.`
|
|
23633
|
+
);
|
|
23634
|
+
}
|
|
23635
|
+
return profile;
|
|
23636
|
+
}
|
|
23609
23637
|
function isReservedPlatformProfileId(profileId) {
|
|
23610
23638
|
return BUILT_IN_VALIDATED_PROFILE_IDS.includes(profileId);
|
|
23611
23639
|
}
|
|
23612
23640
|
function isBuiltInReadinessProfile(profileId) {
|
|
23613
23641
|
return isReservedPlatformProfileId(profileId) || getBuiltInReadinessProfile(profileId) !== void 0;
|
|
23614
23642
|
}
|
|
23615
|
-
var SystemKindSchema, SystemLifecycleSchema, SystemIdSchema, SystemPathSchema, UiPositionSchema, NodeIdStringSchema, SystemUiSchema, SystemInterfaceKeySchema, SystemInterfaceLifecycleSchema, SYSTEM_INTERFACE_PROFILES, SYSTEM_INTERFACE_READINESS_PROFILES, BUILT_IN_VALIDATED_PROFILE_IDS, SystemInterfaceReadinessProfileSchema, SystemInterfaceResourceScopeSchema, SystemApiInterfaceReadinessContractSchema, SystemApiInterfaceSchema, SystemInterfaceRefSchema, JsonValueSchema, SystemConfigSchema, SystemEntrySchema, SystemsDomainSchema, DEFAULT_ORGANIZATION_MODEL_SYSTEMS;
|
|
23643
|
+
var SystemKindSchema, SystemLifecycleSchema, SystemIdSchema, SystemPathSchema, UiPositionSchema, NodeIdStringSchema, SystemUiSchema, SystemInterfaceKeySchema, SystemInterfaceLifecycleSchema, SYSTEM_INTERFACE_PROFILES, SYSTEM_INTERFACE_READINESS_PROFILES, CONTENT_API_INTERFACE, BUILT_IN_VALIDATED_PROFILE_IDS, SystemInterfaceReadinessProfileSchema, SystemInterfaceResourceScopeSchema, SystemApiInterfaceReadinessContractSchema, SystemApiInterfaceSchema, SystemInterfaceRefSchema, JsonValueSchema, SystemConfigSchema, SystemEntrySchema, SystemsDomainSchema, DEFAULT_ORGANIZATION_MODEL_SYSTEMS;
|
|
23616
23644
|
var init_systems = __esm({
|
|
23617
23645
|
"../core/src/organization-model/domains/systems.ts"() {
|
|
23618
23646
|
"use strict";
|
|
@@ -23676,6 +23704,7 @@ var init_systems = __esm({
|
|
|
23676
23704
|
SYSTEM_INTERFACE_READINESS_PROFILES = SYSTEM_INTERFACE_PROFILES.map(
|
|
23677
23705
|
(profile) => profile.readinessProfile
|
|
23678
23706
|
);
|
|
23707
|
+
CONTENT_API_INTERFACE = requireSystemInterfaceProfile("content.api");
|
|
23679
23708
|
BUILT_IN_VALIDATED_PROFILE_IDS = SYSTEM_INTERFACE_PROFILES.filter(
|
|
23680
23709
|
(profile) => profile.validation === "built-in"
|
|
23681
23710
|
).map((profile) => profile.readinessProfile);
|
|
@@ -26393,10 +26422,68 @@ function defineSystemApiInterface(input) {
|
|
|
26393
26422
|
...input.readinessContract !== void 0 ? { readinessContract: input.readinessContract } : {}
|
|
26394
26423
|
};
|
|
26395
26424
|
}
|
|
26425
|
+
var LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID, LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID, LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID, LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID, LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID, LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID, CRM_PIPELINE_CATALOG_ONTOLOGY_ID, LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID, LEAD_GEN_API_READINESS_CONTRACT, CRM_API_READINESS_CONTRACT;
|
|
26396
26426
|
var init_define_system_api_interface = __esm({
|
|
26397
26427
|
"../core/src/organization-model/catalogs/define-system-api-interface.ts"() {
|
|
26398
26428
|
"use strict";
|
|
26429
|
+
init_ontology();
|
|
26399
26430
|
init_systems();
|
|
26431
|
+
LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
26432
|
+
scope: "sales.lead-gen",
|
|
26433
|
+
kind: "object",
|
|
26434
|
+
localId: "list"
|
|
26435
|
+
});
|
|
26436
|
+
LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
26437
|
+
scope: "sales.lead-gen",
|
|
26438
|
+
kind: "object",
|
|
26439
|
+
localId: "company"
|
|
26440
|
+
});
|
|
26441
|
+
LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
26442
|
+
scope: "sales.lead-gen",
|
|
26443
|
+
kind: "object",
|
|
26444
|
+
localId: "contact"
|
|
26445
|
+
});
|
|
26446
|
+
LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
26447
|
+
scope: "sales.lead-gen",
|
|
26448
|
+
kind: "catalog",
|
|
26449
|
+
localId: "build-template"
|
|
26450
|
+
});
|
|
26451
|
+
LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
26452
|
+
scope: "sales.lead-gen",
|
|
26453
|
+
kind: "catalog",
|
|
26454
|
+
localId: "company-stage"
|
|
26455
|
+
});
|
|
26456
|
+
LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
26457
|
+
scope: "sales.lead-gen",
|
|
26458
|
+
kind: "catalog",
|
|
26459
|
+
localId: "contact-stage"
|
|
26460
|
+
});
|
|
26461
|
+
CRM_PIPELINE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
26462
|
+
scope: "sales.crm",
|
|
26463
|
+
kind: "catalog",
|
|
26464
|
+
localId: "crm.pipeline"
|
|
26465
|
+
});
|
|
26466
|
+
LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
26467
|
+
scope: "sales.lead-gen",
|
|
26468
|
+
kind: "catalog",
|
|
26469
|
+
localId: "lead-gen.stage-catalog"
|
|
26470
|
+
});
|
|
26471
|
+
LEAD_GEN_API_READINESS_CONTRACT = {
|
|
26472
|
+
requiredObjects: [
|
|
26473
|
+
LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID,
|
|
26474
|
+
LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID,
|
|
26475
|
+
LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID
|
|
26476
|
+
],
|
|
26477
|
+
requiredCatalogs: [
|
|
26478
|
+
LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID,
|
|
26479
|
+
LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID,
|
|
26480
|
+
LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID
|
|
26481
|
+
]
|
|
26482
|
+
};
|
|
26483
|
+
CRM_API_READINESS_CONTRACT = {
|
|
26484
|
+
requiredObjects: [],
|
|
26485
|
+
requiredCatalogs: [CRM_PIPELINE_CATALOG_ONTOLOGY_ID]
|
|
26486
|
+
};
|
|
26400
26487
|
}
|
|
26401
26488
|
});
|
|
26402
26489
|
|
|
@@ -26583,6 +26670,22 @@ function tryCompileReadinessOntology(model, readinessProfile, prepareModel, issu
|
|
|
26583
26670
|
return void 0;
|
|
26584
26671
|
}
|
|
26585
26672
|
}
|
|
26673
|
+
function listReadinessContractsOnBuiltInProfiles(model) {
|
|
26674
|
+
const issues = [];
|
|
26675
|
+
for (const { path: path3, system } of listAllSystems(model)) {
|
|
26676
|
+
const apiInterface = system.apiInterface;
|
|
26677
|
+
if (apiInterface?.readinessContract === void 0 || apiInterface.readinessProfile === void 0) continue;
|
|
26678
|
+
if (!isBuiltInReadinessProfile(apiInterface.readinessProfile)) continue;
|
|
26679
|
+
addReadinessIssue(
|
|
26680
|
+
issues,
|
|
26681
|
+
"SYSTEM_INTERFACE_INVALID",
|
|
26682
|
+
"readiness-contract-on-built-in-profile",
|
|
26683
|
+
`System Interface "${formatInterfaceIdentity(path3, "api")}" declares a readinessContract beside built-in profile "${apiInterface.readinessProfile}". The platform owns that profile's requirements and never reads the contract. Delete the readinessContract.`,
|
|
26684
|
+
{ path: `systems.${path3}.apiInterface.readinessContract`, ref: apiInterface.readinessProfile }
|
|
26685
|
+
);
|
|
26686
|
+
}
|
|
26687
|
+
return issues;
|
|
26688
|
+
}
|
|
26586
26689
|
function computeInterfaceReadiness(model, request2) {
|
|
26587
26690
|
const issues = [];
|
|
26588
26691
|
const system = getSystem(model, request2.systemPath);
|
|
@@ -48554,46 +48657,6 @@ var init_derive_actions = __esm({
|
|
|
48554
48657
|
}
|
|
48555
48658
|
});
|
|
48556
48659
|
|
|
48557
|
-
// ../core/src/business/acquisition/crm-next-action.ts
|
|
48558
|
-
var CrmNextActionMappingSchema, CrmNextActionRuleConfigSchema, CrmNextActionOverrideSchema, MS_PER_DAY2;
|
|
48559
|
-
var init_crm_next_action = __esm({
|
|
48560
|
-
"../core/src/business/acquisition/crm-next-action.ts"() {
|
|
48561
|
-
"use strict";
|
|
48562
|
-
init_zod();
|
|
48563
|
-
CrmNextActionMappingSchema = external_exports.object({
|
|
48564
|
-
stateKey: external_exports.string().trim().min(1).max(120),
|
|
48565
|
-
ownership: external_exports.enum(["us", "them", "*"]),
|
|
48566
|
-
actionKey: external_exports.string().trim().min(1).max(120),
|
|
48567
|
-
requiresStale: external_exports.boolean().optional()
|
|
48568
|
-
}).strict();
|
|
48569
|
-
CrmNextActionRuleConfigSchema = external_exports.object({
|
|
48570
|
-
mappings: external_exports.array(CrmNextActionMappingSchema),
|
|
48571
|
-
ownershipUsFallback: external_exports.string().trim().min(1).max(120).nullable().optional()
|
|
48572
|
-
}).strict();
|
|
48573
|
-
CrmNextActionOverrideSchema = external_exports.object({
|
|
48574
|
-
mappings: external_exports.array(CrmNextActionMappingSchema).optional(),
|
|
48575
|
-
ownershipUsFallback: external_exports.string().trim().min(1).max(120).nullable().optional()
|
|
48576
|
-
}).strict();
|
|
48577
|
-
MS_PER_DAY2 = 24 * 60 * 60 * 1e3;
|
|
48578
|
-
}
|
|
48579
|
-
});
|
|
48580
|
-
|
|
48581
|
-
// ../core/src/business/acquisition/stateful.ts
|
|
48582
|
-
var StatefulSchema;
|
|
48583
|
-
var init_stateful = __esm({
|
|
48584
|
-
"../core/src/business/acquisition/stateful.ts"() {
|
|
48585
|
-
"use strict";
|
|
48586
|
-
init_zod();
|
|
48587
|
-
init_activity_events();
|
|
48588
|
-
StatefulSchema = external_exports.object({
|
|
48589
|
-
pipeline_key: external_exports.string(),
|
|
48590
|
-
stage_key: external_exports.string(),
|
|
48591
|
-
state_key: external_exports.string(),
|
|
48592
|
-
activity_log: external_exports.array(ActivityEventSchema)
|
|
48593
|
-
});
|
|
48594
|
-
}
|
|
48595
|
-
});
|
|
48596
|
-
|
|
48597
48660
|
// ../core/src/business/acquisition/ontology-validation.ts
|
|
48598
48661
|
function isPlainRecord2(value) {
|
|
48599
48662
|
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
|
|
@@ -48700,77 +48763,21 @@ function findLeadGenTemplateStepCatalog(index) {
|
|
|
48700
48763
|
(catalog) => catalog.ownerSystemId === "sales.lead-gen" && catalog.kind === "template-step" && catalog.appliesTo === LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID
|
|
48701
48764
|
);
|
|
48702
48765
|
}
|
|
48703
|
-
var LEAD_GEN_API_INTERFACE, CRM_API_INTERFACE, LEAD_GEN_CRM_HANDOFF_INTERFACE, LEAD_GEN_API_READINESS_LABEL, CRM_API_READINESS_LABEL, LEAD_GEN_CRM_HANDOFF_READINESS_LABEL
|
|
48766
|
+
var LEAD_GEN_API_INTERFACE, CRM_API_INTERFACE, LEAD_GEN_CRM_HANDOFF_INTERFACE, LEAD_GEN_API_READINESS_LABEL, CRM_API_READINESS_LABEL, LEAD_GEN_CRM_HANDOFF_READINESS_LABEL;
|
|
48704
48767
|
var init_ontology_validation = __esm({
|
|
48705
48768
|
"../core/src/business/acquisition/ontology-validation.ts"() {
|
|
48706
48769
|
"use strict";
|
|
48707
|
-
init_ontology();
|
|
48708
48770
|
init_systems();
|
|
48709
48771
|
init_migration_helpers();
|
|
48710
48772
|
init_helpers();
|
|
48711
48773
|
init_engine();
|
|
48712
|
-
|
|
48713
|
-
|
|
48714
|
-
|
|
48774
|
+
init_define_system_api_interface();
|
|
48775
|
+
LEAD_GEN_API_INTERFACE = requireSystemInterfaceProfile("sales.lead-gen.api");
|
|
48776
|
+
CRM_API_INTERFACE = requireSystemInterfaceProfile("sales.crm.api");
|
|
48777
|
+
LEAD_GEN_CRM_HANDOFF_INTERFACE = requireSystemInterfaceProfile("sales.lead-gen.crm-handoff");
|
|
48715
48778
|
LEAD_GEN_API_READINESS_LABEL = LEAD_GEN_API_INTERFACE.readinessProfile;
|
|
48716
48779
|
CRM_API_READINESS_LABEL = CRM_API_INTERFACE.readinessProfile;
|
|
48717
48780
|
LEAD_GEN_CRM_HANDOFF_READINESS_LABEL = LEAD_GEN_CRM_HANDOFF_INTERFACE.readinessProfile;
|
|
48718
|
-
LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
48719
|
-
scope: "sales.lead-gen",
|
|
48720
|
-
kind: "object",
|
|
48721
|
-
localId: "list"
|
|
48722
|
-
});
|
|
48723
|
-
LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
48724
|
-
scope: "sales.lead-gen",
|
|
48725
|
-
kind: "object",
|
|
48726
|
-
localId: "company"
|
|
48727
|
-
});
|
|
48728
|
-
LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID = formatOntologyId({
|
|
48729
|
-
scope: "sales.lead-gen",
|
|
48730
|
-
kind: "object",
|
|
48731
|
-
localId: "contact"
|
|
48732
|
-
});
|
|
48733
|
-
LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
48734
|
-
scope: "sales.lead-gen",
|
|
48735
|
-
kind: "catalog",
|
|
48736
|
-
localId: "build-template"
|
|
48737
|
-
});
|
|
48738
|
-
LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
48739
|
-
scope: "sales.lead-gen",
|
|
48740
|
-
kind: "catalog",
|
|
48741
|
-
localId: "company-stage"
|
|
48742
|
-
});
|
|
48743
|
-
LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
48744
|
-
scope: "sales.lead-gen",
|
|
48745
|
-
kind: "catalog",
|
|
48746
|
-
localId: "contact-stage"
|
|
48747
|
-
});
|
|
48748
|
-
CRM_PIPELINE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
48749
|
-
scope: "sales.crm",
|
|
48750
|
-
kind: "catalog",
|
|
48751
|
-
localId: "crm.pipeline"
|
|
48752
|
-
});
|
|
48753
|
-
LEAD_GEN_STAGE_CATALOG_ONTOLOGY_ID = formatOntologyId({
|
|
48754
|
-
scope: "sales.lead-gen",
|
|
48755
|
-
kind: "catalog",
|
|
48756
|
-
localId: "lead-gen.stage-catalog"
|
|
48757
|
-
});
|
|
48758
|
-
LEAD_GEN_API_READINESS_CONTRACT = {
|
|
48759
|
-
requiredObjects: [
|
|
48760
|
-
LEAD_GEN_LIST_OBJECT_ONTOLOGY_ID,
|
|
48761
|
-
LEAD_GEN_COMPANY_OBJECT_ONTOLOGY_ID,
|
|
48762
|
-
LEAD_GEN_CONTACT_OBJECT_ONTOLOGY_ID
|
|
48763
|
-
],
|
|
48764
|
-
requiredCatalogs: [
|
|
48765
|
-
LEAD_GEN_BUILD_TEMPLATE_CATALOG_ONTOLOGY_ID,
|
|
48766
|
-
LEAD_GEN_COMPANY_STAGE_CATALOG_ONTOLOGY_ID,
|
|
48767
|
-
LEAD_GEN_CONTACT_STAGE_CATALOG_ONTOLOGY_ID
|
|
48768
|
-
]
|
|
48769
|
-
};
|
|
48770
|
-
CRM_API_READINESS_CONTRACT = {
|
|
48771
|
-
requiredObjects: [],
|
|
48772
|
-
requiredCatalogs: [CRM_PIPELINE_CATALOG_ONTOLOGY_ID]
|
|
48773
|
-
};
|
|
48774
48781
|
registerBuiltInReadinessProfile(LEAD_GEN_API_INTERFACE.readinessProfile, {
|
|
48775
48782
|
validate: (issues, index, resources, _model, context) => requireLeadGenInterfaceReadiness(issues, index, resources, context),
|
|
48776
48783
|
prepareModel: mergeLeadGenDerivedCatalogs
|
|
@@ -48801,6 +48808,74 @@ var init_ontology_validation = __esm({
|
|
|
48801
48808
|
}
|
|
48802
48809
|
});
|
|
48803
48810
|
|
|
48811
|
+
// ../core/src/business/acquisition/compile-action-catalog.ts
|
|
48812
|
+
var init_compile_action_catalog = __esm({
|
|
48813
|
+
"../core/src/business/acquisition/compile-action-catalog.ts"() {
|
|
48814
|
+
"use strict";
|
|
48815
|
+
}
|
|
48816
|
+
});
|
|
48817
|
+
|
|
48818
|
+
// ../core/src/business/acquisition/crm-next-action.ts
|
|
48819
|
+
var CrmNextActionMappingSchema, CrmNextActionRuleConfigSchema, CrmNextActionOverrideSchema, MS_PER_DAY2;
|
|
48820
|
+
var init_crm_next_action = __esm({
|
|
48821
|
+
"../core/src/business/acquisition/crm-next-action.ts"() {
|
|
48822
|
+
"use strict";
|
|
48823
|
+
init_zod();
|
|
48824
|
+
CrmNextActionMappingSchema = external_exports.object({
|
|
48825
|
+
stateKey: external_exports.string().trim().min(1).max(120),
|
|
48826
|
+
ownership: external_exports.enum(["us", "them", "*"]),
|
|
48827
|
+
actionKey: external_exports.string().trim().min(1).max(120),
|
|
48828
|
+
requiresStale: external_exports.boolean().optional()
|
|
48829
|
+
}).strict();
|
|
48830
|
+
CrmNextActionRuleConfigSchema = external_exports.object({
|
|
48831
|
+
mappings: external_exports.array(CrmNextActionMappingSchema),
|
|
48832
|
+
ownershipUsFallback: external_exports.string().trim().min(1).max(120).nullable().optional()
|
|
48833
|
+
}).strict();
|
|
48834
|
+
CrmNextActionOverrideSchema = external_exports.object({
|
|
48835
|
+
mappings: external_exports.array(CrmNextActionMappingSchema).optional(),
|
|
48836
|
+
ownershipUsFallback: external_exports.string().trim().min(1).max(120).nullable().optional()
|
|
48837
|
+
}).strict();
|
|
48838
|
+
MS_PER_DAY2 = 24 * 60 * 60 * 1e3;
|
|
48839
|
+
}
|
|
48840
|
+
});
|
|
48841
|
+
|
|
48842
|
+
// ../core/src/business/acquisition/crm-rule-config.ts
|
|
48843
|
+
var CrmSystemRulesConfigSchema;
|
|
48844
|
+
var init_crm_rule_config = __esm({
|
|
48845
|
+
"../core/src/business/acquisition/crm-rule-config.ts"() {
|
|
48846
|
+
"use strict";
|
|
48847
|
+
init_zod();
|
|
48848
|
+
init_crm_next_action();
|
|
48849
|
+
init_crm_priority();
|
|
48850
|
+
CrmSystemRulesConfigSchema = external_exports.object({
|
|
48851
|
+
priority: CrmPriorityOverrideSchema.omit({ closedStageKeys: true }).optional(),
|
|
48852
|
+
nextActions: CrmNextActionOverrideSchema.optional(),
|
|
48853
|
+
/**
|
|
48854
|
+
* Days without an update after which an open deal in a stage is reported
|
|
48855
|
+
* stale by the deals summary and pipeline analytics. Keys must be
|
|
48856
|
+
* `crm.pipeline` stage keys; a stage with no entry is never reported stale.
|
|
48857
|
+
*/
|
|
48858
|
+
staleAfterDaysByStageKey: external_exports.record(external_exports.string().trim().min(1).max(120), external_exports.number().int().min(1).max(365)).optional()
|
|
48859
|
+
}).strict();
|
|
48860
|
+
}
|
|
48861
|
+
});
|
|
48862
|
+
|
|
48863
|
+
// ../core/src/business/acquisition/stateful.ts
|
|
48864
|
+
var StatefulSchema;
|
|
48865
|
+
var init_stateful = __esm({
|
|
48866
|
+
"../core/src/business/acquisition/stateful.ts"() {
|
|
48867
|
+
"use strict";
|
|
48868
|
+
init_zod();
|
|
48869
|
+
init_activity_events();
|
|
48870
|
+
StatefulSchema = external_exports.object({
|
|
48871
|
+
pipeline_key: external_exports.string(),
|
|
48872
|
+
stage_key: external_exports.string(),
|
|
48873
|
+
state_key: external_exports.string(),
|
|
48874
|
+
activity_log: external_exports.array(ActivityEventSchema)
|
|
48875
|
+
});
|
|
48876
|
+
}
|
|
48877
|
+
});
|
|
48878
|
+
|
|
48804
48879
|
// ../core/src/business/acquisition/index.ts
|
|
48805
48880
|
var init_acquisition = __esm({
|
|
48806
48881
|
"../core/src/business/acquisition/index.ts"() {
|
|
@@ -48809,6 +48884,8 @@ var init_acquisition = __esm({
|
|
|
48809
48884
|
init_activity_events();
|
|
48810
48885
|
init_build_templates();
|
|
48811
48886
|
init_derive_actions();
|
|
48887
|
+
init_compile_action_catalog();
|
|
48888
|
+
init_crm_rule_config();
|
|
48812
48889
|
init_crm_priority();
|
|
48813
48890
|
init_crm_next_action();
|
|
48814
48891
|
init_deal_ownership();
|
|
@@ -49577,7 +49654,7 @@ var init_package = __esm({
|
|
|
49577
49654
|
"package.json"() {
|
|
49578
49655
|
package_default = {
|
|
49579
49656
|
name: "@elevasis/sdk",
|
|
49580
|
-
version: "1.
|
|
49657
|
+
version: "1.57.0",
|
|
49581
49658
|
description: "SDK for building Elevasis organization resources",
|
|
49582
49659
|
type: "module",
|
|
49583
49660
|
bin: {
|
|
@@ -49896,6 +49973,17 @@ ${gapLines}
|
|
|
49896
49973
|
Run \`pnpm exec elevasis-sdk om:scaffold:fill --gaps <path>\` to scaffold the missing apiInterface declarations.`
|
|
49897
49974
|
);
|
|
49898
49975
|
}
|
|
49976
|
+
if (org.organizationModel !== void 0) {
|
|
49977
|
+
const builtInContractIssues = listReadinessContractsOnBuiltInProfiles(org.organizationModel);
|
|
49978
|
+
if (builtInContractIssues.length > 0) {
|
|
49979
|
+
throw new RegistryValidationError(
|
|
49980
|
+
orgName,
|
|
49981
|
+
null,
|
|
49982
|
+
builtInContractIssues[0].path ?? "organizationModel.apiInterface.readinessContract",
|
|
49983
|
+
builtInContractIssues.map((issue2) => issue2.message).join("\n")
|
|
49984
|
+
);
|
|
49985
|
+
}
|
|
49986
|
+
}
|
|
49899
49987
|
validateDeclaredSystemInterfaceReadiness(orgName, org.organizationModel);
|
|
49900
49988
|
const mode = process.env.ELEVASIS_RESOURCE_VALIDATOR === "warn-only" ? "warn-only" : "strict";
|
|
49901
49989
|
validateResourceGovernance(orgName, org, org.organizationModel, {
|
|
@@ -58826,6 +58914,17 @@ function verifyKnowledgeLinks(model, diagnostics, context) {
|
|
|
58826
58914
|
});
|
|
58827
58915
|
}
|
|
58828
58916
|
}
|
|
58917
|
+
function verifyBuiltInReadinessContracts(model, diagnostics) {
|
|
58918
|
+
for (const issue2 of listReadinessContractsOnBuiltInProfiles(model)) {
|
|
58919
|
+
diagnostics.push({
|
|
58920
|
+
severity: "error",
|
|
58921
|
+
code: issue2.code,
|
|
58922
|
+
message: issue2.message,
|
|
58923
|
+
...issue2.path !== void 0 ? { systemPath: issue2.path.replace(/^systems./, "").replace(/.apiInterface.readinessContract$/, "") } : {},
|
|
58924
|
+
...issue2.ref !== void 0 ? { targetId: issue2.ref } : {}
|
|
58925
|
+
});
|
|
58926
|
+
}
|
|
58927
|
+
}
|
|
58829
58928
|
function verifyRenameOrphans(model, diagnostics) {
|
|
58830
58929
|
const systemPaths = new Set(listAllSystems(model).map(({ path: path3 }) => path3));
|
|
58831
58930
|
const missingRefs = /* @__PURE__ */ new Map();
|
|
@@ -58885,6 +58984,7 @@ function runOmDoctorChecks(inputModel, options = {}) {
|
|
|
58885
58984
|
verifyOntologyReferences(model, diagnostics, context);
|
|
58886
58985
|
verifyKnowledgeLinks(model, diagnostics, context);
|
|
58887
58986
|
verifyRenameOrphans(model, diagnostics);
|
|
58987
|
+
verifyBuiltInReadinessContracts(model, diagnostics);
|
|
58888
58988
|
diagnostics.push({
|
|
58889
58989
|
severity: "info",
|
|
58890
58990
|
code: "organization-model-summary",
|
|
@@ -58903,7 +59003,7 @@ function runOmDoctorChecks(inputModel, options = {}) {
|
|
|
58903
59003
|
return {
|
|
58904
59004
|
ok: summary.error === 0,
|
|
58905
59005
|
scope: options.scope ?? null,
|
|
58906
|
-
checksRun:
|
|
59006
|
+
checksRun: 4,
|
|
58907
59007
|
summary,
|
|
58908
59008
|
diagnostics: grouped
|
|
58909
59009
|
};
|
|
@@ -58933,7 +59033,7 @@ function formatOmDoctorReport(report) {
|
|
|
58933
59033
|
const lines = [
|
|
58934
59034
|
`om:doctor ${report.ok ? "passed" : "failed"}: ${report.summary.error} error(s), ${report.summary.warn} warning(s), ${report.summary.info} info.`,
|
|
58935
59035
|
report.scope ? `Scope: ${report.scope}` : "Scope: full Organization Model",
|
|
58936
|
-
"Runs 3 of the platform doctor's checks (ontology references, knowledge links, rename orphans). UI-consistency and contract-ref checks are monorepo-only and do not run here."
|
|
59036
|
+
"Runs 3 of the platform doctor's checks (ontology references, knowledge links, rename orphans), plus the readinessContract-on-built-in-profile check. UI-consistency and contract-ref checks are monorepo-only and do not run here."
|
|
58937
59037
|
];
|
|
58938
59038
|
if (report.sources) {
|
|
58939
59039
|
lines.push("Structural checks: project model (core/config/organization-model.ts)");
|
|
@@ -58958,7 +59058,7 @@ function formatOmDoctorReport(report) {
|
|
|
58958
59058
|
// src/cli/commands/om/doctor.ts
|
|
58959
59059
|
function registerOmDoctorCommand(program3) {
|
|
58960
59060
|
withTarget(program3.command("om:doctor").description(
|
|
58961
|
-
"Reduced model doctor \u2014 runs 3 of the platform's 5 checks, plus deployed readiness\n Checks: ontology references, knowledge links, rename-orphan hints\n NOT run (monorepo-only): UI-manifest consistency, contract-ref resolution\n Readiness is read from the deployed snapshot; it reports NOT RUN when offline\n Example: elevasis-sdk om:doctor\n Example: elevasis-sdk om:doctor --scope sales.crm\n Example: elevasis-sdk om:doctor --skip-deployed\n Example: elevasis-sdk om:doctor --require-deployed\n Example: elevasis-sdk om:doctor --json"
|
|
59061
|
+
"Reduced model doctor \u2014 runs 3 of the platform's 5 checks, plus built-in contract and deployed readiness\n Checks: ontology references, knowledge links, rename-orphan hints, readinessContract on a built-in profile\n NOT run (monorepo-only): UI-manifest consistency, contract-ref resolution\n Readiness is read from the deployed snapshot; it reports NOT RUN when offline\n Example: elevasis-sdk om:doctor\n Example: elevasis-sdk om:doctor --scope sales.crm\n Example: elevasis-sdk om:doctor --skip-deployed\n Example: elevasis-sdk om:doctor --require-deployed\n Example: elevasis-sdk om:doctor --json"
|
|
58962
59062
|
).option("--json", "Output as grouped JSON envelope").option("--scope <systemPath>", "Limit diagnostics to a system path and descendants").option("--skip-deployed", "Structural checks only \u2014 do not ask the API about readiness").option(
|
|
58963
59063
|
"--require-deployed",
|
|
58964
59064
|
"Fail (non-zero exit) if the deployed-snapshot readiness check is unavailable \u2014 API unreachable or no platform key \u2014 instead of the default degraded pass. Opt-in: default behavior is unchanged, and this is rejected together with --skip-deployed."
|
|
@@ -59003,7 +59103,7 @@ function registerOmDoctorCommand(program3) {
|
|
|
59003
59103
|
report = {
|
|
59004
59104
|
ok: false,
|
|
59005
59105
|
scope: options.scope ?? null,
|
|
59006
|
-
checksRun:
|
|
59106
|
+
checksRun: 4,
|
|
59007
59107
|
summary: { error: 1, warn: 0, info: 0, total: 1 },
|
|
59008
59108
|
diagnostics: {
|
|
59009
59109
|
error: [
|
package/dist/index.d.ts
CHANGED
|
@@ -7307,24 +7307,6 @@ declare const ActivityEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
7307
7307
|
}, z.core.$strip>], "type">;
|
|
7308
7308
|
type ActivityEvent = z.infer<typeof ActivityEventSchema>;
|
|
7309
7309
|
|
|
7310
|
-
interface Action {
|
|
7311
|
-
key: string;
|
|
7312
|
-
label: string;
|
|
7313
|
-
payloadSchema?: z.ZodTypeAny;
|
|
7314
|
-
}
|
|
7315
|
-
interface ActionDef {
|
|
7316
|
-
key: string;
|
|
7317
|
-
label: string;
|
|
7318
|
-
isAvailableFor: (deal: AcqDealRow) => boolean;
|
|
7319
|
-
workflowId: string;
|
|
7320
|
-
payloadSchema?: z.ZodTypeAny;
|
|
7321
|
-
}
|
|
7322
|
-
type DealActionInput = AcqDealRow & {
|
|
7323
|
-
ownership?: 'us' | 'them' | null;
|
|
7324
|
-
nextAction?: string | null;
|
|
7325
|
-
};
|
|
7326
|
-
declare function deriveActions(deal: DealActionInput, actions?: ActionDef[]): Action[];
|
|
7327
|
-
|
|
7328
7310
|
declare const OntologyIdSchema: z.ZodString;
|
|
7329
7311
|
type OntologyId = z.infer<typeof OntologyIdSchema>;
|
|
7330
7312
|
declare const OntologyObjectTypeSchema: z.ZodObject<{
|
|
@@ -7356,12 +7338,18 @@ declare const OntologyActionTypeSchema: z.ZodObject<{
|
|
|
7356
7338
|
ownerSystemId: z.ZodOptional<z.ZodString>;
|
|
7357
7339
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7358
7340
|
actsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
7341
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
7359
7342
|
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7360
7343
|
effects: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
7361
7344
|
resourceId: z.ZodOptional<z.ZodString>;
|
|
7362
7345
|
invocations: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
7363
7346
|
lifecycle: z.ZodOptional<z.ZodString>;
|
|
7364
7347
|
legacyActionId: z.ZodOptional<z.ZodString>;
|
|
7348
|
+
availableFrom: z.ZodOptional<z.ZodObject<{
|
|
7349
|
+
stageKeys: z.ZodArray<z.ZodString>;
|
|
7350
|
+
stateKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7351
|
+
nextActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7352
|
+
}, z.core.$strict>>;
|
|
7365
7353
|
}, z.core.$strict>;
|
|
7366
7354
|
declare const OntologyCatalogTypeSchema: z.ZodObject<{
|
|
7367
7355
|
id: z.ZodString;
|
|
@@ -7456,12 +7444,18 @@ declare const OntologyScopeSchema: z.ZodDefault<z.ZodObject<{
|
|
|
7456
7444
|
ownerSystemId: z.ZodOptional<z.ZodString>;
|
|
7457
7445
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7458
7446
|
actsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
7447
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
7459
7448
|
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7460
7449
|
effects: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
7461
7450
|
resourceId: z.ZodOptional<z.ZodString>;
|
|
7462
7451
|
invocations: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
7463
7452
|
lifecycle: z.ZodOptional<z.ZodString>;
|
|
7464
7453
|
legacyActionId: z.ZodOptional<z.ZodString>;
|
|
7454
|
+
availableFrom: z.ZodOptional<z.ZodObject<{
|
|
7455
|
+
stageKeys: z.ZodArray<z.ZodString>;
|
|
7456
|
+
stateKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7457
|
+
nextActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7458
|
+
}, z.core.$strict>>;
|
|
7465
7459
|
}, z.core.$strict>>>>;
|
|
7466
7460
|
catalogTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
7467
7461
|
id: z.ZodString;
|
|
@@ -8837,12 +8831,18 @@ declare const OrganizationModelSchema: z.ZodObject<{
|
|
|
8837
8831
|
ownerSystemId: z.ZodOptional<z.ZodString>;
|
|
8838
8832
|
aliases: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8839
8833
|
actsOn: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
|
|
8834
|
+
order: z.ZodOptional<z.ZodNumber>;
|
|
8840
8835
|
input: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
8841
8836
|
effects: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
8842
8837
|
resourceId: z.ZodOptional<z.ZodString>;
|
|
8843
8838
|
invocations: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
8844
8839
|
lifecycle: z.ZodOptional<z.ZodString>;
|
|
8845
8840
|
legacyActionId: z.ZodOptional<z.ZodString>;
|
|
8841
|
+
availableFrom: z.ZodOptional<z.ZodObject<{
|
|
8842
|
+
stageKeys: z.ZodArray<z.ZodString>;
|
|
8843
|
+
stateKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8844
|
+
nextActionKeys: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
8845
|
+
}, z.core.$strict>>;
|
|
8846
8846
|
}, z.core.$strict>>>>;
|
|
8847
8847
|
catalogTypes: z.ZodOptional<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
8848
8848
|
id: z.ZodString;
|
|
@@ -9380,6 +9380,7 @@ type CrmApiOntologyValidationIndex = BusinessOntologyValidationIndexBase & {
|
|
|
9380
9380
|
crmPipelineCatalog: OntologyCatalogType;
|
|
9381
9381
|
};
|
|
9382
9382
|
type BusinessOntologyValidationIndex = LeadGenApiOntologyValidationIndex & CrmApiOntologyValidationIndex;
|
|
9383
|
+
declare function compileCrmApiOntologyValidationIndex(model: OrganizationModel): CrmApiOntologyValidationIndex;
|
|
9383
9384
|
/**
|
|
9384
9385
|
* Legacy mixed acquisition index.
|
|
9385
9386
|
*
|
|
@@ -9409,6 +9410,67 @@ type LeadGenStageValidators = {
|
|
|
9409
9410
|
};
|
|
9410
9411
|
declare function createLeadGenStageValidators(index: LeadGenApiOntologyValidationIndex): LeadGenStageValidators;
|
|
9411
9412
|
|
|
9413
|
+
/**
|
|
9414
|
+
* When a deal action is selectable, authored by the tenant rather than hardcoded
|
|
9415
|
+
* as a TypeScript predicate. `stageKeys` / `stateKeys` / `nextActionKeys` AND
|
|
9416
|
+
* together; membership within one dimension is OR; an omitted dimension is
|
|
9417
|
+
* unconstrained. Mirrors
|
|
9418
|
+
* `OntologyActionAvailabilityCondition` (`organization-model/ontology.ts`)
|
|
9419
|
+
* verbatim -- this is that schema's compiled/validated shape.
|
|
9420
|
+
*/
|
|
9421
|
+
interface CompiledCrmActionAvailability {
|
|
9422
|
+
stageKeys: string[];
|
|
9423
|
+
stateKeys?: string[];
|
|
9424
|
+
nextActionKeys?: string[];
|
|
9425
|
+
}
|
|
9426
|
+
/** One CRM deal action, compiled from the OM's `sales.crm` ontology `actionTypes`. */
|
|
9427
|
+
interface CompiledCrmAction {
|
|
9428
|
+
key: string;
|
|
9429
|
+
label: string;
|
|
9430
|
+
availableFrom: CompiledCrmActionAvailability;
|
|
9431
|
+
resourceId: string;
|
|
9432
|
+
payloadSchema?: z.ZodTypeAny;
|
|
9433
|
+
}
|
|
9434
|
+
/**
|
|
9435
|
+
* Compiles the `sales.crm` System's ontology `actionTypes` into the flat
|
|
9436
|
+
* catalog `deriveActions()`'s callers (a later wave's API service) will
|
|
9437
|
+
* evaluate against a deal row via `isCompiledCrmActionAvailable`
|
|
9438
|
+
* (`derive-actions.ts`).
|
|
9439
|
+
*
|
|
9440
|
+
* Takes the already-gated `CrmApiOntologyValidationIndex` rather than a raw
|
|
9441
|
+
* `OrganizationModel` -- `compileCrmApiOntologyValidationIndex` has already
|
|
9442
|
+
* proven the CRM System Interface is ready (including that `crmPipelineCatalog`
|
|
9443
|
+
* exists and is non-empty) before this runs, so this function reuses that gate
|
|
9444
|
+
* instead of re-checking interface readiness itself.
|
|
9445
|
+
*
|
|
9446
|
+
* Records with no `availableFrom` are skipped, not errored -- a CRM ontology
|
|
9447
|
+
* can carry `actionTypes` records for purposes other than a deal action.
|
|
9448
|
+
*
|
|
9449
|
+
* Structural problems (a `stageKeys`/`stateKeys` entry naming nothing real, or
|
|
9450
|
+
* a missing `resourceId`) throw `SystemInterfaceReadinessError` carrying the
|
|
9451
|
+
* `SYSTEM_INTERFACE_INVALID` family -- the same family the readiness engine
|
|
9452
|
+
* uses for other "authored data does not check out" cases (`foreign-catalog`,
|
|
9453
|
+
* `ontology-compile-failed`, `missing-readiness-profile`). All actions are
|
|
9454
|
+
* checked before throwing, so a single call reports every problem at once.
|
|
9455
|
+
*/
|
|
9456
|
+
declare function compileCrmActionCatalog(index: CrmApiOntologyValidationIndex): CompiledCrmAction[];
|
|
9457
|
+
/**
|
|
9458
|
+
* The subset of a compiled catalog a given deal row can currently invoke, in
|
|
9459
|
+
* the catalog's authored order.
|
|
9460
|
+
*/
|
|
9461
|
+
declare function deriveCompiledCrmActions(deal: DealActionInput, catalog: CompiledCrmAction[]): CompiledCrmAction[];
|
|
9462
|
+
|
|
9463
|
+
interface Action {
|
|
9464
|
+
key: string;
|
|
9465
|
+
label: string;
|
|
9466
|
+
payloadSchema?: z.ZodTypeAny;
|
|
9467
|
+
}
|
|
9468
|
+
type DealActionInput = AcqDealRow & {
|
|
9469
|
+
ownership?: 'us' | 'them' | null;
|
|
9470
|
+
nextAction?: string | null;
|
|
9471
|
+
};
|
|
9472
|
+
declare function isCompiledCrmActionAvailable(deal: DealActionInput, action: CompiledCrmAction): boolean;
|
|
9473
|
+
|
|
9412
9474
|
/**
|
|
9413
9475
|
* A single CRM activity entry (note, stage change, or deal creation).
|
|
9414
9476
|
* Matches the CrmActivityEntry interface from useRecentCrmActivity.ts.
|
|
@@ -15723,5 +15785,5 @@ declare function defineWorkflowConfig<const TResourceId extends string>(resource
|
|
|
15723
15785
|
declare const ListBuilderStageKeySchema: z.ZodString;
|
|
15724
15786
|
type ListBuilderStageKey = z.infer<typeof ListBuilderStageKeySchema>;
|
|
15725
15787
|
|
|
15726
|
-
export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ProspectingBuildTemplateSchema as BuildTemplateSchema, ContractRefResolutionError, CrmStageKeySchema, CrmStateKeySchema, EmailSchema, ExecutionError, ListBuilderStageKeySchema, ProcessingStageStatusSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, bindResourceDescriptor, compileBusinessOntologyValidationIndex, concurrentPool, createLeadGenStageValidators, defineContract, defineResource, defineResourceOntology, defineResources, defineSingleStepWorkflow, defineTopology, defineTopologyRelationship, defineWorkflowConfig,
|
|
15727
|
-
export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqDealRow, AcqList, Action,
|
|
15788
|
+
export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ProspectingBuildTemplateSchema as BuildTemplateSchema, ContractRefResolutionError, CrmStageKeySchema, CrmStateKeySchema, EmailSchema, ExecutionError, ListBuilderStageKeySchema, ProcessingStageStatusSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, bindResourceDescriptor, compileBusinessOntologyValidationIndex, compileCrmActionCatalog, compileCrmApiOntologyValidationIndex, concurrentPool, createLeadGenStageValidators, defineContract, defineResource, defineResourceOntology, defineResources, defineSingleStepWorkflow, defineTopology, defineTopologyRelationship, defineWorkflowConfig, deriveCompiledCrmActions, diagnosticOutput, integrationInput, isBuiltInReadinessProfile, isCompiledCrmActionAvailable, isZodType, lookupReadinessProfile, parseTopologyNodeRef, projectDeploymentSpec, projectTopologyRelationships, registerReadinessProfile, resolveContractRef, runDiagnostic, splitName, toSdkResourceDescriptor, topologyRef, topologyRelationship, validateDeclaredSystemInterfaceReadiness, validateResourceGovernance, withPlatformAgentResourceDescriptor, withPlatformAgentResourceDescriptors, withPlatformIntegrationResourceDescriptor, withPlatformIntegrationResourceDescriptors, withPlatformResourceDescriptor, withPlatformResourceDescriptors };
|
|
15789
|
+
export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqDealRow, AcqList, Action, ActivityEvent, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, AgentResourceDescriptorResolver, FindCompanyEmailParams as AnymailfinderFindCompanyEmailParams, FindCompanyEmailResult as AnymailfinderFindCompanyEmailResult, FindDecisionMakerEmailParams as AnymailfinderFindDecisionMakerEmailParams, FindDecisionMakerEmailResult as AnymailfinderFindDecisionMakerEmailResult, FindPersonEmailParams as AnymailfinderFindPersonEmailParams, FindPersonEmailResult as AnymailfinderFindPersonEmailResult, AnymailfinderToolMap, VerifyEmailParams as AnymailfinderVerifyEmailParams, VerifyEmailResult as AnymailfinderVerifyEmailResult, ApifyToolMap, ApifyWebhookConfig, AppendRowsParams, AppendRowsResult, ApprovalToolMap, ArtifactsToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BuildPlanSnapshotStep, BulkDeleteLeadsParams, BulkDeleteLeadsResult, BulkImportParams, BulkImportResult, BusinessOntologyValidationIndex, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, ClickUpToolMap, CompanyFilters, CompiledCrmAction, CompiledCrmActionAvailability, ConcurrentPoolOptions, ConcurrentPoolResult, ConditionalNext, ContactFilters, ContentToolMap, Contract, ContractRefResolutionErrorCode, ContractRegistry, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, CrmApiOntologyValidationIndex, CrmStageKey, CrmStateKey, CrmToolMap, DefineSingleStepWorkflowOptions, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DeploymentSpec, DiagnosticOutput, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetDailyCampaignAnalyticsParams, GetDailyCampaignAnalyticsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstagramToolMap, InstantlyToolMap, IntegrationDefinition, IntegrationResourceDescriptorResolver, JsonSchema, LLMAdapterFactory, LLMContentPart, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadGenStageValidators, LeadToolMap, LinearNext, ListAttributesParams, ListAttributesResult, ListBuilderStageKey, ListBuilderStep, ListLeadsParams, ListLeadsResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, ListToolMap, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, MillionVerifierToolMap, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, OrganizationModel, OrganizationModelAgentResourceEntry, OrganizationModelIntegrationResourceEntry, OrganizationModelResourceEntry, OrganizationModelResourceOntologyBinding, OrganizationModelTopology, OrganizationModelTopologyNodeRef, OrganizationModelTopologyRelationship, OrganizationModelWorkflowResourceEntry, PaginatedResult, PaginationParams, PdfToolMap, ProcessingStageStatus, ProjectDeploymentSpecOptions, ProjectsToolMap, QueryRecordsParams, QueryRecordsResult, ReadSheetParams, ReadSheetResult, ReadinessProfileEntry, ReadinessProfileKind, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResolvedContractRef, ResourceCategory, ResourceDefinition, ResourceLink, ResourceMetricsConfig, ResourceOntologyBindingResolver, ResourceRelationships, ResourceStatus$1 as ResourceStatus, ResourceType, RunActorParams, RunActorResult, SDKLLMGenerateParams, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SingleStepWorkflowStep, SortCriteria, StartActorParams, StartActorResult, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, SystemApiInterfaceReadinessContract, TaskSchedule, TaskScheduleConfig, TombaToolMap, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TransitionItemParams, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePaymentLinkParams, UpdatePaymentLinkResult, UpdateProposalDataParams, UpdateRecordParams, UpdateRecordResult, UpdateRowByValueParams, UpdateRowByValueResult, UploadFileParams, UploadFileResult, UpsertCompanyParams, UpsertContactParams, UpsertDealParams, UpsertRowParams, UpsertRowResult, VoidEnvelopeParams, VoidEnvelopeResult, WebhookProviderType, WebhookTriggerConfig, WorkflowConfig, WorkflowConfigActionRegistry, WorkflowDefinition, WorkflowLogger, WorkflowResourceDescriptorMap, WorkflowResourceDescriptorResolver, WorkflowStep, WriteSheetParams, WriteSheetResult };
|