@sermas/api-client 1.0.0-alpha.22 → 1.0.0-alpha.24

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/index.d.cts CHANGED
@@ -1,3 +1,6 @@
1
+ import mqtt from 'mqtt';
2
+ export { MqttClient } from 'mqtt';
3
+
1
4
  type ApiRequestOptions = {
2
5
  readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
3
6
  readonly url: string;
@@ -631,10 +634,11 @@ type AppPromptDto = {
631
634
  };
632
635
 
633
636
  type AppSettingsDto = {
634
- login: boolean;
637
+ ttsEnabled?: boolean;
638
+ login?: boolean;
635
639
  avatar: string;
636
- language: string;
637
- llm: string;
640
+ language?: string;
641
+ llm?: string;
638
642
  background: string;
639
643
  prompt?: AppPromptDto;
640
644
  };
@@ -1155,22 +1159,7 @@ type SessionDto = {
1155
1159
  closedAt: string;
1156
1160
  };
1157
1161
 
1158
- type SessionStorageEventDto = {
1159
- appId: string;
1160
- /**
1161
- * Reference to the authenticated client the request originated from
1162
- */
1163
- clientId?: string;
1164
- /**
1165
- * Reference to the user interacting with the system
1166
- */
1167
- userId?: string;
1168
- sessionId: string;
1169
- data: Record<string, any>;
1170
- storageId: string;
1171
- };
1172
-
1173
- type SessionStorageRequestDto = {
1162
+ type SessionStorageRecordDto = {
1174
1163
  appId: string;
1175
1164
  /**
1176
1165
  * Reference to the authenticated client the request originated from
@@ -1180,30 +1169,16 @@ type SessionStorageRequestDto = {
1180
1169
  * Reference to the user interacting with the system
1181
1170
  */
1182
1171
  userId?: string;
1183
- sessionId: string;
1184
- data: Record<string, any>;
1185
- };
1186
-
1187
- type SessionStorageResponseDto = {
1188
- appId: string;
1189
- /**
1190
- * Reference to the authenticated client the request originated from
1191
- */
1192
- clientId?: string;
1193
- /**
1194
- * Reference to the user interacting with the system
1195
- */
1196
- userId?: string;
1197
- sessionId: string;
1172
+ storageId?: string;
1173
+ sessionId?: string;
1198
1174
  data: Record<string, any>;
1199
- storageId: string;
1200
1175
  };
1201
1176
 
1202
1177
  type SessionStorageSearchDto = {
1203
1178
  appId: string;
1204
- userId: Array<string>;
1205
- sessionId: Array<string>;
1206
- storageId: Array<string>;
1179
+ userId?: Array<string>;
1180
+ sessionId?: Array<string>;
1181
+ storageId?: Array<string>;
1207
1182
  };
1208
1183
 
1209
1184
  type SessionSupportRequestDto = {
@@ -1238,29 +1213,33 @@ declare class SessionService {
1238
1213
  readonly httpRequest: BaseHttpRequest;
1239
1214
  constructor(httpRequest: BaseHttpRequest);
1240
1215
  /**
1216
+ * Load a session
1241
1217
  * @param sessionId
1242
1218
  * @returns any
1243
1219
  * @throws ApiError
1244
1220
  */
1245
- sessionControllerRead(sessionId: string): CancelablePromise<any>;
1221
+ readSession(sessionId: string): CancelablePromise<any>;
1246
1222
  /**
1223
+ * Remove session
1247
1224
  * @param sessionId
1248
1225
  * @returns any
1249
1226
  * @throws ApiError
1250
1227
  */
1251
- sessionControllerDelete(sessionId: string): CancelablePromise<any>;
1228
+ deleteSession(sessionId: string): CancelablePromise<any>;
1252
1229
  /**
1230
+ * Create session
1253
1231
  * @param requestBody
1254
1232
  * @returns any
1255
1233
  * @throws ApiError
1256
1234
  */
1257
- sessionControllerCreate(requestBody: SessionDto): CancelablePromise<any>;
1235
+ createSession(requestBody: SessionDto): CancelablePromise<any>;
1258
1236
  /**
1237
+ * Update session
1259
1238
  * @param requestBody
1260
1239
  * @returns any
1261
1240
  * @throws ApiError
1262
1241
  */
1263
- sessionControllerUpdate(requestBody: SessionDto): CancelablePromise<any>;
1242
+ updateSession(requestBody: SessionDto): CancelablePromise<any>;
1264
1243
  /**
1265
1244
  * Notifies of an agent update
1266
1245
  * @param requestBody
@@ -1269,33 +1248,40 @@ declare class SessionService {
1269
1248
  */
1270
1249
  agentUpdate(requestBody: AgentHeartBeatEventDto): CancelablePromise<any>;
1271
1250
  /**
1272
- * Store user or session related data
1251
+ * Request support from human
1273
1252
  * @param requestBody
1274
- * @returns SessionStorageResponseDto User data stored
1253
+ * @returns SessionSupportResponseDto Human support requested
1275
1254
  * @throws ApiError
1276
1255
  */
1277
- saveStore(requestBody: SessionStorageRequestDto): CancelablePromise<SessionStorageResponseDto>;
1256
+ support(requestBody: SessionSupportRequestDto): CancelablePromise<SessionSupportResponseDto>;
1278
1257
  /**
1279
- * Retrieve stored data
1280
- * @param storageId
1281
- * @returns SessionDto Stored data retrieved
1258
+ * Store user data
1259
+ * @param requestBody
1260
+ * @returns SessionStorageRecordDto Record stored
1282
1261
  * @throws ApiError
1283
1262
  */
1284
- getStore(storageId: string): CancelablePromise<SessionDto>;
1263
+ setRecord(requestBody: SessionStorageRecordDto): CancelablePromise<SessionStorageRecordDto>;
1285
1264
  /**
1286
- * Search storage data
1265
+ * Store user data
1287
1266
  * @param requestBody
1288
- * @returns SessionStorageEventDto Data retrieved from search
1267
+ * @returns SessionStorageRecordDto Record stored
1289
1268
  * @throws ApiError
1290
1269
  */
1291
- searchStore(requestBody: SessionStorageSearchDto): CancelablePromise<Array<SessionStorageEventDto>>;
1270
+ findRecords(requestBody: SessionStorageSearchDto): CancelablePromise<Array<SessionStorageRecordDto>>;
1292
1271
  /**
1293
- * Request support from human
1294
- * @param requestBody
1295
- * @returns SessionSupportResponseDto Human support requested
1272
+ * Retrieve stored data
1273
+ * @param storageId
1274
+ * @returns SessionStorageRecordDto Record retrieved
1296
1275
  * @throws ApiError
1297
1276
  */
1298
- support(requestBody: SessionSupportRequestDto): CancelablePromise<SessionSupportResponseDto>;
1277
+ getRecord(storageId: string): CancelablePromise<SessionStorageRecordDto>;
1278
+ /**
1279
+ * Delete a record
1280
+ * @param storageId
1281
+ * @returns any Record deleted
1282
+ * @throws ApiError
1283
+ */
1284
+ deleteRecord(storageId: string): CancelablePromise<any>;
1299
1285
  }
1300
1286
 
1301
1287
  type UIContentDto = {
@@ -1904,8 +1890,11 @@ declare class Broker {
1904
1890
  password: string;
1905
1891
  params: Record<string, any>;
1906
1892
  });
1907
- setToken(token: string): Promise<void>;
1908
- connect(): Promise<void>;
1893
+ disconnect(): Promise<void>;
1894
+ setParams(params: Record<string, any>): void;
1895
+ setToken(token: string): void;
1896
+ getClient(): mqtt.MqttClient;
1897
+ connect(): void;
1909
1898
  parseTopic(topic: string): {
1910
1899
  type: string;
1911
1900
  appId: string;
@@ -1913,7 +1902,7 @@ declare class Broker {
1913
1902
  scope: string;
1914
1903
  context: string[];
1915
1904
  };
1916
- subscribe<T>(topic: string, callback: (ev: T) => void, params?: Record<string, any>): Promise<() => void>;
1905
+ subscribe<T>(topic: string, callback: (ev: T) => void, params?: Record<string, any>): () => any;
1917
1906
  publish<T>(topic: string, ev: T | Buffer, params?: Record<string, string>): Promise<boolean>;
1918
1907
  replaceTopicParams(topic: string, params?: Record<string, any>): string;
1919
1908
  }
@@ -1939,11 +1928,11 @@ interface AppToolsDto {
1939
1928
  returnDirect?: boolean;
1940
1929
  url?: string;
1941
1930
  }
1942
- interface AnonymousSchema_59 {
1931
+ interface AnonymousSchema_60 {
1943
1932
  username?: string;
1944
1933
  password: string;
1945
1934
  }
1946
- interface AnonymousSchema_62 {
1935
+ interface AnonymousSchema_63 {
1947
1936
  clientType?: string;
1948
1937
  clientId?: string;
1949
1938
  clientSecret?: string;
@@ -2004,7 +1993,7 @@ interface StringInferenceValue {
2004
1993
  probability: number;
2005
1994
  value: string;
2006
1995
  }
2007
- type AnonymousSchema_124 = 'start' | 'stop';
1996
+ type AnonymousSchema_125 = 'start' | 'stop';
2008
1997
  interface UserCharacterizationEventDto {
2009
1998
  appId: string;
2010
1999
  clientId?: string;
@@ -2083,10 +2072,10 @@ interface AgentDto {
2083
2072
  clientId?: string;
2084
2073
  userId?: string;
2085
2074
  agentId: string;
2086
- status: AnonymousSchema_198;
2075
+ status: AnonymousSchema_199;
2087
2076
  modules: string[];
2088
2077
  }
2089
- type AnonymousSchema_198 = 'unavailable' | 'error' | 'not_ready' | 'ready' | 'loading' | 'interacting' | 'waiting' | 'processing';
2078
+ type AnonymousSchema_199 = 'unavailable' | 'error' | 'not_ready' | 'ready' | 'loading' | 'interacting' | 'waiting' | 'processing';
2090
2079
  interface AgentChangedDto {
2091
2080
  appId: string;
2092
2081
  clientId?: string;
@@ -2105,6 +2094,13 @@ interface SessionSupportEventDto {
2105
2094
  feedback: string;
2106
2095
  code: string;
2107
2096
  }
2097
+ interface SessionStorageEventDto {
2098
+ appId: string;
2099
+ clientId?: string;
2100
+ userId?: string;
2101
+ operation: string;
2102
+ record: SessionStorageRecordDto;
2103
+ }
2108
2104
  interface UiStatusDto {
2109
2105
  appId: string;
2110
2106
  clientId?: string;
@@ -2118,14 +2114,14 @@ interface UiContentDto {
2118
2114
  clientId?: string;
2119
2115
  userId?: string;
2120
2116
  sessionId?: string;
2121
- contentType: AnonymousSchema_230;
2117
+ contentType: AnonymousSchema_235;
2122
2118
  content: Record<string, any>;
2123
2119
  metadata?: Record<string, any>;
2124
2120
  options: Record<string, any>;
2125
2121
  chunkId?: number;
2126
2122
  messageId?: string;
2127
2123
  }
2128
- type AnonymousSchema_230 = 'video' | 'image' | 'pdf' | 'webpage' | 'object' | 'text' | 'email' | 'html' | 'link' | 'dialogue-message' | 'navigation' | 'buttons' | 'quiz' | 'clear-screen';
2124
+ type AnonymousSchema_235 = 'video' | 'image' | 'pdf' | 'webpage' | 'object' | 'text' | 'email' | 'html' | 'link' | 'dialogue-message' | 'navigation' | 'buttons' | 'quiz' | 'clear-screen';
2129
2125
  interface UiInteractionEventDto {
2130
2126
  appId: string;
2131
2127
  clientId?: string;
@@ -2345,19 +2341,19 @@ declare class Session {
2345
2341
  appId?: string;
2346
2342
  agentId?: string;
2347
2343
  }): Promise<() => void>;
2348
- storageUpdated(event: SessionStorageEventDto, params?: {
2344
+ support(event: SessionSupportEventDto, params?: {
2349
2345
  appId?: string;
2350
- storageId?: string;
2351
2346
  }): Promise<boolean>;
2352
- onStorageUpdated(fn: (event: SessionStorageEventDto) => void | Promise<void>, params?: {
2347
+ onSupport(fn: (event: SessionSupportEventDto) => void | Promise<void>, params?: {
2353
2348
  appId?: string;
2354
- storageId?: string;
2355
2349
  }): Promise<() => void>;
2356
- support(event: SessionSupportEventDto, params?: {
2350
+ storageUpdated(event: SessionStorageEventDto, params?: {
2357
2351
  appId?: string;
2352
+ storageId?: string;
2358
2353
  }): Promise<boolean>;
2359
- onSupport(fn: (event: SessionSupportEventDto) => void | Promise<void>, params?: {
2354
+ onStorageUpdated(fn: (event: SessionStorageEventDto) => void | Promise<void>, params?: {
2360
2355
  appId?: string;
2356
+ storageId?: string;
2361
2357
  }): Promise<() => void>;
2362
2358
  }
2363
2359
 
@@ -2496,19 +2492,17 @@ interface LoggerService {
2496
2492
  declare const sleep: (t?: number) => Promise<void>;
2497
2493
  type SermasEnvType = 'local' | 'dev' | 'prod';
2498
2494
  interface SermasApiClientConfig {
2499
- domain?: string;
2500
2495
  access_token?: string;
2501
2496
  refresh_token?: string;
2502
2497
  clientId?: string;
2503
2498
  clientSecret?: string;
2504
- env?: SermasEnvType;
2499
+ baseURL?: string;
2505
2500
  appId?: string;
2506
2501
  logger?: LoggerService;
2507
2502
  }
2508
- declare const createSermasClient: (config: SermasApiClientConfig) => Promise<SermasApiClient>;
2509
2503
  declare class SermasApiClient {
2510
2504
  private readonly config;
2511
- private readonly logger;
2505
+ private logger;
2512
2506
  api: SermasApi;
2513
2507
  events: AsyncApiClient;
2514
2508
  private broker;
@@ -2519,11 +2513,16 @@ declare class SermasApiClient {
2519
2513
  private jwt;
2520
2514
  private params;
2521
2515
  constructor(config: SermasApiClientConfig);
2522
- init(force?: boolean): Promise<void>;
2516
+ getBroker(): Broker;
2517
+ close(): Promise<void>;
2518
+ private init;
2519
+ private watchToken;
2523
2520
  refreshToken(): Promise<any>;
2524
2521
  loadToken(clientId: any, clientSecret: any, appId?: string): Promise<JwtTokenDto>;
2525
- setToken(accessToken: string | LoginResponseDto, refreshToken?: string): Promise<void>;
2522
+ setToken(accessToken: string | (LoginResponseDto & {
2523
+ appId?: string;
2524
+ }), refreshToken?: string, appId?: string): void;
2526
2525
  login(username: any, password: any, appId?: string): Promise<LoginResponseDto>;
2527
2526
  }
2528
2527
 
2529
- export { type AccessTokenRequestDto, type ActuationEventDto, type AgentChangedDto, type AgentDto, type AgentHeartBeatEventDto, type AnonymousSchema_124, type AnonymousSchema_198, type AnonymousSchema_230, type AnonymousSchema_59, type AnonymousSchema_62, type AppClientDto, type AppModuleConfigDto, type AppPromptDto, type AppSettingsDto, type AppToolsDTO, type AppToolsDto, type AudioClassificationEventDto, type AudioClassificationValue, type AuthJwtUser, type AuthorizationUser, type AvatarCameraConfig, type BoundingBox, type Buffer$1 as Buffer, type ButtonsContentDto, type ButtonsUIContentDto, type ClearScreenDto, type ClearUIContentDto, type CreatePlatformAppDto, type DialogueDocumentDto, type DialogueDocumentMetadataDto, type DialogueMessageDto, type DialogueMessageUIContentDto, type DialogueTextToSpeechDto, type DialogueToolTriggeredEventDto, type DialogueUserMessageDto, type EmailContentDto, type EmailUIContentDto, type HtmlContentDto, type HtmlUIContentDto, type ImageContentDto, type ImageUIContentDto, type InitialPoseDto, type InitialPoseEventDto, type JwtTokenDto, type KeycloakJwtTokenResourceAccess, type LinearVelocityDto, type LinkContentDto, type LinkUIContentDto, type LoginRequestDto, type LoginResponseDto, type ModuleConfigEventDto, type ModuleResourceDto, type ModuleSettingsDto, type MovementDto, type MovementEventDto, type NoiseEventDto, type ObjectContentDto, type ObjectDetectionDto, type ObjectDetectionEventDto, type ObjectUIContentDto, type OrientationDto, type PdfContentDto, type PdfUIContentDto, type PlatformAppChangedDto, type PlatformAppClientChangedDto, type PlatformAppDto, type PlatformAppExportFilterDto, type PlatformAppModuleConfigEventDto, type PlatformModuleConfigDto, type PlatformSettingsDto, type PlatformTokenDto, type Point3D, type PoseDto, type PositionDto, type QrCodeEventDto, type QuizAnswerDto, type QuizContentDto, type QuizUIContentDto, type RefreshTokenRequestDto, type RegistrationRequestDto, type RegistrationResponseDto, type RepositoryAvatarModelDto, type RepositoryBackgroundMetadataDto, type RepositoryBackgroundModelDto, type RepositoryConfigDto, type RepositoryMapModelDto, type RepositoryRobotModelDto, type SentimentAnalysisRequest, SermasApiClient, type SermasApiClientConfig, type SermasBaseDto, type SermasEnvType, type SessionChangedDto, type SessionDto, type SessionStorageEventDto, type SessionStorageRequestDto, type SessionStorageResponseDto, type SessionStorageSearchDto, type SessionSupportEventDto, type SessionSupportRequestDto, type SessionSupportResponseDto, type StatusDto, type StatusEventDto, type StringInferenceValue, type TextContentDto, type TextUIContentDto, type ToolsRequestSchema, type ToolsRequestSchemaAuthBasic, type ToolsRequestSchemaAuthBearer, type UIContentDto, type UIInteractionDTO, type UILoaderResponseDto, type UIModelMapBlendShapesRequestDto, type UIModelMapBlendShapesResponseDto, type UiContentDto, type UiInteractionDto, type UiInteractionEventDto, type UiStatusDto, type UpdateUserEventDto, type UpdateUserRequestDto, type UserAgeValue, type UserCharacterizationDto, type UserCharacterizationEventDto, type UserDetectionDto, type UserDetectionEventDto, type UserEmotionValue, type UserInteractionIntentionDto, type VelocityDto, type VideoContentDto, type VideoUIContentDto, type ViewLogsRequestDto, type WebpageContentDto, type WebpageUIContentDto, type XRMarkerDto, type XRMarkerListRequestDto, type XRMarkerListResponseDto, type XROcclusionResponseDto, type XrMarkerDetectedDto, type XrMarkerDto, type XrOcclusionDto, createSermasClient, sleep };
2528
+ export { type AccessTokenRequestDto, type ActuationEventDto, type AgentChangedDto, type AgentDto, type AgentHeartBeatEventDto, type AnonymousSchema_125, type AnonymousSchema_199, type AnonymousSchema_235, type AnonymousSchema_60, type AnonymousSchema_63, type AppClientDto, type AppModuleConfigDto, type AppPromptDto, type AppSettingsDto, type AppToolsDTO, type AppToolsDto, type AudioClassificationEventDto, type AudioClassificationValue, type AuthJwtUser, type AuthorizationUser, type AvatarCameraConfig, type BoundingBox, Broker, type Buffer$1 as Buffer, type ButtonsContentDto, type ButtonsUIContentDto, type ClearScreenDto, type ClearUIContentDto, type CreatePlatformAppDto, type DialogueDocumentDto, type DialogueDocumentMetadataDto, type DialogueMessageDto, type DialogueMessageUIContentDto, type DialogueTextToSpeechDto, type DialogueToolTriggeredEventDto, type DialogueUserMessageDto, type EmailContentDto, type EmailUIContentDto, type HtmlContentDto, type HtmlUIContentDto, type ImageContentDto, type ImageUIContentDto, type InitialPoseDto, type InitialPoseEventDto, type JwtTokenDto, type KeycloakJwtTokenResourceAccess, type LinearVelocityDto, type LinkContentDto, type LinkUIContentDto, type LoginRequestDto, type LoginResponseDto, type ModuleConfigEventDto, type ModuleResourceDto, type ModuleSettingsDto, type MovementDto, type MovementEventDto, type NoiseEventDto, type ObjectContentDto, type ObjectDetectionDto, type ObjectDetectionEventDto, type ObjectUIContentDto, type OrientationDto, type PdfContentDto, type PdfUIContentDto, type PlatformAppChangedDto, type PlatformAppClientChangedDto, type PlatformAppDto, type PlatformAppExportFilterDto, type PlatformAppModuleConfigEventDto, type PlatformModuleConfigDto, type PlatformSettingsDto, type PlatformTokenDto, type Point3D, type PoseDto, type PositionDto, type QrCodeEventDto, type QuizAnswerDto, type QuizContentDto, type QuizUIContentDto, type RefreshTokenRequestDto, type RegistrationRequestDto, type RegistrationResponseDto, type RepositoryAvatarModelDto, type RepositoryBackgroundMetadataDto, type RepositoryBackgroundModelDto, type RepositoryConfigDto, type RepositoryMapModelDto, type RepositoryRobotModelDto, type SentimentAnalysisRequest, SermasApiClient, type SermasApiClientConfig, type SermasBaseDto, type SermasEnvType, type SessionChangedDto, type SessionDto, type SessionStorageEventDto, type SessionStorageRecordDto, type SessionStorageSearchDto, type SessionSupportEventDto, type SessionSupportRequestDto, type SessionSupportResponseDto, type StatusDto, type StatusEventDto, type StringInferenceValue, type TextContentDto, type TextUIContentDto, type ToolsRequestSchema, type ToolsRequestSchemaAuthBasic, type ToolsRequestSchemaAuthBearer, type UIContentDto, type UIInteractionDTO, type UILoaderResponseDto, type UIModelMapBlendShapesRequestDto, type UIModelMapBlendShapesResponseDto, type UiContentDto, type UiInteractionDto, type UiInteractionEventDto, type UiStatusDto, type UpdateUserEventDto, type UpdateUserRequestDto, type UserAgeValue, type UserCharacterizationDto, type UserCharacterizationEventDto, type UserDetectionDto, type UserDetectionEventDto, type UserEmotionValue, type UserInteractionIntentionDto, type VelocityDto, type VideoContentDto, type VideoUIContentDto, type ViewLogsRequestDto, type WebpageContentDto, type WebpageUIContentDto, type XRMarkerDto, type XRMarkerListRequestDto, type XRMarkerListResponseDto, type XROcclusionResponseDto, type XrMarkerDetectedDto, type XrMarkerDto, type XrOcclusionDto, sleep };