@hahnpro/hpc-api 2026.9.0 → 2026.9.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # @hahnpro/hpc-api
2
2
 
3
+ # 2026.9.1
4
+
5
+ - Added `transcribeAudio` (`POST /ai/audio/transcription`) for server-side audio transcription and removed `getSpeechToken` (`GET /ai/speech/token`)
6
+
3
7
  # 2026.8.5
4
8
 
5
9
  - added `MostRecentTimeSeriesValueUpdate` and `WebSocketError` types to interfaces
package/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "@hahnpro/hpc-api",
3
- "version": "2026.9.0",
3
+ "version": "2026.9.2",
4
4
  "description": "Module for easy access to the HahnPRO Cloud API",
5
5
  "license": "MIT",
6
6
  "author": {
7
7
  "name": "Hahn Projects GmbH",
8
8
  "url": "https://hahnpro.com"
9
9
  },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/hahnprojects/hpc.git",
13
+ "directory": "lib/hpc-api"
14
+ },
10
15
  "dependencies": {
11
16
  "@microsoft/fetch-event-source": "2.0.1",
12
17
  "axios": "1.20.0",
@@ -247,9 +247,8 @@ export interface UserMessage extends BaseMessage {
247
247
  attachments?: MessageAttachment[];
248
248
  }
249
249
  export type Message = AssistantMessage | SystemMessage | ToolMessage | UserMessage | ErrorMessage;
250
- export interface SpeechToken {
251
- token: string;
252
- region: string;
250
+ export interface AudioTranscription {
251
+ text: string;
253
252
  }
254
253
  export interface Thread {
255
254
  id: string;
@@ -1,4 +1,4 @@
1
- export type { AiAssistant, AiSkill, AiSkillSummary, AssetResourceSelectionOption, AssistantMessage, DocumentResourceSelectionOption, ErrorMessage, GenericResourceSelectionOption, LogbookEntryResourceSelectionOption, Message, MessageAttachment, OneShotTaskResult, ResourceSelectionOption, ResourceSelectionRejected, SpeechToken, SystemMessage, Thread, ThreadPopulated, ToolMessage, ToolNameType, UserMessage, } from './ai.interface';
1
+ export type { AiAssistant, AiSkill, AiSkillSummary, AudioTranscription, AssetResourceSelectionOption, AssistantMessage, DocumentResourceSelectionOption, ErrorMessage, GenericResourceSelectionOption, LogbookEntryResourceSelectionOption, Message, MessageAttachment, OneShotTaskResult, ResourceSelectionOption, ResourceSelectionRejected, SystemMessage, Thread, ThreadPopulated, ToolMessage, ToolNameType, UserMessage, } from './ai.interface';
2
2
  export type { Alert, AlertCondition, TimeSeriesReference, UpdatedField } from './alert.interface';
3
3
  export type { Api, Change, ChangeSubject, ObjectIdLike } from './api.interface';
4
4
  export type { AddToProperty, Asset, AssetChange, AssetRevision, AssetSubject, AssetTimeSeriesValue, AssetType, AssetTypeRevision, AssetTypeSearchResult, Attachment, EventCause, EventLevelOverride, RemoveFromProperty, Template, } from './asset.interface';
@@ -1,4 +1,4 @@
1
- import { AiAssistant, AiSkill, AiSkillSummary, Config, Message, OneShotTaskId, OneShotTaskResult, Paginated, SpeechToken, Thread, ThreadPopulated, TokenOption } from '../interfaces';
1
+ import { AiAssistant, AiSkill, AiSkillSummary, AudioTranscription, Config, Message, OneShotTaskId, OneShotTaskResult, Paginated, Thread, ThreadPopulated, TokenOption } from '../interfaces';
2
2
  import { AiService } from '../services';
3
3
  import type { CrossPlatformFormData } from '../utils';
4
4
  import { APIBaseMock } from './api-base.mock';
@@ -9,7 +9,7 @@ export declare class AiMockService extends APIBaseMock<never> implements AiServi
9
9
  getLatestAssistantThread(assistantId: string): Promise<ThreadPopulated>;
10
10
  getAssistant(assistantId: string): Promise<AiAssistant>;
11
11
  getAssistants(options?: TokenOption): Promise<AiAssistant[]>;
12
- getSpeechToken(): Promise<SpeechToken>;
12
+ transcribeAudio(_form: CrossPlatformFormData, _options?: Config): Promise<AudioTranscription>;
13
13
  getSkills(_options?: Config): Promise<AiSkillSummary[]>;
14
14
  setSkillEnabled(_id: string, _enabled: boolean, _options?: Config): Promise<AiSkill>;
15
15
  deleteSkill(_id: string, _options?: Config): Promise<AiSkill>;
@@ -21,7 +21,7 @@ class AiMockService extends api_base_mock_1.APIBaseMock {
21
21
  getAssistants(options = {}) {
22
22
  throw new Error('Method not implemented.');
23
23
  }
24
- getSpeechToken() {
24
+ transcribeAudio(_form, _options = {}) {
25
25
  throw new Error('Method not implemented.');
26
26
  }
27
27
  getSkills(_options = {}) {
@@ -1,5 +1,5 @@
1
1
  import { APIBase } from '../api-base';
2
- import { AiAssistant, AiAssistantId, AiSkill, AiSkillSummary, Config, Message, OneShotTaskId, OneShotTaskResult, Paginated, SpeechToken, Thread, ThreadPopulated, TokenOption } from '../interfaces';
2
+ import { AiAssistant, AiAssistantId, AiSkill, AiSkillSummary, AudioTranscription, Config, Message, OneShotTaskId, OneShotTaskResult, Paginated, Thread, ThreadPopulated, TokenOption } from '../interfaces';
3
3
  import { CrossPlatformFormData } from '../utils';
4
4
  import { HttpClientService } from './http-client.service';
5
5
  export declare class AiService extends APIBase {
@@ -10,7 +10,7 @@ export declare class AiService extends APIBase {
10
10
  listAssistantThreads(assistantId: AiAssistantId): Promise<ThreadPopulated[]>;
11
11
  getAssistant(assistantId: AiAssistantId): Promise<AiAssistant>;
12
12
  getAssistants(options?: TokenOption): Promise<AiAssistant[]>;
13
- getSpeechToken(): Promise<SpeechToken>;
13
+ transcribeAudio(form: CrossPlatformFormData, options?: Config): Promise<AudioTranscription>;
14
14
  getSkills(options?: Config): Promise<AiSkillSummary[]>;
15
15
  setSkillEnabled(id: string, enabled: boolean, options?: Config): Promise<AiSkill>;
16
16
  deleteSkill(id: string, options?: Config): Promise<AiSkill>;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AiService = void 0;
4
4
  const api_base_1 = require("../api-base");
5
5
  const utils_1 = require("../utils");
6
+ const AUDIO_TRANSCRIPTION_TIMEOUT_MS = 5 * 60000;
6
7
  class AiService extends api_base_1.APIBase {
7
8
  constructor(httpClient) {
8
9
  super(httpClient, '/ai');
@@ -25,8 +26,15 @@ class AiService extends api_base_1.APIBase {
25
26
  getAssistants(options = {}) {
26
27
  return this.httpClient.get(`${this.basePath}/assistants`, options);
27
28
  }
28
- getSpeechToken() {
29
- return this.httpClient.get(`${this.basePath}/speech/token`);
29
+ transcribeAudio(form, options = {}) {
30
+ const headers = { ...(0, utils_1.getFormDataHeaders)(form), ...options.headers };
31
+ return this.httpClient.post(`${this.basePath}/audio/transcription`, form, {
32
+ ...options,
33
+ headers,
34
+ maxBodyLength: Infinity,
35
+ maxContentLength: Infinity,
36
+ timeout: AUDIO_TRANSCRIPTION_TIMEOUT_MS,
37
+ });
30
38
  }
31
39
  getSkills(options = {}) {
32
40
  return this.httpClient.get(`${this.basePath}/skills`, options);