@@ -82,6 +82,13 @@ module SocketIO {
82
82
}
83
83
84
84
override DataFlow:: SourceNode ref ( ) { result = server ( DataFlow:: TypeTracker:: end ( ) ) }
85
+
86
+ /**
87
+ * DEPRECATED. Always returns `this` as a `ServerObject` now represents the origin of a server.
88
+ *
89
+ * Instead of `getOrigin()` to get a server origin from a reference, use `ServerObject.ref()` to get references to a given server.
90
+ */
91
+ deprecated DataFlow:: SourceNode getOrigin ( ) { result = this }
85
92
}
86
93
87
94
/** A data flow node that may produce (that is, create or return) a socket.io server. */
@@ -270,6 +277,21 @@ module SocketIO {
270
277
}
271
278
272
279
override string getChannel ( ) { this .getArgument ( 0 ) .mayHaveStringValue ( result ) }
280
+
281
+ /** Gets a parameter through which data is received from a client. */
282
+ DataFlow:: SourceNode getAReceivedItem ( ) { result = getReceivedItem ( _) }
283
+
284
+ /** Gets a client-side node that may be sending the data received here. */
285
+ SendNode getASender ( ) { result .getAReceiver ( ) = this }
286
+
287
+ /** Gets the acknowledgment callback, if any. */
288
+ DataFlow:: FunctionNode getAck ( ) {
289
+ result = getListener ( ) .getLastParameter ( ) and
290
+ exists ( result .getAnInvocation ( ) )
291
+ }
292
+
293
+ /** DEPRECATED. Use `getChannel()` instead. */
294
+ deprecated string getEventName ( ) { result = getChannel ( ) }
273
295
}
274
296
275
297
/** An acknowledgment callback when receiving a message. */
@@ -350,6 +372,16 @@ module SocketIO {
350
372
override SocketIOClient:: ReceiveNode getAReceiver ( ) {
351
373
result .getSocket ( ) .getATargetNamespace ( ) = getNamespace ( )
352
374
}
375
+
376
+ /** Gets the acknowledgment callback, if any. */
377
+ DataFlow:: FunctionNode getAck ( ) {
378
+ // acknowledgments are only available when sending through a socket
379
+ exists ( getSocket ( ) ) and
380
+ result = getLastArgument ( ) .getALocalSource ( )
381
+ }
382
+
383
+ /** DEPRECATED. Use `getChannel()` instead. */
384
+ deprecated string getEventName ( ) { result = getChannel ( ) }
353
385
}
354
386
355
387
/** A socket.io namespace, identified by its server and its path. */
@@ -538,6 +570,21 @@ module SocketIOClient {
538
570
result != cb .getLastParameter ( ) or not exists ( result .getAnInvocation ( ) )
539
571
)
540
572
}
573
+
574
+ /** Gets a data flow node representing data received from the server. */
575
+ DataFlow:: SourceNode getAReceivedItem ( ) { result = getReceivedItem ( _) }
576
+
577
+ /** Gets the acknowledgment callback, if any. */
578
+ DataFlow:: FunctionNode getAck ( ) {
579
+ result = getListener ( ) .getLastParameter ( ) and
580
+ exists ( result .getAnInvocation ( ) )
581
+ }
582
+
583
+ /** Gets a server-side node that may be sending the data received here. */
584
+ SocketIO:: SendNode getASender ( ) {
585
+ result .getNamespace ( ) = getSocket ( ) .getATargetNamespace ( ) and
586
+ not result .getChannel ( ) != getChannel ( )
587
+ }
541
588
}
542
589
543
590
/** An acknowledgment callback from a receive node. */
@@ -607,10 +654,23 @@ module SocketIOClient {
607
654
)
608
655
}
609
656
657
+ /** Gets a data flow node representing data sent to the client. */
658
+ DataFlow:: Node getASentItem ( ) { result = getSentItem ( _) }
659
+
610
660
/** Gets a server-side node that may be receiving the data sent here. */
611
661
override SocketIO:: ReceiveNode getAReceiver ( ) {
612
662
result .getSocket ( ) .getNamespace ( ) = getSocket ( ) .getATargetNamespace ( )
613
663
}
664
+
665
+ /** Gets the acknowledgment callback, if any. */
666
+ DataFlow:: FunctionNode getAck ( ) {
667
+ // acknowledgments are only available when sending through a socket
668
+ exists ( getSocket ( ) ) and
669
+ result = getLastArgument ( ) .getALocalSource ( )
670
+ }
671
+
672
+ /** DEPRECATED. Use `getChannel()` instead. */
673
+ deprecated string getEventName ( ) { result = getChannel ( ) }
614
674
}
615
675
616
676
/**
0 commit comments