mftsccs-browser 1.1.59-beta → 1.1.60-beta

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.
@@ -16621,8 +16621,10 @@ __webpack_require__.r(__webpack_exports__);
16621
16621
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16622
16622
  /* harmony export */ FormatConceptsAndConnectionsNormalList: () => (/* binding */ FormatConceptsAndConnectionsNormalList),
16623
16623
  /* harmony export */ FormatFromConnectionsAlteredArrayExternal: () => (/* binding */ FormatFromConnectionsAlteredArrayExternal),
16624
+ /* harmony export */ FormatFromConnectionsAlteredArrayExternalJustId: () => (/* binding */ FormatFromConnectionsAlteredArrayExternalJustId),
16624
16625
  /* harmony export */ FormatFunctionData: () => (/* binding */ FormatFunctionData),
16625
16626
  /* harmony export */ FormatFunctionDataForData: () => (/* binding */ FormatFunctionDataForData),
16627
+ /* harmony export */ FormatFunctionDataForDataJustId: () => (/* binding */ FormatFunctionDataForDataJustId),
16626
16628
  /* harmony export */ formatFunction: () => (/* binding */ formatFunction),
16627
16629
  /* harmony export */ formatFunctionForData: () => (/* binding */ formatFunctionForData)
16628
16630
  /* harmony export */ });
@@ -16899,6 +16901,144 @@ function FormatFromConnectionsAlteredArrayExternal(connections_1, compositionDat
16899
16901
  return mainData;
16900
16902
  });
16901
16903
  }
