@microsoft/omnichannel-chat-sdk 1.4.4-main.461759e → 1.4.4-main.cbf6134
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/lib/tsconfig.tsbuildinfo
CHANGED
@@ -1522,7 +1522,7 @@
|
|
1522
1522
|
"affectsGlobalScope": false
|
1523
1523
|
},
|
1524
1524
|
"../src/validators/OmnichannelConfigValidator.ts": {
|
1525
|
-
"version": "
|
1525
|
+
"version": "08c65f7b916dd5867cc71ff4ea84ccdd76bfa15f6bf19c87edb6c2df0f0d2dcf",
|
1526
1526
|
"signature": "36754e9e735007b6b26e3eec4bad359eb7f0fe24ec837b7ca8cbf02ab7d289d7",
|
1527
1527
|
"affectsGlobalScope": false
|
1528
1528
|
},
|
@@ -5,12 +5,24 @@ var validateOmnichannelConfig = function (omnichannelConfig) {
|
|
5
5
|
if (!omnichannelConfig) {
|
6
6
|
throw new Error("OmnichannelConfiguration not found");
|
7
7
|
}
|
8
|
-
var currentOmnichannelConfigParams = Object.keys(omnichannelConfig);
|
9
8
|
for (var _i = 0, requiredOmnichannelConfigParams_1 = requiredOmnichannelConfigParams; _i < requiredOmnichannelConfigParams_1.length; _i++) {
|
10
9
|
var key = requiredOmnichannelConfigParams_1[_i];
|
11
|
-
|
10
|
+
//check for they key present in the map, if not present or value is undefined then throw error
|
11
|
+
var isPresent = Reflect.has(omnichannelConfig, key);
|
12
|
+
if (!isPresent) {
|
12
13
|
throw new Error("Missing '" + key + "' in OmnichannelConfiguration");
|
13
14
|
}
|
15
|
+
/**
|
16
|
+
* Since we know the keys that are required and we know those values are string,
|
17
|
+
* there is no point in make a generic function to validate the object and different
|
18
|
+
* types of values based on its type. We can just check for the keys and check if the value is empty or not.
|
19
|
+
*/
|
20
|
+
var propertyValue = Reflect.get(omnichannelConfig, key);
|
21
|
+
if (!propertyValue ||
|
22
|
+
(typeof propertyValue === "string" && propertyValue.trim().length === 0) ||
|
23
|
+
propertyValue.length === 0) {
|
24
|
+
throw new Error("Empty '" + key + "' in OmnichannelConfiguration");
|
25
|
+
}
|
14
26
|
}
|
15
27
|
};
|
16
28
|
exports.default = validateOmnichannelConfig;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"OmnichannelConfigValidator.js","sourceRoot":"","sources":["../../src/validators/OmnichannelConfigValidator.ts"],"names":[],"mappings":";;AAEA,IAAM,+BAA+B,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAExE,IAAM,yBAAyB,GAAG,UAAC,iBAAoC;IACnE,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACvD;IAED,
|
1
|
+
{"version":3,"file":"OmnichannelConfigValidator.js","sourceRoot":"","sources":["../../src/validators/OmnichannelConfigValidator.ts"],"names":[],"mappings":";;AAEA,IAAM,+BAA+B,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;AAExE,IAAM,yBAAyB,GAAG,UAAC,iBAAoC;IACnE,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;KACvD;IAED,KAAkB,UAA+B,EAA/B,mEAA+B,EAA/B,6CAA+B,EAA/B,IAA+B,EAAE;QAA9C,IAAM,GAAG,wCAAA;QACZ,8FAA8F;QAC9F,IAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;QAEtD,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,cAAY,GAAG,kCAA+B,CAAC,CAAC;SACjE;QAED;;;;UAIE;QACF,IAAM,aAAa,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;QAE1D,IAAI,CAAC,aAAa;YAChB,CAAC,OAAO,aAAa,KAAK,QAAQ,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;YACxE,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5B,MAAM,IAAI,KAAK,CAAC,YAAU,GAAG,kCAA+B,CAAC,CAAC;SAC/D;KACF;AACL,CAAC,CAAA;AAED,kBAAe,yBAAyB,CAAC"}
|