@sermas/api-client 1.0.0-alpha9 → 2.0.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.
Files changed (410) hide show
  1. package/README.md +60 -0
  2. package/index.cjs +2 -0
  3. package/index.cjs.map +1 -0
  4. package/index.d.cts +4915 -0
  5. package/index.d.ts +4899 -17
  6. package/index.js +1 -154
  7. package/index.js.map +1 -1
  8. package/package.json +23 -16
  9. package/asyncapi-generator.d.ts +0 -1
  10. package/asyncapi-generator.js +0 -181
  11. package/asyncapi-generator.js.map +0 -1
  12. package/asyncapi.d.ts +0 -1
  13. package/asyncapi.js +0 -18
  14. package/asyncapi.js.map +0 -1
  15. package/libs/asyncapi/auth.d.ts +0 -24
  16. package/libs/asyncapi/auth.js +0 -29
  17. package/libs/asyncapi/auth.js.map +0 -1
  18. package/libs/asyncapi/detection.d.ts +0 -48
  19. package/libs/asyncapi/detection.js +0 -53
  20. package/libs/asyncapi/detection.js.map +0 -1
  21. package/libs/asyncapi/dialogue.d.ts +0 -30
  22. package/libs/asyncapi/dialogue.js +0 -29
  23. package/libs/asyncapi/dialogue.js.map +0 -1
  24. package/libs/asyncapi/index.d.ts +0 -23
  25. package/libs/asyncapi/index.js +0 -28
  26. package/libs/asyncapi/index.js.map +0 -1
  27. package/libs/asyncapi/models.d.ts +0 -451
  28. package/libs/asyncapi/models.js +0 -38
  29. package/libs/asyncapi/models.js.map +0 -1
  30. package/libs/asyncapi/module.d.ts +0 -12
  31. package/libs/asyncapi/module.js +0 -17
  32. package/libs/asyncapi/module.js.map +0 -1
  33. package/libs/asyncapi/platform.d.ts +0 -32
  34. package/libs/asyncapi/platform.js +0 -35
  35. package/libs/asyncapi/platform.js.map +0 -1
  36. package/libs/asyncapi/robotics.d.ts +0 -30
  37. package/libs/asyncapi/robotics.js +0 -35
  38. package/libs/asyncapi/robotics.js.map +0 -1
  39. package/libs/asyncapi/session.d.ts +0 -48
  40. package/libs/asyncapi/session.js +0 -47
  41. package/libs/asyncapi/session.js.map +0 -1
  42. package/libs/asyncapi/ui.d.ts +0 -26
  43. package/libs/asyncapi/ui.js +0 -29
  44. package/libs/asyncapi/ui.js.map +0 -1
  45. package/libs/asyncapi/xr.d.ts +0 -26
  46. package/libs/asyncapi/xr.js +0 -29
  47. package/libs/asyncapi/xr.js.map +0 -1
  48. package/libs/broker.d.ts +0 -25
  49. package/libs/broker.js +0 -141
  50. package/libs/broker.js.map +0 -1
  51. package/libs/logger.d.ts +0 -13
  52. package/libs/logger.dto.d.ts +0 -151
  53. package/libs/logger.dto.js +0 -3
  54. package/libs/logger.dto.js.map +0 -1
  55. package/libs/logger.js +0 -49
  56. package/libs/logger.js.map +0 -1
  57. package/libs/openapi/SermasApi.d.ts +0 -26
  58. package/libs/openapi/SermasApi.js +0 -40
  59. package/libs/openapi/SermasApi.js.map +0 -1
  60. package/libs/openapi/core/ApiError.d.ts +0 -10
  61. package/libs/openapi/core/ApiError.js +0 -16
  62. package/libs/openapi/core/ApiError.js.map +0 -1
  63. package/libs/openapi/core/ApiRequestOptions.d.ts +0 -13
  64. package/libs/openapi/core/ApiRequestOptions.js +0 -3
  65. package/libs/openapi/core/ApiRequestOptions.js.map +0 -1
  66. package/libs/openapi/core/ApiResult.d.ts +0 -7
  67. package/libs/openapi/core/ApiResult.js +0 -3
  68. package/libs/openapi/core/ApiResult.js.map +0 -1
  69. package/libs/openapi/core/AxiosHttpRequest.d.ts +0 -14
  70. package/libs/openapi/core/AxiosHttpRequest.js +0 -21
  71. package/libs/openapi/core/AxiosHttpRequest.js.map +0 -1
  72. package/libs/openapi/core/BaseHttpRequest.d.ts +0 -8
  73. package/libs/openapi/core/BaseHttpRequest.js +0 -10
  74. package/libs/openapi/core/BaseHttpRequest.js.map +0 -1
  75. package/libs/openapi/core/CancelablePromise.d.ts +0 -20
  76. package/libs/openapi/core/CancelablePromise.js +0 -117
  77. package/libs/openapi/core/CancelablePromise.js.map +0 -1
  78. package/libs/openapi/core/OpenAPI.d.ts +0 -16
  79. package/libs/openapi/core/OpenAPI.js +0 -15
  80. package/libs/openapi/core/OpenAPI.js.map +0 -1
  81. package/libs/openapi/core/request.d.ts +0 -34
  82. package/libs/openapi/core/request.js +0 -277
  83. package/libs/openapi/core/request.js.map +0 -1
  84. package/libs/openapi/index.d.ts +0 -111
  85. package/libs/openapi/index.js +0 -75
  86. package/libs/openapi/index.js.map +0 -1
  87. package/libs/openapi/models/AccessTokenRequestDto.d.ts +0 -5
  88. package/libs/openapi/models/AccessTokenRequestDto.js +0 -3
  89. package/libs/openapi/models/AccessTokenRequestDto.js.map +0 -1
  90. package/libs/openapi/models/ActuationEventDto.d.ts +0 -12
  91. package/libs/openapi/models/ActuationEventDto.js +0 -3
  92. package/libs/openapi/models/ActuationEventDto.js.map +0 -1
  93. package/libs/openapi/models/AgentHeartBeatEventDto.d.ts +0 -29
  94. package/libs/openapi/models/AgentHeartBeatEventDto.js +0 -18
  95. package/libs/openapi/models/AgentHeartBeatEventDto.js.map +0 -1
  96. package/libs/openapi/models/AppClientDto.d.ts +0 -13
  97. package/libs/openapi/models/AppClientDto.js +0 -3
  98. package/libs/openapi/models/AppClientDto.js.map +0 -1
  99. package/libs/openapi/models/AppModuleConfigDto.d.ts +0 -14
  100. package/libs/openapi/models/AppModuleConfigDto.js +0 -3
  101. package/libs/openapi/models/AppModuleConfigDto.js.map +0 -1
  102. package/libs/openapi/models/AppPromptDto.d.ts +0 -3
  103. package/libs/openapi/models/AppPromptDto.js +0 -3
  104. package/libs/openapi/models/AppPromptDto.js.map +0 -1
  105. package/libs/openapi/models/AppSettingsDto.d.ts +0 -9
  106. package/libs/openapi/models/AppSettingsDto.js +0 -3
  107. package/libs/openapi/models/AppSettingsDto.js.map +0 -1
  108. package/libs/openapi/models/AppToolsDTO.d.ts +0 -10
  109. package/libs/openapi/models/AppToolsDTO.js +0 -3
  110. package/libs/openapi/models/AppToolsDTO.js.map +0 -1
  111. package/libs/openapi/models/AuthJwtUser.d.ts +0 -28
  112. package/libs/openapi/models/AuthJwtUser.js +0 -3
  113. package/libs/openapi/models/AuthJwtUser.js.map +0 -1
  114. package/libs/openapi/models/AuthorizationUser.d.ts +0 -5
  115. package/libs/openapi/models/AuthorizationUser.js +0 -3
  116. package/libs/openapi/models/AuthorizationUser.js.map +0 -1
  117. package/libs/openapi/models/AvatarCameraConfig.d.ts +0 -5
  118. package/libs/openapi/models/AvatarCameraConfig.js +0 -3
  119. package/libs/openapi/models/AvatarCameraConfig.js.map +0 -1
  120. package/libs/openapi/models/ButtonsContentDto.d.ts +0 -4
  121. package/libs/openapi/models/ButtonsContentDto.js +0 -3
  122. package/libs/openapi/models/ButtonsContentDto.js.map +0 -1
  123. package/libs/openapi/models/ButtonsUIContentDto.d.ts +0 -40
  124. package/libs/openapi/models/ButtonsUIContentDto.js +0 -24
  125. package/libs/openapi/models/ButtonsUIContentDto.js.map +0 -1
  126. package/libs/openapi/models/ClearScreenDto.d.ts +0 -39
  127. package/libs/openapi/models/ClearScreenDto.js +0 -24
  128. package/libs/openapi/models/ClearScreenDto.js.map +0 -1
  129. package/libs/openapi/models/ClearUIContentDto.d.ts +0 -39
  130. package/libs/openapi/models/ClearUIContentDto.js +0 -24
  131. package/libs/openapi/models/ClearUIContentDto.js.map +0 -1
  132. package/libs/openapi/models/CreatePlatformAppDto.d.ts +0 -19
  133. package/libs/openapi/models/CreatePlatformAppDto.js +0 -3
  134. package/libs/openapi/models/CreatePlatformAppDto.js.map +0 -1
  135. package/libs/openapi/models/DialogueDocumentDto.d.ts +0 -7
  136. package/libs/openapi/models/DialogueDocumentDto.js +0 -3
  137. package/libs/openapi/models/DialogueDocumentDto.js.map +0 -1
  138. package/libs/openapi/models/DialogueDocumentMetadataDto.d.ts +0 -4
  139. package/libs/openapi/models/DialogueDocumentMetadataDto.js +0 -3
  140. package/libs/openapi/models/DialogueDocumentMetadataDto.js.map +0 -1
  141. package/libs/openapi/models/DialogueMessageDto.d.ts +0 -26
  142. package/libs/openapi/models/DialogueMessageDto.js +0 -3
  143. package/libs/openapi/models/DialogueMessageDto.js.map +0 -1
  144. package/libs/openapi/models/DialogueMessageUIContentDto.d.ts +0 -40
  145. package/libs/openapi/models/DialogueMessageUIContentDto.js +0 -24
  146. package/libs/openapi/models/DialogueMessageUIContentDto.js.map +0 -1
  147. package/libs/openapi/models/DialogueTextToSpeechDto.d.ts +0 -33
  148. package/libs/openapi/models/DialogueTextToSpeechDto.js +0 -3
  149. package/libs/openapi/models/DialogueTextToSpeechDto.js.map +0 -1
  150. package/libs/openapi/models/DialogueUserMessageDto.d.ts +0 -10
  151. package/libs/openapi/models/DialogueUserMessageDto.js +0 -3
  152. package/libs/openapi/models/DialogueUserMessageDto.js.map +0 -1
  153. package/libs/openapi/models/EmailContentDto.d.ts +0 -4
  154. package/libs/openapi/models/EmailContentDto.js +0 -3
  155. package/libs/openapi/models/EmailContentDto.js.map +0 -1
  156. package/libs/openapi/models/EmailUIContentDto.d.ts +0 -40
  157. package/libs/openapi/models/EmailUIContentDto.js +0 -24
  158. package/libs/openapi/models/EmailUIContentDto.js.map +0 -1
  159. package/libs/openapi/models/HtmlContentDto.d.ts +0 -3
  160. package/libs/openapi/models/HtmlContentDto.js +0 -3
  161. package/libs/openapi/models/HtmlContentDto.js.map +0 -1
  162. package/libs/openapi/models/HtmlUIContentDto.d.ts +0 -40
  163. package/libs/openapi/models/HtmlUIContentDto.js +0 -24
  164. package/libs/openapi/models/HtmlUIContentDto.js.map +0 -1
  165. package/libs/openapi/models/ImageContentDto.d.ts +0 -6
  166. package/libs/openapi/models/ImageContentDto.js +0 -3
  167. package/libs/openapi/models/ImageContentDto.js.map +0 -1
  168. package/libs/openapi/models/ImageUIContentDto.d.ts +0 -40
  169. package/libs/openapi/models/ImageUIContentDto.js +0 -24
  170. package/libs/openapi/models/ImageUIContentDto.js.map +0 -1
  171. package/libs/openapi/models/JwtTokenDto.d.ts +0 -11
  172. package/libs/openapi/models/JwtTokenDto.js +0 -3
  173. package/libs/openapi/models/JwtTokenDto.js.map +0 -1
  174. package/libs/openapi/models/KeycloakJwtTokenResourceAccess.d.ts +0 -1
  175. package/libs/openapi/models/KeycloakJwtTokenResourceAccess.js +0 -3
  176. package/libs/openapi/models/KeycloakJwtTokenResourceAccess.js.map +0 -1
  177. package/libs/openapi/models/LinearVelocityDto.d.ts +0 -1
  178. package/libs/openapi/models/LinearVelocityDto.js +0 -3
  179. package/libs/openapi/models/LinearVelocityDto.js.map +0 -1
  180. package/libs/openapi/models/LinkContentDto.d.ts +0 -4
  181. package/libs/openapi/models/LinkContentDto.js +0 -3
  182. package/libs/openapi/models/LinkContentDto.js.map +0 -1
  183. package/libs/openapi/models/LinkUIContentDto.d.ts +0 -40
  184. package/libs/openapi/models/LinkUIContentDto.js +0 -24
  185. package/libs/openapi/models/LinkUIContentDto.js.map +0 -1
  186. package/libs/openapi/models/LoginRequestDto.d.ts +0 -13
  187. package/libs/openapi/models/LoginRequestDto.js +0 -3
  188. package/libs/openapi/models/LoginRequestDto.js.map +0 -1
  189. package/libs/openapi/models/LoginResponseDto.d.ts +0 -9
  190. package/libs/openapi/models/LoginResponseDto.js +0 -3
  191. package/libs/openapi/models/LoginResponseDto.js.map +0 -1
  192. package/libs/openapi/models/ModuleResourceDto.d.ts +0 -34
  193. package/libs/openapi/models/ModuleResourceDto.js +0 -3
  194. package/libs/openapi/models/ModuleResourceDto.js.map +0 -1
  195. package/libs/openapi/models/ModuleSettingsDto.d.ts +0 -19
  196. package/libs/openapi/models/ModuleSettingsDto.js +0 -3
  197. package/libs/openapi/models/ModuleSettingsDto.js.map +0 -1
  198. package/libs/openapi/models/MovementDto.d.ts +0 -6
  199. package/libs/openapi/models/MovementDto.js +0 -3
  200. package/libs/openapi/models/MovementDto.js.map +0 -1
  201. package/libs/openapi/models/MovementEventDto.d.ts +0 -13
  202. package/libs/openapi/models/MovementEventDto.js +0 -3
  203. package/libs/openapi/models/MovementEventDto.js.map +0 -1
  204. package/libs/openapi/models/ObjectContentDto.d.ts +0 -3
  205. package/libs/openapi/models/ObjectContentDto.js +0 -3
  206. package/libs/openapi/models/ObjectContentDto.js.map +0 -1
  207. package/libs/openapi/models/ObjectUIContentDto.d.ts +0 -40
  208. package/libs/openapi/models/ObjectUIContentDto.js +0 -24
  209. package/libs/openapi/models/ObjectUIContentDto.js.map +0 -1
  210. package/libs/openapi/models/OrientationDto.d.ts +0 -6
  211. package/libs/openapi/models/OrientationDto.js +0 -3
  212. package/libs/openapi/models/OrientationDto.js.map +0 -1
  213. package/libs/openapi/models/PdfContentDto.d.ts +0 -3
  214. package/libs/openapi/models/PdfContentDto.js +0 -3
  215. package/libs/openapi/models/PdfContentDto.js.map +0 -1
  216. package/libs/openapi/models/PdfUIContentDto.d.ts +0 -40
  217. package/libs/openapi/models/PdfUIContentDto.js +0 -24
  218. package/libs/openapi/models/PdfUIContentDto.js.map +0 -1
  219. package/libs/openapi/models/PlatformAppDto.d.ts +0 -22
  220. package/libs/openapi/models/PlatformAppDto.js +0 -3
  221. package/libs/openapi/models/PlatformAppDto.js.map +0 -1
  222. package/libs/openapi/models/PlatformAppExportFilterDto.d.ts +0 -4
  223. package/libs/openapi/models/PlatformAppExportFilterDto.js +0 -3
  224. package/libs/openapi/models/PlatformAppExportFilterDto.js.map +0 -1
  225. package/libs/openapi/models/PlatformModuleConfigDto.d.ts +0 -13
  226. package/libs/openapi/models/PlatformModuleConfigDto.js +0 -3
  227. package/libs/openapi/models/PlatformModuleConfigDto.js.map +0 -1
  228. package/libs/openapi/models/PlatformSettingsDto.d.ts +0 -3
  229. package/libs/openapi/models/PlatformSettingsDto.js +0 -3
  230. package/libs/openapi/models/PlatformSettingsDto.js.map +0 -1
  231. package/libs/openapi/models/Point3D.d.ts +0 -5
  232. package/libs/openapi/models/Point3D.js +0 -3
  233. package/libs/openapi/models/Point3D.js.map +0 -1
  234. package/libs/openapi/models/PoseDto.d.ts +0 -6
  235. package/libs/openapi/models/PoseDto.js +0 -3
  236. package/libs/openapi/models/PoseDto.js.map +0 -1
  237. package/libs/openapi/models/PositionDto.d.ts +0 -5
  238. package/libs/openapi/models/PositionDto.js +0 -3
  239. package/libs/openapi/models/PositionDto.js.map +0 -1
  240. package/libs/openapi/models/QuizAnswerDto.d.ts +0 -5
  241. package/libs/openapi/models/QuizAnswerDto.js +0 -3
  242. package/libs/openapi/models/QuizAnswerDto.js.map +0 -1
  243. package/libs/openapi/models/QuizContentDto.d.ts +0 -5
  244. package/libs/openapi/models/QuizContentDto.js +0 -3
  245. package/libs/openapi/models/QuizContentDto.js.map +0 -1
  246. package/libs/openapi/models/QuizUIContentDto.d.ts +0 -40
  247. package/libs/openapi/models/QuizUIContentDto.js +0 -24
  248. package/libs/openapi/models/QuizUIContentDto.js.map +0 -1
  249. package/libs/openapi/models/RefreshTokenRequestDto.d.ts +0 -13
  250. package/libs/openapi/models/RefreshTokenRequestDto.js +0 -3
  251. package/libs/openapi/models/RefreshTokenRequestDto.js.map +0 -1
  252. package/libs/openapi/models/RegistrationRequestDto.d.ts +0 -14
  253. package/libs/openapi/models/RegistrationRequestDto.js +0 -3
  254. package/libs/openapi/models/RegistrationRequestDto.js.map +0 -1
  255. package/libs/openapi/models/RegistrationResponseDto.d.ts +0 -3
  256. package/libs/openapi/models/RegistrationResponseDto.js +0 -3
  257. package/libs/openapi/models/RegistrationResponseDto.js.map +0 -1
  258. package/libs/openapi/models/RepositoryAvatarModelDto.d.ts +0 -19
  259. package/libs/openapi/models/RepositoryAvatarModelDto.js +0 -17
  260. package/libs/openapi/models/RepositoryAvatarModelDto.js.map +0 -1
  261. package/libs/openapi/models/RepositoryBackgroundMetadataDto.d.ts +0 -3
  262. package/libs/openapi/models/RepositoryBackgroundMetadataDto.js +0 -3
  263. package/libs/openapi/models/RepositoryBackgroundMetadataDto.js.map +0 -1
  264. package/libs/openapi/models/RepositoryBackgroundModelDto.d.ts +0 -6
  265. package/libs/openapi/models/RepositoryBackgroundModelDto.js +0 -3
  266. package/libs/openapi/models/RepositoryBackgroundModelDto.js.map +0 -1
  267. package/libs/openapi/models/RepositoryConfigDto.d.ts +0 -5
  268. package/libs/openapi/models/RepositoryConfigDto.js +0 -3
  269. package/libs/openapi/models/RepositoryConfigDto.js.map +0 -1
  270. package/libs/openapi/models/RepositoryMapModelDto.d.ts +0 -7
  271. package/libs/openapi/models/RepositoryMapModelDto.js +0 -3
  272. package/libs/openapi/models/RepositoryMapModelDto.js.map +0 -1
  273. package/libs/openapi/models/RepositoryRobotModelDto.d.ts +0 -6
  274. package/libs/openapi/models/RepositoryRobotModelDto.js +0 -3
  275. package/libs/openapi/models/RepositoryRobotModelDto.js.map +0 -1
  276. package/libs/openapi/models/SentimentAnalysisRequest.d.ts +0 -12
  277. package/libs/openapi/models/SentimentAnalysisRequest.js +0 -3
  278. package/libs/openapi/models/SentimentAnalysisRequest.js.map +0 -1
  279. package/libs/openapi/models/SermasBaseDto.d.ts +0 -11
  280. package/libs/openapi/models/SermasBaseDto.js +0 -3
  281. package/libs/openapi/models/SermasBaseDto.js.map +0 -1
  282. package/libs/openapi/models/SessionDto.d.ts +0 -23
  283. package/libs/openapi/models/SessionDto.js +0 -3
  284. package/libs/openapi/models/SessionDto.js.map +0 -1
  285. package/libs/openapi/models/SessionStorageEventDto.d.ts +0 -14
  286. package/libs/openapi/models/SessionStorageEventDto.js +0 -3
  287. package/libs/openapi/models/SessionStorageEventDto.js.map +0 -1
  288. package/libs/openapi/models/SessionStorageRequestDto.d.ts +0 -13
  289. package/libs/openapi/models/SessionStorageRequestDto.js +0 -3
  290. package/libs/openapi/models/SessionStorageRequestDto.js.map +0 -1
  291. package/libs/openapi/models/SessionStorageResponseDto.d.ts +0 -14
  292. package/libs/openapi/models/SessionStorageResponseDto.js +0 -3
  293. package/libs/openapi/models/SessionStorageResponseDto.js.map +0 -1
  294. package/libs/openapi/models/SessionStorageSearchDto.d.ts +0 -6
  295. package/libs/openapi/models/SessionStorageSearchDto.js +0 -3
  296. package/libs/openapi/models/SessionStorageSearchDto.js.map +0 -1
  297. package/libs/openapi/models/SessionSupportRequestDto.d.ts +0 -14
  298. package/libs/openapi/models/SessionSupportRequestDto.js +0 -3
  299. package/libs/openapi/models/SessionSupportRequestDto.js.map +0 -1
  300. package/libs/openapi/models/SessionSupportResponseDto.d.ts +0 -12
  301. package/libs/openapi/models/SessionSupportResponseDto.js +0 -3
  302. package/libs/openapi/models/SessionSupportResponseDto.js.map +0 -1
  303. package/libs/openapi/models/StatusDto.d.ts +0 -6
  304. package/libs/openapi/models/StatusDto.js +0 -3
  305. package/libs/openapi/models/StatusDto.js.map +0 -1
  306. package/libs/openapi/models/StatusEventDto.d.ts +0 -14
  307. package/libs/openapi/models/StatusEventDto.js +0 -3
  308. package/libs/openapi/models/StatusEventDto.js.map +0 -1
  309. package/libs/openapi/models/TextContentDto.d.ts +0 -3
  310. package/libs/openapi/models/TextContentDto.js +0 -3
  311. package/libs/openapi/models/TextContentDto.js.map +0 -1
  312. package/libs/openapi/models/TextUIContentDto.d.ts +0 -40
  313. package/libs/openapi/models/TextUIContentDto.js +0 -24
  314. package/libs/openapi/models/TextUIContentDto.js.map +0 -1
  315. package/libs/openapi/models/ToolsRequestSchema.d.ts +0 -25
  316. package/libs/openapi/models/ToolsRequestSchema.js +0 -3
  317. package/libs/openapi/models/ToolsRequestSchema.js.map +0 -1
  318. package/libs/openapi/models/ToolsRequestSchemaAuthBasic.d.ts +0 -4
  319. package/libs/openapi/models/ToolsRequestSchemaAuthBasic.js +0 -3
  320. package/libs/openapi/models/ToolsRequestSchemaAuthBasic.js.map +0 -1
  321. package/libs/openapi/models/ToolsRequestSchemaAuthBearer.d.ts +0 -25
  322. package/libs/openapi/models/ToolsRequestSchemaAuthBearer.js +0 -3
  323. package/libs/openapi/models/ToolsRequestSchemaAuthBearer.js.map +0 -1
  324. package/libs/openapi/models/UIContentDto.d.ts +0 -39
  325. package/libs/openapi/models/UIContentDto.js +0 -24
  326. package/libs/openapi/models/UIContentDto.js.map +0 -1
  327. package/libs/openapi/models/UIInteractionDTO.d.ts +0 -5
  328. package/libs/openapi/models/UIInteractionDTO.js +0 -3
  329. package/libs/openapi/models/UIInteractionDTO.js.map +0 -1
  330. package/libs/openapi/models/UILoaderResponseDto.d.ts +0 -14
  331. package/libs/openapi/models/UILoaderResponseDto.js +0 -3
  332. package/libs/openapi/models/UILoaderResponseDto.js.map +0 -1
  333. package/libs/openapi/models/UIModelMapBlendShapesRequestDto.d.ts +0 -3
  334. package/libs/openapi/models/UIModelMapBlendShapesRequestDto.js +0 -3
  335. package/libs/openapi/models/UIModelMapBlendShapesRequestDto.js.map +0 -1
  336. package/libs/openapi/models/UIModelMapBlendShapesResponseDto.d.ts +0 -3
  337. package/libs/openapi/models/UIModelMapBlendShapesResponseDto.js +0 -3
  338. package/libs/openapi/models/UIModelMapBlendShapesResponseDto.js.map +0 -1
  339. package/libs/openapi/models/UpdateUserRequestDto.d.ts +0 -16
  340. package/libs/openapi/models/UpdateUserRequestDto.js +0 -3
  341. package/libs/openapi/models/UpdateUserRequestDto.js.map +0 -1
  342. package/libs/openapi/models/UserInteractionIntentionDto.d.ts +0 -25
  343. package/libs/openapi/models/UserInteractionIntentionDto.js +0 -12
  344. package/libs/openapi/models/UserInteractionIntentionDto.js.map +0 -1
  345. package/libs/openapi/models/VelocityDto.d.ts +0 -5
  346. package/libs/openapi/models/VelocityDto.js +0 -3
  347. package/libs/openapi/models/VelocityDto.js.map +0 -1
  348. package/libs/openapi/models/VideoContentDto.d.ts +0 -9
  349. package/libs/openapi/models/VideoContentDto.js +0 -3
  350. package/libs/openapi/models/VideoContentDto.js.map +0 -1
  351. package/libs/openapi/models/VideoUIContentDto.d.ts +0 -40
  352. package/libs/openapi/models/VideoUIContentDto.js +0 -24
  353. package/libs/openapi/models/VideoUIContentDto.js.map +0 -1
  354. package/libs/openapi/models/ViewLogsRequestDto.d.ts +0 -12
  355. package/libs/openapi/models/ViewLogsRequestDto.js +0 -13
  356. package/libs/openapi/models/ViewLogsRequestDto.js.map +0 -1
  357. package/libs/openapi/models/WebpageContentDto.d.ts +0 -3
  358. package/libs/openapi/models/WebpageContentDto.js +0 -3
  359. package/libs/openapi/models/WebpageContentDto.js.map +0 -1
  360. package/libs/openapi/models/WebpageUIContentDto.d.ts +0 -40
  361. package/libs/openapi/models/WebpageUIContentDto.js +0 -24
  362. package/libs/openapi/models/WebpageUIContentDto.js.map +0 -1
  363. package/libs/openapi/models/XRMarkerDto.d.ts +0 -23
  364. package/libs/openapi/models/XRMarkerDto.js +0 -3
  365. package/libs/openapi/models/XRMarkerDto.js.map +0 -1
  366. package/libs/openapi/models/XRMarkerListRequestDto.d.ts +0 -12
  367. package/libs/openapi/models/XRMarkerListRequestDto.js +0 -3
  368. package/libs/openapi/models/XRMarkerListRequestDto.js.map +0 -1
  369. package/libs/openapi/models/XRMarkerListResponseDto.d.ts +0 -3
  370. package/libs/openapi/models/XRMarkerListResponseDto.js +0 -3
  371. package/libs/openapi/models/XRMarkerListResponseDto.js.map +0 -1
  372. package/libs/openapi/models/XROcclusionResponseDto.d.ts +0 -12
  373. package/libs/openapi/models/XROcclusionResponseDto.js +0 -3
  374. package/libs/openapi/models/XROcclusionResponseDto.js.map +0 -1
  375. package/libs/openapi/models/index.d.ts +0 -96
  376. package/libs/openapi/models/index.js +0 -113
  377. package/libs/openapi/models/index.js.map +0 -1
  378. package/libs/openapi/services/AgentService.d.ts +0 -54
  379. package/libs/openapi/services/AgentService.js +0 -100
  380. package/libs/openapi/services/AgentService.js.map +0 -1
  381. package/libs/openapi/services/AuthenticationService.d.ts +0 -55
  382. package/libs/openapi/services/AuthenticationService.js +0 -118
  383. package/libs/openapi/services/AuthenticationService.js.map +0 -1
  384. package/libs/openapi/services/DetectionService.d.ts +0 -38
  385. package/libs/openapi/services/DetectionService.js +0 -75
  386. package/libs/openapi/services/DetectionService.js.map +0 -1
  387. package/libs/openapi/services/DialogueService.d.ts +0 -75
  388. package/libs/openapi/services/DialogueService.js +0 -154
  389. package/libs/openapi/services/DialogueService.js.map +0 -1
  390. package/libs/openapi/services/PlatformService.d.ts +0 -240
  391. package/libs/openapi/services/PlatformService.js +0 -497
  392. package/libs/openapi/services/PlatformService.js.map +0 -1
  393. package/libs/openapi/services/RoboticsService.d.ts +0 -78
  394. package/libs/openapi/services/RoboticsService.js +0 -154
  395. package/libs/openapi/services/RoboticsService.js.map +0 -1
  396. package/libs/openapi/services/SessionService.d.ts +0 -73
  397. package/libs/openapi/services/SessionService.js +0 -147
  398. package/libs/openapi/services/SessionService.js.map +0 -1
  399. package/libs/openapi/services/UiService.d.ts +0 -33
  400. package/libs/openapi/services/UiService.js +0 -67
  401. package/libs/openapi/services/UiService.js.map +0 -1
  402. package/libs/openapi/services/XrService.d.ts +0 -44
  403. package/libs/openapi/services/XrService.js +0 -94
  404. package/libs/openapi/services/XrService.js.map +0 -1
  405. package/openapi-generator.d.ts +0 -1
  406. package/openapi-generator.js +0 -48
  407. package/openapi-generator.js.map +0 -1
  408. package/openapi.d.ts +0 -1
  409. package/openapi.js +0 -18
  410. package/openapi.js.map +0 -1