16904
+ /**
16905
+ * ############ Format is Just Id and is used for list. ############
16906
+ * This is helpful in building a format that has multiple mainCompositions i.e. in the context of the list
16907
+ * The list format is helpful because you do not have to go over each individual query.
16908
+ * @param connections the type connections that need (external connections) to be passed
16909
+ * @param compositionData this is a dictionary type of format that has all the build compositions {id: { actual data}}
16910
+ * @param mainComposition this is list of ids of the main composition that builds the tree
16911
+ * @param reverse this is the list of connections ids that needs to go to the reverse direction (to---->from)
16912
+ * @returns
16913
+ */
16914
+ function FormatFromConnectionsAlteredArrayExternalJustId(connections_1, compositionData_1, mainComposition_1) {
16915
+ return __awaiter(this, arguments, void 0, function* (connections, compositionData, mainComposition, reverse = []) {
16916
+ var _a, _b, _c, _d;
16917
+ let startTime = new Date().getTime();
16918
+ let mainData = [];
16919
+ let myConcepts = [];
16920
+ for (let i = 0; i < connections.length; i++) {
16921
+ myConcepts.push(connections[i].toTheConceptId);
16922
+ myConcepts.push(connections[i].ofTheConceptId);
16923
+ myConcepts.push(connections[i].typeId);
16924
+ }
16925
+ connections.sort(function (x, y) {
16926
+ return y.id - x.id;
16927
+ });
16928
+ for (let i = 0; i < connections.length; i++) {
16929
+ let reverseFlag = false;
16930
+ let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);
16931
+ let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);
16932
+ if (reverse.includes(connections[i].id)) {
16933
+ reverseFlag = true;
16934
+ }
16935
+ if (reverseFlag == true) {
16936
+ if (ofTheConcept.id != 0 && toTheConcept.id != 0) {
16937
+ if (toTheConcept.id in compositionData) {
16938
+ let newData;
16939
+ let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);
16940
+ let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : "self";
16941
+ let flag = false;
16942
+ if (connections[i].toTheConceptId in compositionData) {
16943
+ flag = true;
16944
+ }
16945
+ if (connections[i].toTheConceptId in compositionData) {
16946
+ newData = compositionData[connections[i].toTheConceptId];
16947
+ let newType = typeof newData[key];
16948
+ if (newType == "string") {
16949
+ newData[key] = {};
16950
+ }
16951
+ }
16952
+ else {
16953
+ newData = {};
16954
+ newData[key] = {};
16955
+ compositionData[connections[i].toTheConceptId] = newData;
16956
+ }
16957
+ try {
16958
+ let isComp = compositionData[connections[i].ofTheConceptId];
16959
+ if (isComp) {
16960
+ let data = compositionData[connections[i].ofTheConceptId];
16961
+ data["id"] = ofTheConcept.id;
16962
+ let reverseCharater = linkerConcept.characterValue + "_reverse";
16963
+ if (Array.isArray(newData[key][reverseCharater])) {
16964
+ newData[key][reverseCharater].push(data);
16965
+ }
16966
+ else {
16967
+ if (reverseCharater.includes("_s_")) {
16968
+ newData[key][reverseCharater] = [];
16969
+ newData[key][reverseCharater].push(data);
16970
+ }
16971
+ else {
16972
+ newData[key][reverseCharater] = data;
16973
+ }
16974
+ }
16975
+ }
16976
+ }
16977
+ catch (ex) {
16978
+ console.log("this is error", ex);
16979
+ }
16980
+ }
16981
+ }
16982
+ }
16983
+ else {
16984
+ if (ofTheConcept.id != 0 && toTheConcept.id != 0) {
16985
+ if (ofTheConcept.id in compositionData) {
16986
+ let newData;
16987
+ let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);
16988
+ let key = (_d = (_c = ofTheConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : "self";
16989
+ let flag = false;
16990
+ if (connections[i].toTheConceptId in compositionData) {
16991
+ flag = true;
16992
+ }
16993
+ if (connections[i].ofTheConceptId in compositionData) {
16994
+ newData = compositionData[connections[i].ofTheConceptId];
16995
+ let newType = typeof newData[key];
16996
+ if (newType == "string") {
16997
+ newData[key] = {};
16998
+ }
16999
+ }
17000
+ else {
17001
+ newData = {};
17002
+ newData[key] = {};
17003
+ compositionData[connections[i].ofTheConceptId] = newData;
17004
+ }
17005
+ try {
17006
+ let isComp = compositionData[connections[i].toTheConceptId];
17007
+ if (isComp) {
17008
+ let data = compositionData[connections[i].toTheConceptId];
17009
+ data["id"] = toTheConcept.id;
17010
+ if (Array.isArray(newData[key][linkerConcept.characterValue])) {
17011
+ newData[key][linkerConcept.characterValue].push(data);
17012
+ }
17013
+ else {
17014
+ if (linkerConcept.characterValue.includes("_s_")) {
17015
+ newData[key][linkerConcept.characterValue] = [];
17016
+ newData[key][linkerConcept.characterValue].push(data);
17017
+ }
17018
+ else {
17019
+ newData[key][linkerConcept.characterValue] = data;
17020
+ }
17021
+ }
17022
+ }
17023
+ }
17024
+ catch (ex) {
17025
+ console.log("this is error", ex);
17026
+ }
17027
+ }
17028
+ }
17029
+ }
17030
+ }
17031
+ console.log("this is the main compositions", mainComposition);
17032
+ for (let i = 0; i < mainComposition.length; i++) {
17033
+ let mymainData = {};
17034
+ console.log("this is the main compositions DATA", compositionData[mainComposition[i]]);
17035
+ mymainData = compositionData[mainComposition[i]];
17036
+ mymainData["id"] = mainComposition[i];
17037
+ mainData.push(mymainData);
17038
+ }
17039
+ return mainData;
17040
+ });
17041
+ }
16902
17042
  /**
16903
17043
  *
16904
17044
  * ## Format Normal ##
@@ -17319,6 +17459,127 @@ function FormatFunctionDataForData(connections_1, compositionData_1) {
17319
17459
  return compositionData;
17320
17460
  });
17321
17461
  }
17462
+ /**
17463
+ * ## Format Just-Id ##
17464
+ * this function takes in connections and creates a single level objects so that all the data are added to its object/ array.
17465
+ * This is then passed on further for stiching.
17466
+ * @param connections
17467
+ * @param compositionData
17468
+ * @param reverse
17469
+ * @returns
17470
+ */
17471
+ function FormatFunctionDataForDataJustId(connections_1, compositionData_1) {
17472
+ return __awaiter(this, arguments, void 0, function* (connections, compositionData, reverse = []) {
17473
+ var _a, _b, _c, _d, _e, _f, _g, _h;
17474
+ let myConcepts = [];
17475
+ for (let i = 0; i < connections.length; i++) {
17476
+ myConcepts.push(connections[i].toTheConceptId);
17477
+ myConcepts.push(connections[i].ofTheConceptId);
17478
+ myConcepts.push(connections[i].typeId);
17479
+ }
17480
+ connections.sort(function (x, y) {
17481
+ return y.id - x.id;
17482
+ });
17483
+ for (let i = 0; i < connections.length; i++) {
17484
+ let reverseFlag = false;
17485
+ let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);
17486
+ let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);
17487
+ if (reverse.includes(connections[i].id)) {
17488
+ reverseFlag = true;
17489
+ }
17490
+ if (reverseFlag == true) {
17491
+ if (ofTheConcept.id != 0 && toTheConcept.id != 0) {
17492
+ let newData;
17493
+ let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);
17494
+ let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : "self";
17495
+ if (connections[i].toTheConceptId in compositionData) {
17496
+ newData = compositionData[connections[i].toTheConceptId];
17497
+ if (!(key in newData)) {
17498
+ newData[key] = {};
17499
+ }
17500
+ }
17501
+ else {
17502
+ newData = {};
17503
+ newData[key] = {};
17504
+ compositionData[connections[i].toTheConceptId] = newData;
17505
+ }
17506
+ try {
17507
+ let mytype = (_d = (_c = ofTheConcept === null || ofTheConcept === void 0 ? void 0 : ofTheConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : "none";
17508
+ let value = ofTheConcept.characterValue;
17509
+ let dataCharacter = linkerConcept.characterValue;
17510
+ // if there is not connection type defined then put the type of the destination concept.
17511
+ if (dataCharacter == "") {
17512
+ dataCharacter = mytype;
17513
+ dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);
17514
+ }
17515
+ let data = {
17516
+ "id": ofTheConcept.id,
17517
+ [mytype]: value
17518
+ };
17519
+ let reverseCharater = dataCharacter + "_reverse";
17520
+ if (reverseCharater.includes("_s_")) {
17521
+ // do nothing
17522
+ }
17523
+ else {
17524
+ if (typeof newData[key] == "string") {
17525
+ newData[key] = {};
17526
+ }
17527
+ newData[key][reverseCharater] = data;
17528
+ }
17529
+ }
17530
+ catch (ex) {
17531
+ console.log("this is error", ex);
17532
+ }
17533
+ }
17534
+ }
17535
+ else {
17536
+ if (ofTheConcept.id != 0 && toTheConcept.id != 0) {
17537
+ let newData;
17538
+ let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);
17539
+ let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : "self";
17540
+ if (connections[i].ofTheConceptId in compositionData) {
17541
+ newData = compositionData[connections[i].ofTheConceptId];
17542
+ if (!(key in newData)) {
17543
+ newData[key] = {};
17544
+ }
17545
+ }
17546
+ else {
17547
+ newData = {};
17548
+ newData[key] = {};
17549
+ compositionData[connections[i].ofTheConceptId] = newData;
17550
+ }
17551
+ try {
17552
+ let mytype = (_h = (_g = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _g === void 0 ? void 0 : _g.characterValue) !== null && _h !== void 0 ? _h : "none";
17553
+ let value = toTheConcept.characterValue;
17554
+ let dataCharacter = linkerConcept.characterValue;
17555
+ // if there is not connection type defined then put the type of the destination concept.
17556
+ if (dataCharacter == "") {
17557
+ dataCharacter = mytype;
17558
+ dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);
17559
+ }
17560
+ let data = {
17561
+ "id": toTheConcept.id,
17562
+ [mytype]: value
17563
+ };
17564
+ if (dataCharacter.includes("_s_")) {
17565
+ // do nothing
17566
+ }
17567
+ else {
17568
+ if (typeof newData[key] == "string") {
17569
+ newData[key] = {};
17570
+ }
17571
+ newData[key][dataCharacter] = data;
17572
+ }
17573
+ }
17574
+ catch (ex) {
17575
+ console.log("this is error", ex);
17576
+ }
17577
+ }
17578
+ }
17579
+ }
17580
+ return compositionData;
17581
+ });
17582
+ }
17322
17583
 
