@magic-xpa/utils 4.1300.0-dev4130.2 → 4.1300.0-dev4130.200
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/fesm2022/magic-xpa-utils.mjs +25 -3
- package/fesm2022/magic-xpa-utils.mjs.map +1 -1
- package/package.json +8 -6
- package/types/magic-xpa-utils.d.ts +2848 -0
- package/index.d.ts +0 -29
- package/src/Base64.d.ts +0 -17
- package/src/ChoiceUtils.d.ts +0 -5
- package/src/Constants.d.ts +0 -71
- package/src/DateTimeUtils.d.ts +0 -5
- package/src/DateUtil.d.ts +0 -6
- package/src/InternalInterface.d.ts +0 -337
- package/src/JSON_Utils.d.ts +0 -3
- package/src/Logger.d.ts +0 -49
- package/src/MagicConstants.d.ts +0 -9
- package/src/Misc.d.ts +0 -13
- package/src/MsgInterface.d.ts +0 -180
- package/src/PICInterface.d.ts +0 -50
- package/src/PlatformUtils.d.ts +0 -5
- package/src/Queue.d.ts +0 -9
- package/src/Randomizer.d.ts +0 -14
- package/src/RequestInfo.d.ts +0 -15
- package/src/Rtf.d.ts +0 -152
- package/src/StorageAttribute.d.ts +0 -14
- package/src/StrUtil.d.ts +0 -46
- package/src/SyncExecutionHelper.d.ts +0 -7
- package/src/UtilDateJpn.d.ts +0 -19
- package/src/UtilImeJpn.d.ts +0 -9
- package/src/UtilStrByteMode.d.ts +0 -27
- package/src/XMLConstants.d.ts +0 -170
- package/src/Xml/XmlParser.d.ts +0 -34
- package/src/enums.d.ts +0 -1564
|
@@ -1,5 +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
|
-
import {
|
|
2
|
+
import { XMLParser } from 'fast-xml-parser';
|
|
3
3
|
|
|
4
4
|
/// <summary>JPN: DBCS support
|
|
5
5
|
/// Utility Class for String
|
|
@@ -4978,7 +4978,8 @@ class InternalInterface {
|
|
|
4978
4978
|
static MG_ACT_CONTEXT_TIMEOUT_RESET = 636;
|
|
4979
4979
|
static MG_ACT_CONTEXT_REMOVE = 647;
|
|
4980
4980
|
static MG_ACT_DUMP_ENVIRONMENT = 653;
|
|
4981
|
-
static
|
|
4981
|
+
static MG_ACT_PUBSUB_TOPIC_PUBLISHED = 659;
|
|
4982
|
+
static MG_ACT_TOT_CNT = 660;
|
|
4982
4983
|
// NEW INTERNAL EVENTS
|
|
4983
4984
|
static MG_ACT_TASK_PREFIX = 1001;
|
|
4984
4985
|
static MG_ACT_TASK_SUFFIX = 1002;
|
|
@@ -5020,9 +5021,30 @@ class InternalInterface {
|
|
|
5020
5021
|
}
|
|
5021
5022
|
}
|
|
5022
5023
|
|
|
5024
|
+
const parser = new XMLParser({
|
|
5025
|
+
ignoreAttributes: false,
|
|
5026
|
+
attributeNamePrefix: "",
|
|
5027
|
+
attributesGroupName: "$",
|
|
5028
|
+
textNodeName: "_",
|
|
5029
|
+
parseTagValue: false,
|
|
5030
|
+
parseAttributeValue: false,
|
|
5031
|
+
trimValues: false,
|
|
5032
|
+
isArray: (_name, jPath, _isLeafNode, isAttribute) => {
|
|
5033
|
+
if (isAttribute) {
|
|
5034
|
+
return false;
|
|
5035
|
+
}
|
|
5036
|
+
// Keep root object shape as xml2js default; force arrays for child elements.
|
|
5037
|
+
return jPath.indexOf(".") !== -1;
|
|
5038
|
+
}
|
|
5039
|
+
});
|
|
5023
5040
|
class JSON_Utils {
|
|
5024
5041
|
static JSONFromXML(xml, onComplete) {
|
|
5025
|
-
|
|
5042
|
+
try {
|
|
5043
|
+
onComplete(null, parser.parse(xml));
|
|
5044
|
+
}
|
|
5045
|
+
catch (error) {
|
|
5046
|
+
onComplete(error, null);
|
|
5047
|
+
}
|
|
5026
5048
|
}
|
|
5027
5049
|
}
|
|
5028
5050
|
|