@hashgraphonline/standards-sdk 0.0.87 → 0.0.89
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/hcs-10/connections-manager.d.ts +2 -0
- package/dist/es/hcs-10/connections-manager.d.ts.map +1 -1
- package/dist/es/standards-sdk.es10.js +18 -10
- package/dist/es/standards-sdk.es10.js.map +1 -1
- package/dist/es/standards-sdk.es100.js +30 -13
- package/dist/es/standards-sdk.es100.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +14 -3
- package/dist/es/standards-sdk.es101.js.map +1 -1
- package/dist/es/standards-sdk.es102.js +3 -3
- package/dist/es/standards-sdk.es102.js.map +1 -1
- package/dist/es/standards-sdk.es103.js +3 -15
- package/dist/es/standards-sdk.es103.js.map +1 -1
- package/dist/es/standards-sdk.es104.js +15 -4
- package/dist/es/standards-sdk.es104.js.map +1 -1
- package/dist/es/standards-sdk.es105.js +5 -39
- package/dist/es/standards-sdk.es105.js.map +1 -1
- package/dist/es/standards-sdk.es106.js +38 -39
- package/dist/es/standards-sdk.es106.js.map +1 -1
- package/dist/es/standards-sdk.es107.js +37 -34
- package/dist/es/standards-sdk.es107.js.map +1 -1
- package/dist/es/standards-sdk.es108.js +34 -75
- package/dist/es/standards-sdk.es108.js.map +1 -1
- package/dist/es/standards-sdk.es109.js +77 -2281
- package/dist/es/standards-sdk.es109.js.map +1 -1
- package/dist/es/standards-sdk.es111.js +34 -3
- package/dist/es/standards-sdk.es111.js.map +1 -1
- package/dist/es/standards-sdk.es112.js +33 -2
- package/dist/es/standards-sdk.es112.js.map +1 -1
- package/dist/es/standards-sdk.es113.js +9 -2
- package/dist/es/standards-sdk.es113.js.map +1 -1
- package/dist/es/standards-sdk.es114.js +32 -32
- package/dist/es/standards-sdk.es114.js.map +1 -1
- package/dist/es/standards-sdk.es115.js +3 -33
- package/dist/es/standards-sdk.es115.js.map +1 -1
- package/dist/es/standards-sdk.es116.js +2 -9
- package/dist/es/standards-sdk.es116.js.map +1 -1
- package/dist/es/standards-sdk.es117.js +2 -34
- package/dist/es/standards-sdk.es117.js.map +1 -1
- package/dist/es/standards-sdk.es13.js +2 -2
- package/dist/es/standards-sdk.es15.js +1 -1
- package/dist/es/standards-sdk.es18.js +1 -1
- package/dist/es/standards-sdk.es19.js +2 -2
- package/dist/es/standards-sdk.es23.js +7190 -36
- package/dist/es/standards-sdk.es23.js.map +1 -1
- package/dist/es/standards-sdk.es24.js +1039 -46
- package/dist/es/standards-sdk.es24.js.map +1 -1
- package/dist/es/standards-sdk.es25.js +36 -7190
- package/dist/es/standards-sdk.es25.js.map +1 -1
- package/dist/es/standards-sdk.es26.js +48 -3
- package/dist/es/standards-sdk.es26.js.map +1 -1
- package/dist/es/standards-sdk.es27.js +3 -2
- package/dist/es/standards-sdk.es27.js.map +1 -1
- package/dist/es/standards-sdk.es28.js +2 -4167
- package/dist/es/standards-sdk.es28.js.map +1 -1
- package/dist/es/standards-sdk.es29.js +5 -1041
- package/dist/es/standards-sdk.es29.js.map +1 -1
- package/dist/es/standards-sdk.es30.js +4167 -5
- package/dist/es/standards-sdk.es30.js.map +1 -1
- package/dist/es/standards-sdk.es31.js +7136 -2
- package/dist/es/standards-sdk.es31.js.map +1 -1
- package/dist/es/standards-sdk.es32.js +3 -195
- package/dist/es/standards-sdk.es32.js.map +1 -1
- package/dist/es/standards-sdk.es33.js +86 -423
- package/dist/es/standards-sdk.es33.js.map +1 -1
- package/dist/es/standards-sdk.es34.js +2 -25
- package/dist/es/standards-sdk.es34.js.map +1 -1
- package/dist/es/standards-sdk.es35.js +15 -138
- package/dist/es/standards-sdk.es35.js.map +1 -1
- package/dist/es/standards-sdk.es36.js +405 -14
- package/dist/es/standards-sdk.es36.js.map +1 -1
- package/dist/es/standards-sdk.es37.js +2 -29
- package/dist/es/standards-sdk.es37.js.map +1 -1
- package/dist/es/standards-sdk.es38.js +362 -27
- package/dist/es/standards-sdk.es38.js.map +1 -1
- package/dist/es/standards-sdk.es39.js +5 -20
- package/dist/es/standards-sdk.es39.js.map +1 -1
- package/dist/es/standards-sdk.es4.js +1 -1
- package/dist/es/standards-sdk.es40.js +172 -37
- package/dist/es/standards-sdk.es40.js.map +1 -1
- package/dist/es/standards-sdk.es41.js +76 -13
- package/dist/es/standards-sdk.es41.js.map +1 -1
- package/dist/es/standards-sdk.es42.js +108 -55
- package/dist/es/standards-sdk.es42.js.map +1 -1
- package/dist/es/standards-sdk.es43.js +43 -1280
- package/dist/es/standards-sdk.es43.js.map +1 -1
- package/dist/es/standards-sdk.es44.js +10 -148
- package/dist/es/standards-sdk.es44.js.map +1 -1
- package/dist/es/standards-sdk.es45.js +87 -81
- package/dist/es/standards-sdk.es45.js.map +1 -1
- package/dist/es/standards-sdk.es46.js +3 -83
- package/dist/es/standards-sdk.es46.js.map +1 -1
- package/dist/es/standards-sdk.es47.js +2 -32
- package/dist/es/standards-sdk.es47.js.map +1 -1
- package/dist/es/standards-sdk.es48.js +112 -5
- package/dist/es/standards-sdk.es48.js.map +1 -1
- package/dist/es/standards-sdk.es49.js +69 -154
- package/dist/es/standards-sdk.es49.js.map +1 -1
- package/dist/es/standards-sdk.es5.js +2 -2
- package/dist/es/standards-sdk.es50.js +5 -22
- package/dist/es/standards-sdk.es50.js.map +1 -1
- package/dist/es/standards-sdk.es51.js +4 -792
- package/dist/es/standards-sdk.es51.js.map +1 -1
- package/dist/es/standards-sdk.es52.js +195 -338
- package/dist/es/standards-sdk.es52.js.map +1 -1
- package/dist/es/standards-sdk.es53.js +58 -6
- package/dist/es/standards-sdk.es53.js.map +1 -1
- package/dist/es/standards-sdk.es54.js +68 -178
- package/dist/es/standards-sdk.es54.js.map +1 -1
- package/dist/es/standards-sdk.es55.js +2282 -81
- package/dist/es/standards-sdk.es55.js.map +1 -1
- package/dist/es/standards-sdk.es56.js +154 -104
- package/dist/es/standards-sdk.es56.js.map +1 -1
- package/dist/es/standards-sdk.es57.js +78 -46
- package/dist/es/standards-sdk.es57.js.map +1 -1
- package/dist/es/standards-sdk.es58.js +22 -9
- package/dist/es/standards-sdk.es58.js.map +1 -1
- package/dist/es/standards-sdk.es59.js +134 -83
- package/dist/es/standards-sdk.es59.js.map +1 -1
- package/dist/es/standards-sdk.es60.js +90 -3
- package/dist/es/standards-sdk.es60.js.map +1 -1
- package/dist/es/standards-sdk.es61.js +195 -2
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es62.js +423 -98
- package/dist/es/standards-sdk.es62.js.map +1 -1
- package/dist/es/standards-sdk.es63.js +22 -71
- package/dist/es/standards-sdk.es63.js.map +1 -1
- package/dist/es/standards-sdk.es64.js +138 -5
- package/dist/es/standards-sdk.es64.js.map +1 -1
- package/dist/es/standards-sdk.es65.js +17 -4
- package/dist/es/standards-sdk.es65.js.map +1 -1
- package/dist/es/standards-sdk.es66.js +21 -213
- package/dist/es/standards-sdk.es66.js.map +1 -1
- package/dist/es/standards-sdk.es67.js +27 -56
- package/dist/es/standards-sdk.es67.js.map +1 -1
- package/dist/es/standards-sdk.es68.js +21 -69
- package/dist/es/standards-sdk.es68.js.map +1 -1
- package/dist/es/standards-sdk.es69.js +38 -168
- package/dist/es/standards-sdk.es69.js.map +1 -1
- package/dist/es/standards-sdk.es7.js +2 -2
- package/dist/es/standards-sdk.es70.js +13 -138
- package/dist/es/standards-sdk.es70.js.map +1 -1
- package/dist/es/standards-sdk.es71.js +49 -407
- package/dist/es/standards-sdk.es71.js.map +1 -1
- package/dist/es/standards-sdk.es72.js +1289 -2
- package/dist/es/standards-sdk.es72.js.map +1 -1
- package/dist/es/standards-sdk.es73.js +27 -115
- package/dist/es/standards-sdk.es73.js.map +1 -1
- package/dist/es/standards-sdk.es74.js +5 -20
- package/dist/es/standards-sdk.es74.js.map +1 -1
- package/dist/es/standards-sdk.es75.js +159 -3
- package/dist/es/standards-sdk.es75.js.map +1 -1
- package/dist/es/standards-sdk.es76.js +780 -151
- package/dist/es/standards-sdk.es76.js.map +1 -1
- package/dist/es/standards-sdk.es77.js +170 -28
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +136 -56
- package/dist/es/standards-sdk.es78.js.map +1 -1
- package/dist/es/standards-sdk.es79.js +27 -45
- package/dist/es/standards-sdk.es79.js.map +1 -1
- package/dist/es/standards-sdk.es8.js +2 -2
- package/dist/es/standards-sdk.es80.js +62 -9
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es81.js +45 -60
- package/dist/es/standards-sdk.es81.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +10 -6
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +62 -12
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +5 -6
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js +13 -43
- package/dist/es/standards-sdk.es85.js.map +1 -1
- package/dist/es/standards-sdk.es86.js +7 -2
- package/dist/es/standards-sdk.es86.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +39 -130
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +2 -172
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +136 -27
- package/dist/es/standards-sdk.es89.js.map +1 -1
- package/dist/es/standards-sdk.es9.js +1 -1
- package/dist/es/standards-sdk.es90.js +172 -26
- package/dist/es/standards-sdk.es90.js.map +1 -1
- package/dist/es/standards-sdk.es91.js +19 -36
- package/dist/es/standards-sdk.es91.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +26 -100
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/standards-sdk.es93.js +26 -2
- package/dist/es/standards-sdk.es93.js.map +1 -1
- package/dist/es/standards-sdk.es94.js +37 -15
- package/dist/es/standards-sdk.es94.js.map +1 -1
- package/dist/es/standards-sdk.es95.js +397 -387
- package/dist/es/standards-sdk.es95.js.map +1 -1
- package/dist/es/standards-sdk.es96.js +2 -7136
- package/dist/es/standards-sdk.es96.js.map +1 -1
- package/dist/es/standards-sdk.es97.js +120 -13
- package/dist/es/standards-sdk.es97.js.map +1 -1
- package/dist/es/standards-sdk.es98.js +13 -13
- package/dist/es/standards-sdk.es98.js.map +1 -1
- package/dist/es/standards-sdk.es99.js +13 -32
- package/dist/es/standards-sdk.es99.js.map +1 -1
- package/dist/umd/hcs-10/connections-manager.d.ts +2 -0
- package/dist/umd/hcs-10/connections-manager.d.ts.map +1 -1
- package/dist/umd/standards-sdk.umd.js +1 -1
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -27,6 +27,7 @@ export interface Connection {
|
|
|
27
27
|
status: 'pending' | 'established' | 'needs_confirmation' | 'closed';
|
|
28
28
|
isPending: boolean;
|
|
29
29
|
needsConfirmation: boolean;
|
|
30
|
+
memo?: string;
|
|
30
31
|
created: Date;
|
|
31
32
|
lastActivity?: Date;
|
|
32
33
|
profileInfo?: AIAgentProfile;
|
|
@@ -50,6 +51,7 @@ export interface ConnectionsManagerOptions {
|
|
|
50
51
|
}
|
|
51
52
|
/**
|
|
52
53
|
* Defines the interface for a connections manager that handles HCS-10 connections
|
|
54
|
+
* This interface represents the public API of ConnectionsManager
|
|
53
55
|
*/
|
|
54
56
|
export interface IConnectionsManager {
|
|
55
57
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connections-manager.d.ts","sourceRoot":"","sources":["../../../src/hcs-10/connections-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,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AAyB,CACvB,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,UAAU,EAAE,GACrB,UAAU,GAAG,SAAS;IAwCzB;;;;OAIG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAkBhE;;;OAGG;IACH,iBAAiB,IAAI,UAAU,EAAE;IAWjC;;;OAGG;IACH,kBAAkB,IAAI,UAAU,EAAE;IAalC;;;;OAIG;IACH,OAAO,CAAC,mCAAmC;IAO3C;;;OAGG;IACH,oBAAoB,IAAI,UAAU,EAAE;IAMpC;;;OAGG;IACH,iCAAiC,IAAI,UAAU,EAAE;IAQjD;;;;OAIG;IACH,sBAAsB,CAAC,iBAAiB,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIzE;;;;OAIG;IACH,wBAAwB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAOnE;;;;OAIG;IACH,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE;IAM1D;;;OAGG;IACH,qBAAqB,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IAInD;;OAEG;IACH,QAAQ,IAAI,IAAI;IAKhB;;;;;;;OAOG;IACH,4BAA4B,CAC1B,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO;IAsBV;;;;;;OAMG;IACH,8BAA8B,CAC5B,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,GAChB,OAAO;CAmCX"}
|
|
@@ -143,7 +143,8 @@ class ConnectionsManager {
|
|
|
143
143
|
connectionRequestId: requestId,
|
|
144
144
|
uniqueRequestKey: conn.uniqueRequestKey,
|
|
145
145
|
originTopicId: conn.originTopicId,
|
|
146
|
-
processed: conn.processed
|
|
146
|
+
processed: conn.processed,
|
|
147
|
+
memo: conn.memo
|
|
147
148
|
};
|
|
148
149
|
this.connections.set(connectionTopicId, newConnection);
|
|
149
150
|
if (pendingKey) {
|
|
@@ -431,7 +432,8 @@ class ConnectionsManager {
|
|
|
431
432
|
connectionRequestId: requestId,
|
|
432
433
|
uniqueRequestKey: pendingKey,
|
|
433
434
|
originTopicId: msg.outbound_topic_id || "",
|
|
434
|
-
processed: false
|
|
435
|
+
processed: false,
|
|
436
|
+
memo: msg.m
|
|
435
437
|
};
|
|
436
438
|
this.connections.set(pendingKey, pendingConnection);
|
|
437
439
|
}
|
|
@@ -473,7 +475,8 @@ class ConnectionsManager {
|
|
|
473
475
|
requesterOutboundTopicId: msg.outbound_topic_id,
|
|
474
476
|
uniqueRequestKey: pendingKey,
|
|
475
477
|
originTopicId: msg.outbound_topic_id || "",
|
|
476
|
-
processed: false
|
|
478
|
+
processed: false,
|
|
479
|
+
memo: msg.m
|
|
477
480
|
});
|
|
478
481
|
} else {
|
|
479
482
|
const conn = this.connections.get(connectionTopicId);
|
|
@@ -487,7 +490,8 @@ class ConnectionsManager {
|
|
|
487
490
|
requesterOutboundTopicId: msg.outbound_topic_id,
|
|
488
491
|
uniqueRequestKey: pendingKey,
|
|
489
492
|
originTopicId: msg.outbound_topic_id || "",
|
|
490
|
-
processed: false
|
|
493
|
+
processed: false,
|
|
494
|
+
memo: msg.m
|
|
491
495
|
});
|
|
492
496
|
}
|
|
493
497
|
}
|
|
@@ -512,7 +516,8 @@ class ConnectionsManager {
|
|
|
512
516
|
closeMethod: msg.close_method,
|
|
513
517
|
uniqueRequestKey: uniqueKey,
|
|
514
518
|
originTopicId: conn.originTopicId,
|
|
515
|
-
processed: false
|
|
519
|
+
processed: false,
|
|
520
|
+
memo: msg.m
|
|
516
521
|
});
|
|
517
522
|
}
|
|
518
523
|
}
|
|
@@ -556,7 +561,8 @@ class ConnectionsManager {
|
|
|
556
561
|
inboundRequestId: sequenceNumber,
|
|
557
562
|
uniqueRequestKey: needsConfirmKey,
|
|
558
563
|
originTopicId: requestorTopicId,
|
|
559
|
-
processed: false
|
|
564
|
+
processed: false,
|
|
565
|
+
memo: msg.m
|
|
560
566
|
});
|
|
561
567
|
}
|
|
562
568
|
}
|
|
@@ -589,7 +595,8 @@ class ConnectionsManager {
|
|
|
589
595
|
inboundRequestId: sequenceNumber,
|
|
590
596
|
uniqueRequestKey: needsConfirmKey,
|
|
591
597
|
originTopicId: msg.connection_topic_id,
|
|
592
|
-
processed: false
|
|
598
|
+
processed: false,
|
|
599
|
+
memo: msg.m
|
|
593
600
|
});
|
|
594
601
|
} else {
|
|
595
602
|
const conn = this.connections.get(connectionTopicId);
|
|
@@ -601,7 +608,8 @@ class ConnectionsManager {
|
|
|
601
608
|
inboundRequestId: sequenceNumber,
|
|
602
609
|
uniqueRequestKey: needsConfirmKey,
|
|
603
610
|
originTopicId: msg.connection_topic_id,
|
|
604
|
-
processed: false
|
|
611
|
+
processed: false,
|
|
612
|
+
memo: msg.m
|
|
605
613
|
});
|
|
606
614
|
}
|
|
607
615
|
}
|
|
@@ -681,7 +689,7 @@ class ConnectionsManager {
|
|
|
681
689
|
getPendingRequests() {
|
|
682
690
|
const pendingConnections = Array.from(this.connections.values()).filter(
|
|
683
691
|
(conn) => {
|
|
684
|
-
return conn.isPending &&
|
|
692
|
+
return conn.isPending && !this.filterPendingAccountIds.has(conn.targetAccountId);
|
|
685
693
|
}
|
|
686
694
|
);
|
|
687
695
|
return pendingConnections;
|
|
@@ -711,7 +719,7 @@ class ConnectionsManager {
|
|
|
711
719
|
*/
|
|
712
720
|
getConnectionsNeedingConfirmation() {
|
|
713
721
|
return Array.from(this.connections.values()).filter(
|
|
714
|
-
(conn) => conn.needsConfirmation &&
|
|
722
|
+
(conn) => conn.needsConfirmation && !this.filterPendingAccountIds.has(conn.targetAccountId)
|
|
715
723
|
);
|
|
716
724
|
}
|
|
717
725
|
/**
|
|
@@ -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';\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 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 */\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 };\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 };\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 });\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 });\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 });\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 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 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 });\n }\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 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 });\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 });\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 this.hasEstablishedConnectionWithAccount(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 this.hasEstablishedConnectionWithAccount(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 this.hasEstablishedConnectionWithAccount(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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AAK,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
|
+
{"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 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 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 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 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 this.hasEstablishedConnectionWithAccount(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,YAA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|
|
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];
|
|
11
14
|
});
|
|
12
|
-
headers.normalize();
|
|
13
|
-
return data;
|
|
14
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
|
+
};
|
|
15
32
|
export {
|
|
16
|
-
|
|
33
|
+
AxiosURLSearchParams as default
|
|
17
34
|
};
|
|
18
35
|
//# sourceMappingURL=standards-sdk.es100.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es100.js","sources":["../../node_modules/axios/lib/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es100.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,7 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import utils from "./standards-sdk.es38.js";
|
|
2
|
+
import defaults from "./standards-sdk.es42.js";
|
|
3
|
+
import AxiosHeaders from "./standards-sdk.es52.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;
|
|
3
14
|
}
|
|
4
15
|
export {
|
|
5
|
-
|
|
16
|
+
transformData as default
|
|
6
17
|
};
|
|
7
18
|
//# sourceMappingURL=standards-sdk.es101.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es101.js","sources":["../../node_modules/axios/lib/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es101.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,7 +1,7 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function isAbsoluteURL(url) {
|
|
2
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url);
|
|
3
3
|
}
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
isAbsoluteURL as default
|
|
6
6
|
};
|
|
7
7
|
//# sourceMappingURL=standards-sdk.es102.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es102.js","sources":["../../node_modules/axios/lib/helpers/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es102.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,19 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
function combineURLs(baseURL, relativeURL) {
|
|
2
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
15
3
|
}
|
|
16
4
|
export {
|
|
17
|
-
|
|
5
|
+
combineURLs as default
|
|
18
6
|
};
|
|
19
7
|
//# sourceMappingURL=standards-sdk.es103.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es103.js","sources":["../../node_modules/axios/lib/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es103.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,8 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import AxiosError from "./standards-sdk.es49.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
|
+
}
|
|
4
15
|
}
|
|
5
16
|
export {
|
|
6
|
-
|
|
17
|
+
settle as default
|
|
7
18
|
};
|
|
8
19
|
//# sourceMappingURL=standards-sdk.es104.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es104.js","sources":["../../node_modules/axios/lib/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es104.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]}
|