@hashgraphonline/standards-sdk 0.0.97 → 0.0.98

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 (274) hide show
  1. package/dist/es/hcs-10/base-client.d.ts +3 -14
  2. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  3. package/dist/es/hcs-10/connections-manager.d.ts +0 -51
  4. package/dist/es/hcs-10/connections-manager.d.ts.map +1 -1
  5. package/dist/es/hcs-10/sdk.d.ts +1 -38
  6. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  7. package/dist/es/hcs-10/types.d.ts +3 -9
  8. package/dist/es/hcs-10/types.d.ts.map +1 -1
  9. package/dist/es/inscribe/inscriber.d.ts +0 -2
  10. package/dist/es/inscribe/inscriber.d.ts.map +1 -1
  11. package/dist/es/services/index.d.ts +0 -1
  12. package/dist/es/services/index.d.ts.map +1 -1
  13. package/dist/es/services/mirror-node.d.ts +1 -17
  14. package/dist/es/services/mirror-node.d.ts.map +1 -1
  15. package/dist/es/services/types.d.ts +0 -24
  16. package/dist/es/services/types.d.ts.map +1 -1
  17. package/dist/es/standards-sdk.es.js +5 -8
  18. package/dist/es/standards-sdk.es.js.map +1 -1
  19. package/dist/es/standards-sdk.es10.js +0 -66
  20. package/dist/es/standards-sdk.es10.js.map +1 -1
  21. package/dist/es/standards-sdk.es100.js +13 -4
  22. package/dist/es/standards-sdk.es100.js.map +1 -1
  23. package/dist/es/standards-sdk.es101.js +13 -4
  24. package/dist/es/standards-sdk.es101.js.map +1 -1
  25. package/dist/es/standards-sdk.es102.js +31 -15
  26. package/dist/es/standards-sdk.es102.js.map +1 -1
  27. package/dist/es/standards-sdk.es103.js +14 -4
  28. package/dist/es/standards-sdk.es103.js.map +1 -1
  29. package/dist/es/standards-sdk.es104.js +4 -39
  30. package/dist/es/standards-sdk.es104.js.map +1 -1
  31. package/dist/es/standards-sdk.es105.js +4 -40
  32. package/dist/es/standards-sdk.es105.js.map +1 -1
  33. package/dist/es/standards-sdk.es106.js +15 -36
  34. package/dist/es/standards-sdk.es106.js.map +1 -1
  35. package/dist/es/standards-sdk.es107.js +5 -78
  36. package/dist/es/standards-sdk.es107.js.map +1 -1
  37. package/dist/es/standards-sdk.es108.js +39 -4
  38. package/dist/es/standards-sdk.es108.js.map +1 -1
  39. package/dist/es/standards-sdk.es109.js +38 -32
  40. package/dist/es/standards-sdk.es109.js.map +1 -1
  41. package/dist/es/standards-sdk.es110.js +35 -31
  42. package/dist/es/standards-sdk.es110.js.map +1 -1
  43. package/dist/es/standards-sdk.es111.js +78 -9
  44. package/dist/es/standards-sdk.es111.js.map +1 -1
  45. package/dist/es/standards-sdk.es112.js +3 -34
  46. package/dist/es/standards-sdk.es112.js.map +1 -1
  47. package/dist/es/standards-sdk.es113.js +2 -3
  48. package/dist/es/standards-sdk.es113.js.map +1 -1
  49. package/dist/es/standards-sdk.es114.js +2 -2
  50. package/dist/es/standards-sdk.es114.js.map +1 -1
  51. package/dist/es/standards-sdk.es115.js +34 -2
  52. package/dist/es/standards-sdk.es115.js.map +1 -1
  53. package/dist/es/standards-sdk.es116.js +29 -97
  54. package/dist/es/standards-sdk.es116.js.map +1 -1
  55. package/dist/es/standards-sdk.es117.js +9 -2
  56. package/dist/es/standards-sdk.es117.js.map +1 -1
  57. package/dist/es/standards-sdk.es118.js +34 -16
  58. package/dist/es/standards-sdk.es118.js.map +1 -1
  59. package/dist/es/standards-sdk.es13.js +5 -5
  60. package/dist/es/standards-sdk.es15.js +1 -1
  61. package/dist/es/standards-sdk.es16.js +1 -1
  62. package/dist/es/standards-sdk.es18.js +2 -2
  63. package/dist/es/standards-sdk.es19.js +386 -393
  64. package/dist/es/standards-sdk.es19.js.map +1 -1
  65. package/dist/es/standards-sdk.es20.js +315 -386
  66. package/dist/es/standards-sdk.es20.js.map +1 -1
  67. package/dist/es/standards-sdk.es21.js +128 -357
  68. package/dist/es/standards-sdk.es21.js.map +1 -1
  69. package/dist/es/standards-sdk.es22.js +7 -155
  70. package/dist/es/standards-sdk.es22.js.map +1 -1
  71. package/dist/es/standards-sdk.es23.js +1041 -7
  72. package/dist/es/standards-sdk.es23.js.map +1 -1
  73. package/dist/es/standards-sdk.es24.js +1692 -966
  74. package/dist/es/standards-sdk.es24.js.map +1 -1
  75. package/dist/es/standards-sdk.es25.js +3 -1769
  76. package/dist/es/standards-sdk.es25.js.map +1 -1
  77. package/dist/es/standards-sdk.es26.js +3843 -6866
  78. package/dist/es/standards-sdk.es26.js.map +1 -1
  79. package/dist/es/standards-sdk.es27.js +7190 -3
  80. package/dist/es/standards-sdk.es27.js.map +1 -1
  81. package/dist/es/standards-sdk.es28.js +2 -9
  82. package/dist/es/standards-sdk.es28.js.map +1 -1
  83. package/dist/es/standards-sdk.es29.js +36 -2
  84. package/dist/es/standards-sdk.es29.js.map +1 -1
  85. package/dist/es/standards-sdk.es30.js +48 -5
  86. package/dist/es/standards-sdk.es30.js.map +1 -1
  87. package/dist/es/standards-sdk.es31.js +5 -36
  88. package/dist/es/standards-sdk.es31.js.map +1 -1
  89. package/dist/es/standards-sdk.es32.js +100 -47
  90. package/dist/es/standards-sdk.es32.js.map +1 -1
  91. package/dist/es/standards-sdk.es33.js +2 -10
  92. package/dist/es/standards-sdk.es33.js.map +1 -1
  93. package/dist/es/standards-sdk.es34.js +15 -4166
  94. package/dist/es/standards-sdk.es34.js.map +1 -1
  95. package/dist/es/standards-sdk.es35.js +409 -2
  96. package/dist/es/standards-sdk.es35.js.map +1 -1
  97. package/dist/es/standards-sdk.es36.js +2 -364
  98. package/dist/es/standards-sdk.es36.js.map +1 -1
  99. package/dist/es/standards-sdk.es37.js +2282 -6
  100. package/dist/es/standards-sdk.es37.js.map +1 -1
  101. package/dist/es/standards-sdk.es38.js +152 -167
  102. package/dist/es/standards-sdk.es38.js.map +1 -1
  103. package/dist/es/standards-sdk.es39.js +188 -74
  104. package/dist/es/standards-sdk.es39.js.map +1 -1
  105. package/dist/es/standards-sdk.es4.js +1 -1
  106. package/dist/es/standards-sdk.es40.js +423 -99
  107. package/dist/es/standards-sdk.es40.js.map +1 -1
  108. package/dist/es/standards-sdk.es41.js +20 -47
  109. package/dist/es/standards-sdk.es41.js.map +1 -1
  110. package/dist/es/standards-sdk.es42.js +138 -9
  111. package/dist/es/standards-sdk.es42.js.map +1 -1
  112. package/dist/es/standards-sdk.es43.js +13 -92
  113. package/dist/es/standards-sdk.es43.js.map +1 -1
  114. package/dist/es/standards-sdk.es44.js +28 -3
  115. package/dist/es/standards-sdk.es44.js.map +1 -1
  116. package/dist/es/standards-sdk.es45.js +29 -2
  117. package/dist/es/standards-sdk.es45.js.map +1 -1
  118. package/dist/es/standards-sdk.es46.js +15 -107
  119. package/dist/es/standards-sdk.es46.js.map +1 -1
  120. package/dist/es/standards-sdk.es47.js +41 -71
  121. package/dist/es/standards-sdk.es47.js.map +1 -1
  122. package/dist/es/standards-sdk.es48.js +17 -5
  123. package/dist/es/standards-sdk.es48.js.map +1 -1
  124. package/dist/es/standards-sdk.es49.js +60 -4
  125. package/dist/es/standards-sdk.es49.js.map +1 -1
  126. package/dist/es/standards-sdk.es5.js +9 -32
  127. package/dist/es/standards-sdk.es5.js.map +1 -1
  128. package/dist/es/standards-sdk.es50.js +1259 -191
  129. package/dist/es/standards-sdk.es50.js.map +1 -1
  130. package/dist/es/standards-sdk.es51.js +142 -52
  131. package/dist/es/standards-sdk.es51.js.map +1 -1
  132. package/dist/es/standards-sdk.es52.js +91 -69
  133. package/dist/es/standards-sdk.es52.js.map +1 -1
  134. package/dist/es/standards-sdk.es53.js +79 -414
  135. package/dist/es/standards-sdk.es53.js.map +1 -1
  136. package/dist/es/standards-sdk.es54.js +32 -2
  137. package/dist/es/standards-sdk.es54.js.map +1 -1
  138. package/dist/es/standards-sdk.es55.js +5 -119
  139. package/dist/es/standards-sdk.es55.js.map +1 -1
  140. package/dist/es/standards-sdk.es56.js +147 -183
  141. package/dist/es/standards-sdk.es56.js.map +1 -1
  142. package/dist/es/standards-sdk.es57.js +18 -433
  143. package/dist/es/standards-sdk.es57.js.map +1 -1
  144. package/dist/es/standards-sdk.es58.js +788 -20
  145. package/dist/es/standards-sdk.es58.js.map +1 -1
  146. package/dist/es/standards-sdk.es59.js +161 -126
  147. package/dist/es/standards-sdk.es59.js.map +1 -1
  148. package/dist/es/standards-sdk.es60.js +138 -13
  149. package/dist/es/standards-sdk.es60.js.map +1 -1
  150. package/dist/es/standards-sdk.es61.js +13 -21
  151. package/dist/es/standards-sdk.es61.js.map +1 -1
  152. package/dist/es/standards-sdk.es62.js +25 -27
  153. package/dist/es/standards-sdk.es62.js.map +1 -1
  154. package/dist/es/standards-sdk.es63.js +24 -19
  155. package/dist/es/standards-sdk.es63.js.map +1 -1
  156. package/dist/es/standards-sdk.es64.js +36 -42
  157. package/dist/es/standards-sdk.es64.js.map +1 -1
  158. package/dist/es/standards-sdk.es65.js +3 -18
  159. package/dist/es/standards-sdk.es65.js.map +1 -1
  160. package/dist/es/standards-sdk.es66.js +3 -60
  161. package/dist/es/standards-sdk.es66.js.map +1 -1
  162. package/dist/es/standards-sdk.es67.js +7060 -1213
  163. package/dist/es/standards-sdk.es67.js.map +1 -1
  164. package/dist/es/standards-sdk.es68.js +402 -131
  165. package/dist/es/standards-sdk.es68.js.map +1 -1
  166. package/dist/es/standards-sdk.es69.js +2 -91
  167. package/dist/es/standards-sdk.es69.js.map +1 -1
  168. package/dist/es/standards-sdk.es7.js +5 -106
  169. package/dist/es/standards-sdk.es7.js.map +1 -1
  170. package/dist/es/standards-sdk.es70.js +113 -77
  171. package/dist/es/standards-sdk.es70.js.map +1 -1
  172. package/dist/es/standards-sdk.es71.js +360 -28
  173. package/dist/es/standards-sdk.es71.js.map +1 -1
  174. package/dist/es/standards-sdk.es72.js +5 -5
  175. package/dist/es/standards-sdk.es72.js.map +1 -1
  176. package/dist/es/standards-sdk.es73.js +167 -147
  177. package/dist/es/standards-sdk.es73.js.map +1 -1
  178. package/dist/es/standards-sdk.es74.js +80 -22
  179. package/dist/es/standards-sdk.es74.js.map +1 -1
  180. package/dist/es/standards-sdk.es75.js +102 -781
  181. package/dist/es/standards-sdk.es75.js.map +1 -1
  182. package/dist/es/standards-sdk.es76.js +44 -166
  183. package/dist/es/standards-sdk.es76.js.map +1 -1
  184. package/dist/es/standards-sdk.es77.js +9 -142
  185. package/dist/es/standards-sdk.es77.js.map +1 -1
  186. package/dist/es/standards-sdk.es78.js +97 -3
  187. package/dist/es/standards-sdk.es78.js.map +1 -1
  188. package/dist/es/standards-sdk.es79.js +3 -163
  189. package/dist/es/standards-sdk.es79.js.map +1 -1
  190. package/dist/es/standards-sdk.es8.js +4 -4
  191. package/dist/es/standards-sdk.es80.js +2 -32
  192. package/dist/es/standards-sdk.es80.js.map +1 -1
  193. package/dist/es/standards-sdk.es81.js +103 -53
  194. package/dist/es/standards-sdk.es81.js.map +1 -1
  195. package/dist/es/standards-sdk.es82.js +69 -45
  196. package/dist/es/standards-sdk.es82.js.map +1 -1
  197. package/dist/es/standards-sdk.es83.js +5 -9
  198. package/dist/es/standards-sdk.es83.js.map +1 -1
  199. package/dist/es/standards-sdk.es84.js +4 -64
  200. package/dist/es/standards-sdk.es84.js.map +1 -1
  201. package/dist/es/standards-sdk.es85.js +221 -6
  202. package/dist/es/standards-sdk.es85.js.map +1 -1
  203. package/dist/es/standards-sdk.es86.js +56 -13
  204. package/dist/es/standards-sdk.es86.js.map +1 -1
  205. package/dist/es/standards-sdk.es87.js +68 -6
  206. package/dist/es/standards-sdk.es87.js.map +1 -1
  207. package/dist/es/standards-sdk.es88.js +31 -44
  208. package/dist/es/standards-sdk.es88.js.map +1 -1
  209. package/dist/es/standards-sdk.es89.js +63 -2
  210. package/dist/es/standards-sdk.es89.js.map +1 -1
  211. package/dist/es/standards-sdk.es9.js +1 -1
  212. package/dist/es/standards-sdk.es90.js +47 -133
  213. package/dist/es/standards-sdk.es90.js.map +1 -1
  214. package/dist/es/standards-sdk.es91.js +10 -172
  215. package/dist/es/standards-sdk.es91.js.map +1 -1
  216. package/dist/es/standards-sdk.es92.js +61 -17
  217. package/dist/es/standards-sdk.es92.js.map +1 -1
  218. package/dist/es/standards-sdk.es93.js +6 -27
  219. package/dist/es/standards-sdk.es93.js.map +1 -1
  220. package/dist/es/standards-sdk.es94.js +14 -25
  221. package/dist/es/standards-sdk.es94.js.map +1 -1
  222. package/dist/es/standards-sdk.es95.js +7 -38
  223. package/dist/es/standards-sdk.es95.js.map +1 -1
  224. package/dist/es/standards-sdk.es96.js +44 -12
  225. package/dist/es/standards-sdk.es96.js.map +1 -1
  226. package/dist/es/standards-sdk.es97.js +2 -13
  227. package/dist/es/standards-sdk.es97.js.map +1 -1
  228. package/dist/es/standards-sdk.es98.js +134 -30
  229. package/dist/es/standards-sdk.es98.js.map +1 -1
  230. package/dist/es/standards-sdk.es99.js +171 -14
  231. package/dist/es/standards-sdk.es99.js.map +1 -1
  232. package/dist/es/utils/index.d.ts +0 -1
  233. package/dist/es/utils/index.d.ts.map +1 -1
  234. package/dist/umd/hcs-10/base-client.d.ts +3 -14
  235. package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
  236. package/dist/umd/hcs-10/connections-manager.d.ts +0 -51
  237. package/dist/umd/hcs-10/connections-manager.d.ts.map +1 -1
  238. package/dist/umd/hcs-10/sdk.d.ts +1 -38
  239. package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
  240. package/dist/umd/hcs-10/types.d.ts +3 -9
  241. package/dist/umd/hcs-10/types.d.ts.map +1 -1
  242. package/dist/umd/inscribe/inscriber.d.ts +0 -2
  243. package/dist/umd/inscribe/inscriber.d.ts.map +1 -1
  244. package/dist/umd/services/index.d.ts +0 -1
  245. package/dist/umd/services/index.d.ts.map +1 -1
  246. package/dist/umd/services/mirror-node.d.ts +1 -17
  247. package/dist/umd/services/mirror-node.d.ts.map +1 -1
  248. package/dist/umd/services/types.d.ts +0 -24
  249. package/dist/umd/services/types.d.ts.map +1 -1
  250. package/dist/umd/standards-sdk.umd.js +22 -22
  251. package/dist/umd/standards-sdk.umd.js.map +1 -1
  252. package/dist/umd/utils/index.d.ts +0 -1
  253. package/dist/umd/utils/index.d.ts.map +1 -1
  254. package/package.json +8 -12
  255. package/dist/es/standards-sdk.es119.js +0 -412
  256. package/dist/es/standards-sdk.es119.js.map +0 -1
  257. package/dist/es/standards-sdk.es120.js +0 -2285
  258. package/dist/es/standards-sdk.es120.js.map +0 -1
  259. package/dist/es/standards-sdk.es121.js +0 -7139
  260. package/dist/es/standards-sdk.es121.js.map +0 -1
  261. package/dist/es/standards-sdk.es122.js +0 -13
  262. package/dist/es/standards-sdk.es122.js.map +0 -1
  263. package/dist/es/standards-sdk.es123.js +0 -14
  264. package/dist/es/standards-sdk.es123.js.map +0 -1
  265. package/dist/es/standards-sdk.es124.js +0 -21
  266. package/dist/es/standards-sdk.es124.js.map +0 -1
  267. package/dist/es/standards-sdk.es125.js +0 -9
  268. package/dist/es/standards-sdk.es125.js.map +0 -1
  269. package/dist/es/standards-sdk.es126.js +0 -12
  270. package/dist/es/standards-sdk.es126.js.map +0 -1
  271. package/dist/es/utils/transaction-parser.d.ts +0 -103
  272. package/dist/es/utils/transaction-parser.d.ts.map +0 -1
  273. package/dist/umd/utils/transaction-parser.d.ts +0 -103
  274. package/dist/umd/utils/transaction-parser.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es10.js","sources":["../../src/hcs-10/connections-manager.ts"],"sourcesContent":["import { Logger, LoggerOptions } from '../utils/logger';\nimport { HCSMessage, HCS10BaseClient } from './base-client';\nimport { AIAgentProfile } from '../hcs-11';\nimport { TransactMessage } from './types';\n\n/**\n * Represents a connection request between agents\n */\nexport interface ConnectionRequest {\n id: number;\n requesterId: string;\n requesterTopicId: string;\n targetAccountId: string;\n targetTopicId: string;\n operatorId: string;\n sequenceNumber: number;\n created: Date;\n memo?: string;\n status: 'pending' | 'confirmed' | 'rejected';\n}\n\n/**\n * Represents an active connection between agents\n */\nexport interface Connection {\n connectionTopicId: string;\n targetAccountId: string;\n targetAgentName?: string;\n targetInboundTopicId?: string;\n targetOutboundTopicId?: string;\n status: 'pending' | 'established' | 'needs_confirmation' | 'closed';\n isPending: boolean;\n needsConfirmation: boolean;\n memo?: string;\n created: Date;\n lastActivity?: Date;\n profileInfo?: AIAgentProfile;\n connectionRequestId?: number;\n confirmedRequestId?: number;\n requesterOutboundTopicId?: string;\n inboundRequestId?: number;\n closedReason?: string;\n closeMethod?: string;\n uniqueRequestKey?: string;\n originTopicId?: string;\n processed: boolean;\n}\n\n/**\n * Options for the connections manager\n */\nexport interface ConnectionsManagerOptions {\n logLevel?: 'debug' | 'info' | 'warn' | 'error';\n filterPendingAccountIds?: string[];\n baseClient: HCS10BaseClient;\n}\n\n/**\n * Defines the interface for a connections manager that handles HCS-10 connections\n * This interface represents the public API of ConnectionsManager\n */\nexport interface IConnectionsManager {\n /**\n * Fetches and processes connection data using the configured client\n * @param accountId - The account ID to fetch connection data for\n * @returns A promise that resolves to an array of Connection objects\n */\n fetchConnectionData(accountId: string): Promise<Connection[]>;\n\n /**\n * Process outbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @param accountId - The account ID that sent the messages\n * @returns Array of connections after processing\n */\n processOutboundMessages(\n messages: HCSMessage[],\n accountId: string\n ): Connection[];\n\n /**\n * Process inbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @returns Array of connections after processing\n */\n processInboundMessages(messages: HCSMessage[]): Connection[];\n\n /**\n * Process connection topic messages to update last activity time\n * @param connectionTopicId - The topic ID of the connection\n * @param messages - The messages to process\n * @returns The updated connection or undefined if not found\n */\n processConnectionMessages(\n connectionTopicId: string,\n messages: HCSMessage[]\n ): Connection | undefined;\n\n /**\n * Adds or updates profile information for a connection\n * @param accountId - The account ID to add profile info for\n * @param profile - The profile information\n */\n addProfileInfo(accountId: string, profile: AIAgentProfile): void;\n\n /**\n * Gets all connections\n * @returns Array of all connections that should be visible\n */\n getAllConnections(): Connection[];\n\n /**\n * Gets all pending connection requests\n * @returns Array of pending connection requests\n */\n getPendingRequests(): Connection[];\n\n /**\n * Gets all active (established) connections\n * @returns Array of active connections\n */\n getActiveConnections(): Connection[];\n\n /**\n * Gets all connections needing confirmation\n * @returns Array of connections needing confirmation\n */\n getConnectionsNeedingConfirmation(): Connection[];\n\n /**\n * Gets a connection by its topic ID\n * @param connectionTopicId - The topic ID to look up\n * @returns The connection with the given topic ID, or undefined if not found\n */\n getConnectionByTopicId(connectionTopicId: string): Connection | undefined;\n\n /**\n * Gets a connection by account ID\n * @param accountId - The account ID to look up\n * @returns The connection with the given account ID, or undefined if not found\n */\n getConnectionByAccountId(accountId: string): Connection | undefined;\n\n /**\n * Gets all connections for a specific account ID\n * @param accountId - The account ID to look up\n * @returns Array of connections for the given account ID\n */\n getConnectionsByAccountId(accountId: string): Connection[];\n\n /**\n * Updates or adds a connection\n * @param connection - The connection to update or add\n */\n updateOrAddConnection(connection: Connection): void;\n\n /**\n * Clears all tracked connections and requests\n */\n clearAll(): void;\n\n /**\n * Checks if a given connection request has been processed already\n * This uses a combination of topic ID and request ID to uniquely identify requests\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if this specific request has been processed, false otherwise\n */\n isConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean;\n\n /**\n * Marks a specific connection request as processed\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if a matching connection was found and marked, false otherwise\n */\n markConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean;\n\n /**\n * Gets pending transactions from a specific connection\n * @param connectionTopicId - The connection topic ID to check for transactions\n * @param limit - Optional limit for the number of transactions to return\n * @returns Array of pending transaction messages sorted by timestamp (newest first)\n */\n getPendingTransactions(\n connectionTopicId: string,\n limit?: number\n ): Promise<TransactMessage[]>;\n\n /**\n * Gets the status of a scheduled transaction\n * @param scheduleId - The schedule ID to check\n * @returns Status of the scheduled transaction\n */\n getScheduledTransactionStatus(scheduleId: string): Promise<{\n executed: boolean;\n executedTimestamp?: string;\n deleted: boolean;\n expirationTime?: string;\n }>;\n\n /**\n * Gets the timestamp of the last message sent by the specified operator on the connection topic\n * @param connectionTopicId - The topic ID to check\n * @param operatorAccountId - The account ID of the operator\n * @returns The timestamp of the last message or undefined if no messages found\n */\n getLastOperatorActivity(\n connectionTopicId: string,\n operatorAccountId: string\n ): Promise<Date | undefined>;\n}\n\n/**\n * ConnectionsManager provides a unified way to track and manage HCS-10 connections\n * across different applications. It works with both frontend and backend implementations.\n */\nexport class ConnectionsManager implements IConnectionsManager {\n private logger: Logger;\n private connections: Map<string, Connection> = new Map();\n private pendingRequests: Map<string, ConnectionRequest> = new Map();\n private profileCache: Map<string, AIAgentProfile> = new Map();\n private filterPendingAccountIds: Set<string> = new Set();\n private baseClient: HCS10BaseClient;\n\n /**\n * Creates a new ConnectionsManager instance\n */\n constructor(options: ConnectionsManagerOptions) {\n const loggerOptions: LoggerOptions = {\n module: 'ConnectionsManager',\n level: options?.logLevel || 'info',\n prettyPrint: true,\n };\n this.logger = new Logger(loggerOptions);\n\n if (options?.filterPendingAccountIds) {\n this.filterPendingAccountIds = new Set(options.filterPendingAccountIds);\n }\n\n if (!options.baseClient) {\n throw new Error('ConnectionsManager requires a baseClient to operate');\n }\n\n this.baseClient = options.baseClient;\n }\n\n /**\n * Fetches and processes connection data using the configured client\n * @param accountId - The account ID to fetch connection data for\n * @returns A promise that resolves to an array of Connection objects\n */\n async fetchConnectionData(accountId: string): Promise<Connection[]> {\n try {\n const topicInfo = await this.baseClient.retrieveCommunicationTopics(\n accountId\n );\n\n const isValidTopicId = (topicId: string): boolean => {\n return Boolean(topicId) && !topicId.includes(':');\n };\n\n if (\n !isValidTopicId(topicInfo.inboundTopic) ||\n !isValidTopicId(topicInfo.outboundTopic)\n ) {\n this.logger.warn(\n 'Invalid topic IDs detected in retrieved communication topics'\n );\n return this.getAllConnections();\n }\n\n const [outboundMessagesResult, inboundMessagesResult] = await Promise.all(\n [\n this.baseClient.getMessages(topicInfo.outboundTopic),\n this.baseClient.getMessages(topicInfo.inboundTopic),\n ]\n );\n\n this.processOutboundMessages(\n outboundMessagesResult.messages || [],\n accountId\n );\n this.processInboundMessages(inboundMessagesResult.messages || []);\n\n const pendingCount = Array.from(this.connections.values()).filter(\n (conn) => conn.status === 'pending' || conn.isPending\n ).length;\n this.logger.debug(\n `Processed ${\n outboundMessagesResult.messages?.length || 0\n } outbound and ${\n inboundMessagesResult.messages?.length || 0\n } inbound messages. Found ${pendingCount} pending connections.`\n );\n\n await this.checkTargetInboundTopicsForConfirmations();\n await this.checkOutboundRequestsForConfirmations();\n await this.fetchProfilesForConnections();\n await this.fetchConnectionActivity();\n\n return this.getAllConnections();\n } catch (error) {\n this.logger.error('Error fetching connection data:', error);\n return this.getAllConnections();\n }\n }\n\n /**\n * Checks target agent inbound topics to find confirmations for pending requests\n * that might not be visible in our local messages\n */\n private async checkTargetInboundTopicsForConfirmations(): Promise<void> {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) =>\n (conn.isPending || conn.status === 'pending') &&\n conn.targetInboundTopicId\n );\n\n if (pendingConnections.length === 0) {\n return;\n }\n\n const pendingRequestsByTarget = new Map<string, Connection[]>();\n\n pendingConnections.forEach((conn) => {\n if (conn.targetInboundTopicId) {\n const requests =\n pendingRequestsByTarget.get(conn.targetInboundTopicId) || [];\n requests.push(conn);\n pendingRequestsByTarget.set(conn.targetInboundTopicId, requests);\n }\n });\n\n const MAX_FETCH_ATTEMPTS = 2;\n const FETCH_DELAY_MS = 500;\n\n for (const [\n targetInboundTopicId,\n requests,\n ] of pendingRequestsByTarget.entries()) {\n for (let attempt = 1; attempt <= MAX_FETCH_ATTEMPTS; attempt++) {\n try {\n const targetMessagesResult = await this.baseClient.getMessages(\n targetInboundTopicId\n );\n const targetMessages = targetMessagesResult.messages || [];\n\n let confirmedAny = false;\n\n for (const conn of requests) {\n const requestId = conn.connectionRequestId;\n if (!requestId) {\n continue;\n }\n\n const confirmationMsg = targetMessages.find((msg) => {\n if (msg.op !== 'connection_created' || !msg.connection_topic_id) {\n return false;\n }\n\n if (msg.connection_id !== requestId) {\n return false;\n }\n\n if (conn.uniqueRequestKey) {\n const keyParts = conn.uniqueRequestKey.split(':');\n if (keyParts.length > 1) {\n const operatorIdPart = keyParts[1];\n\n if (msg.operator_id && msg.operator_id === operatorIdPart) {\n return true;\n }\n\n if (msg.connected_account_id === conn.targetAccountId) {\n return true;\n }\n }\n }\n\n return true;\n });\n\n if (confirmationMsg?.connection_topic_id) {\n confirmedAny = true;\n\n const connectionTopicId = confirmationMsg.connection_topic_id;\n\n let pendingKey = conn.uniqueRequestKey;\n\n const newConnection: Connection = {\n connectionTopicId,\n targetAccountId: conn.targetAccountId,\n targetAgentName: conn.targetAgentName,\n targetInboundTopicId: conn.targetInboundTopicId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: new Date(confirmationMsg.created || conn.created),\n profileInfo: conn.profileInfo,\n connectionRequestId: requestId,\n uniqueRequestKey: conn.uniqueRequestKey,\n originTopicId: conn.originTopicId,\n processed: conn.processed,\n memo: conn.memo,\n };\n\n this.connections.set(connectionTopicId, newConnection);\n\n if (pendingKey) {\n this.connections.delete(pendingKey);\n }\n\n this.logger.debug(\n `Confirmed connection in target inbound topic: ${connectionTopicId}`\n );\n }\n }\n\n if (confirmedAny || attempt === MAX_FETCH_ATTEMPTS) {\n break;\n }\n\n await new Promise((resolve) => setTimeout(resolve, FETCH_DELAY_MS));\n } catch (error) {\n this.logger.debug(\n `Error fetching target inbound topic ${targetInboundTopicId}:`,\n error\n );\n if (attempt === MAX_FETCH_ATTEMPTS) {\n break;\n }\n await new Promise((resolve) => setTimeout(resolve, FETCH_DELAY_MS));\n }\n }\n }\n }\n\n /**\n * Checks target agents' inbound topics for confirmations of our outbound connection requests\n * This complements checkTargetInboundTopicsForConfirmations by looking for confirmations\n * that might have been sent to the target agent's inbound topic rather than our own\n */\n private async checkOutboundRequestsForConfirmations(): Promise<void> {\n const allConnections = Array.from(this.connections.values());\n this.logger.info(`Total connections in map: ${allConnections.length}`);\n\n const pendingByStatus = allConnections.filter(\n (conn) => conn.status === 'pending'\n );\n this.logger.info(\n `Connections with status='pending': ${pendingByStatus.length}`\n );\n\n const pendingConnections = allConnections.filter(\n (conn) => conn.status === 'pending'\n );\n\n if (!Boolean(pendingConnections?.length)) {\n this.logger.info('No pending connections found');\n return;\n }\n\n for (const conn of pendingConnections) {\n this.logger.debug(\n `Processing pending connection: ${conn.connectionTopicId}`\n );\n\n if (!conn.targetAccountId) {\n this.logger.debug(\n `Skipping connection ${conn.connectionTopicId} - no targetAccountId`\n );\n continue;\n }\n\n let targetInboundTopicId = conn.targetInboundTopicId;\n if (!targetInboundTopicId) {\n try {\n const profileResponse = await this.baseClient.retrieveProfile(\n conn.targetAccountId\n );\n if (profileResponse?.profile?.inboundTopicId) {\n targetInboundTopicId = profileResponse.profile.inboundTopicId;\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n targetInboundTopicId,\n });\n this.logger.debug(\n `Updated connection ${conn.connectionTopicId} with inbound topic ID: ${targetInboundTopicId}`\n );\n } else {\n this.logger.debug(\n `Couldn't get inbound topic ID for account ${conn.targetAccountId}`\n );\n continue;\n }\n } catch (error) {\n this.logger.debug(\n `Error fetching profile for ${conn.targetAccountId}: ${error}`\n );\n continue;\n }\n }\n\n if (!targetInboundTopicId || targetInboundTopicId.includes(':')) {\n this.logger.debug(\n `Skipping invalid inbound topic format: ${targetInboundTopicId}`\n );\n continue;\n }\n\n const requestId = conn.connectionRequestId || conn.inboundRequestId;\n if (!requestId) {\n this.logger.debug(\n `Skipping connection ${conn.connectionTopicId} - no request ID`\n );\n continue;\n }\n\n try {\n this.logger.debug(\n `Checking for confirmations on topic ${targetInboundTopicId} for request ID ${requestId}`\n );\n const targetMessagesResult = await this.baseClient.getMessages(\n targetInboundTopicId\n );\n const targetMessages = targetMessagesResult.messages || [];\n\n const confirmationMsg = targetMessages.find(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_id === requestId &&\n msg.connection_topic_id\n );\n\n if (confirmationMsg?.connection_topic_id) {\n const connectionTopicId = confirmationMsg.connection_topic_id;\n this.logger.info(\n `Found confirmation for request #${requestId} to ${conn.targetAccountId} on their inbound topic`\n );\n\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n connectionTopicId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: new Date(confirmationMsg.created || conn.created),\n lastActivity: new Date(confirmationMsg.created || conn.created),\n });\n } else {\n this.logger.debug(\n `No confirmation found for request ID ${requestId} on topic ${targetInboundTopicId}`\n );\n }\n } catch (error) {\n this.logger.warn(\n `Error checking for confirmations on target inbound topic for ${conn.targetAccountId}: ${error}`\n );\n }\n }\n }\n\n /**\n * Fetches profiles for all connected accounts\n * @param accountId - The account ID making the request\n */\n private async fetchProfilesForConnections(): Promise<void> {\n const targetAccountIds = new Set<string>();\n\n for (const connection of this.connections.values()) {\n if (\n connection.targetAccountId &&\n !this.profileCache.has(connection.targetAccountId)\n ) {\n targetAccountIds.add(connection.targetAccountId);\n }\n }\n\n const accountIdPromises = Array.from(targetAccountIds).map(\n async (targetId) => {\n try {\n const profileResponse = await this.baseClient.retrieveProfile(\n targetId\n );\n if (profileResponse.success && profileResponse.profile) {\n this.addProfileInfo(targetId, profileResponse.profile);\n\n this.updatePendingConnectionsWithProfileInfo(\n targetId,\n profileResponse.profile\n );\n }\n } catch (error) {\n this.logger.debug(`Failed to fetch profile for ${targetId}:`, error);\n }\n }\n );\n\n await Promise.allSettled(accountIdPromises);\n }\n\n /**\n * Updates pending connections with inbound topic IDs from profile info\n * @param accountId - The account ID to update connections for\n * @param profile - The profile containing the inbound topic ID\n */\n private updatePendingConnectionsWithProfileInfo(\n accountId: string,\n profile: AIAgentProfile\n ): void {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) =>\n conn.targetAccountId === accountId &&\n (conn.isPending || conn.needsConfirmation) &&\n !conn.targetInboundTopicId\n );\n\n if (pendingConnections.length > 0 && profile.inboundTopicId) {\n for (const conn of pendingConnections) {\n const updatedConn = {\n ...conn,\n targetInboundTopicId: profile.inboundTopicId,\n };\n this.connections.set(conn.connectionTopicId, updatedConn);\n }\n }\n }\n\n /**\n * Fetches activity from active connection topics\n * Updates the lastActivity timestamp for each connection based on latest messages\n * @returns Promise that resolves when all activity has been fetched\n */\n private async fetchConnectionActivity(): Promise<void> {\n const activeConnections = this.getActiveConnections();\n\n const validConnections = activeConnections.filter((connection) => {\n const topicId = connection.connectionTopicId;\n\n if (!topicId || topicId.includes(':') || !topicId.match(/^0\\.0\\.\\d+$/)) {\n this.logger.debug(\n `Skipping activity fetch for invalid topic ID format: ${topicId}`\n );\n return false;\n }\n return true;\n });\n\n const activityPromises = validConnections.map(async (connection) => {\n try {\n const topicId = connection.connectionTopicId;\n const messagesResult = await this.baseClient.getMessages(topicId);\n\n if (messagesResult?.messages?.length > 0) {\n this.processConnectionMessages(topicId, messagesResult.messages);\n }\n } catch (error) {\n this.logger.debug(\n `Failed to fetch activity for ${connection.connectionTopicId}:`,\n error\n );\n }\n });\n\n await Promise.allSettled(activityPromises);\n }\n\n /**\n * Checks if an account should be filtered, taking into account existing established connections\n * @param accountId - The account ID to check\n * @returns True if the account should be filtered, false otherwise\n */\n private shouldFilterAccount(accountId: string): boolean {\n if (!this.filterPendingAccountIds.has(accountId)) {\n return false;\n }\n\n if (this.hasEstablishedConnectionWithAccount(accountId)) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Process outbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @param accountId - The account ID that sent the messages\n * @returns Array of connections after processing\n */\n processOutboundMessages(\n messages: HCSMessage[],\n accountId: string\n ): Connection[] {\n if (!Boolean(messages?.length)) {\n return Array.from(this.connections.values());\n }\n\n const requestMessages = messages.filter(\n (msg) => msg.op === 'connection_request' && msg.connection_request_id\n );\n\n for (const msg of requestMessages) {\n const requestId = msg.connection_request_id!;\n const operatorId = msg.operator_id || '';\n const targetAccountId =\n this.baseClient.extractAccountFromOperatorId(operatorId);\n const targetInboundTopicId =\n this.baseClient.extractTopicFromOperatorId(operatorId);\n\n if (this.shouldFilterAccount(targetAccountId)) {\n this.logger.debug(\n `Filtering out outbound request to account: ${targetAccountId}`\n );\n continue;\n }\n\n const isAlreadyConfirmed = Array.from(this.connections.values()).some(\n (conn) =>\n conn.connectionRequestId === requestId &&\n !conn.isPending &&\n conn.targetAccountId === targetAccountId\n );\n\n const pendingKey = `req-${requestId}:${operatorId}`;\n\n if (!isAlreadyConfirmed && !this.pendingRequests.has(pendingKey)) {\n const pendingRequest = {\n id: requestId,\n requesterId: accountId,\n requesterTopicId: msg.outbound_topic_id || '',\n targetAccountId,\n targetTopicId: targetInboundTopicId,\n operatorId,\n sequenceNumber: msg.sequence_number,\n created: msg.created || new Date(),\n memo: msg.m,\n status: 'pending' as 'pending' | 'confirmed' | 'rejected',\n };\n\n this.pendingRequests.set(pendingKey, pendingRequest);\n\n if (!this.connections.has(pendingKey)) {\n const pendingConnection = {\n connectionTopicId: pendingKey,\n targetAccountId,\n targetInboundTopicId,\n status: 'pending' as\n | 'pending'\n | 'established'\n | 'needs_confirmation'\n | 'closed',\n isPending: true,\n needsConfirmation: false,\n created: msg.created || new Date(),\n connectionRequestId: requestId,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n };\n\n this.connections.set(pendingKey, pendingConnection);\n }\n }\n }\n\n const confirmationMessages = messages.filter(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_topic_id &&\n msg.connection_request_id\n );\n\n for (const msg of confirmationMessages) {\n const requestId = msg.connection_request_id!;\n const connectionTopicId = msg.connection_topic_id!;\n const targetAccountId = this.baseClient.extractAccountFromOperatorId(\n msg.operator_id || ''\n );\n\n if (this.shouldFilterAccount(targetAccountId)) {\n this.logger.debug(\n `Filtering out outbound confirmation to account: ${targetAccountId}`\n );\n continue;\n }\n\n const pendingKey = `req-${requestId}:${msg.operator_id}`;\n\n const pendingRequest = this.pendingRequests.get(pendingKey);\n if (pendingRequest) {\n pendingRequest.status = 'confirmed';\n }\n\n if (this.connections.has(pendingKey)) {\n this.connections.delete(pendingKey);\n }\n\n if (!this.connections.has(connectionTopicId)) {\n this.connections.set(connectionTopicId, {\n connectionTopicId,\n targetAccountId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: msg.created || new Date(),\n connectionRequestId: requestId,\n confirmedRequestId: msg.confirmed_request_id,\n requesterOutboundTopicId: msg.outbound_topic_id,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n });\n } else {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n connectionRequestId: requestId,\n confirmedRequestId: msg.confirmed_request_id,\n requesterOutboundTopicId: msg.outbound_topic_id,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n const closedMessages = messages.filter(\n (msg) =>\n (msg.op as string) === 'connection_closed' ||\n (msg.op === 'close_connection' && msg.connection_topic_id)\n );\n\n for (const msg of closedMessages) {\n const connectionTopicId = msg.connection_topic_id!;\n\n if (this.connections.has(connectionTopicId)) {\n const conn = this.connections.get(connectionTopicId)!;\n if (\n this.shouldFilterAccount(conn.targetAccountId) &&\n conn.status !== 'established'\n ) {\n continue;\n }\n\n const uniqueKey =\n msg.connection_request_id && msg.operator_id\n ? `req-${msg.connection_request_id}:${msg.operator_id}`\n : undefined;\n\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'closed',\n isPending: false,\n needsConfirmation: false,\n lastActivity: msg.created || new Date(),\n closedReason: msg.reason,\n closeMethod: msg.close_method,\n uniqueRequestKey: uniqueKey,\n originTopicId: conn.originTopicId,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Process inbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @returns Array of connections after processing\n */\n processInboundMessages(messages: HCSMessage[]): Connection[] {\n if (!Boolean(messages?.length)) {\n return Array.from(this.connections.values());\n }\n\n const requestMessages = messages.filter(\n (msg) => msg.op === 'connection_request' && msg.sequence_number\n );\n\n const confirmationMessages = messages.filter(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_topic_id &&\n msg.connection_id\n );\n\n for (const msg of requestMessages) {\n const sequenceNumber = msg.sequence_number;\n const operatorId = msg.operator_id || '';\n const requestorAccountId =\n this.baseClient.extractAccountFromOperatorId(operatorId);\n const requestorTopicId =\n this.baseClient.extractTopicFromOperatorId(operatorId);\n\n if (this.shouldFilterAccount(requestorAccountId)) {\n this.logger.debug(\n `Filtering out request from account: ${requestorAccountId}`\n );\n continue;\n }\n\n const needsConfirmKey = `inb-${sequenceNumber}:${operatorId}`;\n\n const hasCreated = confirmationMessages.some(\n (m) => m.connection_id === sequenceNumber\n );\n\n if (hasCreated) {\n this.logger.debug(\n `Skipping request from ${requestorAccountId} as it has already been confirmed`\n );\n continue;\n }\n\n if (!this.connections.has(needsConfirmKey)) {\n this.connections.set(needsConfirmKey, {\n connectionTopicId: needsConfirmKey,\n targetAccountId: requestorAccountId,\n targetInboundTopicId: requestorTopicId,\n status: 'needs_confirmation',\n isPending: false,\n needsConfirmation: true,\n created: msg.created || new Date(),\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: requestorTopicId,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n for (const msg of confirmationMessages) {\n const sequenceNumber = msg.connection_id!;\n const connectionTopicId = msg.connection_topic_id!;\n const connectedAccountId = msg.connected_account_id || '';\n const operatorId = msg.operator_id || '';\n\n if (this.shouldFilterAccount(connectedAccountId)) {\n this.logger.debug(\n `Filtering out confirmation for account: ${connectedAccountId}`\n );\n continue;\n }\n\n const needsConfirmKey = `inb-${sequenceNumber}:${operatorId}`;\n\n if (this.connections.has(needsConfirmKey)) {\n this.connections.delete(needsConfirmKey);\n }\n\n if (!this.connections.has(connectionTopicId)) {\n this.connections.set(connectionTopicId, {\n connectionTopicId,\n targetAccountId: connectedAccountId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: msg.created || new Date(),\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: msg.connection_topic_id,\n processed: false,\n memo: msg.m,\n });\n } else {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: msg.connection_topic_id,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Process connection topic messages to update last activity time\n * @param connectionTopicId - The topic ID of the connection\n * @param messages - The messages to process\n * @returns The updated connection or undefined if not found\n */\n processConnectionMessages(\n connectionTopicId: string,\n messages: HCSMessage[]\n ): Connection | undefined {\n if (\n !messages ||\n messages.length === 0 ||\n !this.connections.has(connectionTopicId)\n ) {\n return this.connections.get(connectionTopicId);\n }\n\n const latestMessage = messages\n .filter((m) => m.created)\n .sort((a, b) => {\n const dateA = a.created ? new Date(a.created).getTime() : 0;\n const dateB = b.created ? new Date(b.created).getTime() : 0;\n return dateB - dateA;\n })[0];\n\n if (latestMessage?.created) {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n lastActivity: latestMessage.created,\n });\n }\n\n const closeMessage = messages.find((msg) => msg.op === 'close_connection');\n if (closeMessage) {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'closed',\n lastActivity: closeMessage.created || new Date(),\n closedReason: closeMessage.reason,\n closeMethod: 'explicit',\n });\n }\n\n return this.connections.get(connectionTopicId);\n }\n\n /**\n * Adds or updates profile information for a connection\n * @param accountId - The account ID to add profile info for\n * @param profile - The profile information\n */\n addProfileInfo(accountId: string, profile: AIAgentProfile): void {\n this.profileCache.set(accountId, profile);\n\n const matchingConnections = Array.from(this.connections.values()).filter(\n (conn) => conn.targetAccountId === accountId\n );\n\n for (const conn of matchingConnections) {\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n profileInfo: profile,\n targetAgentName: profile.display_name,\n targetInboundTopicId: profile.inboundTopicId,\n targetOutboundTopicId: profile.outboundTopicId,\n });\n }\n }\n\n /**\n * Gets all connections\n * @returns Array of all connections that should be visible\n */\n getAllConnections(): Connection[] {\n const connections = Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n return connections;\n }\n\n /**\n * Gets all pending connection requests\n * @returns Array of pending connection requests\n */\n getPendingRequests(): Connection[] {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) => {\n return (\n conn.isPending &&\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n );\n\n return pendingConnections;\n }\n\n /**\n * Helper method to check if there's an established connection with an account\n * @param accountId - The account ID to check\n * @returns True if there's an established connection, false otherwise\n */\n private hasEstablishedConnectionWithAccount(accountId: string): boolean {\n return Array.from(this.connections.values()).some(\n (conn) =>\n conn.targetAccountId === accountId && conn.status === 'established'\n );\n }\n\n /**\n * Gets all active (established) connections\n * @returns Array of active connections\n */\n getActiveConnections(): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) => conn.status === 'established'\n );\n }\n\n /**\n * Gets all connections needing confirmation\n * @returns Array of connections needing confirmation\n */\n getConnectionsNeedingConfirmation(): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.needsConfirmation &&\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Gets a connection by its topic ID\n * @param connectionTopicId - The topic ID to look up\n * @returns The connection with the given topic ID, or undefined if not found\n */\n getConnectionByTopicId(connectionTopicId: string): Connection | undefined {\n return this.connections.get(connectionTopicId);\n }\n\n /**\n * Gets a connection by account ID\n * @param accountId - The account ID to look up\n * @returns The connection with the given account ID, or undefined if not found\n */\n getConnectionByAccountId(accountId: string): Connection | undefined {\n return Array.from(this.connections.values()).find(\n (conn) =>\n conn.targetAccountId === accountId && conn.status === 'established'\n );\n }\n\n /**\n * Gets all connections for a specific account ID\n * @param accountId - The account ID to look up\n * @returns Array of connections for the given account ID\n */\n getConnectionsByAccountId(accountId: string): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) => conn.targetAccountId === accountId\n );\n }\n\n /**\n * Updates or adds a connection\n * @param connection - The connection to update or add\n */\n updateOrAddConnection(connection: Connection): void {\n this.connections.set(connection.connectionTopicId, connection);\n }\n\n /**\n * Clears all tracked connections and requests\n */\n clearAll(): void {\n this.connections.clear();\n this.pendingRequests.clear();\n }\n\n /**\n * Checks if a given connection request has been processed already\n * This uses a combination of topic ID and request ID to uniquely identify requests\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if this specific request has been processed, false otherwise\n */\n isConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean {\n for (const conn of this.connections.values()) {\n if (\n conn.originTopicId === inboundTopicId &&\n conn.inboundRequestId === requestId &&\n conn.processed\n ) {\n return true;\n }\n\n if (\n conn.originTopicId === inboundTopicId &&\n conn.connectionRequestId === requestId &&\n conn.processed\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Marks a specific connection request as processed\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if a matching connection was found and marked, false otherwise\n */\n markConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean {\n let found = false;\n\n for (const [key, conn] of this.connections.entries()) {\n if (\n conn.originTopicId === inboundTopicId &&\n conn.inboundRequestId === requestId\n ) {\n this.connections.set(key, {\n ...conn,\n processed: true,\n });\n found = true;\n this.logger.debug(\n `Marked inbound connection request #${requestId} on topic ${inboundTopicId} as processed`\n );\n }\n\n if (\n conn.originTopicId === inboundTopicId &&\n conn.connectionRequestId === requestId\n ) {\n this.connections.set(key, {\n ...conn,\n processed: true,\n });\n found = true;\n this.logger.debug(\n `Marked outbound connection request #${requestId} on topic ${inboundTopicId} as processed`\n );\n }\n }\n\n return found;\n }\n\n /**\n * Gets pending transactions from a specific connection\n * @param connectionTopicId - The connection topic ID to check for transactions\n * @param limit - Optional limit for the number of transactions to return\n * @returns Array of pending transaction messages sorted by timestamp (newest first)\n */\n async getPendingTransactions(\n connectionTopicId: string,\n limit?: number\n ): Promise<TransactMessage[]> {\n try {\n const transactMessages = await this.baseClient.getTransactionRequests(\n connectionTopicId,\n limit\n );\n\n const pendingTransactions: TransactMessage[] = [];\n\n for (const transaction of transactMessages) {\n try {\n const status =\n await this.baseClient.mirrorNode.getScheduledTransactionStatus(\n transaction.schedule_id\n );\n\n if (!status.executed && !status.deleted) {\n pendingTransactions.push(transaction);\n }\n } catch (error) {\n this.logger.error(`Error checking transaction status: ${error}`);\n pendingTransactions.push(transaction);\n }\n }\n\n return pendingTransactions;\n } catch (error) {\n this.logger.error(`Error getting pending transactions: ${error}`);\n return [];\n }\n }\n\n /**\n * Gets the status of a scheduled transaction\n * @param scheduleId - The schedule ID to check\n * @returns Status of the scheduled transaction\n */\n async getScheduledTransactionStatus(scheduleId: string): Promise<{\n executed: boolean;\n executedTimestamp?: string;\n deleted: boolean;\n expirationTime?: string;\n }> {\n return this.baseClient.mirrorNode.getScheduledTransactionStatus(scheduleId);\n }\n\n /**\n * Gets the timestamp of the last message sent by the specified operator on the connection topic\n * @param connectionTopicId - The topic ID to check\n * @param operatorAccountId - The account ID of the operator\n * @returns The timestamp of the last message or undefined if no messages found\n */\n async getLastOperatorActivity(\n connectionTopicId: string,\n operatorAccountId: string\n ): Promise<Date | undefined> {\n try {\n const { messages } = await this.baseClient.getMessageStream(\n connectionTopicId\n );\n\n const operatorMessages = messages.filter(\n (msg) =>\n msg.operator_id &&\n msg.operator_id.includes(operatorAccountId) &&\n msg.created\n );\n\n if (operatorMessages.length === 0) {\n return undefined;\n }\n\n operatorMessages.sort(\n (a, b) => b.created!.getTime() - a.created!.getTime()\n );\n\n return operatorMessages[0].created;\n } catch (error) {\n this.logger.error(`Error getting last operator activity: ${error}`);\n return undefined;\n }\n }\n}\n"],"names":[],"mappings":";AAiOO,MAAM,mBAAkD;AAAA;AAAA;AAAA;AAAA,EAW7D,YAAY,SAAoC;AATxC,SAAA,kCAA2C,IAAI;AAC/C,SAAA,sCAAsD,IAAI;AAC1D,SAAA,mCAAgD,IAAI;AACpD,SAAA,8CAA2C,IAAI;AAOrD,UAAM,gBAA+B;AAAA,MACnC,QAAQ;AAAA,MACR,OAAO,SAAS,YAAY;AAAA,MAC5B,aAAa;AAAA,IACf;AACK,SAAA,SAAS,IAAI,OAAO,aAAa;AAEtC,QAAI,SAAS,yBAAyB;AACpC,WAAK,0BAA0B,IAAI,IAAI,QAAQ,uBAAuB;AAAA,IAAA;AAGpE,QAAA,CAAC,QAAQ,YAAY;AACjB,YAAA,IAAI,MAAM,qDAAqD;AAAA,IAAA;AAGvE,SAAK,aAAa,QAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ5B,MAAM,oBAAoB,WAA0C;AAC9D,QAAA;AACI,YAAA,YAAY,MAAM,KAAK,WAAW;AAAA,QACtC;AAAA,MACF;AAEM,YAAA,iBAAiB,CAAC,YAA6B;AACnD,eAAO,QAAQ,OAAO,KAAK,CAAC,QAAQ,SAAS,GAAG;AAAA,MAClD;AAGE,UAAA,CAAC,eAAe,UAAU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A;AACF,gBAAM,SACJ,MAAM,KAAK,WAAW,WAAW;AAAA,YAC/B,YAAY;AAAA,UACd;AAEF,cAAI,CAAC,OAAO,YAAY,CAAC,OAAO,SAAS;AACvC,gCAAoB,KAAK,WAAW;AAAA,UAAA;AAAA,iBAE/B,OAAO;AACd,eAAK,OAAO,MAAM,sCAAsC,KAAK,EAAE;AAC/D,8BAAoB,KAAK,WAAW;AAAA,QAAA;AAAA,MACtC;AAGK,aAAA;AAAA,aACA,OAAO;AACd,WAAK,OAAO,MAAM,uCAAuC,KAAK,EAAE;AAChE,aAAO,CAAC;AAAA,IAAA;AAAA,EACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQF,MAAM,8BAA8B,YAKjC;AACD,WAAO,KAAK,WAAW,WAAW,8BAA8B,UAAU;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS5E,MAAM,wBACJ,mBACA,mBAC2B;AACvB,QAAA;AACF,YAAM,EAAE,SAAa,IAAA,MAAM,KAAK,WAAW;AAAA,QACzC;AAAA,MACF;AAEA,YAAM,mBAAmB,SAAS;AAAA,QAChC,CAAC,QACC,IAAI,eACJ,IAAI,YAAY,SAAS,iBAAiB,KAC1C,IAAI;AAAA,MACR;AAEI,UAAA,iBAAiB,WAAW,GAAG;AAC1B,eAAA;AAAA,MAAA;AAGQ,uBAAA;AAAA,QACf,CAAC,GAAG,MAAM,EAAE,QAAS,YAAY,EAAE,QAAS,QAAQ;AAAA,MACtD;AAEO,aAAA,iBAAiB,CAAC,EAAE;AAAA,aACpB,OAAO;AACd,WAAK,OAAO,MAAM,yCAAyC,KAAK,EAAE;AAC3D,aAAA;AAAA,IAAA;AAAA,EACT;AAEJ;"}
1
+ {"version":3,"file":"standards-sdk.es10.js","sources":["../../src/hcs-10/connections-manager.ts"],"sourcesContent":["import { Logger, LoggerOptions } from '../utils/logger';\nimport { HCSMessage, HCS10BaseClient } from './base-client';\nimport { AIAgentProfile } from '../hcs-11';\n\n/**\n * Represents a connection request between agents\n */\nexport interface ConnectionRequest {\n id: number;\n requesterId: string;\n requesterTopicId: string;\n targetAccountId: string;\n targetTopicId: string;\n operatorId: string;\n sequenceNumber: number;\n created: Date;\n memo?: string;\n status: 'pending' | 'confirmed' | 'rejected';\n}\n\n/**\n * Represents an active connection between agents\n */\nexport interface Connection {\n connectionTopicId: string;\n targetAccountId: string;\n targetAgentName?: string;\n targetInboundTopicId?: string;\n targetOutboundTopicId?: string;\n status: 'pending' | 'established' | 'needs_confirmation' | 'closed';\n isPending: boolean;\n needsConfirmation: boolean;\n memo?: string;\n created: Date;\n lastActivity?: Date;\n profileInfo?: AIAgentProfile;\n connectionRequestId?: number;\n confirmedRequestId?: number;\n requesterOutboundTopicId?: string;\n inboundRequestId?: number;\n closedReason?: string;\n closeMethod?: string;\n uniqueRequestKey?: string;\n originTopicId?: string;\n processed: boolean;\n}\n\n/**\n * Options for the connections manager\n */\nexport interface ConnectionsManagerOptions {\n logLevel?: 'debug' | 'info' | 'warn' | 'error';\n filterPendingAccountIds?: string[];\n baseClient: HCS10BaseClient;\n}\n\n/**\n * Defines the interface for a connections manager that handles HCS-10 connections\n * This interface represents the public API of ConnectionsManager\n */\nexport interface IConnectionsManager {\n /**\n * Fetches and processes connection data using the configured client\n * @param accountId - The account ID to fetch connection data for\n * @returns A promise that resolves to an array of Connection objects\n */\n fetchConnectionData(accountId: string): Promise<Connection[]>;\n\n /**\n * Process outbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @param accountId - The account ID that sent the messages\n * @returns Array of connections after processing\n */\n processOutboundMessages(\n messages: HCSMessage[],\n accountId: string\n ): Connection[];\n\n /**\n * Process inbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @returns Array of connections after processing\n */\n processInboundMessages(messages: HCSMessage[]): Connection[];\n\n /**\n * Process connection topic messages to update last activity time\n * @param connectionTopicId - The topic ID of the connection\n * @param messages - The messages to process\n * @returns The updated connection or undefined if not found\n */\n processConnectionMessages(\n connectionTopicId: string,\n messages: HCSMessage[]\n ): Connection | undefined;\n\n /**\n * Adds or updates profile information for a connection\n * @param accountId - The account ID to add profile info for\n * @param profile - The profile information\n */\n addProfileInfo(accountId: string, profile: AIAgentProfile): void;\n\n /**\n * Gets all connections\n * @returns Array of all connections that should be visible\n */\n getAllConnections(): Connection[];\n\n /**\n * Gets all pending connection requests\n * @returns Array of pending connection requests\n */\n getPendingRequests(): Connection[];\n\n /**\n * Gets all active (established) connections\n * @returns Array of active connections\n */\n getActiveConnections(): Connection[];\n\n /**\n * Gets all connections needing confirmation\n * @returns Array of connections needing confirmation\n */\n getConnectionsNeedingConfirmation(): Connection[];\n\n /**\n * Gets a connection by its topic ID\n * @param connectionTopicId - The topic ID to look up\n * @returns The connection with the given topic ID, or undefined if not found\n */\n getConnectionByTopicId(connectionTopicId: string): Connection | undefined;\n\n /**\n * Gets a connection by account ID\n * @param accountId - The account ID to look up\n * @returns The connection with the given account ID, or undefined if not found\n */\n getConnectionByAccountId(accountId: string): Connection | undefined;\n\n /**\n * Gets all connections for a specific account ID\n * @param accountId - The account ID to look up\n * @returns Array of connections for the given account ID\n */\n getConnectionsByAccountId(accountId: string): Connection[];\n\n /**\n * Updates or adds a connection\n * @param connection - The connection to update or add\n */\n updateOrAddConnection(connection: Connection): void;\n\n /**\n * Clears all tracked connections and requests\n */\n clearAll(): void;\n\n /**\n * Checks if a given connection request has been processed already\n * This uses a combination of topic ID and request ID to uniquely identify requests\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if this specific request has been processed, false otherwise\n */\n isConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean;\n\n /**\n * Marks a specific connection request as processed\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if a matching connection was found and marked, false otherwise\n */\n markConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean;\n}\n\n/**\n * ConnectionsManager provides a unified way to track and manage HCS-10 connections\n * across different applications. It works with both frontend and backend implementations.\n */\nexport class ConnectionsManager implements IConnectionsManager {\n private logger: Logger;\n private connections: Map<string, Connection> = new Map();\n private pendingRequests: Map<string, ConnectionRequest> = new Map();\n private profileCache: Map<string, AIAgentProfile> = new Map();\n private filterPendingAccountIds: Set<string> = new Set();\n private baseClient: HCS10BaseClient;\n\n /**\n * Creates a new ConnectionsManager instance\n */\n constructor(options: ConnectionsManagerOptions) {\n const loggerOptions: LoggerOptions = {\n module: 'ConnectionsManager',\n level: options?.logLevel || 'info',\n prettyPrint: true,\n };\n this.logger = new Logger(loggerOptions);\n\n if (options?.filterPendingAccountIds) {\n this.filterPendingAccountIds = new Set(options.filterPendingAccountIds);\n }\n\n if (!options.baseClient) {\n throw new Error('ConnectionsManager requires a baseClient to operate');\n }\n\n this.baseClient = options.baseClient;\n }\n\n /**\n * Fetches and processes connection data using the configured client\n * @param accountId - The account ID to fetch connection data for\n * @returns A promise that resolves to an array of Connection objects\n */\n async fetchConnectionData(accountId: string): Promise<Connection[]> {\n try {\n const topicInfo = await this.baseClient.retrieveCommunicationTopics(\n accountId\n );\n\n const isValidTopicId = (topicId: string): boolean => {\n return Boolean(topicId) && !topicId.includes(':');\n };\n\n if (\n !isValidTopicId(topicInfo.inboundTopic) ||\n !isValidTopicId(topicInfo.outboundTopic)\n ) {\n this.logger.warn(\n 'Invalid topic IDs detected in retrieved communication topics'\n );\n return this.getAllConnections();\n }\n\n const [outboundMessagesResult, inboundMessagesResult] = await Promise.all(\n [\n this.baseClient.getMessages(topicInfo.outboundTopic),\n this.baseClient.getMessages(topicInfo.inboundTopic),\n ]\n );\n\n this.processOutboundMessages(\n outboundMessagesResult.messages || [],\n accountId\n );\n this.processInboundMessages(inboundMessagesResult.messages || []);\n\n const pendingCount = Array.from(this.connections.values()).filter(\n (conn) => conn.status === 'pending' || conn.isPending\n ).length;\n this.logger.debug(\n `Processed ${\n outboundMessagesResult.messages?.length || 0\n } outbound and ${\n inboundMessagesResult.messages?.length || 0\n } inbound messages. Found ${pendingCount} pending connections.`\n );\n\n await this.checkTargetInboundTopicsForConfirmations();\n await this.checkOutboundRequestsForConfirmations();\n await this.fetchProfilesForConnections();\n await this.fetchConnectionActivity();\n\n return this.getAllConnections();\n } catch (error) {\n this.logger.error('Error fetching connection data:', error);\n return this.getAllConnections();\n }\n }\n\n /**\n * Checks target agent inbound topics to find confirmations for pending requests\n * that might not be visible in our local messages\n */\n private async checkTargetInboundTopicsForConfirmations(): Promise<void> {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) =>\n (conn.isPending || conn.status === 'pending') &&\n conn.targetInboundTopicId\n );\n\n if (pendingConnections.length === 0) {\n return;\n }\n\n const pendingRequestsByTarget = new Map<string, Connection[]>();\n\n pendingConnections.forEach((conn) => {\n if (conn.targetInboundTopicId) {\n const requests =\n pendingRequestsByTarget.get(conn.targetInboundTopicId) || [];\n requests.push(conn);\n pendingRequestsByTarget.set(conn.targetInboundTopicId, requests);\n }\n });\n\n const MAX_FETCH_ATTEMPTS = 2;\n const FETCH_DELAY_MS = 500;\n\n for (const [\n targetInboundTopicId,\n requests,\n ] of pendingRequestsByTarget.entries()) {\n for (let attempt = 1; attempt <= MAX_FETCH_ATTEMPTS; attempt++) {\n try {\n const targetMessagesResult = await this.baseClient.getMessages(\n targetInboundTopicId\n );\n const targetMessages = targetMessagesResult.messages || [];\n\n let confirmedAny = false;\n\n for (const conn of requests) {\n const requestId = conn.connectionRequestId;\n if (!requestId) {\n continue;\n }\n\n const confirmationMsg = targetMessages.find((msg) => {\n if (msg.op !== 'connection_created' || !msg.connection_topic_id) {\n return false;\n }\n\n if (msg.connection_id !== requestId) {\n return false;\n }\n\n if (conn.uniqueRequestKey) {\n const keyParts = conn.uniqueRequestKey.split(':');\n if (keyParts.length > 1) {\n const operatorIdPart = keyParts[1];\n\n if (msg.operator_id && msg.operator_id === operatorIdPart) {\n return true;\n }\n\n if (msg.connected_account_id === conn.targetAccountId) {\n return true;\n }\n }\n }\n\n return true;\n });\n\n if (confirmationMsg?.connection_topic_id) {\n confirmedAny = true;\n\n const connectionTopicId = confirmationMsg.connection_topic_id;\n\n let pendingKey = conn.uniqueRequestKey;\n\n const newConnection: Connection = {\n connectionTopicId,\n targetAccountId: conn.targetAccountId,\n targetAgentName: conn.targetAgentName,\n targetInboundTopicId: conn.targetInboundTopicId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: new Date(confirmationMsg.created || conn.created),\n profileInfo: conn.profileInfo,\n connectionRequestId: requestId,\n uniqueRequestKey: conn.uniqueRequestKey,\n originTopicId: conn.originTopicId,\n processed: conn.processed,\n memo: conn.memo,\n };\n\n this.connections.set(connectionTopicId, newConnection);\n\n if (pendingKey) {\n this.connections.delete(pendingKey);\n }\n\n this.logger.debug(\n `Confirmed connection in target inbound topic: ${connectionTopicId}`\n );\n }\n }\n\n if (confirmedAny || attempt === MAX_FETCH_ATTEMPTS) {\n break;\n }\n\n await new Promise((resolve) => setTimeout(resolve, FETCH_DELAY_MS));\n } catch (error) {\n this.logger.debug(\n `Error fetching target inbound topic ${targetInboundTopicId}:`,\n error\n );\n if (attempt === MAX_FETCH_ATTEMPTS) {\n break;\n }\n await new Promise((resolve) => setTimeout(resolve, FETCH_DELAY_MS));\n }\n }\n }\n }\n\n /**\n * Checks target agents' inbound topics for confirmations of our outbound connection requests\n * This complements checkTargetInboundTopicsForConfirmations by looking for confirmations\n * that might have been sent to the target agent's inbound topic rather than our own\n */\n private async checkOutboundRequestsForConfirmations(): Promise<void> {\n const allConnections = Array.from(this.connections.values());\n this.logger.info(`Total connections in map: ${allConnections.length}`);\n\n const pendingByStatus = allConnections.filter(\n (conn) => conn.status === 'pending'\n );\n this.logger.info(\n `Connections with status='pending': ${pendingByStatus.length}`\n );\n\n const pendingConnections = allConnections.filter(\n (conn) => conn.status === 'pending'\n );\n\n if (!Boolean(pendingConnections?.length)) {\n this.logger.info('No pending connections found');\n return;\n }\n\n for (const conn of pendingConnections) {\n this.logger.debug(\n `Processing pending connection: ${conn.connectionTopicId}`\n );\n\n if (!conn.targetAccountId) {\n this.logger.debug(\n `Skipping connection ${conn.connectionTopicId} - no targetAccountId`\n );\n continue;\n }\n\n let targetInboundTopicId = conn.targetInboundTopicId;\n if (!targetInboundTopicId) {\n try {\n const profileResponse = await this.baseClient.retrieveProfile(\n conn.targetAccountId\n );\n if (profileResponse?.profile?.inboundTopicId) {\n targetInboundTopicId = profileResponse.profile.inboundTopicId;\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n targetInboundTopicId,\n });\n this.logger.debug(\n `Updated connection ${conn.connectionTopicId} with inbound topic ID: ${targetInboundTopicId}`\n );\n } else {\n this.logger.debug(\n `Couldn't get inbound topic ID for account ${conn.targetAccountId}`\n );\n continue;\n }\n } catch (error) {\n this.logger.debug(\n `Error fetching profile for ${conn.targetAccountId}: ${error}`\n );\n continue;\n }\n }\n\n if (!targetInboundTopicId || targetInboundTopicId.includes(':')) {\n this.logger.debug(\n `Skipping invalid inbound topic format: ${targetInboundTopicId}`\n );\n continue;\n }\n\n const requestId = conn.connectionRequestId || conn.inboundRequestId;\n if (!requestId) {\n this.logger.debug(\n `Skipping connection ${conn.connectionTopicId} - no request ID`\n );\n continue;\n }\n\n try {\n this.logger.debug(\n `Checking for confirmations on topic ${targetInboundTopicId} for request ID ${requestId}`\n );\n const targetMessagesResult = await this.baseClient.getMessages(\n targetInboundTopicId\n );\n const targetMessages = targetMessagesResult.messages || [];\n\n const confirmationMsg = targetMessages.find(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_id === requestId &&\n msg.connection_topic_id\n );\n\n if (confirmationMsg?.connection_topic_id) {\n const connectionTopicId = confirmationMsg.connection_topic_id;\n this.logger.info(\n `Found confirmation for request #${requestId} to ${conn.targetAccountId} on their inbound topic`\n );\n\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n connectionTopicId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: new Date(confirmationMsg.created || conn.created),\n lastActivity: new Date(confirmationMsg.created || conn.created),\n });\n } else {\n this.logger.debug(\n `No confirmation found for request ID ${requestId} on topic ${targetInboundTopicId}`\n );\n }\n } catch (error) {\n this.logger.warn(\n `Error checking for confirmations on target inbound topic for ${conn.targetAccountId}: ${error}`\n );\n }\n }\n }\n\n /**\n * Fetches profiles for all connected accounts\n * @param accountId - The account ID making the request\n */\n private async fetchProfilesForConnections(): Promise<void> {\n const targetAccountIds = new Set<string>();\n\n for (const connection of this.connections.values()) {\n if (\n connection.targetAccountId &&\n !this.profileCache.has(connection.targetAccountId)\n ) {\n targetAccountIds.add(connection.targetAccountId);\n }\n }\n\n const accountIdPromises = Array.from(targetAccountIds).map(\n async (targetId) => {\n try {\n const profileResponse = await this.baseClient.retrieveProfile(\n targetId\n );\n if (profileResponse.success && profileResponse.profile) {\n this.addProfileInfo(targetId, profileResponse.profile);\n\n this.updatePendingConnectionsWithProfileInfo(\n targetId,\n profileResponse.profile\n );\n }\n } catch (error) {\n this.logger.debug(`Failed to fetch profile for ${targetId}:`, error);\n }\n }\n );\n\n await Promise.allSettled(accountIdPromises);\n }\n\n /**\n * Updates pending connections with inbound topic IDs from profile info\n * @param accountId - The account ID to update connections for\n * @param profile - The profile containing the inbound topic ID\n */\n private updatePendingConnectionsWithProfileInfo(\n accountId: string,\n profile: AIAgentProfile\n ): void {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) =>\n conn.targetAccountId === accountId &&\n (conn.isPending || conn.needsConfirmation) &&\n !conn.targetInboundTopicId\n );\n\n if (pendingConnections.length > 0 && profile.inboundTopicId) {\n for (const conn of pendingConnections) {\n const updatedConn = {\n ...conn,\n targetInboundTopicId: profile.inboundTopicId,\n };\n this.connections.set(conn.connectionTopicId, updatedConn);\n }\n }\n }\n\n /**\n * Fetches activity from active connection topics\n * Updates the lastActivity timestamp for each connection based on latest messages\n * @returns Promise that resolves when all activity has been fetched\n */\n private async fetchConnectionActivity(): Promise<void> {\n const activeConnections = this.getActiveConnections();\n\n const validConnections = activeConnections.filter((connection) => {\n const topicId = connection.connectionTopicId;\n\n if (!topicId || topicId.includes(':') || !topicId.match(/^0\\.0\\.\\d+$/)) {\n this.logger.debug(\n `Skipping activity fetch for invalid topic ID format: ${topicId}`\n );\n return false;\n }\n return true;\n });\n\n const activityPromises = validConnections.map(async (connection) => {\n try {\n const topicId = connection.connectionTopicId;\n const messagesResult = await this.baseClient.getMessages(topicId);\n\n if (messagesResult?.messages?.length > 0) {\n this.processConnectionMessages(topicId, messagesResult.messages);\n }\n } catch (error) {\n this.logger.debug(\n `Failed to fetch activity for ${connection.connectionTopicId}:`,\n error\n );\n }\n });\n\n await Promise.allSettled(activityPromises);\n }\n\n /**\n * Checks if an account should be filtered, taking into account existing established connections\n * @param accountId - The account ID to check\n * @returns True if the account should be filtered, false otherwise\n */\n private shouldFilterAccount(accountId: string): boolean {\n if (!this.filterPendingAccountIds.has(accountId)) {\n return false;\n }\n\n if (this.hasEstablishedConnectionWithAccount(accountId)) {\n return false;\n }\n\n return true;\n }\n\n /**\n * Process outbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @param accountId - The account ID that sent the messages\n * @returns Array of connections after processing\n */\n processOutboundMessages(\n messages: HCSMessage[],\n accountId: string\n ): Connection[] {\n if (!Boolean(messages?.length)) {\n return Array.from(this.connections.values());\n }\n\n const requestMessages = messages.filter(\n (msg) => msg.op === 'connection_request' && msg.connection_request_id\n );\n\n for (const msg of requestMessages) {\n const requestId = msg.connection_request_id!;\n const operatorId = msg.operator_id || '';\n const targetAccountId =\n this.baseClient.extractAccountFromOperatorId(operatorId);\n const targetInboundTopicId =\n this.baseClient.extractTopicFromOperatorId(operatorId);\n\n if (this.shouldFilterAccount(targetAccountId)) {\n this.logger.debug(\n `Filtering out outbound request to account: ${targetAccountId}`\n );\n continue;\n }\n\n const isAlreadyConfirmed = Array.from(this.connections.values()).some(\n (conn) =>\n conn.connectionRequestId === requestId &&\n !conn.isPending &&\n conn.targetAccountId === targetAccountId\n );\n\n const pendingKey = `req-${requestId}:${operatorId}`;\n\n if (!isAlreadyConfirmed && !this.pendingRequests.has(pendingKey)) {\n const pendingRequest = {\n id: requestId,\n requesterId: accountId,\n requesterTopicId: msg.outbound_topic_id || '',\n targetAccountId,\n targetTopicId: targetInboundTopicId,\n operatorId,\n sequenceNumber: msg.sequence_number,\n created: msg.created || new Date(),\n memo: msg.m,\n status: 'pending' as 'pending' | 'confirmed' | 'rejected',\n };\n\n this.pendingRequests.set(pendingKey, pendingRequest);\n\n if (!this.connections.has(pendingKey)) {\n const pendingConnection = {\n connectionTopicId: pendingKey,\n targetAccountId,\n targetInboundTopicId,\n status: 'pending' as\n | 'pending'\n | 'established'\n | 'needs_confirmation'\n | 'closed',\n isPending: true,\n needsConfirmation: false,\n created: msg.created || new Date(),\n connectionRequestId: requestId,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n };\n\n this.connections.set(pendingKey, pendingConnection);\n }\n }\n }\n\n const confirmationMessages = messages.filter(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_topic_id &&\n msg.connection_request_id\n );\n\n for (const msg of confirmationMessages) {\n const requestId = msg.connection_request_id!;\n const connectionTopicId = msg.connection_topic_id!;\n const targetAccountId = this.baseClient.extractAccountFromOperatorId(\n msg.operator_id || ''\n );\n\n if (this.shouldFilterAccount(targetAccountId)) {\n this.logger.debug(\n `Filtering out outbound confirmation to account: ${targetAccountId}`\n );\n continue;\n }\n\n const pendingKey = `req-${requestId}:${msg.operator_id}`;\n\n const pendingRequest = this.pendingRequests.get(pendingKey);\n if (pendingRequest) {\n pendingRequest.status = 'confirmed';\n }\n\n if (this.connections.has(pendingKey)) {\n this.connections.delete(pendingKey);\n }\n\n if (!this.connections.has(connectionTopicId)) {\n this.connections.set(connectionTopicId, {\n connectionTopicId,\n targetAccountId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: msg.created || new Date(),\n connectionRequestId: requestId,\n confirmedRequestId: msg.confirmed_request_id,\n requesterOutboundTopicId: msg.outbound_topic_id,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n });\n } else {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n connectionRequestId: requestId,\n confirmedRequestId: msg.confirmed_request_id,\n requesterOutboundTopicId: msg.outbound_topic_id,\n uniqueRequestKey: pendingKey,\n originTopicId: msg.outbound_topic_id || '',\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n const closedMessages = messages.filter(\n (msg) =>\n (msg.op as string) === 'connection_closed' ||\n (msg.op === 'close_connection' && msg.connection_topic_id)\n );\n\n for (const msg of closedMessages) {\n const connectionTopicId = msg.connection_topic_id!;\n\n if (this.connections.has(connectionTopicId)) {\n const conn = this.connections.get(connectionTopicId)!;\n if (\n this.shouldFilterAccount(conn.targetAccountId) &&\n conn.status !== 'established'\n ) {\n continue;\n }\n\n const uniqueKey =\n msg.connection_request_id && msg.operator_id\n ? `req-${msg.connection_request_id}:${msg.operator_id}`\n : undefined;\n\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'closed',\n isPending: false,\n needsConfirmation: false,\n lastActivity: msg.created || new Date(),\n closedReason: msg.reason,\n closeMethod: msg.close_method,\n uniqueRequestKey: uniqueKey,\n originTopicId: conn.originTopicId,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Process inbound messages to track connection requests and confirmations\n * @param messages - The messages to process\n * @returns Array of connections after processing\n */\n processInboundMessages(messages: HCSMessage[]): Connection[] {\n if (!Boolean(messages?.length)) {\n return Array.from(this.connections.values());\n }\n\n const requestMessages = messages.filter(\n (msg) => msg.op === 'connection_request' && msg.sequence_number\n );\n\n const confirmationMessages = messages.filter(\n (msg) =>\n msg.op === 'connection_created' &&\n msg.connection_topic_id &&\n msg.connection_id\n );\n\n for (const msg of requestMessages) {\n const sequenceNumber = msg.sequence_number;\n const operatorId = msg.operator_id || '';\n const requestorAccountId =\n this.baseClient.extractAccountFromOperatorId(operatorId);\n const requestorTopicId =\n this.baseClient.extractTopicFromOperatorId(operatorId);\n\n if (this.shouldFilterAccount(requestorAccountId)) {\n this.logger.debug(\n `Filtering out request from account: ${requestorAccountId}`\n );\n continue;\n }\n\n const needsConfirmKey = `inb-${sequenceNumber}:${operatorId}`;\n\n const hasCreated = confirmationMessages.some(\n (m) => m.connection_id === sequenceNumber\n );\n\n if (hasCreated) {\n this.logger.debug(\n `Skipping request from ${requestorAccountId} as it has already been confirmed`\n );\n continue;\n }\n\n if (!this.connections.has(needsConfirmKey)) {\n this.connections.set(needsConfirmKey, {\n connectionTopicId: needsConfirmKey,\n targetAccountId: requestorAccountId,\n targetInboundTopicId: requestorTopicId,\n status: 'needs_confirmation',\n isPending: false,\n needsConfirmation: true,\n created: msg.created || new Date(),\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: requestorTopicId,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n\n\n for (const msg of confirmationMessages) {\n const sequenceNumber = msg.connection_id!;\n const connectionTopicId = msg.connection_topic_id!;\n const connectedAccountId = msg.connected_account_id || '';\n const operatorId = msg.operator_id || '';\n\n if (this.shouldFilterAccount(connectedAccountId)) {\n this.logger.debug(\n `Filtering out confirmation for account: ${connectedAccountId}`\n );\n continue;\n }\n\n const needsConfirmKey = `inb-${sequenceNumber}:${operatorId}`;\n\n if (this.connections.has(needsConfirmKey)) {\n this.connections.delete(needsConfirmKey);\n }\n\n if (!this.connections.has(connectionTopicId)) {\n this.connections.set(connectionTopicId, {\n connectionTopicId,\n targetAccountId: connectedAccountId,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n created: msg.created || new Date(),\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: msg.connection_topic_id,\n processed: false,\n memo: msg.m,\n });\n } else {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'established',\n isPending: false,\n needsConfirmation: false,\n inboundRequestId: sequenceNumber,\n uniqueRequestKey: needsConfirmKey,\n originTopicId: msg.connection_topic_id,\n processed: false,\n memo: msg.m,\n });\n }\n }\n\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n }\n\n /**\n * Process connection topic messages to update last activity time\n * @param connectionTopicId - The topic ID of the connection\n * @param messages - The messages to process\n * @returns The updated connection or undefined if not found\n */\n processConnectionMessages(\n connectionTopicId: string,\n messages: HCSMessage[]\n ): Connection | undefined {\n if (\n !messages ||\n messages.length === 0 ||\n !this.connections.has(connectionTopicId)\n ) {\n return this.connections.get(connectionTopicId);\n }\n\n const latestMessage = messages\n .filter((m) => m.created)\n .sort((a, b) => {\n const dateA = a.created ? new Date(a.created).getTime() : 0;\n const dateB = b.created ? new Date(b.created).getTime() : 0;\n return dateB - dateA;\n })[0];\n\n if (latestMessage?.created) {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n lastActivity: latestMessage.created,\n });\n }\n\n const closeMessage = messages.find((msg) => msg.op === 'close_connection');\n if (closeMessage) {\n const conn = this.connections.get(connectionTopicId)!;\n this.connections.set(connectionTopicId, {\n ...conn,\n status: 'closed',\n lastActivity: closeMessage.created || new Date(),\n closedReason: closeMessage.reason,\n closeMethod: 'explicit',\n });\n }\n\n return this.connections.get(connectionTopicId);\n }\n\n /**\n * Adds or updates profile information for a connection\n * @param accountId - The account ID to add profile info for\n * @param profile - The profile information\n */\n addProfileInfo(accountId: string, profile: AIAgentProfile): void {\n this.profileCache.set(accountId, profile);\n\n const matchingConnections = Array.from(this.connections.values()).filter(\n (conn) => conn.targetAccountId === accountId\n );\n\n for (const conn of matchingConnections) {\n this.connections.set(conn.connectionTopicId, {\n ...conn,\n profileInfo: profile,\n targetAgentName: profile.display_name,\n targetInboundTopicId: profile.inboundTopicId,\n targetOutboundTopicId: profile.outboundTopicId,\n });\n }\n }\n\n /**\n * Gets all connections\n * @returns Array of all connections that should be visible\n */\n getAllConnections(): Connection[] {\n const connections = Array.from(this.connections.values()).filter(\n (conn) =>\n conn.status === 'established' ||\n conn.status === 'closed' ||\n !this.filterPendingAccountIds.has(conn.targetAccountId)\n );\n return connections;\n }\n\n /**\n * Gets all pending connection requests\n * @returns Array of pending connection requests\n */\n getPendingRequests(): Connection[] {\n const pendingConnections = Array.from(this.connections.values()).filter(\n (conn) => {\n return (\n conn.isPending &&\n (!this.filterPendingAccountIds.has(conn.targetAccountId))\n );\n }\n );\n\n return pendingConnections;\n }\n\n /**\n * Helper method to check if there's an established connection with an account\n * @param accountId - The account ID to check\n * @returns True if there's an established connection, false otherwise\n */\n private hasEstablishedConnectionWithAccount(accountId: string): boolean {\n return Array.from(this.connections.values()).some(\n (conn) =>\n conn.targetAccountId === accountId && conn.status === 'established'\n );\n }\n\n /**\n * Gets all active (established) connections\n * @returns Array of active connections\n */\n getActiveConnections(): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) => conn.status === 'established'\n );\n }\n\n /**\n * Gets all connections needing confirmation\n * @returns Array of connections needing confirmation\n */\n getConnectionsNeedingConfirmation(): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) =>\n conn.needsConfirmation &&\n (!this.filterPendingAccountIds.has(conn.targetAccountId))\n );\n }\n\n /**\n * Gets a connection by its topic ID\n * @param connectionTopicId - The topic ID to look up\n * @returns The connection with the given topic ID, or undefined if not found\n */\n getConnectionByTopicId(connectionTopicId: string): Connection | undefined {\n return this.connections.get(connectionTopicId);\n }\n\n /**\n * Gets a connection by account ID\n * @param accountId - The account ID to look up\n * @returns The connection with the given account ID, or undefined if not found\n */\n getConnectionByAccountId(accountId: string): Connection | undefined {\n return Array.from(this.connections.values()).find(\n (conn) =>\n conn.targetAccountId === accountId && conn.status === 'established'\n );\n }\n\n /**\n * Gets all connections for a specific account ID\n * @param accountId - The account ID to look up\n * @returns Array of connections for the given account ID\n */\n getConnectionsByAccountId(accountId: string): Connection[] {\n return Array.from(this.connections.values()).filter(\n (conn) => conn.targetAccountId === accountId\n );\n }\n\n /**\n * Updates or adds a connection\n * @param connection - The connection to update or add\n */\n updateOrAddConnection(connection: Connection): void {\n this.connections.set(connection.connectionTopicId, connection);\n }\n\n /**\n * Clears all tracked connections and requests\n */\n clearAll(): void {\n this.connections.clear();\n this.pendingRequests.clear();\n }\n\n /**\n * Checks if a given connection request has been processed already\n * This uses a combination of topic ID and request ID to uniquely identify requests\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if this specific request has been processed, false otherwise\n */\n isConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean {\n for (const conn of this.connections.values()) {\n if (\n conn.originTopicId === inboundTopicId &&\n conn.inboundRequestId === requestId &&\n conn.processed\n ) {\n return true;\n }\n\n if (\n conn.originTopicId === inboundTopicId &&\n conn.connectionRequestId === requestId &&\n conn.processed\n ) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Marks a specific connection request as processed\n *\n * @param inboundTopicId - The inbound topic ID where the request was received\n * @param requestId - The sequence number (request ID)\n * @returns True if a matching connection was found and marked, false otherwise\n */\n markConnectionRequestProcessed(\n inboundTopicId: string,\n requestId: number\n ): boolean {\n let found = false;\n\n for (const [key, conn] of this.connections.entries()) {\n if (\n conn.originTopicId === inboundTopicId &&\n conn.inboundRequestId === requestId\n ) {\n this.connections.set(key, {\n ...conn,\n processed: true,\n });\n found = true;\n this.logger.debug(\n `Marked inbound connection request #${requestId} on topic ${inboundTopicId} as processed`\n );\n }\n\n if (\n conn.originTopicId === inboundTopicId &&\n conn.connectionRequestId === requestId\n ) {\n this.connections.set(key, {\n ...conn,\n processed: true,\n });\n found = true;\n this.logger.debug(\n `Marked outbound connection request #${requestId} on topic ${inboundTopicId} as processed`\n );\n }\n }\n\n return found;\n }\n}\n"],"names":[],"mappings":";AA8LO,MAAM,mBAAkD;AAAA;AAAA;AAAA;AAAA,EAW7D,YAAY,SAAoC;AATxC,SAAA,kCAA2C,IAAI;AAC/C,SAAA,sCAAsD,IAAI;AAC1D,SAAA,mCAAgD,IAAI;AACpD,SAAA,8CAA2C,IAAI;AAOrD,UAAM,gBAA+B;AAAA,MACnC,QAAQ;AAAA,MACR,OAAO,SAAS,YAAY;AAAA,MAC5B,aAAa;AAAA,IACf;AACK,SAAA,SAAS,IAAI,OAAO,aAAa;AAEtC,QAAI,SAAS,yBAAyB;AACpC,WAAK,0BAA0B,IAAI,IAAI,QAAQ,uBAAuB;AAAA,IAAA;AAGpE,QAAA,CAAC,QAAQ,YAAY;AACjB,YAAA,IAAI,MAAM,qDAAqD;AAAA,IAAA;AAGvE,SAAK,aAAa,QAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ5B,MAAM,oBAAoB,WAA0C;AAC9D,QAAA;AACI,YAAA,YAAY,MAAM,KAAK,WAAW;AAAA,QACtC;AAAA,MACF;AAEM,YAAA,iBAAiB,CAAC,YAA6B;AACnD,eAAO,QAAQ,OAAO,KAAK,CAAC,QAAQ,SAAS,GAAG;AAAA,MAClD;AAGE,UAAA,CAAC,eAAe,UAAU,YAAY,KACtC,CAAC,eAAe,UAAU,aAAa,GACvC;AACA,aAAK,OAAO;AAAA,UACV;AAAA,QACF;AACA,eAAO,KAAK,kBAAkB;AAAA,MAAA;AAGhC,YAAM,CAAC,wBAAwB,qBAAqB,IAAI,MAAM,QAAQ;AAAA,QACpE;AAAA,UACE,KAAK,WAAW,YAAY,UAAU,aAAa;AAAA,UACnD,KAAK,WAAW,YAAY,UAAU,YAAY;AAAA,QAAA;AAAA,MAEtD;AAE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wB,aAC7B,KAAK,WACL;AACO,eAAA;AAAA,MAAA;AAAA,IACT;AAGK,WAAA;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUT,+BACE,gBACA,WACS;AACT,QAAI,QAAQ;AAEZ,eAAW,CAAC,KAAK,IAAI,KAAK,KAAK,YAAY,WAAW;AACpD,UACE,KAAK,kBAAkB,kBACvB,KAAK,qBAAqB,WAC1B;AACK,aAAA,YAAY,IAAI,KAAK;AAAA,UACxB,GAAG;AAAA,UACH,WAAW;AAAA,QAAA,CACZ;AACO,gBAAA;AACR,aAAK,OAAO;AAAA,UACV,sCAAsC,SAAS,aAAa,cAAc;AAAA,QAC5E;AAAA,MAAA;AAGF,UACE,KAAK,kBAAkB,kBACvB,KAAK,wBAAwB,WAC7B;AACK,aAAA,YAAY,IAAI,KAAK;AAAA,UACxB,GAAG;AAAA,UACH,WAAW;AAAA,QAAA,CACZ;AACO,gBAAA;AACR,aAAK,OAAO;AAAA,UACV,uCAAuC,SAAS,aAAa,cAAc;AAAA,QAC7E;AAAA,MAAA;AAAA,IACF;AAGK,WAAA;AAAA,EAAA;AAEX;"}
@@ -1,7 +1,16 @@
1
- function isAbsoluteURL(url) {
2
- return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
3
- }
1
+ import URLSearchParams from "./standards-sdk.es112.js";
2
+ import FormData from "./standards-sdk.es113.js";
3
+ import Blob from "./standards-sdk.es114.js";
4
+ const platform = {
5
+ isBrowser: true,
6
+ classes: {
7
+ URLSearchParams,
8
+ FormData,
9
+ Blob
10
+ },
11
+ protocols: ["http", "https", "file", "blob", "url", "data"]
12
+ };
4
13
  export {
5
- isAbsoluteURL as default
14
+ platform as default
6
15
  };
7
16
  //# sourceMappingURL=standards-sdk.es100.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es100.js","sources":["../../node_modules/axios/lib/helpers/isAbsoluteURL.js"],"sourcesContent":["'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n"],"names":[],"mappings":"AASe,SAAS,cAAc,KAAK;AAIzC,SAAO,8BAA8B,KAAK,GAAG;AAC/C;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es100.js","sources":["../../node_modules/axios/lib/platform/browser/index.js"],"sourcesContent":["import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n"],"names":[],"mappings":";;;AAIA,MAAe,WAAA;AAAA,EACb,WAAW;AAAA,EACX,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACD,WAAW,CAAC,QAAQ,SAAS,QAAQ,QAAQ,OAAO,MAAM;AAC5D;","x_google_ignoreList":[0]}
@@ -1,7 +1,16 @@
1
- function combineURLs(baseURL, relativeURL) {
2
- return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
3
- }
1
+ const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
2
+ const _navigator = typeof navigator === "object" && navigator || void 0;
3
+ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
4
+ const hasStandardBrowserWebWorkerEnv = (() => {
5
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
6
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
7
+ })();
8
+ const origin = hasBrowserEnv && window.location.href || "http://localhost";
4
9
  export {
5
- combineURLs as default
10
+ hasBrowserEnv,
11
+ hasStandardBrowserEnv,
12
+ hasStandardBrowserWebWorkerEnv,
13
+ _navigator as navigator,
14
+ origin
6
15
  };
7
16
  //# sourceMappingURL=standards-sdk.es101.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es101.js","sources":["../../node_modules/axios/lib/helpers/combineURLs.js"],"sourcesContent":["'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n"],"names":[],"mappings":"AAUe,SAAS,YAAY,SAAS,aAAa;AACxD,SAAO,cACH,QAAQ,QAAQ,UAAU,EAAE,IAAI,MAAM,YAAY,QAAQ,QAAQ,EAAE,IACpE;AACN;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es101.js","sources":["../../node_modules/axios/lib/platform/common/utils.js"],"sourcesContent":["const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n"],"names":[],"mappings":"AAAK,MAAC,gBAAgB,OAAO,WAAW,eAAe,OAAO,aAAa;AAEtE,MAAC,aAAa,OAAO,cAAc,YAAY,aAAa;AAmB5D,MAAC,wBAAwB,kBAC3B,CAAC,cAAc,CAAC,eAAe,gBAAgB,IAAI,EAAE,QAAQ,WAAW,OAAO,IAAI;AAWjF,MAAC,kCAAkC,MAAM;AAC5C,SACE,OAAO,sBAAsB;AAAA,EAE7B,gBAAgB,qBAChB,OAAO,KAAK,kBAAkB;AAElC,GAAC;AAEI,MAAC,SAAS,iBAAiB,OAAO,SAAS,QAAQ;","x_google_ignoreList":[0]}
@@ -1,19 +1,35 @@
1
- import AxiosError from "./standards-sdk.es47.js";
2
- function settle(resolve, reject, response) {
3
- const validateStatus = response.config.validateStatus;
4
- if (!response.status || !validateStatus || validateStatus(response.status)) {
5
- resolve(response);
6
- } else {
7
- reject(new AxiosError(
8
- "Request failed with status code " + response.status,
9
- [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
10
- response.config,
11
- response.request,
12
- response
13
- ));
14
- }
1
+ import toFormData from "./standards-sdk.es81.js";
2
+ function encode(str) {
3
+ const charMap = {
4
+ "!": "%21",
5
+ "'": "%27",
6
+ "(": "%28",
7
+ ")": "%29",
8
+ "~": "%7E",
9
+ "%20": "+",
10
+ "%00": "\0"
11
+ };
12
+ return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {
13
+ return charMap[match];
14
+ });
15
15
  }
16
+ function AxiosURLSearchParams(params, options) {
17
+ this._pairs = [];
18
+ params && toFormData(params, this, options);
19
+ }
20
+ const prototype = AxiosURLSearchParams.prototype;
21
+ prototype.append = function append(name, value) {
22
+ this._pairs.push([name, value]);
23
+ };
24
+ prototype.toString = function toString(encoder) {
25
+ const _encode = encoder ? function(value) {
26
+ return encoder.call(this, value, encode);
27
+ } : encode;
28
+ return this._pairs.map(function each(pair) {
29
+ return _encode(pair[0]) + "=" + _encode(pair[1]);
30
+ }, "").join("&");
31
+ };
16
32
  export {
17
- settle as default
33
+ AxiosURLSearchParams as default
18
34
  };
19
35
  //# sourceMappingURL=standards-sdk.es102.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es102.js","sources":["../../node_modules/axios/lib/core/settle.js"],"sourcesContent":["'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n"],"names":[],"mappings":";AAae,SAAS,OAAO,SAAS,QAAQ,UAAU;AACxD,QAAM,iBAAiB,SAAS,OAAO;AACvC,MAAI,CAAC,SAAS,UAAU,CAAC,kBAAkB,eAAe,SAAS,MAAM,GAAG;AAC1E,YAAQ,QAAQ;AAAA,EACpB,OAAS;AACL,WAAO,IAAI;AAAA,MACT,qCAAqC,SAAS;AAAA,MAC9C,CAAC,WAAW,iBAAiB,WAAW,gBAAgB,EAAE,KAAK,MAAM,SAAS,SAAS,GAAG,IAAI,CAAC;AAAA,MAC/F,SAAS;AAAA,MACT,SAAS;AAAA,MACT;AAAA,IACN,CAAK;AAAA,EACL;AACA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es102.js","sources":["../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js"],"sourcesContent":["'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object<string, any>} params - The parameters to be converted to a FormData object.\n * @param {Object<string, any>} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n"],"names":[],"mappings":";AAYA,SAAS,OAAO,KAAK;AACnB,QAAM,UAAU;AAAA,IACd,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,EACR;AACD,SAAO,mBAAmB,GAAG,EAAE,QAAQ,oBAAoB,SAAS,SAAS,OAAO;AAClF,WAAO,QAAQ,KAAK;AAAA,EACxB,CAAG;AACH;AAUA,SAAS,qBAAqB,QAAQ,SAAS;AAC7C,OAAK,SAAS,CAAE;AAEhB,YAAU,WAAW,QAAQ,MAAM,OAAO;AAC5C;AAEA,MAAM,YAAY,qBAAqB;AAEvC,UAAU,SAAS,SAAS,OAAO,MAAM,OAAO;AAC9C,OAAK,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAChC;AAEA,UAAU,WAAW,SAAS,SAAS,SAAS;AAC9C,QAAM,UAAU,UAAU,SAAS,OAAO;AACxC,WAAO,QAAQ,KAAK,MAAM,OAAO,MAAM;AAAA,EAC3C,IAAM;AAEJ,SAAO,KAAK,OAAO,IAAI,SAAS,KAAK,MAAM;AACzC,WAAO,QAAQ,KAAK,CAAC,CAAC,IAAI,MAAM,QAAQ,KAAK,CAAC,CAAC;AAAA,EACnD,GAAK,EAAE,EAAE,KAAK,GAAG;AACjB;","x_google_ignoreList":[0]}
@@ -1,8 +1,18 @@
1
- function parseProtocol(url) {
2
- const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
3
- return match && match[1] || "";
1
+ import utils from "./standards-sdk.es71.js";
2
+ import defaults from "./standards-sdk.es75.js";
3
+ import AxiosHeaders from "./standards-sdk.es85.js";
4
+ function transformData(fns, response) {
5
+ const config = this || defaults;
6
+ const context = response || config;
7
+ const headers = AxiosHeaders.from(context.headers);
8
+ let data = context.data;
9
+ utils.forEach(fns, function transform(fn) {
10
+ data = fn.call(config, data, headers.normalize(), response ? response.status : void 0);
11
+ });
12
+ headers.normalize();
13
+ return data;
4
14
  }
5
15
  export {
6
- parseProtocol as default
16
+ transformData as default
7
17
  };
8
18
  //# sourceMappingURL=standards-sdk.es103.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es103.js","sources":["../../node_modules/axios/lib/helpers/parseProtocol.js"],"sourcesContent":["'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n"],"names":[],"mappings":"AAEe,SAAS,cAAc,KAAK;AACzC,QAAM,QAAQ,4BAA4B,KAAK,GAAG;AAClD,SAAO,SAAS,MAAM,CAAC,KAAK;AAC9B;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es103.js","sources":["../../node_modules/axios/lib/core/transformData.js"],"sourcesContent":["'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n"],"names":[],"mappings":";;;AAce,SAAS,cAAc,KAAK,UAAU;AACnD,QAAM,SAAS,QAAQ;AACvB,QAAM,UAAU,YAAY;AAC5B,QAAM,UAAU,aAAa,KAAK,QAAQ,OAAO;AACjD,MAAI,OAAO,QAAQ;AAEnB,QAAM,QAAQ,KAAK,SAAS,UAAU,IAAI;AACxC,WAAO,GAAG,KAAK,QAAQ,MAAM,QAAQ,UAAS,GAAI,WAAW,SAAS,SAAS,MAAS;AAAA,EAC5F,CAAG;AAED,UAAQ,UAAW;AAEnB,SAAO;AACT;","x_google_ignoreList":[0]}
@@ -1,42 +1,7 @@
1
- import speedometer from "./standards-sdk.es109.js";
2
- import throttle from "./standards-sdk.es110.js";
3
- import utils from "./standards-sdk.es36.js";
4
- const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
5
- let bytesNotified = 0;
6
- const _speedometer = speedometer(50, 250);
7
- return throttle((e) => {
8
- const loaded = e.loaded;
9
- const total = e.lengthComputable ? e.total : void 0;
10
- const progressBytes = loaded - bytesNotified;
11
- const rate = _speedometer(progressBytes);
12
- const inRange = loaded <= total;
13
- bytesNotified = loaded;
14
- const data = {
15
- loaded,
16
- total,
17
- progress: total ? loaded / total : void 0,
18
- bytes: progressBytes,
19
- rate: rate ? rate : void 0,
20
- estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
21
- event: e,
22
- lengthComputable: total != null,
23
- [isDownloadStream ? "download" : "upload"]: true
24
- };
25
- listener(data);
26
- }, freq);
27
- };
28
- const progressEventDecorator = (total, throttled) => {
29
- const lengthComputable = total != null;
30
- return [(loaded) => throttled[0]({
31
- lengthComputable,
32
- total,
33
- loaded
34
- }), throttled[1]];
35
- };
36
- const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
1
+ function isAbsoluteURL(url) {
2
+ return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
3
+ }
37
4
  export {
38
- asyncDecorator,
39
- progressEventDecorator,
40
- progressEventReducer
5
+ isAbsoluteURL as default
41
6
  };
42
7
  //# sourceMappingURL=standards-sdk.es104.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es104.js","sources":["../../node_modules/axios/lib/helpers/progressEventReducer.js"],"sourcesContent":["import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n"],"names":[],"mappings":";;;AAIY,MAAC,uBAAuB,CAAC,UAAU,kBAAkB,OAAO,MAAM;AAC5E,MAAI,gBAAgB;AACpB,QAAM,eAAe,YAAY,IAAI,GAAG;AAExC,SAAO,SAAS,OAAK;AACnB,UAAM,SAAS,EAAE;AACjB,UAAM,QAAQ,EAAE,mBAAmB,EAAE,QAAQ;AAC7C,UAAM,gBAAgB,SAAS;AAC/B,UAAM,OAAO,aAAa,aAAa;AACvC,UAAM,UAAU,UAAU;AAE1B,oBAAgB;AAEhB,UAAM,OAAO;AAAA,MACX;AAAA,MACA;AAAA,MACA,UAAU,QAAS,SAAS,QAAS;AAAA,MACrC,OAAO;AAAA,MACP,MAAM,OAAO,OAAO;AAAA,MACpB,WAAW,QAAQ,SAAS,WAAW,QAAQ,UAAU,OAAO;AAAA,MAChE,OAAO;AAAA,MACP,kBAAkB,SAAS;AAAA,MAC3B,CAAC,mBAAmB,aAAa,QAAQ,GAAG;AAAA,IAC7C;AAED,aAAS,IAAI;AAAA,EACd,GAAE,IAAI;AACT;AAEY,MAAC,yBAAyB,CAAC,OAAO,cAAc;AAC1D,QAAM,mBAAmB,SAAS;AAElC,SAAO,CAAC,CAAC,WAAW,UAAU,CAAC,EAAE;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG,GAAG,UAAU,CAAC,CAAC;AAClB;AAEY,MAAC,iBAAiB,CAAC,OAAO,IAAI,SAAS,MAAM,KAAK,MAAM,GAAG,GAAG,IAAI,CAAC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es104.js","sources":["../../node_modules/axios/lib/helpers/isAbsoluteURL.js"],"sourcesContent":["'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n"],"names":[],"mappings":"AASe,SAAS,cAAc,KAAK;AAIzC,SAAO,8BAA8B,KAAK,GAAG;AAC/C;","x_google_ignoreList":[0]}
@@ -1,43 +1,7 @@
1
- import platform from "./standards-sdk.es87.js";
2
- import utils from "./standards-sdk.es36.js";
3
- import isURLSameOrigin from "./standards-sdk.es111.js";
4
- import cookies from "./standards-sdk.es112.js";
5
- import buildFullPath from "./standards-sdk.es83.js";
6
- import mergeConfig from "./standards-sdk.es39.js";
7
- import AxiosHeaders from "./standards-sdk.es50.js";
8
- import buildURL from "./standards-sdk.es80.js";
9
- const resolveConfig = (config) => {
10
- const newConfig = mergeConfig({}, config);
11
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
12
- newConfig.headers = headers = AxiosHeaders.from(headers);
13
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
14
- if (auth) {
15
- headers.set(
16
- "Authorization",
17
- "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
18
- );
19
- }
20
- let contentType;
21
- if (utils.isFormData(data)) {
22
- if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
23
- headers.setContentType(void 0);
24
- } else if ((contentType = headers.getContentType()) !== false) {
25
- const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
26
- headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
27
- }
28
- }
29
- if (platform.hasStandardBrowserEnv) {
30
- withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
31
- if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
32
- const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
33
- if (xsrfValue) {
34
- headers.set(xsrfHeaderName, xsrfValue);
35
- }
36
- }
37
- }
38
- return newConfig;
39
- };
1
+ function combineURLs(baseURL, relativeURL) {
2
+ return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
3
+ }
40
4
  export {
41
- resolveConfig as default
5
+ combineURLs as default
42
6
  };
43
7
  //# sourceMappingURL=standards-sdk.es105.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es105.js","sources":["../../node_modules/axios/lib/helpers/resolveConfig.js"],"sourcesContent":["import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n"],"names":[],"mappings":";;;;;;;;AASA,MAAe,gBAAA,CAAC,WAAW;AACzB,QAAM,YAAY,YAAY,CAAE,GAAE,MAAM;AAExC,MAAI,EAAC,MAAM,eAAe,gBAAgB,gBAAgB,SAAS,KAAI,IAAI;AAE3E,YAAU,UAAU,UAAU,aAAa,KAAK,OAAO;AAEvD,YAAU,MAAM,SAAS,cAAc,UAAU,SAAS,UAAU,KAAK,UAAU,iBAAiB,GAAG,OAAO,QAAQ,OAAO,gBAAgB;AAG7I,MAAI,MAAM;AACR,YAAQ;AAAA,MAAI;AAAA,MAAiB,WAC3B,MAAM,KAAK,YAAY,MAAM,OAAO,KAAK,WAAW,SAAS,mBAAmB,KAAK,QAAQ,CAAC,IAAI,GAAG;AAAA,IACtG;AAAA,EACL;AAEE,MAAI;AAEJ,MAAI,MAAM,WAAW,IAAI,GAAG;AAC1B,QAAI,SAAS,yBAAyB,SAAS,gCAAgC;AAC7E,cAAQ,eAAe,MAAS;AAAA,IACjC,YAAW,cAAc,QAAQ,eAAc,OAAQ,OAAO;AAE7D,YAAM,CAAC,MAAM,GAAG,MAAM,IAAI,cAAc,YAAY,MAAM,GAAG,EAAE,IAAI,WAAS,MAAM,KAAI,CAAE,EAAE,OAAO,OAAO,IAAI,CAAE;AAC9G,cAAQ,eAAe,CAAC,QAAQ,uBAAuB,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;AAAA,IAClF;AAAA,EACA;AAME,MAAI,SAAS,uBAAuB;AAClC,qBAAiB,MAAM,WAAW,aAAa,MAAM,gBAAgB,cAAc,SAAS;AAE5F,QAAI,iBAAkB,kBAAkB,SAAS,gBAAgB,UAAU,GAAG,GAAI;AAEhF,YAAM,YAAY,kBAAkB,kBAAkB,QAAQ,KAAK,cAAc;AAEjF,UAAI,WAAW;AACb,gBAAQ,IAAI,gBAAgB,SAAS;AAAA,MAC7C;AAAA,IACA;AAAA,EACA;AAEE,SAAO;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es105.js","sources":["../../node_modules/axios/lib/helpers/combineURLs.js"],"sourcesContent":["'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n"],"names":[],"mappings":"AAUe,SAAS,YAAY,SAAS,aAAa;AACxD,SAAO,cACH,QAAQ,QAAQ,UAAU,EAAE,IAAI,MAAM,YAAY,QAAQ,QAAQ,EAAE,IACpE;AACN;","x_google_ignoreList":[0]}