package/index.js CHANGED
@@ -1,155 +1,2 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.SermasApiClient = exports.createSermasClient = exports.sleep = void 0;
7
- const dotenv_1 = __importDefault(require("dotenv"));
8
- const jwt_decode_1 = require("jwt-decode");
9
- const asyncapi_1 = __importDefault(require("./libs/asyncapi"));
10
- const broker_1 = require("./libs/broker");
11
- const logger_1 = require("./libs/logger");
12
- const openapi_1 = require("./libs/openapi");
13
- const sleep = (t = 1000) => new Promise((resolve) => setTimeout(() => resolve(), t));
14
- exports.sleep = sleep;
15
- const BASE_DOMAIN = `prod.sermas.spindoxlabs.it`;
16
- const createSermasClient = async (config) => {
17
- if (config.logger) {
18
- (0, logger_1.setDefaultLogger)(config.logger);
19
- }
20
- const client = new SermasApiClient(config);
21
- if (config.access_token)
22
- await client.init();
23
- return client;
24
- };
25
- exports.createSermasClient = createSermasClient;
26
- class SermasApiClient {
27
- constructor(config) {
28
- this.config = config;
29
- this.logger = new logger_1.Logger(SermasApiClient.name);
30
- this.ready = false;
31
- this.params = {};
32
- let domain = config.domain || BASE_DOMAIN;
33
- if (!config.domain && config.env) {
34
- domain = BASE_DOMAIN.replace('prod.', `${config.env}.`);
35
- }
36
- this.config.domain = domain;
37
- this.apiUrl = `https://${domain}`;
38
- this.mqttUrl = `wss://${domain}:443/mqtt`;
39
- }
40
- async init(force = false) {
41
- if (force)
42
- this.ready = false;
43
- if (this.ready)
44
- return;
45
- if (!this.api) {
46
- this.api = new openapi_1.SermasApi({
47
- BASE: this.apiUrl,
48
- TOKEN: this.config.access_token,
49
- });
50
- }
51
- else {
52
- this.api.request.config.TOKEN = this.config.access_token;
53
- }
54
- if (!this.broker) {
55
- this.params = {
56
- appId: this.config.appId,
57
- };
58
- this.broker = new broker_1.Broker({
59
- url: this.mqttUrl,
60
- username: this.config.access_token,
61
- password: 'api-client',
62
- params: this.params,
63
- });
64
- await this.broker.connect();
65
- }
66
- else {
67
- this.broker.setToken(this.config.access_token);
68
- }
69
- this.events = new asyncapi_1.default(this.broker);
70
- const jwt = (0, jwt_decode_1.jwtDecode)(this.config.access_token);
71
- this.jwt = jwt;
72
- const expires = (jwt.exp - 10) * 1000 - Date.now();
73
- if (this.refreshTimeout)
74
- clearTimeout(this.refreshTimeout);
75
- this.refreshTimeout = setTimeout(() => this.refreshToken(), expires);
76
- this.ready = true;
77
- }
78
- async refreshToken() {
79
- this.logger.log(`Refreshing token`);
80
- let res;
81
- try {
82
- res = await this.api.platform.getClientRefreshToken({
83
- refreshToken: this.config.refresh_token,
84
- appId: this.config.appId,
85
- });
86
- }
87
- catch (e) {
88
- this.logger.error(`Refresh token failed: ${e.stack}`);
89
- return;
90
- }
91
- this.logger.debug(`Expires in ${res.expires_in * 1000 - Date.now() / 1000 / 60 / 60}min`);
92
- this.config.access_token = res.access_token;
93
- this.config.refresh_token = res.refresh_token;
94
- await this.init(true);
95
- return res;
96
- }
97
- async loadToken(clientId, clientSecret, appId) {
98
- const client = new openapi_1.SermasApi({
99
- BASE: this.apiUrl,
100
- });
101
- this.config.appId = appId || this.config.appId;
102
- const res = await client.platform.getClientAccessToken({
103
- clientId,
104
- clientSecret,
105
- appId: this.config.appId,
106
- });
107
- this.logger.debug(`Expires in ${res.expires_in * 1000 - Date.now() / 1000 / 60 / 60}min`);
108
- this.config.access_token = res.access_token;
109
- this.config.refresh_token = res.refresh_token;
110
- await this.init(true);
111
- return res;
112
- }
113
- async login(username, password, appId) {
114
- const client = new openapi_1.SermasApi({
115
- BASE: this.apiUrl,
116
- });
117
- this.config.appId = appId || this.config.appId;
118
- const res = await client.authentication.login({
119
- username,
120
- password,
121
- appId: this.config.appId,
122
- });
123
- this.config.access_token = res.access_token;
124
- this.config.refresh_token = res.refresh_token;
125
- await this.init(true);
126
- return res;
127
- }
128
- }
129
- exports.SermasApiClient = SermasApiClient;
130
- if (require.main === module) {
131
- (async () => {
132
- dotenv_1.default.config();
133
- const client = await (0, exports.createSermasClient)({
134
- env: process.env.ENV || 'local',
135
- });
136
- await client.login(process.env.USERNAME, process.env.PASSWORD);
137
- console.log('Logged in');
138
- const cancelSub = await client.events.detection.onNoise((ev) => {
139
- console.log('Got noise', ev);
140
- }, {
141
- appId: 'asa',
142
- });
143
- console.log('subscribed');
144
- await (0, exports.sleep)();
145
- await client.events.detection.noise({
146
- appId: 'test',
147
- level: '100',
148
- noiseType: 'foo',
149
- speakerId: ['123456789'],
150
- });
151
- await (0, exports.sleep)();
152
- cancelSub();
153
- })();
154
- }
1
+ var ee=Object.defineProperty;var te=(r,e,t)=>e in r?ee(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var n=(r,e,t)=>(te(r,typeof e!="symbol"?e+"":e,t),t);import{jwtDecode as me}from"jwt-decode";var x=class{constructor(e){this.broker=e}async moduleChanged(e,t){return this.broker.publish("system/platform/module/changed/:moduleId",e,t)}async onModuleChanged(e,t){return this.broker.subscribe("system/platform/module/changed/:moduleId",e,t)}};var E=class{constructor(e){this.broker=e}async appChanged(e,t){return this.broker.publish("app/:appId/platform/app/changed/:appId",e,t)}async onAppChanged(e,t){return this.broker.subscribe("app/:appId/platform/app/changed/:appId",e,t)}async clientChanged(e,t){return this.broker.publish("app/:appId/platform/client/changed/:clientId",e,t)}async onClientChanged(e,t){return this.broker.subscribe("app/:appId/platform/client/changed/:clientId",e,t)}async record(e,t){return this.broker.publish("app/:appId/platform/monitoring",e,t)}async onRecord(e,t){return this.broker.subscribe("app/:appId/platform/monitoring",e,t)}async tokenRequested(e,t){return this.broker.publish("app/:appId/platform/token",e,t)}async onTokenRequested(e,t){return this.broker.subscribe("app/:appId/platform/token",e,t)}async appModuleChanged(e,t){return this.broker.publish("app/:appId/platform/module",e,t)}async onAppModuleChanged(e,t){return this.broker.subscribe("app/:appId/platform/module",e,t)}};var M=class{constructor(e){this.broker=e}async userUpdate(e,t){return this.broker.publish("app/:appId/auth/update",e,t)}async onUserUpdate(e,t){return this.broker.subscribe("app/:appId/auth/update",e,t)}async userRegistration(e,t){return this.broker.publish("app/:appId/auth/create",e,t)}async onUserRegistration(e,t){return this.broker.subscribe("app/:appId/auth/create",e,t)}async userLogin(e,t){return this.broker.publish("app/:appId/auth/login",e,t)}async onUserLogin(e,t){return this.broker.subscribe("app/:appId/auth/login",e,t)}};var U=class{constructor(e){this.broker=e}async userDetected(e,t){return this.broker.publish("app/:appId/detection/user",e,t)}async onUserDetected(e,t){return this.broker.subscribe("app/:appId/detection/user",e,t)}async interactionIntention(e,t){return this.broker.publish("app/:appId/detection/interaction",e,t)}async onInteractionIntention(e,t){return this.broker.subscribe("app/:appId/detection/interaction",e,t)}async userCharacterization(e,t){return this.broker.publish("app/:appId/detection/characterization",e,t)}async onUserCharacterization(e,t){return this.broker.subscribe("app/:appId/detection/characterization",e,t)}async audioClassification(e,t){return this.broker.publish("app/:appId/detection/audio",e,t)}async onAudioClassification(e,t){return this.broker.subscribe("app/:appId/detection/audio",e,t)}async objectDetected(e,t){return this.broker.publish("app/:appId/detection/object",e,t)}async onObjectDetected(e,t){return this.broker.subscribe("app/:appId/detection/object",e,t)}async qrCodeDetected(e,t){return this.broker.publish("app/:appId/detection/qr_code",e,t)}async onQrCodeDetected(e,t){return this.broker.subscribe("app/:appId/detection/qr_code",e,t)}async noise(e,t){return this.broker.publish("app/:appId/detection/noise",e,t)}async onNoise(e,t){return this.broker.subscribe("app/:appId/detection/noise",e,t)}};var O=class{constructor(e){this.broker=e}async assetChanged(e,t){return this.broker.publish("app/:appId/ui/status",e,t)}async onAssetChanged(e,t){return this.broker.subscribe("app/:appId/ui/status",e,t)}async content(e,t){return this.broker.publish("app/:appId/ui/content",e,t)}async onContent(e,t){return this.broker.subscribe("app/:appId/ui/content",e,t)}async interaction(e,t){return this.broker.publish("app/:appId/ui/interaction/:moduleId",e,t)}async onInteraction(e,t){return this.broker.subscribe("app/:appId/ui/interaction/:moduleId",e,t)}};var w=class{constructor(e){this.broker=e}async agentInteraction(e,t){return this.broker.publish("app/:appId/session/interaction/agent",e,t)}async onAgentInteraction(e,t){return this.broker.subscribe("app/:appId/session/interaction/agent",e,t)}async agentChanged(e,t){return this.broker.publish("app/:appId/session/agent/changed/:agentId",e,t)}async onAgentChanged(e,t){return this.broker.subscribe("app/:appId/session/agent/changed/:agentId",e,t)}async userInteraction(e,t){return this.broker.publish("app/:appId/session/interaction/user",e,t)}async onUserInteraction(e,t){return this.broker.subscribe("app/:appId/session/interaction/user",e,t)}async sessionChanged(e,t){return this.broker.publish("app/:appId/session/session/changed/:sessionId",e,t)}async onSessionChanged(e,t){return this.broker.subscribe("app/:appId/session/session/changed/:sessionId",e,t)}async storageUpdated(e,t){return this.broker.publish("app/:appId/session/storage/:storageId",e,t)}async onStorageUpdated(e,t){return this.broker.subscribe("app/:appId/session/storage/:storageId",e,t)}async support(e,t){return this.broker.publish("app/:appId/session/support",e,t)}async onSupport(e,t){return this.broker.subscribe("app/:appId/session/support",e,t)}};var B=class{constructor(e){this.broker=e}async dialogueProgress(e,t){return this.broker.publish("app/:appId/dialogue/progress/:sessionId",e,t)}async onDialogueProgress(e,t){return this.broker.subscribe("app/:appId/dialogue/progress/:sessionId",e,t)}async dialogueMessages(e,t){return this.broker.publish("app/:appId/dialogue/messages/:sessionId",e,t)}async onDialogueMessages(e,t){return this.broker.subscribe("app/:appId/dialogue/messages/:sessionId",e,t)}async agentSpeech(e,t){return this.broker.publish("app/:appId/dialogue/speech/:sessionId/:messageId/:chunkId",e,t)}async onAgentSpeech(e,t){return this.broker.subscribe("app/:appId/dialogue/speech/:sessionId/:messageId/:chunkId",e,t)}async agentStopSpeech(e,t){return this.broker.publish("app/:appId/dialogue/stop/:sessionId",e,t)}async onAgentStopSpeech(e,t){return this.broker.subscribe("app/:appId/dialogue/stop/:sessionId",e,t)}async agentPauseSpeech(e,t){return this.broker.publish("app/:appId/dialogue/pause/:sessionId",e,t)}async onAgentPauseSpeech(e,t){return this.broker.subscribe("app/:appId/dialogue/pause/:sessionId",e,t)}async agentContinueSpeech(e,t){return this.broker.publish("app/:appId/dialogue/continue/:sessionId",e,t)}async onAgentContinueSpeech(e,t){return this.broker.subscribe("app/:appId/dialogue/continue/:sessionId",e,t)}async userSpeech(e,t){return this.broker.publish("app/:appId/dialogue/user-speech/:sessionId/:chunkId",e,t)}async onUserSpeech(e,t){return this.broker.subscribe("app/:appId/dialogue/user-speech/:sessionId/:chunkId",e,t)}async userSpeechStream(e,t){return this.broker.publish("app/:appId/dialogue/user-speech/stream/:sessionId/:chunkId",e,t)}async onUserSpeechStream(e,t){return this.broker.subscribe("app/:appId/dialogue/user-speech/stream/:sessionId/:chunkId",e,t)}async request(e,t){return this.broker.publish("app/:appId/dialogue/request/:sessionId",e,t)}async onRequest(e,t){return this.broker.subscribe("app/:appId/dialogue/request/:sessionId",e,t)}async toolTriggered(e,t){return this.broker.publish("app/:appId/dialogue/tool/:name",e,t)}async onToolTriggered(e,t){return this.broker.subscribe("app/:appId/dialogue/tool/:name",e,t)}async toolChanged(e,t){return this.broker.publish("app/:appId/dialogue/tool/changed/:repositoryId",e,t)}async onToolChanged(e,t){return this.broker.subscribe("app/:appId/dialogue/tool/changed/:repositoryId",e,t)}async toolNotMatching(e,t){return this.broker.publish("app/:appId/dialogue/tool/not-matching",e,t)}async onToolNotMatching(e,t){return this.broker.subscribe("app/:appId/dialogue/tool/not-matching",e,t)}async taskChanged(e,t){return this.broker.publish("app/:appId/dialogue/task/changed/:taskId",e,t)}async onTaskChanged(e,t){return this.broker.subscribe("app/:appId/dialogue/task/changed/:taskId",e,t)}async taskProgress(e,t){return this.broker.publish("app/:appId/dialogue/task/progress/:taskId",e,t)}async onTaskProgress(e,t){return this.broker.subscribe("app/:appId/dialogue/task/progress/:taskId",e,t)}async recordChanged(e,t){return this.broker.publish("app/:appId/dialogue/task/record/:taskId",e,t)}async onRecordChanged(e,t){return this.broker.subscribe("app/:appId/dialogue/task/record/:taskId",e,t)}async fieldHandler(e,t){return this.broker.publish("app/:appId/dialogue/task/handler",e,t)}async onFieldHandler(e,t){return this.broker.subscribe("app/:appId/dialogue/task/handler",e,t)}};var L=class{constructor(e){this.broker=e}async actuate(e,t){return this.broker.publish("app/:appId/robotics/actuate",e,t)}async onActuate(e,t){return this.broker.subscribe("app/:appId/robotics/actuate",e,t)}async move(e,t){return this.broker.publish("app/:appId/robotics/move",e,t)}async onMove(e,t){return this.broker.subscribe("app/:appId/robotics/move",e,t)}async robotStatus(e,t){return this.broker.publish("app/:appId/robotics/status",e,t)}async onRobotStatus(e,t){return this.broker.subscribe("app/:appId/robotics/status",e,t)}async initialPose(e,t){return this.broker.publish("app/:appId/robotics/initialpose",e,t)}async onInitialPose(e,t){return this.broker.subscribe("app/:appId/robotics/initialpose",e,t)}async opState(e,t){return this.broker.publish("app/:appId/robotics/opstate",e,t)}async onOpState(e,t){return this.broker.subscribe("app/:appId/robotics/opstate",e,t)}};var $=class{constructor(e){this.broker=e}async detected(e,t){return this.broker.publish("app/:appId/xr/marker/detected",e,t)}async onDetected(e,t){return this.broker.subscribe("app/:appId/xr/marker/detected",e,t)}async changed(e,t){return this.broker.publish("app/:appId/xr/marker/changed/:markerId",e,t)}async onChanged(e,t){return this.broker.subscribe("app/:appId/xr/marker/changed/:markerId",e,t)}async occluded(e,t){return this.broker.publish("app/:appId/xr/occlusion",e,t)}async onOccluded(e,t){return this.broker.subscribe("app/:appId/xr/occlusion",e,t)}};var m=class{constructor(e){this.broker=e;n(this,"module");n(this,"platform");n(this,"auth");n(this,"detection");n(this,"ui");n(this,"session");n(this,"dialogue");n(this,"robotics");n(this,"xr");this.module=new x(e),this.platform=new E(e),this.auth=new M(e),this.detection=new U(e),this.ui=new O(e),this.session=new w(e),this.dialogue=new B(e),this.robotics=new L(e),this.xr=new $(e)}};import re from"mqtt";var G,X=r=>{G=r},oe=(r="logger")=>new class{format(e){return`[${r}] ${e}`}debug(e,...t){console.debug(this.format(e))}error(e,...t){console.error(this.format(e))}fatal(e,...t){console.error(this.format(e))}log(e,...t){console.info(this.format(e))}setLogLevels(e){}verbose(e,...t){console.debug(this.format(e))}warn(e,...t){console.warn(this.format(e))}},g=class{constructor(e){n(this,"logger");this.logger=G||oe(e)}debug(e,...t){(this.logger.debug||this.logger.log).apply(this.logger,[e])}error(e,...t){this.logger.error(e)}fatal(e,...t){this.logger.error(e)}log(e,...t){(this.logger.info||this.logger.log).apply(this.logger,[e])}setLogLevels(e){}verbose(e,...t){(this.logger.verbose||this.logger.log).apply(this.logger,[e])}warn(e,...t){this.logger.warn(e)}};var N=class r{constructor(e){this.config=e;n(this,"logger",new g(r.name));n(this,"client");n(this,"subscriptions",[])}async reconnect(){this.logger.warn("Forcing reconnection");try{await this.disconnect()}catch(e){this.logger.warn(`reconnect: disconnection error ${e.stack}`)}try{this.client=void 0,await this.connect()}catch(e){this.logger.warn(`reconnect: connection error ${e.stack}`)}}async disconnect(){if(this.client)try{await this.client.endAsync(!0)}catch(e){this.logger.warn(`Error closing broker connection: ${e.stack}`)}}setParams(e){this.config.params=e}setToken(e){this.config.username=e,this.client&&(this.logger.debug("Token updated, reconnecting"),this.client.options.username=e,this.client.reconnect())}getClient(){return this.client||null}connect(){if(!this.client){if(!this.config.username){this.logger.debug("Skip mqtt connection, missing token");return}this.logger.debug(`Connecting to ${this.config.url}`),this.client=re.connect(this.config.url,{username:this.config.username,password:this.config.password}),this.client.on("connect",async()=>{this.logger.debug("client connected");try{for(let e of this.subscriptions)this.logger.debug(`SUB ${e.topic}`),await this.client?.subscribeAsync(e.topic)}catch(e){this.logger.warn(`Subscription failed: ${e.stack}`),setTimeout(()=>this.reconnect(),1e3)}}),this.client.on("error",e=>{this.logger.error(`mqtt client error ${e.stack}`)}),this.client.on("disconnect",()=>{this.logger.warn("mqtt disconnected")}),this.client.on("reconnect",()=>{this.logger.debug("mqtt reconnecting")}),this.client.on("connect",()=>{this.logger.debug("mqtt connected")}),this.client.on("message",(e,t)=>{let o=t;try{o=JSON.parse(t.toString())}catch{}this.logger.debug(`MSG ${e}`);let s=e.indexOf("#");s>-1&&(e=e.substring(0,s));let i=this.parseTopic(e),a=p=>p==="+";this.subscriptions.forEach(p=>{if(p.type===i.type&&!(!a(p.appId)&&p.appId!==i.appId)&&!(!a(p.resource)&&p.resource!==i.resource)&&!(!a(p.scope)&&p.scope!==i.scope)){for(let d in i.context||[])if(!a(p.context[d])&&p.context[d]!==i.context[d])return;p.callback(o)}})})}}parseTopic(e){let t=e.split("/"),[o,s,i,a]=t,p=t.slice(3);return{type:o,appId:s,resource:i,scope:a,context:p}}subscribe(e,t,o){return this.connect(),e=this.replaceTopicParams(e,{...o||{}}),this.subscriptions.push({...this.parseTopic(e),topic:e,callback:t}),()=>{let s=this.subscriptions.findIndex(a=>a.topic===e&&a.callback===t);if(s===-1)return null;let i=this.subscriptions[s];this.subscriptions.splice(s,1);try{this.client?.unsubscribe(i.topic,i.callback)}catch{}}}async publish(e,t,o){let s=t.byteLength!==void 0,i;s?i=t:i=JSON.stringify(t);try{if(e=this.replaceTopicParams(e,{...s?{}:t,...o||{}}),!this.client)return!1;await this.client.publishAsync(e,i)}catch{return!1}return!0}replaceTopicParams(e,t){t={...this.config?.params||{},...t||{}};for(let o of Object.keys(t)){let s=`:${o}`,i=t[o];if(i!=null){if(typeof i=="object"&&!Array.isArray(i)){e=this.replaceTopicParams(e,i);continue}if(!(typeof i!="string"&&typeof i!="number"))for(;e.indexOf(s)>-1;)e=e.replace(s,i.toString())}}return e=e.split("/").map(o=>o[0]===":"?"+":o).join("/"),e}};var u=class{constructor(){n(this,"_fns");this._fns=[]}eject(e){let t=this._fns.indexOf(e);t!==-1&&(this._fns=[...this._fns.slice(0,t),...this._fns.slice(t+1)])}use(e){this._fns=[...this._fns,e]}},se={BASE:"",CREDENTIALS:"include",ENCODE_PATH:void 0,HEADERS:void 0,PASSWORD:void 0,RESULT:"body",TOKEN:void 0,USERNAME:void 0,VERSION:"1.0",WITH_CREDENTIALS:!1,interceptors:{request:new u,response:new u}};var h=class{constructor(e){this.config=e}};var y=class extends Error{constructor(t,o,s){super(s);n(this,"url");n(this,"status");n(this,"statusText");n(this,"body");n(this,"request");this.name="ApiError",this.url=o.url,this.status=o.status,this.statusText=o.statusText,this.body=o.body,this.request=t}};var _=class extends Error{constructor(e){super(e),this.name="CancelError"}get isCancelled(){return!0}},I=class{constructor(e){n(this,"_isResolved");n(this,"_isRejected");n(this,"_isCancelled");n(this,"cancelHandlers");n(this,"promise");n(this,"_resolve");n(this,"_reject");this._isResolved=!1,this._isRejected=!1,this._isCancelled=!1,this.cancelHandlers=[],this.promise=new Promise((t,o)=>{this._resolve=t,this._reject=o;let s=p=>{this._isResolved||this._isRejected||this._isCancelled||(this._isResolved=!0,this._resolve&&this._resolve(p))},i=p=>{this._isResolved||this._isRejected||this._isCancelled||(this._isRejected=!0,this._reject&&this._reject(p))},a=p=>{this._isResolved||this._isRejected||this._isCancelled||this.cancelHandlers.push(p)};return Object.defineProperty(a,"isResolved",{get:()=>this._isResolved}),Object.defineProperty(a,"isRejected",{get:()=>this._isRejected}),Object.defineProperty(a,"isCancelled",{get:()=>this._isCancelled}),e(s,i,a)})}get[Symbol.toStringTag](){return"Cancellable Promise"}then(e,t){return this.promise.then(e,t)}catch(e){return this.promise.catch(e)}finally(e){return this.promise.finally(e)}cancel(){if(!(this._isResolved||this._isRejected||this._isCancelled)){if(this._isCancelled=!0,this.cancelHandlers.length)try{for(let e of this.cancelHandlers)e()}catch(e){console.warn("Cancellation threw an error",e);return}this.cancelHandlers.length=0,this._reject&&this._reject(new _("Request aborted"))}}get isCancelled(){return this._isCancelled}};var D=r=>typeof r=="string",W=r=>D(r)&&r!=="",F=r=>r instanceof Blob,Q=r=>r instanceof FormData,ie=r=>{try{return btoa(r)}catch{return Buffer.from(r).toString("base64")}},ne=r=>{let e=[],t=(s,i)=>{e.push(`${encodeURIComponent(s)}=${encodeURIComponent(String(i))}`)},o=(s,i)=>{i!=null&&(Array.isArray(i)?i.forEach(a=>o(s,a)):typeof i=="object"?Object.entries(i).forEach(([a,p])=>o(`${s}[${a}]`,p)):t(s,i))};return Object.entries(r).forEach(([s,i])=>o(s,i)),e.length?`?${e.join("&")}`:""},ae=(r,e)=>{let t=r.ENCODE_PATH||encodeURI,o=e.url.replace("{api-version}",r.VERSION).replace(/{(.*?)}/g,(i,a)=>e.path?.hasOwnProperty(a)?t(String(e.path[a])):i),s=r.BASE+o;return e.query?s+ne(e.query):s},pe=r=>{if(r.formData){let e=new FormData,t=(o,s)=>{D(s)||F(s)?e.append(o,s):e.append(o,JSON.stringify(s))};return Object.entries(r.formData).filter(([,o])=>o!=null).forEach(([o,s])=>{Array.isArray(s)?s.forEach(i=>t(o,i)):t(o,s)}),e}},j=async(r,e)=>typeof e=="function"?e(r):e,de=async(r,e)=>{let[t,o,s,i]=await Promise.all([j(e,r.TOKEN),j(e,r.USERNAME),j(e,r.PASSWORD),j(e,r.HEADERS)]),a=Object.entries({Accept:"application/json",...i,...e.headers}).filter(([,p])=>p!=null).reduce((p,[d,c])=>({...p,[d]:String(c)}),{});if(W(t)&&(a.Authorization=`Bearer ${t}`),W(o)&&W(s)){let p=ie(`${o}:${s}`);a.Authorization=`Basic ${p}`}return e.body!==void 0&&(e.mediaType?a["Content-Type"]=e.mediaType:F(e.body)?a["Content-Type"]=e.body.type||"application/octet-stream":D(e.body)?a["Content-Type"]="text/plain":Q(e.body)||(a["Content-Type"]="application/json")),new Headers(a)},ce=r=>{if(r.body!==void 0)return r.mediaType?.includes("application/json")||r.mediaType?.includes("+json")?JSON.stringify(r.body):D(r.body)||F(r.body)||Q(r.body)?r.body:JSON.stringify(r.body)},ue=async(r,e,t,o,s,i,a)=>{let p=new AbortController,d={headers:i,body:o??s,method:e.method,signal:p.signal};r.WITH_CREDENTIALS&&(d.credentials=r.CREDENTIALS);for(let c of r.interceptors.request._fns)d=await c(d);return a(()=>p.abort()),await fetch(t,d)},le=(r,e)=>{if(e){let t=r.headers.get(e);if(D(t))return t}},ge=async r=>{if(r.status!==204)try{let e=r.headers.get("Content-Type");if(e){let t=["application/octet-stream","application/pdf","application/zip","audio/","image/","video/"];if(e.includes("application/json")||e.includes("+json"))return await r.json();if(t.some(o=>e.includes(o)))return await r.blob();if(e.includes("multipart/form-data"))return await r.formData();if(e.includes("text/"))return await r.text()}}catch(e){console.error(e)}},ye=(r,e)=>{let o={400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"Im a teapot",421:"Misdirected Request",422:"Unprocessable Content",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required",...r.errors}[e.status];if(o)throw new y(r,e,o);if(!e.ok){let s=e.status??"unknown",i=e.statusText??"unknown",a=(()=>{try{return JSON.stringify(e.body,null,2)}catch{return}})();throw new y(r,e,`Generic Error: status: ${s}; status text: ${i}; body: ${a}`)}},J=(r,e)=>new I(async(t,o,s)=>{try{let i=ae(r,e),a=pe(e),p=ce(e),d=await de(r,e);if(!s.isCancelled){let c=await ue(r,e,i,p,a,d,s);for(let Z of r.interceptors.response._fns)c=await Z(c);let K=await ge(c),Y=le(c,e.responseHeader),z={url:i,ok:c.ok,status:c.status,statusText:c.statusText,body:Y??K};ye(e,z),t(z.body)}}catch(i){o(i)}});var H=class extends h{constructor(e){super(e)}request(e){return J(this.config,e)}};var f=class{constructor(e){this.httpRequest=e}roboticsAgentControllerMoveToArea(e){let{appId:t,room:o}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/move/{appId}/{room}",path:{appId:t,room:o}})}roboticsAgentControllerStatusDescription(e){let{appId:t,robotId:o}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/status/{appId}/{robotId}",path:{appId:t,robotId:o}})}roboticsAgentControllerMove(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/relocate",body:t,mediaType:"application/json"})}roboticsAgentControllerInitialPose(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/initialpose",body:t,mediaType:"application/json"})}roboticsAgentControllerActuate(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/actuate",body:t,mediaType:"application/json"})}roboticsAgentControllerStatus(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/status",body:t,mediaType:"application/json"})}};var R=class{constructor(e){this.httpRequest=e}whoami(){return this.httpRequest.request({method:"GET",url:"/api/auth/whoami",errors:{401:"Not authorized"}})}login(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/auth/login",body:t,mediaType:"application/json",errors:{401:"Not authorized"}})}register(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/auth/register",body:t,mediaType:"application/json"})}refreshToken(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/auth/refresh",body:t,mediaType:"application/json",errors:{401:"Not authorized"}})}edit(e){let{requestBody:t,userId:o}=e;return this.httpRequest.request({method:"PUT",url:"/api/auth/{userId}",path:{userId:o},body:t,mediaType:"application/json",errors:{401:"Not authorized"}})}delete(e){let{userId:t}=e;return this.httpRequest.request({method:"DELETE",url:"/api/auth/{userId}",path:{userId:t},errors:{401:"Not authorized"}})}saveUser(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/auth/admin/user",body:t,mediaType:"application/json"})}importUsers(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/auth/admin/import",body:t,mediaType:"application/json"})}};var b=class{constructor(e){this.httpRequest=e}objectDetection(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/detection/object-detection",body:t,mediaType:"application/json"})}detectionControllerSentimentAnalysis(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/detection/sentiment-analysis",body:t,mediaType:"application/json"})}detectionControllerInteractionIntention(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/detection/interaction",body:t,mediaType:"application/json"})}detectionControllerSendFrame(e){let{appId:t,cameraId:o,formData:s}=e;return this.httpRequest.request({method:"POST",url:"/api/detection/{appId}/{cameraId}/frame",path:{appId:t,cameraId:o},formData:s,mediaType:"multipart/form-data"})}detectionControllerServe(e){let{appId:t,cameraId:o,overlay:s}=e;return this.httpRequest.request({method:"GET",url:"/api/detection/{appId}/{cameraId}/camera",path:{appId:t,cameraId:o},query:{overlay:s}})}};var q=class{constructor(e){this.httpRequest=e}save(e){let{requestBody:t}=e;return this.httpRequest.request({method:"PUT",url:"/api/dialogue/document",body:t,mediaType:"application/json"})}import(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/dialogue/document",body:t,mediaType:"application/json"})}removeAll(e){let{appId:t}=e;return this.httpRequest.request({method:"DELETE",url:"/api/dialogue/document/{appId}/all",path:{appId:t}})}remove(e){let{appId:t,documentId:o}=e;return this.httpRequest.request({method:"DELETE",url:"/api/dialogue/document/{appId}",path:{appId:t},query:{documentId:o}})}speak(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/dialogue/speech/tts",body:t,mediaType:"application/json"})}text(e){let{appId:t,formData:o,sampleRate:s,sessionId:i}=e;return this.httpRequest.request({method:"POST",url:"/api/dialogue/speech/stt/{appId}/{sessionId}",path:{appId:t,sessionId:i},query:{sampleRate:s},formData:o,mediaType:"multipart/form-data"})}chatMessage(e){let{appId:t,requestBody:o,sessionId:s}=e;return this.httpRequest.request({method:"POST",url:"/api/dialogue/speech/chat/{appId}/{sessionId}",path:{appId:t,sessionId:s},body:o,mediaType:"application/json"})}stopAgentSpeech(e){let{appId:t,chunkId:o,sessionId:s}=e;return this.httpRequest.request({method:"POST",url:"/api/dialogue/speech/stop/{appId}/{sessionId}/{chunkId}",path:{appId:t,sessionId:s,chunkId:o}})}listModels(){return this.httpRequest.request({method:"GET",url:"/api/dialogue/speech/models"})}getChatHistory(e){let{sessionId:t}=e;return this.httpRequest.request({method:"GET",url:"/api/dialogue/memory/{sessionId}",path:{sessionId:t}})}nextStep(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/dialogue/tasks/next-step",body:t,mediaType:"application/json"})}setTools(e){let{repositoryId:t,requestBody:o}=e;return this.httpRequest.request({method:"POST",url:"/api/dialogue/tools/{repositoryId}",path:{repositoryId:t},body:o,mediaType:"application/json"})}addTools(e){let{repositoryId:t,requestBody:o}=e;return this.httpRequest.request({method:"PUT",url:"/api/dialogue/tools/{repositoryId}",path:{repositoryId:t},body:o,mediaType:"application/json"})}removeRepository(e){let{repositoryId:t}=e;return this.httpRequest.request({method:"DELETE",url:"/api/dialogue/tools/{repositoryId}",path:{repositoryId:t}})}};var T=class{constructor(e){this.httpRequest=e}getUserSettings(){return this.httpRequest.request({method:"GET",url:"/api/platorm/topics/user"})}getSettings(){return this.httpRequest.request({method:"GET",url:"/api/platorm/topics"})}getClientAccessToken(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/token",body:t,mediaType:"application/json"})}getClientAccessToken1(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/token/access_token",body:t,mediaType:"application/json"})}getClientRefreshToken(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/token/refresh",body:t,mediaType:"application/json"})}getClientRefreshToken1(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/token/refresh_token",body:t,mediaType:"application/json"})}getRepositoryDefaults(){return this.httpRequest.request({method:"GET",url:"/api/app/repository/defaults"})}platformAppControllerListApps(){return this.httpRequest.request({method:"GET",url:"/api/app"})}createApp(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/app",body:t,mediaType:"application/json"})}updateApp(e){let{requestBody:t}=e;return this.httpRequest.request({method:"PUT",url:"/api/app",body:t,mediaType:"application/json"})}listUserApps(){return this.httpRequest.request({method:"GET",url:"/api/app/list"})}updateAppTools(e){let{appId:t,requestBody:o}=e;return this.httpRequest.request({method:"PUT",url:"/api/app/{appId}/tools",path:{appId:t},body:o,mediaType:"application/json"})}updateAppSettings(e){let{appId:t,requestBody:o}=e;return this.httpRequest.request({method:"PUT",url:"/api/app/{appId}/settings",path:{appId:t},body:o,mediaType:"application/json"})}getAppRepository(e){let{appId:t}=e;return this.httpRequest.request({method:"GET",url:"/api/app/{appId}/repository",path:{appId:t}})}getAppRepositoryRobots(e){let{appId:t,name:o}=e;return this.httpRequest.request({method:"GET",url:"/api/app/{appId}/repository/robots",path:{appId:t},query:{name:o}})}getAppRepositoryAvatars(e){let{appId:t,name:o}=e;return this.httpRequest.request({method:"GET",url:"/api/app/{appId}/repository/avatars",path:{appId:t},query:{name:o}})}getAppRepositoryBackgrounds(e){let{appId:t,name:o}=e;return this.httpRequest.request({method:"GET",url:"/api/app/{appId}/repository/backgrounds",path:{appId:t},query:{name:o}})}readApp(e){let{appId:t}=e;return this.httpRequest.request({method:"GET",url:"/api/app/{appId}",path:{appId:t}})}removeApp(e){let{appId:t}=e;return this.httpRequest.request({method:"DELETE",url:"/api/app/{appId}",path:{appId:t}})}importApps(e){let{requestBody:t,skipClients:o}=e;return this.httpRequest.request({method:"POST",url:"/api/app/admin/import",query:{skipClients:o},body:t,mediaType:"application/json"})}exportApps(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/app/admin/export",body:t,mediaType:"application/json"})}removeApps(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/app/admin/remove",body:t,mediaType:"application/json"})}createClient(e){let{appId:t,requestBody:o}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/app/{appId}/client",path:{appId:t},body:o,mediaType:"application/json"})}readClient(e){let{appId:t,clientId:o}=e;return this.httpRequest.request({method:"GET",url:"/api/platform/app/{appId}/client/{clientId}",path:{appId:t,clientId:o}})}removeClient(e){let{appId:t,clientId:o}=e;return this.httpRequest.request({method:"DELETE",url:"/api/platform/app/{appId}/client/{clientId}",path:{clientId:o,appId:t}})}listTopics(e){let{appId:t,clientId:o}=e;return this.httpRequest.request({method:"GET",url:"/api/platform/app/{appId}/client/{clientId}/topics",path:{appId:t,clientId:o}})}saveAppModule(e){let{appId:t,requestBody:o}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/app/{appId}/module",path:{appId:t},body:o,mediaType:"application/json"})}getAppModule(e){let{appId:t,moduleId:o}=e;return this.httpRequest.request({method:"GET",url:"/api/platform/app/{appId}/module/{moduleId}",path:{appId:t,moduleId:o}})}removeAppModule(e){let{appId:t,moduleId:o}=e;return this.httpRequest.request({method:"DELETE",url:"/api/platform/app/{appId}/module/{moduleId}",path:{appId:t,moduleId:o}})}savePlatformModule(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/module",body:t,mediaType:"application/json"})}refreshPlatformModule(e){let{moduleId:t}=e;return this.httpRequest.request({method:"HEAD",url:"/api/platform/module/{moduleId}",path:{moduleId:t}})}getPlatformModule(e){let{moduleId:t}=e;return this.httpRequest.request({method:"GET",url:"/api/platform/module/{moduleId}",path:{moduleId:t}})}removePlatformModule(e){let{moduleId:t}=e;return this.httpRequest.request({method:"DELETE",url:"/api/platform/module/{moduleId}",path:{moduleId:t}})}monitoringAdd(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/monitoring",body:t,mediaType:"application/json"})}monitoringSearch(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/monitoring/search",body:t,mediaType:"application/json"})}monitoringAdvancedSearch(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/platform/monitoring/advanced-search",body:t,mediaType:"application/json"})}};var v=class{constructor(e){this.httpRequest=e}platformModuleProxyControllerTriggerGet(e){let{moduleId:t,operationId:o}=e;return this.httpRequest.request({method:"GET",url:"/api/module/{moduleId}/{operationId}",path:{moduleId:t,operationId:o}})}platformModuleProxyControllerTriggerPost(e){let{moduleId:t,operationId:o}=e;return this.httpRequest.request({method:"POST",url:"/api/module/{moduleId}/{operationId}",path:{moduleId:t,operationId:o}})}platformModuleProxyControllerTriggerPut(e){let{moduleId:t,operationId:o}=e;return this.httpRequest.request({method:"PUT",url:"/api/module/{moduleId}/{operationId}",path:{moduleId:t,operationId:o}})}platformModuleProxyControllerTriggerDelete(e){let{moduleId:t,operationId:o}=e;return this.httpRequest.request({method:"DELETE",url:"/api/module/{moduleId}/{operationId}",path:{moduleId:t,operationId:o}})}platformModuleProxyControllerTriggerPatch(e){let{moduleId:t,operationId:o}=e;return this.httpRequest.request({method:"PATCH",url:"/api/module/{moduleId}/{operationId}",path:{moduleId:t,operationId:o}})}platformModuleProxyControllerTriggerOptions(e){let{moduleId:t,operationId:o}=e;return this.httpRequest.request({method:"OPTIONS",url:"/api/module/{moduleId}/{operationId}",path:{moduleId:t,operationId:o}})}platformModuleProxyControllerTriggerHead(e){let{moduleId:t,operationId:o}=e;return this.httpRequest.request({method:"HEAD",url:"/api/module/{moduleId}/{operationId}",path:{moduleId:t,operationId:o}})}};var C=class{constructor(e){this.httpRequest=e}roboticsAgentControllerMoveToArea(e){let{appId:t,room:o}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/move/{appId}/{room}",path:{appId:t,room:o}})}roboticsAgentControllerStatusDescription(e){let{appId:t,robotId:o}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/status/{appId}/{robotId}",path:{appId:t,robotId:o}})}roboticsAgentControllerMove(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/relocate",body:t,mediaType:"application/json"})}roboticsAgentControllerInitialPose(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/initialpose",body:t,mediaType:"application/json"})}roboticsAgentControllerActuate(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/actuate",body:t,mediaType:"application/json"})}roboticsAgentControllerStatus(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/agent/status",body:t,mediaType:"application/json"})}navigationControllerSave(e){let{appId:t,requestBody:o}=e;return this.httpRequest.request({method:"POST",url:"/api/robotics/navigation/{appId}",path:{appId:t},body:o,mediaType:"application/json"})}navigationControllerRemove(e){let{appId:t,spaceId:o}=e;return this.httpRequest.request({method:"DELETE",url:"/api/robotics/navigation/{appId}/{spaceId}",path:{appId:t,spaceId:o}})}navigationControllerGetById(e){let{appId:t,spaceId:o}=e;return this.httpRequest.request({method:"GET",url:"/api/robotics/navigation/{appId}/{spaceId}",path:{appId:t,spaceId:o}})}navigationControllerGetStatus(e){let{appId:t,robotId:o}=e;return this.httpRequest.request({method:"GET",url:"/api/robotics/navigation/{appId}/status/{robotId}",path:{appId:t,robotId:o}})}};var A=class{constructor(e){this.httpRequest=e}getUserSession(e){let{appId:t}=e;return this.httpRequest.request({method:"GET",url:"/api/session/user/{appId}",path:{appId:t}})}search(e){let{appId:t,requestBody:o}=e;return this.httpRequest.request({method:"POST",url:"/api/session/search/{appId}",path:{appId:t},body:o,mediaType:"application/json"})}readSession(e){let{sessionId:t}=e;return this.httpRequest.request({method:"GET",url:"/api/session/{sessionId}",path:{sessionId:t}})}deleteSession(e){let{sessionId:t}=e;return this.httpRequest.request({method:"DELETE",url:"/api/session/{sessionId}",path:{sessionId:t}})}createSession(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/session",body:t,mediaType:"application/json"})}updateSession(e){let{requestBody:t}=e;return this.httpRequest.request({method:"PUT",url:"/api/session",body:t,mediaType:"application/json"})}support(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/session/support",body:t,mediaType:"application/json",errors:{401:"unauthorized"}})}setRecord(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/session/storage",body:t,mediaType:"application/json"})}findRecords(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/session/storage/search",body:t,mediaType:"application/json"})}getRecord(e){let{storageId:t}=e;return this.httpRequest.request({method:"GET",url:"/api/session/storage/{storageId}",path:{storageId:t}})}deleteRecord(e){let{storageId:t}=e;return this.httpRequest.request({method:"DELETE",url:"/api/session/storage/{storageId}",path:{storageId:t}})}agentUpdate(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/session/agent",body:t,mediaType:"application/json"})}prompt(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/session/agent/prompt",body:t,mediaType:"application/json"})}};var P=class{constructor(e){this.httpRequest=e}notifyInteraction(e){let{appId:t,moduleId:o,requestBody:s}=e;return this.httpRequest.request({method:"PUT",url:"/api/ui/interaction/{appId}/{moduleId}",path:{appId:t,moduleId:o},body:s,mediaType:"application/json",errors:{401:"unauthorized"}})}showContent(e){let{requestBody:t}=e;return this.httpRequest.request({method:"PUT",url:"/api/ui/content/{appId}",body:t,mediaType:"application/json",errors:{401:"unauthorized"}})}generateQrCode(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/ui/qrcode/generate",body:t,mediaType:"application/json"})}uiModelControllerMapBlendShapes(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/ui/model/map-blend-shapes",body:t,mediaType:"application/json",errors:{401:"unauthorized"}})}getAsset(e){let{appId:t,assetId:o,type:s}=e;return this.httpRequest.request({method:"GET",url:"/api/ui/asset/{appId}/{type}/{assetId}",path:{appId:t,type:s,assetId:o}})}saveAsset(e){let{formData:t}=e;return this.httpRequest.request({method:"POST",url:"/api/ui/asset",formData:t,mediaType:"multipart/form-data"})}adminSaveAsset(e){let{formData:t}=e;return this.httpRequest.request({method:"POST",url:"/api/ui/admin/asset",formData:t,mediaType:"multipart/form-data"})}};var k=class{constructor(e){this.httpRequest=e}uiPrivacyControllerUpdatePrivacyPolicy(){return this.httpRequest.request({method:"POST",url:"/api/ui/privacy"})}};var S=class{constructor(e){this.httpRequest=e}xrMarkerControllerSearchMarker(e){let{requestBody:t}=e;return this.httpRequest.request({method:"POST",url:"/api/xr/marker/search",body:t,mediaType:"application/json"})}xrMarkerControllerSaveMarker(e){let{requestBody:t}=e;return this.httpRequest.request({method:"PUT",url:"/api/xr/marker",body:t,mediaType:"application/json"})}xrMarkerControllerDeleteMarker(e){let{markerId:t}=e;return this.httpRequest.request({method:"DELETE",url:"/api/xr/marker/{markerId}",path:{markerId:t}})}xrMarkerControllerGetMarkerQrCode(e){let{markerId:t}=e;return this.httpRequest.request({method:"GET",url:"/api/xr/marker/{markerId}",path:{markerId:t}})}xrOcclusionControllerOcclusion(){return this.httpRequest.request({method:"GET",url:"/api/xr/occlusion",errors:{401:"Unauthorized"}})}};var l=class{constructor(e,t=H){n(this,"agent");n(this,"authentication");n(this,"detection");n(this,"dialogue");n(this,"platform");n(this,"platformModuleProxy");n(this,"robotics");n(this,"session");n(this,"ui");n(this,"uiPrivacy");n(this,"xr");n(this,"request");this.request=new t({BASE:e?.BASE??"",VERSION:e?.VERSION??"1.0",WITH_CREDENTIALS:e?.WITH_CREDENTIALS??!1,CREDENTIALS:e?.CREDENTIALS??"include",TOKEN:e?.TOKEN,USERNAME:e?.USERNAME,PASSWORD:e?.PASSWORD,HEADERS:e?.HEADERS,ENCODE_PATH:e?.ENCODE_PATH,interceptors:{request:new u,response:new u}}),this.agent=new f(this.request),this.authentication=new R(this.request),this.detection=new b(this.request),this.dialogue=new q(this.request),this.platform=new T(this.request),this.platformModuleProxy=new v(this.request),this.robotics=new C(this.request),this.session=new A(this.request),this.ui=new P(this.request),this.uiPrivacy=new k(this.request),this.xr=new S(this.request)}};var so=(r=1e3)=>new Promise(e=>setTimeout(()=>e(),r)),he="http://localhost:8080",V=class{constructor(e){this.config=e;n(this,"logger");n(this,"api");n(this,"events");n(this,"broker");n(this,"apiUrl");n(this,"mqttUrl");n(this,"refreshTimeout");n(this,"ready",!1);n(this,"jwt");n(this,"params",{});e.logger&&X(e.logger),this.logger=new g("SermasApiClient");let t=e.baseURL||he;this.apiUrl=`${t}`;let o=new URL(this.apiUrl),s=o.protocol.startsWith("https");this.mqttUrl=`ws${s?"s":""}://${o.hostname}${o.port?":"+o.port:""}/mqtt`,this.api=new l({BASE:this.apiUrl,TOKEN:async()=>this.config.access_token||""}),this.broker=new N({url:this.mqttUrl,username:this.config.access_token||void 0,password:"api-client",params:this.params}),this.events=new m(this.broker)}getBroker(){return this.broker||null}async close(){this.refreshTimeout&&clearTimeout(this.refreshTimeout),await this.broker.disconnect()}init(e=!1){if(e&&(this.ready=!1),!this.ready){if(!this.config.access_token){this.logger.debug("Access token not set, skip client init");return}this.params={appId:this.config.appId},this.broker.setParams(this.params),this.broker.setToken(this.config.access_token),this.watchToken(),this.ready=!0}}watchToken(){if(!this.config.access_token)return;let e=me(this.config.access_token);this.jwt=e,this.config.clientId=this.config.clientId||e.aud;let o=new Date(e.exp*1e3).getTime()-Date.now()-30*1e3;this.logger.verbose(`Token expires in ${Math.round(o/1e3/60/60)}min`),this.refreshTimeout&&clearTimeout(this.refreshTimeout),this.refreshTimeout=setTimeout(()=>this.refreshToken(),o)}async refreshToken(){this.logger.verbose("Refreshing token");let{refresh_token:e,appId:t,clientId:o,clientSecret:s}=this.config;if(!e||!t||!o){this.logger.warn("Cannot refresh token: refresh token, appId or clientId missing");return}let i;try{i=await this.api.platform.getClientRefreshToken({requestBody:{refreshToken:e,appId:t,clientId:o,clientSecret:s}})}catch(a){this.logger.error(`Refresh token failed: ${a?.stack}`);return}if(!i){this.logger.warn("Failed to refresh token, no response");return}return this.config.access_token=i.access_token,this.config.refresh_token=i.refresh_token,this.init(!0),i}async loadToken(e,t,o){let s=new l({BASE:this.apiUrl});if(this.config.appId=o||this.config.appId,!this.config.appId)throw new Error("appId is required");let i=await s.platform.getClientAccessToken({requestBody:{clientId:e,clientSecret:t,appId:this.config.appId}});return this.config.clientId=e,this.config.clientSecret=t,this.config.appId=o||this.config.appId,this.config.access_token=i.access_token,this.config.refresh_token=i.refresh_token,this.init(!0),i}setToken(e,t,o){if(typeof e!="string"){let s=e;e=s.access_token,t=s.refresh_token,o=s.appId}this.config.access_token=e,this.config.refresh_token=t,o!==void 0&&(this.config.appId=o),this.init(!0)}async login(e,t,o){let s=new l({BASE:this.apiUrl});this.config.appId=o||this.config.appId;let i=await s.authentication.login({requestBody:{username:e,password:t,appId:this.config.appId}});return this.config.access_token=i.access_token,this.config.refresh_token=i.refresh_token,this.init(!0),i}};export{g as Logger,V as SermasApiClient,so as sleep};
155
2
  //# sourceMappingURL=index.js.map