17323
17584
 
17324
17585
  /***/ }),
@@ -17864,6 +18125,7 @@ __webpack_require__.r(__webpack_exports__);
17864
18125
  /* harmony export */ SearchWithTypeAndLinkerDataId: () => (/* binding */ SearchWithTypeAndLinkerDataId),
17865
18126
  /* harmony export */ formatConnections: () => (/* binding */ formatConnections),
17866
18127
  /* harmony export */ formatConnectionsDataId: () => (/* binding */ formatConnectionsDataId),
18128
+ /* harmony export */ formatConnectionsJustId: () => (/* binding */ formatConnectionsJustId),
17867
18129
  /* harmony export */ formatDataArrayDataId: () => (/* binding */ formatDataArrayDataId),
17868
18130
  /* harmony export */ formatDataArrayNormal: () => (/* binding */ formatDataArrayNormal),
17869
18131
  /* harmony export */ formatLinkersNormal: () => (/* binding */ formatLinkersNormal)
@@ -17999,6 +18261,28 @@ function formatConnections(linkers, conceptIds, mainCompositionIds, reverse) {
17999
18261
  return output;
18000
18262
  });
18001
18263
  }
18264
+ /**
18265
+ * ## Format JustId ##
18266
+ * This function fetches all the connections and then converts all the connections to the single level connections
18267
+ * Then those single level objects are then stiched together to create a complex json/ array.
18268
+ * @param linkers
18269
+ * @param conceptIds
18270
+ * @param mainCompositionIds
18271
+ * @param reverse
18272
+ * @returns
18273
+ */
18274
+ function formatConnectionsJustId(linkers, conceptIds, mainCompositionIds, reverse) {
18275
+ return __awaiter(this, void 0, void 0, function* () {
18276
+ let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);
18277
+ let compositionData = [];
18278
+ let newCompositionData = [];
18279
+ compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);
18280
+ compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.FormatFunctionDataForDataJustId)(prefetchConnections, compositionData, reverse);
18281
+ console.log("this is the composition data", compositionData);
18282
+ let output = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.FormatFromConnectionsAlteredArrayExternalJustId)(prefetchConnections, compositionData, mainCompositionIds, reverse);
18283
+ return output;
18284
+ });
18285
+ }
18002
18286
  /**
18003
18287
  * ## Format DATA-ID ##
18004
18288
  * This function fetches all the connections and then converts all the connections to the single level connections
@@ -20436,6 +20720,9 @@ class SearchLinkMultipleAllObservable extends _DepenedencyObserver__WEBPACK_IMPO
20436
20720
  if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.DATAID) {
20437
20721
  this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_2__.formatConnectionsDataId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse);
20438
20722
  }
20723
+ else if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.JUSTDATA) {
20724
+ this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_2__.formatConnectionsJustId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse);
20725
+ }
20439
20726
  else {
20440
20727
  this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_2__.formatConnections)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse);
20441
20728
  //this.data = await formatDataArrayNormal(this.linkers, this.conceptIds, this.internalConnections, this.mainCompositionIds, this.reverse );