aotrautils 0.0.955 → 0.0.956

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
 
3
- /*utils COMMONS library associated with aotra version : «1_29072022-2359 (15/04/2024-02:47:27)»*/
3
+ /*utils COMMONS library associated with aotra version : «1_29072022-2359 (15/04/2024-02:50:48)»*/
4
4
  /*-----------------------------------------------------------------------------*/
5
5
 
6
6
 
@@ -5275,7 +5275,7 @@ AOTRAUTILS_LIB_IS_LOADED=true;
5275
5275
 
5276
5276
 
5277
5277
 
5278
- /*utils CLIENT library associated with aotra version : «1_29072022-2359 (15/04/2024-02:47:27)»*/
5278
+ /*utils CLIENT library associated with aotra version : «1_29072022-2359 (15/04/2024-02:50:48)»*/
5279
5279
  /*-----------------------------------------------------------------------------*/
5280
5280
  /* ## Utility global methods in a browser (htmljs) client environment.
5281
5281
  *
@@ -13486,7 +13486,7 @@ createOritaMicroClient=function(url, port, isNode=false, staticMicroClientIdPara
13486
13486
 
13487
13487
 
13488
13488
 
13489
- /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (15/04/2024-02:47:27)»*/
13489
+ /*utils GEOMETRY library associated with aotra version : «1_29072022-2359 (15/04/2024-02:50:48)»*/
13490
13490
  /*-----------------------------------------------------------------------------*/
13491
13491
 
13492
13492
 
@@ -14725,7 +14725,7 @@ function rayVsUnitSphereClosestPoint(p, r) {
14725
14725
  // MUST REMAIN AT THE END OF THIS LIBRARY FILE !
14726
14726
 
14727
14727
  AOTRAUTILS_GEOMETRY_LIB_IS_LOADED=true;
14728
- /*utils SERVER library associated with aotra version : «1_29072022-2359 (15/04/2024-02:47:27)»*/
14728
+ /*utils SERVER library associated with aotra version : «1_29072022-2359 (15/04/2024-02:50:48)»*/
14729
14729
  /*-----------------------------------------------------------------------------*/
14730
14730
 
14731
14731
 
@@ -15517,6 +15517,51 @@ WebsocketImplementation={
15517
15517
  },
15518
15518
 
15519
15519
 
15520
+
15521
+ // TODO : FIXME : DUPLICATED CODE !
15522
+ sendChainable:(channelNameParam, data, clientsRoomsTag=null)=>{
15523
+
15524
+ // DBG
15525
+ lognow(">>>>>>sendChainable NODE CLIENT ("+channelNameParam+"):data:",data);
15526
+
15527
+ // We add a message id :
15528
+ const messageId=getUUID();
15529
+ data.messageId=messageId;
15530
+
15531
+ // 1) We prepare the reception :
15532
+ const resultPromise={
15533
+ clientsRoomsTag:clientsRoomsTag,
15534
+ messageId:messageId,
15535
+ thenWhenReceiveMessageType:(channelNameForResponse, listenerConfig={messageType:"",condition:()=>true}, doOnIncomingMessageForResponse)=>{
15536
+ const listenerId=nonull(listenerConfig.messageType,"");
15537
+
15538
+ nodeClientInstance.receive(channelNameForResponse, (dataLocal, clientSocket)=>{
15539
+
15540
+
15541
+ // We check if the message matches the condition :
15542
+ if(listenerConfig.condition && !listenerConfig.condition(dataLocal, clientSocket)) return ;
15543
+
15544
+ // We check if we have the same message id:
15545
+ if(resultPromise.messageId!==dataLocal.messageId){
15546
+ // DBG
15547
+ lognow("resultPromise.messageId:"+resultPromise.messageId+"|dataLocal.messageId"+dataLocal.messageId);
15548
+ return;
15549
+ }
15550
+
15551
+ doOnIncomingMessageForResponse(dataLocal, clientSocket);
15552
+ }, resultPromise.clientsRoomsTag, listenerId, {destroyListenerAfterReceiving:true});
15553
+ return resultPromise;
15554
+ }
15555
+ };
15556
+
15557
+ // 2) We send the data :
15558
+ nodeClientInstance.send(channelNameParam, data, clientsRoomsTag);
15559
+
15560
+
15561
+ return resultPromise;
15562
+ },
15563
+
15564
+
15520
15565
  send:(channelNameParam, data, clientsRoomsTag=null)=>{
15521
15566
 
15522
15567
  // // DBG
@@ -15716,16 +15761,12 @@ WebsocketImplementation={
15716
15761
  },
15717
15762
 
15718
15763
 
15719
-
15720
-
15721
-
15722
15764
 
15723
-
15765
+ // TODO : FIXME : DUPLICATED CODE !
15724
15766
  sendChainable:(channelNameParam, data, clientsRoomsTag=null)=>{
15725
15767
 
15726
-
15727
15768
  // DBG
15728
- lognow(">>>>>>sendChainable("+channelNameParam+"):data:",data);
15769
+ lognow(">>>>>>sendChainable BROWSER CLIENT ("+channelNameParam+"):data:",data);
15729
15770
 
15730
15771
  // We add a message id :
15731
15772
  const messageId=getUUID();
aotrautils/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aotrautils",
3
- "version": "0.0.955",
3
+ "version": "0.0.956",
4
4
  "main": "aotrautils.build.js",
5
5
  "description": "A library for vanilla javascript utils (client-side) used in aotra javascript CMS",
6
6
  "author": "Jeremie Ratomposon <info@alqemia.com> (https://alqemia.com)",