@magic-xpa/utils 4.1300.0-dev4130.143 → 4.1300.0-dev4130.145
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,8 +1,5 @@
|
|
|
1
1
|
import { Encoding, StringBuilder, Hashtable, Stack, NChar, NNumber, NString, RefParam, isNullOrUndefined, DateTime, ISO_8859_1_Encoding, ApplicationException, Int32, Exception, List, Thread, Debug } from '@magic-xpa/mscorelib';
|
|
2
2
|
import { XMLParser } from 'fast-xml-parser';
|
|
3
|
-
import { io } from 'socket.io-client';
|
|
4
|
-
import { Subject } from 'rxjs';
|
|
5
|
-
import { filter } from 'rxjs/operators';
|
|
6
3
|
|
|
7
4
|
/// <summary>JPN: DBCS support
|
|
8
5
|
/// Utility Class for String
|
|
@@ -4981,7 +4978,8 @@ class InternalInterface {
|
|
|
4981
4978
|
static MG_ACT_CONTEXT_TIMEOUT_RESET = 636;
|
|
4982
4979
|
static MG_ACT_CONTEXT_REMOVE = 647;
|
|
4983
4980
|
static MG_ACT_DUMP_ENVIRONMENT = 653;
|
|
4984
|
-
static
|
|
4981
|
+
static MG_ACT_PUBSUB_TOPIC_PUBLISHED = 659;
|
|
4982
|
+
static MG_ACT_TOT_CNT = 660;
|
|
4985
4983
|
// NEW INTERNAL EVENTS
|
|
4986
4984
|
static MG_ACT_TASK_PREFIX = 1001;
|
|
4987
4985
|
static MG_ACT_TASK_SUFFIX = 1002;
|
|
@@ -5773,152 +5771,6 @@ class StorageAttributeCheck {
|
|
|
5773
5771
|
}
|
|
5774
5772
|
}
|
|
5775
5773
|
|
|
5776
|
-
class SubscriberClient {
|
|
5777
|
-
static instance;
|
|
5778
|
-
socket;
|
|
5779
|
-
subscribedTopics = new Set();
|
|
5780
|
-
messageSubject = new Subject();
|
|
5781
|
-
subscriptionsDataSubject = new Subject();
|
|
5782
|
-
constructor(serverURI) {
|
|
5783
|
-
// Connect to the Socket.IO server with subscriber role
|
|
5784
|
-
const serverUrl = serverURI; //Environment.Instance.GetPubSubServerURI();
|
|
5785
|
-
this.socket = io(serverUrl, {
|
|
5786
|
-
query: {
|
|
5787
|
-
role: 'subscriber',
|
|
5788
|
-
token: 'abc123' // Default token for testing; replace with actual authentication
|
|
5789
|
-
}
|
|
5790
|
-
});
|
|
5791
|
-
// Handle connection
|
|
5792
|
-
this.socket.on('connect', () => {
|
|
5793
|
-
console.log('Connected to server as subscriber:', this.socket.id);
|
|
5794
|
-
});
|
|
5795
|
-
// Handle disconnection
|
|
5796
|
-
this.socket.on('disconnect', () => {
|
|
5797
|
-
console.log('Disconnected from server');
|
|
5798
|
-
this.subscribedTopics.clear();
|
|
5799
|
-
});
|
|
5800
|
-
// Handle subscription confirmation
|
|
5801
|
-
this.socket.on('subscribed', (data) => {
|
|
5802
|
-
this.subscribedTopics.add(data.topic);
|
|
5803
|
-
console.log('Subscribed to topic:', data.topic, data.message);
|
|
5804
|
-
});
|
|
5805
|
-
// Handle unsubscription confirmation
|
|
5806
|
-
this.socket.on('unsubscribed', (data) => {
|
|
5807
|
-
this.subscribedTopics.delete(data.topic);
|
|
5808
|
-
console.log('Unsubscribed from topic:', data.topic, data.message);
|
|
5809
|
-
});
|
|
5810
|
-
// Handle errors
|
|
5811
|
-
this.socket.on('error', (error) => {
|
|
5812
|
-
console.error('Socket error:', error.message);
|
|
5813
|
-
});
|
|
5814
|
-
// Handle incoming messages
|
|
5815
|
-
this.socket.on('message', (data) => {
|
|
5816
|
-
this.messageSubject.next(data);
|
|
5817
|
-
console.warn("message", data);
|
|
5818
|
-
});
|
|
5819
|
-
// Handle subscriptions data
|
|
5820
|
-
this.socket.on('subscriptionsData', (data) => {
|
|
5821
|
-
this.subscriptionsDataSubject.next(data);
|
|
5822
|
-
});
|
|
5823
|
-
}
|
|
5824
|
-
/**
|
|
5825
|
-
* Get the singleton instance of SubscriberClient
|
|
5826
|
-
*/
|
|
5827
|
-
static getInstance(serverURI) {
|
|
5828
|
-
if (!SubscriberClient.instance) {
|
|
5829
|
-
SubscriberClient.instance = new SubscriberClient(serverURI);
|
|
5830
|
-
}
|
|
5831
|
-
return SubscriberClient.instance;
|
|
5832
|
-
}
|
|
5833
|
-
/**
|
|
5834
|
-
* Subscribe to a specific topic
|
|
5835
|
-
* @param topic The topic to subscribe to
|
|
5836
|
-
*/
|
|
5837
|
-
subscribe(topic) {
|
|
5838
|
-
if (!this.subscribedTopics.has(topic)) {
|
|
5839
|
-
this.socket.emit('subscribe', topic);
|
|
5840
|
-
}
|
|
5841
|
-
}
|
|
5842
|
-
/**
|
|
5843
|
-
* Subscribe to multiple topics at once
|
|
5844
|
-
* @param topics Array of topics to subscribe to
|
|
5845
|
-
*/
|
|
5846
|
-
subscribeToTopics(topics) {
|
|
5847
|
-
topics.forEach(topic => this.subscribe(topic));
|
|
5848
|
-
}
|
|
5849
|
-
/**
|
|
5850
|
-
* Unsubscribe from a specific topic
|
|
5851
|
-
* @param topic The topic to unsubscribe from
|
|
5852
|
-
*/
|
|
5853
|
-
unsubscribe(topic) {
|
|
5854
|
-
if (this.subscribedTopics.has(topic)) {
|
|
5855
|
-
this.socket.emit('unsubscribe', topic);
|
|
5856
|
-
}
|
|
5857
|
-
}
|
|
5858
|
-
/**
|
|
5859
|
-
* Unsubscribe from multiple topics at once
|
|
5860
|
-
* @param topics Array of topics to unsubscribe from
|
|
5861
|
-
*/
|
|
5862
|
-
unsubscribeFromTopics(topics) {
|
|
5863
|
-
topics.forEach(topic => this.unsubscribe(topic));
|
|
5864
|
-
}
|
|
5865
|
-
/**
|
|
5866
|
-
* Unsubscribe from all topics
|
|
5867
|
-
*/
|
|
5868
|
-
unsubscribeFromAll() {
|
|
5869
|
-
this.subscribedTopics.forEach(topic => this.unsubscribe(topic));
|
|
5870
|
-
}
|
|
5871
|
-
/**
|
|
5872
|
-
* Check if subscribed to a specific topic
|
|
5873
|
-
* @param topic The topic to check
|
|
5874
|
-
* @returns true if subscribed, false otherwise
|
|
5875
|
-
*/
|
|
5876
|
-
isSubscribed(topic) {
|
|
5877
|
-
return this.subscribedTopics.has(topic);
|
|
5878
|
-
}
|
|
5879
|
-
/**
|
|
5880
|
-
* Get all currently subscribed topics
|
|
5881
|
-
* @returns Array of subscribed topics
|
|
5882
|
-
*/
|
|
5883
|
-
getSubscribedTopics() {
|
|
5884
|
-
return Array.from(this.subscribedTopics);
|
|
5885
|
-
}
|
|
5886
|
-
/**
|
|
5887
|
-
* Get an Observable for incoming messages from all subscribed topics
|
|
5888
|
-
* @returns Observable that emits message data
|
|
5889
|
-
*/
|
|
5890
|
-
onMessage() {
|
|
5891
|
-
return this.messageSubject.asObservable();
|
|
5892
|
-
}
|
|
5893
|
-
/**
|
|
5894
|
-
* Get an Observable for incoming messages from a specific topic
|
|
5895
|
-
* @param topic The topic to filter messages for
|
|
5896
|
-
* @returns Observable that emits message data for the specified topic
|
|
5897
|
-
*/
|
|
5898
|
-
onMessageForTopic(topic) {
|
|
5899
|
-
return this.messageSubject.asObservable().pipe(filter((data) => data.topic === topic));
|
|
5900
|
-
}
|
|
5901
|
-
/**
|
|
5902
|
-
* Get current subscriptions (for debugging)
|
|
5903
|
-
*/
|
|
5904
|
-
getSubscriptions() {
|
|
5905
|
-
this.socket.emit('getSubscriptions');
|
|
5906
|
-
}
|
|
5907
|
-
/**
|
|
5908
|
-
* Listen for subscriptions data
|
|
5909
|
-
* @returns Observable that emits subscriptions list
|
|
5910
|
-
*/
|
|
5911
|
-
onSubscriptionsData() {
|
|
5912
|
-
return this.subscriptionsDataSubject.asObservable();
|
|
5913
|
-
}
|
|
5914
|
-
/**
|
|
5915
|
-
* Disconnect from the server
|
|
5916
|
-
*/
|
|
5917
|
-
disconnect() {
|
|
5918
|
-
this.socket.disconnect();
|
|
5919
|
-
}
|
|
5920
|
-
}
|
|
5921
|
-
|
|
5922
5774
|
/// <summary>
|
|
5923
5775
|
/// Helper class for synchronized execution.
|
|
5924
5776
|
/// It works by creating a promise and then waiting for the promise to be completed
|
|
@@ -6641,5 +6493,5 @@ class XmlParser {
|
|
|
6641
6493
|
* Generated bundle index. Do not edit.
|
|
6642
6494
|
*/
|
|
6643
6495
|
|
|
6644
|
-
export { APGDisplayMode, APGFormSize, APGInvokedFrom, APGMode, APGOption, APGType, Access, AlignmentTypeHori, AlignmentTypeVert, AllowedDirectionType, Area, AutoFit, Axis, Base64, BindingLevel, BlobContent, BlockTypes, BorderType, BottomPositionInterval, BoxDir, BrkLevel, BrkScope, BrkType, CacheStrategy, CallComOption, CallOperationMode, CallOsShow, CallUDPType, CallUdpConvention, CallWsStyle, CallbackType, CharacterSet, CheckExist, CheckboxMainStyle, ChoiceControlStyle, ChoiceUtils, ColumnUpdateStyle, CompTypes, ComponentItemType, Constants, ControlStyle, CtrlButtonType, CtrlButtonTypeGui, CtrlHotspotType, CtrlImageStyle, CtrlLineDirection, CtrlLineType, CtrlOleDisplayType, CtrlOleStoreType, CtrlTextType, DBHCache, DBHRowIdentifier, DataTranslation, DataViewHeaderType, DataViewOperationType, DataViewOutputType, DatabaseDataType, DatabaseDefinitionType, DatabaseFilters, DatabaseOperations, DataviewType, DateTimeUtils, DateUtil, DbDelUpdMode, DbOpen, DbShare, DbhKeyDirection, DbhKeyIndexType, DbhKeyMode, DbhKeyRangeMode, DbhSegmentDirection, DefaultMsgDetails, DisplayTextType, DitAttribute, DitType, DriverDB, DspInterface, EndMode, EngineDirect, EnterAnimation, ErrStrategy, ErrorClassific, ExeState, ExecOn, ExitAnimation, ExportType, FieldComAlloc, FieldComType, FieldViewModelType, FldStorage, FldStyle, FlowDirection, FlwMode, ForceExit, FormDelimiter, FormExpandType, FormOperationType, FormPage, FrameLayoutTypes, GradientStyle, HTML_2_STR, HelpCommand, HelpType, HtmlAlignmentType, HttpStatusCode, ImageEffects, InitialMode, InternalInterface, ItemMasks, JSON_Utils, KeyMode, KeyboardReturnKeys, KeyboardTypes, LDir, LineDirection, LineManipulationType, ListboxSelectionMode, LnkEval_Cond, LnkMode, LoadedValues, LockingStrategy, LogType, Logger, Logger_LogLevels, Logger_MessageDirection, LogicHeaderAction, LogicHeaderType, LogicLevel, LogicOperationType, LogicUnit, MagicProperties, MediaAccess, MediaFormat, MediaOrientation, MediaType, MgControlType, MgModelType, Misc, ModelAttGuiFrame, ModelAttMerge, ModelAttRichClientFrameSet, ModelAttrBrowser, ModelAttrField, ModelAttrFramesetForm, ModelAttrGui0, ModelAttrGui1, ModelAttrHelp, ModelAttrRichClient, ModelAttrText, ModelClass, MsgInterface, NotifyCollectionChangedAction, NullArithmetic, OSEnvironment, OSType, OpenEditDialog, Opr, Order, OrientationLock, PICInterface, PaperSize, PaperSizePdfDisabled, PaperSizePdfEnabled, PositionUsage, PrgExecPlace, Priority, Queue, RaiseAt, Randomizer, RangeMode, RbAppearance, Recursion, RemarkType, RequestInfo, Resident, RowType, Rtf, Rtf_ACTN, Rtf_ErrorRtf, Rtf_IDEST, Rtf_IPFN, Rtf_IPROP, Rtf_KWD, Rtf_PROP, Rtf_PROPTYPE, Rtf_RDS, Rtf_RIS, Rtf_RtfChar, Rtf_SYMBOL, SEQ_2_HTML, SEQ_2_STR, ScrollBarThumbType, SelprgMode, SideType, SliderType, SourceContextType, SplitPrimaryDisplay, SplitWindowType, StartupMode, Storage, StorageAttribute, StorageAttributeCheck, StorageAttributeType, StrUtil, SubformType,
|
|
6496
|
+
export { APGDisplayMode, APGFormSize, APGInvokedFrom, APGMode, APGOption, APGType, Access, AlignmentTypeHori, AlignmentTypeVert, AllowedDirectionType, Area, AutoFit, Axis, Base64, BindingLevel, BlobContent, BlockTypes, BorderType, BottomPositionInterval, BoxDir, BrkLevel, BrkScope, BrkType, CacheStrategy, CallComOption, CallOperationMode, CallOsShow, CallUDPType, CallUdpConvention, CallWsStyle, CallbackType, CharacterSet, CheckExist, CheckboxMainStyle, ChoiceControlStyle, ChoiceUtils, ColumnUpdateStyle, CompTypes, ComponentItemType, Constants, ControlStyle, CtrlButtonType, CtrlButtonTypeGui, CtrlHotspotType, CtrlImageStyle, CtrlLineDirection, CtrlLineType, CtrlOleDisplayType, CtrlOleStoreType, CtrlTextType, DBHCache, DBHRowIdentifier, DataTranslation, DataViewHeaderType, DataViewOperationType, DataViewOutputType, DatabaseDataType, DatabaseDefinitionType, DatabaseFilters, DatabaseOperations, DataviewType, DateTimeUtils, DateUtil, DbDelUpdMode, DbOpen, DbShare, DbhKeyDirection, DbhKeyIndexType, DbhKeyMode, DbhKeyRangeMode, DbhSegmentDirection, DefaultMsgDetails, DisplayTextType, DitAttribute, DitType, DriverDB, DspInterface, EndMode, EngineDirect, EnterAnimation, ErrStrategy, ErrorClassific, ExeState, ExecOn, ExitAnimation, ExportType, FieldComAlloc, FieldComType, FieldViewModelType, FldStorage, FldStyle, FlowDirection, FlwMode, ForceExit, FormDelimiter, FormExpandType, FormOperationType, FormPage, FrameLayoutTypes, GradientStyle, HTML_2_STR, HelpCommand, HelpType, HtmlAlignmentType, HttpStatusCode, ImageEffects, InitialMode, InternalInterface, ItemMasks, JSON_Utils, KeyMode, KeyboardReturnKeys, KeyboardTypes, LDir, LineDirection, LineManipulationType, ListboxSelectionMode, LnkEval_Cond, LnkMode, LoadedValues, LockingStrategy, LogType, Logger, Logger_LogLevels, Logger_MessageDirection, LogicHeaderAction, LogicHeaderType, LogicLevel, LogicOperationType, LogicUnit, MagicProperties, MediaAccess, MediaFormat, MediaOrientation, MediaType, MgControlType, MgModelType, Misc, ModelAttGuiFrame, ModelAttMerge, ModelAttRichClientFrameSet, ModelAttrBrowser, ModelAttrField, ModelAttrFramesetForm, ModelAttrGui0, ModelAttrGui1, ModelAttrHelp, ModelAttrRichClient, ModelAttrText, ModelClass, MsgInterface, NotifyCollectionChangedAction, NullArithmetic, OSEnvironment, OSType, OpenEditDialog, Opr, Order, OrientationLock, PICInterface, PaperSize, PaperSizePdfDisabled, PaperSizePdfEnabled, PositionUsage, PrgExecPlace, Priority, Queue, RaiseAt, Randomizer, RangeMode, RbAppearance, Recursion, RemarkType, RequestInfo, Resident, RowType, Rtf, Rtf_ACTN, Rtf_ErrorRtf, Rtf_IDEST, Rtf_IPFN, Rtf_IPROP, Rtf_KWD, Rtf_PROP, Rtf_PROPTYPE, Rtf_RDS, Rtf_RIS, Rtf_RtfChar, Rtf_SYMBOL, SEQ_2_HTML, SEQ_2_STR, ScrollBarThumbType, SelprgMode, SideType, SliderType, SourceContextType, SplitPrimaryDisplay, SplitWindowType, StartupMode, Storage, StorageAttribute, StorageAttributeCheck, StorageAttributeType, StrUtil, SubformType, SyncExecutionHelper, TabControlTabsWidth, TabbingCycleType, TabbingOrderType, TableBehaviour, TableType, TaskFlow, TransBegin, TransMode, TriggerType, TrueFalseValues, UndoRedoAction, UniqueTskSort, UpdateMode, UseSQLCursor, UtilDateJpn, UtilImeJpn, UtilStrByteMode, ValType, VeeDiffUpdate, VeeMode, VeePartOfDataview, VerifyButtons, VerifyDisplay, VerifyImage, VerifyMode, ViewRefreshMode, ViewSelectType, WinCptn, WinHtmlType, WinUom, WindowPosition, WindowType, XMLConstants, XmlParser, YesNoValues };
|
|
6645
6497
|
//# sourceMappingURL=magic-xpa-utils.mjs.map
|