Skip to main content

Communication: hbf-core-api

This is a shared TypeScript npm library, not a running service. It has no inbound HTTP interface and no ports. It communicates outbound only, via axios, to a single target: hbf-core.

Library Role

@helvia/hbf-core-api is imported by Node.js services at build time. Each consuming service instantiates HBFCoreApi at startup (or per-request) and uses the resulting sub-clients to call hbf-core. The library does not run independently.

Instantiation

import { HBFCoreApi } from "@helvia/hbf-core-api";

const coreApi = new HBFCoreApi(process.env.CORE_URL, process.env.CORE_TOKEN);

url and token are stored in the instance. No HTTP calls are made at construction time. Each getter creates a fresh sub-client instance bound to the parent HBFCoreApi.

HTTP Client Configuration

All requests go through requestHBFCore (or requestHBFCoreMultipart for file uploads) in src/core.ts.

ConcernDetail
Base URLPrepended from url constructor arg. Callers typically set this from CORE_URL env var.
Auth headerAuthorization: Bearer <token> on every request. Token from token constructor arg, typically CORE_TOKEN env var.
Content-Typeapplication/json (standard requests). Omitted for multipart/form-data uploads.
Acceptapplication/json
HTTP clientaxios 1.8
No timeoutaxios default (no timeout set). Requests can hang indefinitely.

Exported Client Classes

All clients are accessed as getters on HBFCoreApi. Defined in src/core.ts, implemented in src/clients/.

GetterClasssrc/clients/ filehbf-core resource
.TenantsClientTenantsClientTenantsClient.ts/tenants
.OrganizationsClientOrganizationClientOrganizationClient.ts/organizations
.BotContentClientBotContentClientBotContentClient.tsbot content authoring
.BotDeploymentClientBotDeploymentClientBotDeploymentClient.ts/bot-deployments
.ResponsesClientResponsesClientResponsesClient.tsresponse templates
.AnalyticsClientAnalyticsClientAnalyticsClient.tsanalytics queries
.BroadcastsClientBroadcastsClientBroadcastsClient.tsbroadcasts
.GroupsClientGroupsClientGroupsClient.tsgroups
.UsersClientUsersClientUsersClient.tsusers
.SubscribersClientSubscribersClientSubscribersClient.tssubscribers
.UserGroupsClientUserGroupsClientUserGroupsClient.tsuser groups
.HandoverClientHandoverClientHandoverClient.tsagent handover
.FbHandoverClientFbHandoverClientFbHandoverClient.tsFacebook handover
.ChatSessionsClientChatSessionsClientChatSessionsClient.tschat sessions
.SurveyClientSurveyClientSurveyClient.tssurveys
.MessagingAppsClientMessagingAppsClientMessagingAppsClient.tsmessaging app config
.ElasticSearchClientElasticSearchClientElasticSearchClient.tsElasticsearch proxy
.NluDetectionClientNluDetectionClientNluDetectionClient.tsNLU intent detection
.NluAgentsClientNluAgentsClientNluAgentsClient.tsNLU agent management
.NlpPipelinesClientNlpPipelinesClientNlpPipelinesClient.tsNLP pipeline CRUD
.AuditLogsClientAuditLogsClientAuditLogsClient.tsaudit logs
.KnowledgeBaseClientKnowledgeBaseClientKnowledgeBaseClient.tsknowledge bases
.KnowledgeBaseArticleClientKnowledgeBaseArticleClientKnowledgeBaseArticleClient.tsKB articles
.KnowledgeBaseGroupClientKnowledgeBaseGroupClientKnowledgeBaseGroupClient.tsKB groups
.IntegrationClientIntegrationsClientIntegrationsClient.tsintegration config
.TranslationsClientTranslationsClientTranslationsClient.tstranslations

Note: the getter .IntegrationClient (singular) returns an IntegrationsClient instance. The naming mismatch is a known inconsistency in the source.

Consuming Services

The following services declare @helvia/hbf-core-api as a package.json dependency:

ServiceVersion pinnedPrimary clients used
hbf-bot^30.17.0TenantsClient, BotDeploymentClient, SubscribersClient, ChatSessionsClient
hbf-broadcast^18.0.0BroadcastsClient, SubscribersClient
hbf-stats^24.1.2TenantsClient, AnalyticsClient
hbf-session-manager^29.21.0ChatSessionsClient, TenantsClient, BotDeploymentClient
hbf-notifications^28.5.0UsersClient, TenantsClient
hbf-lcg^30.11.1HandoverClient, BotDeploymentClient, SubscribersClient
hbf-data-manager^30.4.0ChatSessionsClient, TenantsClient
hbf-data-retention^30.12.0TenantsClient, ChatSessionsClient
hbf-nlp^30.10.0NlpPipelinesClient, NluAgentsClient, TenantsClient
hbf-knowledge-manager^30.18.0KnowledgeBaseClient, KnowledgeBaseArticleClient, IntegrationClient
hbf-reports^30.8.0AnalyticsClient, TenantsClient
hbf-client-integrations^30.4.1BotDeploymentClient, SubscribersClient, TenantsClient
hbf-media-manager^30.2.0TenantsClient

hbf-console (React SPA) and hbf-lcm do not consume this library directly.

Consumer Diagram