mftsccs-browser 2.1.14-beta → 2.1.15-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.
package/dist/main.bundle.js
CHANGED
|
@@ -584,7 +584,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
584
584
|
\*******************************************/
|
|
585
585
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
586
586
|
|
|
587
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConceptsData: () => (/* binding */ ConceptsData)\n/* harmony export */ });\n/* harmony import */ var _Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Database/indexeddb */ \"./src/Database/indexeddb.ts\");\n/* harmony import */ var _BinaryTree__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BinaryTree */ \"./src/DataStructures/BinaryTree.ts\");\n/* harmony import */ var _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BinaryCharacterTree */ \"./src/DataStructures/BinaryCharacterTree.ts\");\n/* harmony import */ var _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./BinaryTypeTree */ \"./src/DataStructures/BinaryTypeTree.ts\");\n/* harmony import */ var _Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Services/CreateDefaultConcept */ \"./src/Services/CreateDefaultConcept.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n\nclass ConceptsData {\n constructor() {\n this.name = \"conceptsArray\";\n }\n static CheckContains(concept) {\n var contains = false;\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].id == concept.id) {\n contains = true;\n }\n }\n return contains;\n }\n static AddNpc(id) {\n if (!this.NPC.includes(id)) {\n if (this.NPC.length > 10) {\n this.NPC = [];\n }\n this.NPC.push(id);\n }\n }\n static GetNpc(id) {\n if (this.NPC.includes(id)) {\n return true;\n }\n return false;\n }\n static AddConceptToStorage(concept) {\n if (concept.id > 0) {\n (0,_Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__.UpdateToDatabase)(\"concept\", concept);\n }\n }\n static GetConceptBulkData(ids, connectionArray, remainingIds) {\n return __awaiter(this, void 0, void 0, function* () {\n yield _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.getConceptListFromIds(ids, connectionArray, remainingIds);\n });\n }\n static AddConcept(concept) {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__AddConcept', { concept }); // is async function\n // return res.data // remove comment when this function is async\n }\n catch (error) {\n console.error('Concept Data, Add Concpet sw error: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n if (concept.id > 0) {\n // console.log(\"added the concept to the tree\", concept);\n //var contains = this.CheckContains(concept);\n // this.conceptDictionary[concept.id] = concept;\n // if(contains){\n // this.RemoveConcept(concept);\n // }\n //UpdateToDatabase(\"concept\",concept);\n //IndexDbUpdate.UpdateConceptIndexDb(concept);\n console.log(\"this is the adding type concept\", concept);\n _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.addConceptToTree(concept);\n _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.addConceptToTree(concept);\n //BinaryCharacterTree.addConceptToTree(concept);\n }\n }\n static AddConceptToMemory(concept) {\n if (concept.id > 0) {\n //var contains = this.CheckContains(concept);\n // this.conceptDictionary[concept.id] = concept;\n // if(contains){\n // this.RemoveConcept(concept);\n // }\n _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.addConceptToTree(concept);\n _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.addConceptToTree(concept);\n // BinaryCharacterTree.addConceptToTree(concept);\n }\n }\n static AddConceptTemporary(concept) {\n var contains = this.CheckContains(concept);\n this.conceptDictionary[concept.id] = concept;\n if (contains) {\n this.RemoveConcept(concept);\n }\n this.conceptsArray.push(concept);\n }\n static RemoveConcept(concept) {\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].id == concept.id) {\n this.conceptsArray.splice(i, 1);\n }\n }\n (0,_Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__.removeFromDatabase)(\"concept\", concept.id);\n }\n static GetConcept(id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__GetConcept', { id });\n return res.data;\n }\n catch (error) {\n console.error('Concept Data, Get Concpet sw error: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n if (id == 0 || id == undefined || id == null) {\n return (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n }\n var myConcept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var node = yield _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.getNodeFromTree(id);\n if (node === null || node === void 0 ? void 0 : node.value) {\n var returnedConcept = node.value;\n if (returnedConcept) {\n myConcept = returnedConcept;\n // if(myConcept.count > IndexDbUpdate.MIN_USE_FOR_INDEX_DB){\n // IndexDbUpdate.UpdateConceptIndexDb(myConcept);\n // }\n }\n }\n return myConcept;\n });\n }\n static GetConceptByCharacter(characterValue) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getNodeFromTree(characterValue);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptByCharacterUpdated(characterValue) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getNodeFromTree(characterValue);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptByCharacterAndTypeLocal(character_value, typeId) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n //var Node = await BinaryCharacterTree.getCharacterAndTypeFromTree(character_value,typeId);\n concept = yield _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.getTypeVariantsWithCharacterValueNew(character_value, typeId);\n // if(Node){\n // concept = Node.value;\n // console.log(\"found the output\");\n // console.log(concept);\n // }\n return concept;\n });\n }\n static GetConceptByCharacterAndCategoryLocal(character_value, categoryId) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = yield _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getCharacterAndCategoryFromTree(character_value, categoryId);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptsByTypeId(typeId) {\n var myConcept;\n let ConceptList = [];\n myConcept = null;\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].typeId == typeId) {\n ConceptList.push(this.conceptsArray[i]);\n }\n }\n return ConceptList;\n }\n static GetConceptsByTypeIdAndUser(typeId, userId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__GetConceptsByTypeIdAndUser', { typeId, userId });\n return res.data;\n }\n catch (error) {\n console.error('Concept Data, Get Concpet sw error:', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n let ConceptList = [];\n ConceptList = yield _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.getTypeVariantsFromTreeWithUserIdNew(typeId, userId);\n return ConceptList;\n });\n }\n static GetBinaryCharacterTree() {\n return _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.characterRoot;\n }\n getName() {\n return this.name;\n }\n}\nConceptsData.conceptsArray = [];\nConceptsData.NPC = [];\nConceptsData.conceptDictionary = [];\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/DataStructures/ConceptData.ts?");
|
|
587
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConceptsData: () => (/* binding */ ConceptsData)\n/* harmony export */ });\n/* harmony import */ var _Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Database/indexeddb */ \"./src/Database/indexeddb.ts\");\n/* harmony import */ var _BinaryTree__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BinaryTree */ \"./src/DataStructures/BinaryTree.ts\");\n/* harmony import */ var _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BinaryCharacterTree */ \"./src/DataStructures/BinaryCharacterTree.ts\");\n/* harmony import */ var _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./BinaryTypeTree */ \"./src/DataStructures/BinaryTypeTree.ts\");\n/* harmony import */ var _Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Services/CreateDefaultConcept */ \"./src/Services/CreateDefaultConcept.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n\nclass ConceptsData {\n constructor() {\n this.name = \"conceptsArray\";\n }\n static CheckContains(concept) {\n var contains = false;\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].id == concept.id) {\n contains = true;\n }\n }\n return contains;\n }\n static AddNpc(id) {\n if (!this.NPC.includes(id)) {\n if (this.NPC.length > 10) {\n this.NPC = [];\n }\n this.NPC.push(id);\n }\n }\n static GetNpc(id) {\n if (this.NPC.includes(id)) {\n return true;\n }\n return false;\n }\n static AddConceptToStorage(concept) {\n if (concept.id > 0) {\n (0,_Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__.UpdateToDatabase)(\"concept\", concept);\n }\n }\n static GetConceptBulkData(ids, connectionArray, remainingIds) {\n return __awaiter(this, void 0, void 0, function* () {\n yield _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.getConceptListFromIds(ids, connectionArray, remainingIds);\n });\n }\n static AddConcept(concept) {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__AddConcept', { concept }); // is async function\n // return res.data // remove comment when this function is async\n }\n catch (error) {\n console.error('Concept Data, Add Concpet sw error: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n if (concept.id > 0) {\n // console.log(\"added the concept to the tree\", concept);\n //var contains = this.CheckContains(concept);\n // this.conceptDictionary[concept.id] = concept;\n // if(contains){\n // this.RemoveConcept(concept);\n // }\n //UpdateToDatabase(\"concept\",concept);\n //IndexDbUpdate.UpdateConceptIndexDb(concept);\n _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.addConceptToTree(concept);\n _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.addConceptToTree(concept);\n //BinaryCharacterTree.addConceptToTree(concept);\n }\n }\n static AddConceptToMemory(concept) {\n if (concept.id > 0) {\n //var contains = this.CheckContains(concept);\n // this.conceptDictionary[concept.id] = concept;\n // if(contains){\n // this.RemoveConcept(concept);\n // }\n _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.addConceptToTree(concept);\n _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.addConceptToTree(concept);\n // BinaryCharacterTree.addConceptToTree(concept);\n }\n }\n static AddConceptTemporary(concept) {\n var contains = this.CheckContains(concept);\n this.conceptDictionary[concept.id] = concept;\n if (contains) {\n this.RemoveConcept(concept);\n }\n this.conceptsArray.push(concept);\n }\n static RemoveConcept(concept) {\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].id == concept.id) {\n this.conceptsArray.splice(i, 1);\n }\n }\n (0,_Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__.removeFromDatabase)(\"concept\", concept.id);\n }\n static GetConcept(id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__GetConcept', { id });\n return res.data;\n }\n catch (error) {\n console.error('Concept Data, Get Concpet sw error: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n if (id == 0 || id == undefined || id == null) {\n return (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n }\n var myConcept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var node = yield _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.getNodeFromTree(id);\n if (node === null || node === void 0 ? void 0 : node.value) {\n var returnedConcept = node.value;\n if (returnedConcept) {\n myConcept = returnedConcept;\n // if(myConcept.count > IndexDbUpdate.MIN_USE_FOR_INDEX_DB){\n // IndexDbUpdate.UpdateConceptIndexDb(myConcept);\n // }\n }\n }\n return myConcept;\n });\n }\n static GetConceptByCharacter(characterValue) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getNodeFromTree(characterValue);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptByCharacterUpdated(characterValue) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getNodeFromTree(characterValue);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptByCharacterAndTypeLocal(character_value, typeId) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n //var Node = await BinaryCharacterTree.getCharacterAndTypeFromTree(character_value,typeId);\n concept = yield _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.getTypeVariantsWithCharacterValueNew(character_value, typeId);\n // if(Node){\n // concept = Node.value;\n // console.log(\"found the output\");\n // console.log(concept);\n // }\n return concept;\n });\n }\n static GetConceptByCharacterAndCategoryLocal(character_value, categoryId) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = yield _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getCharacterAndCategoryFromTree(character_value, categoryId);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptsByTypeId(typeId) {\n var myConcept;\n let ConceptList = [];\n myConcept = null;\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].typeId == typeId) {\n ConceptList.push(this.conceptsArray[i]);\n }\n }\n return ConceptList;\n }\n static GetConceptsByTypeIdAndUser(typeId, userId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__GetConceptsByTypeIdAndUser', { typeId, userId });\n return res.data;\n }\n catch (error) {\n console.error('Concept Data, Get Concpet sw error:', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n let ConceptList = [];\n ConceptList = yield _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.getTypeVariantsFromTreeWithUserIdNew(typeId, userId);\n return ConceptList;\n });\n }\n static GetBinaryCharacterTree() {\n return _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.characterRoot;\n }\n getName() {\n return this.name;\n }\n}\nConceptsData.conceptsArray = [];\nConceptsData.NPC = [];\nConceptsData.conceptDictionary = [];\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/DataStructures/ConceptData.ts?");
|
|
588
588
|
|
|
589
589
|
/***/ }),
|
|
590
590
|
|
|
@@ -1704,7 +1704,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1704
1704
|
\*******************************************/
|
|
1705
1705
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1706
1706
|
|
|
1707
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FormatConceptsAndConnectionsNormalList: () => (/* binding */ FormatConceptsAndConnectionsNormalList),\n/* harmony export */ FormatFunctionData: () => (/* binding */ FormatFunctionData),\n/* harmony export */ formatFunction: () => (/* binding */ formatFunction),\n/* harmony export */ formatFunctionForData: () => (/* binding */ formatFunctionForData)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ \"./src/app.ts\");\n/* harmony import */ var _Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/RegexFunction */ \"./src/Services/Common/RegexFunction.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n/**\n * ######### Format is normal ######### used for listing. This only provides type connections.\n * This is helpful in building a format that has multiple mainCompositions i.e. in the context of the list\n * The list format is helpful because you do not have to go over each individual query.\n * @param connections the type connections that need (external connections) to be passed\n * @param compositionData this is a dictionary type of format that has all the build compositions {id: { actual data}}\n * @param mainComposition this is list of ids of the main composition that builds the tree\n * @param reverse this is the list of connections ids that needs to go to the reverse direction (to---->from)\n * @returns\n */\nfunction FormatConceptsAndConnectionsNormalList(connections_1, compositionData_1, mainComposition_1, newCompositionData_1) {\n return __awaiter(this, arguments, void 0, function* (connections, compositionData, mainComposition, newCompositionData, reverse = []) {\n var _a, _b, _c, _d, _e;\n let mainData = [];\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n if (toTheConcept.id in compositionData) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n let data = compositionData[connections[i].ofTheConceptId];\n if (data) {\n if (Array.isArray(newData[key][reverseCharater])) {\n newData[key][reverseCharater].push(data);\n }\n else {\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n newData[key][reverseCharater] = [];\n newData[key][reverseCharater].push(data);\n }\n else {\n newData[key][reverseCharater] = data;\n }\n }\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n if (ofTheConcept.id in compositionData) {\n let newData;\n let key = (_d = (_c = ofTheConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n let newType = typeof newData[key];\n if (newType == \"string\") {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let isComp = false;\n let linkerConceptValue = linkerConcept.characterValue;\n if (linkerConceptValue == \"\") {\n linkerConceptValue = toTheConcept.characterValue;\n isComp = true;\n }\n if (linkerConceptValue == \"\") {\n linkerConceptValue = (_e = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue;\n }\n try {\n let data = compositionData[connections[i].toTheConceptId];\n if (data) {\n if (Array.isArray(newData[key])) {\n if (isComp) {\n console.log(\"this is the data\", data, connections[i].toTheConceptId);\n newData[key].push(data[linkerConceptValue]);\n }\n else {\n newData[key].push(data);\n }\n }\n else {\n if (Array.isArray(newData[key][linkerConceptValue])) {\n newData[key][linkerConceptValue].push(data);\n }\n else {\n if (linkerConceptValue.includes(\"_s_\")) {\n newData[key][linkerConceptValue] = [];\n if (isComp) {\n newData[key][linkerConceptValue].push(data[linkerConceptValue]);\n }\n else {\n newData[key][linkerConceptValue].push(data);\n }\n }\n else {\n if (isComp) {\n newData[key][linkerConceptValue] = data[linkerConceptValue];\n }\n else {\n newData[key][linkerConceptValue] = data;\n }\n }\n }\n }\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n }\n for (let i = 0; i < mainComposition.length; i++) {\n let mymainData = compositionData[mainComposition[i]];\n if (mymainData) {\n mymainData[\"id\"] = mainComposition[i];\n mainData.push(mymainData);\n }\n }\n return mainData;\n });\n}\n/**\n *\n * ## Format Normal ##\n * This function takes in the connections and then converts the connections to the single level objects for further processing\n * This function is the builder of the arrays/ objects from the connections.\n */\nfunction formatFunction(connections, compositionData, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let data = {\n [mytype]: value\n };\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(ofTheConcept.id in compositionData)) {\n compositionData[ofTheConcept.id] = {};\n }\n compositionData[ofTheConcept.id][mytype] = value;\n }\n compositionData[toTheConcept.id] = {};\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = toTheConcept.characterValue;\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(toTheConcept.id in compositionData)) {\n compositionData[toTheConcept.id] = {};\n }\n compositionData[toTheConcept.id][mytype] = value;\n }\n compositionData[ofTheConcept.id] = {};\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n/**\n*\n* ## Format Normal ##\n* This function takes in the connections and then converts the connections to the single level objects for further processing\n* This function is the builder of the arrays/ objects from the connections.\n*/\nfunction formatFunctionForData(connections, compositionData, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n if (!(key in newData)) {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let dataCharacter = linkerConcept.characterValue;\n if (dataCharacter == \"\") {\n dataCharacter = mytype;\n dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);\n }\n let data = {\n [mytype]: value\n };\n let reverseCharater = dataCharacter + \"_reverse\";\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n // do nothing\n }\n else {\n if (typeof newData[key] == \"string\") {\n newData[key] = {};\n }\n newData[key][reverseCharater] = data;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n if (!(key in newData)) {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = toTheConcept.characterValue;\n let dataCharacter = linkerConcept.characterValue;\n let originalDataCharacter = linkerConcept.characterValue;\n let isComp = false;\n if (dataCharacter == \"\") {\n dataCharacter = mytype;\n dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);\n isComp = true;\n }\n let data = {\n [mytype]: value\n };\n if (isNaN(Number(dataCharacter))) {\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n // do nothing\n }\n else {\n if (typeof newData[key] == \"string\") {\n newData[key] = {};\n }\n if (isComp) {\n newData[key][dataCharacter] = value;\n }\n else {\n newData[key][dataCharacter] = data;\n }\n }\n }\n else {\n newData[key] = [];\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n/**\n * ## Format DATA-ID ##\n * this function takes in connections and creates a single level objects so that all the data are added to its object/ array.\n * This is then passed on further for stiching.\n * @param connections\n * @param compositionData\n * @param reverse\n * @returns\n */\nfunction FormatFunctionData(connections_1, compositionData_1) {\n return __awaiter(this, arguments, void 0, function* (connections, compositionData, reverse = []) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n if (reverseCharater.includes(\"_s_\")) {\n if (!(ofTheConcept.id in compositionData)) {\n compositionData[ofTheConcept.id] = {};\n }\n compositionData[ofTheConcept.id][mytype] = value;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n try {\n 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\";\n let value = toTheConcept.characterValue;\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(toTheConcept.id in compositionData)) {\n compositionData[toTheConcept.id] = {};\n }\n compositionData[toTheConcept.id][mytype] = value;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/Search/FormatData.ts?");
|
|
1707
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FormatConceptsAndConnectionsNormalList: () => (/* binding */ FormatConceptsAndConnectionsNormalList),\n/* harmony export */ FormatFunctionData: () => (/* binding */ FormatFunctionData),\n/* harmony export */ formatFunction: () => (/* binding */ formatFunction),\n/* harmony export */ formatFunctionForData: () => (/* binding */ formatFunctionForData)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ \"./src/app.ts\");\n/* harmony import */ var _Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/RegexFunction */ \"./src/Services/Common/RegexFunction.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n/**\n * ######### Format is normal ######### used for listing. This only provides type connections.\n * This is helpful in building a format that has multiple mainCompositions i.e. in the context of the list\n * The list format is helpful because you do not have to go over each individual query.\n * @param connections the type connections that need (external connections) to be passed\n * @param compositionData this is a dictionary type of format that has all the build compositions {id: { actual data}}\n * @param mainComposition this is list of ids of the main composition that builds the tree\n * @param reverse this is the list of connections ids that needs to go to the reverse direction (to---->from)\n * @returns\n */\nfunction FormatConceptsAndConnectionsNormalList(connections_1, compositionData_1, mainComposition_1, newCompositionData_1) {\n return __awaiter(this, arguments, void 0, function* (connections, compositionData, mainComposition, newCompositionData, reverse = []) {\n var _a, _b, _c, _d, _e;\n let mainData = [];\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n if (toTheConcept.id in compositionData) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n let data = compositionData[connections[i].ofTheConceptId];\n if (data) {\n if (Array.isArray(newData[key][reverseCharater])) {\n newData[key][reverseCharater].push(data);\n }\n else {\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n newData[key][reverseCharater] = [];\n newData[key][reverseCharater].push(data);\n }\n else {\n newData[key][reverseCharater] = data;\n }\n }\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n if (ofTheConcept.id in compositionData) {\n let newData;\n let key = (_d = (_c = ofTheConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n let newType = typeof newData[key];\n if (newType == \"string\") {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let isComp = false;\n let linkerConceptValue = linkerConcept.characterValue;\n if (linkerConceptValue == \"\") {\n linkerConceptValue = toTheConcept.characterValue;\n isComp = true;\n }\n if (linkerConceptValue == \"\") {\n linkerConceptValue = (_e = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue;\n }\n try {\n let data = compositionData[connections[i].toTheConceptId];\n if (data) {\n if (Array.isArray(newData[key])) {\n if (isComp) {\n newData[key].push(data[linkerConceptValue]);\n }\n else {\n newData[key].push(data);\n }\n }\n else {\n if (Array.isArray(newData[key][linkerConceptValue])) {\n newData[key][linkerConceptValue].push(data);\n }\n else {\n if (linkerConceptValue.includes(\"_s_\")) {\n newData[key][linkerConceptValue] = [];\n if (isComp) {\n newData[key][linkerConceptValue].push(data[linkerConceptValue]);\n }\n else {\n newData[key][linkerConceptValue].push(data);\n }\n }\n else {\n if (isComp) {\n newData[key][linkerConceptValue] = data[linkerConceptValue];\n }\n else {\n newData[key][linkerConceptValue] = data;\n }\n }\n }\n }\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n }\n for (let i = 0; i < mainComposition.length; i++) {\n let mymainData = compositionData[mainComposition[i]];\n if (mymainData) {\n mymainData[\"id\"] = mainComposition[i];\n mainData.push(mymainData);\n }\n }\n return mainData;\n });\n}\n/**\n *\n * ## Format Normal ##\n * This function takes in the connections and then converts the connections to the single level objects for further processing\n * This function is the builder of the arrays/ objects from the connections.\n */\nfunction formatFunction(connections, compositionData, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let data = {\n [mytype]: value\n };\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(ofTheConcept.id in compositionData)) {\n compositionData[ofTheConcept.id] = {};\n }\n compositionData[ofTheConcept.id][mytype] = value;\n }\n compositionData[toTheConcept.id] = {};\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = toTheConcept.characterValue;\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(toTheConcept.id in compositionData)) {\n compositionData[toTheConcept.id] = {};\n }\n compositionData[toTheConcept.id][mytype] = value;\n }\n compositionData[ofTheConcept.id] = {};\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n/**\n*\n* ## Format Normal ##\n* This function takes in the connections and then converts the connections to the single level objects for further processing\n* This function is the builder of the arrays/ objects from the connections.\n*/\nfunction formatFunctionForData(connections, compositionData, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n if (!(key in newData)) {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let dataCharacter = linkerConcept.characterValue;\n if (dataCharacter == \"\") {\n dataCharacter = mytype;\n dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);\n }\n let data = {\n [mytype]: value\n };\n let reverseCharater = dataCharacter + \"_reverse\";\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n // do nothing\n }\n else {\n if (typeof newData[key] == \"string\") {\n newData[key] = {};\n }\n newData[key][reverseCharater] = data;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n if (!(key in newData)) {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = toTheConcept.characterValue;\n let dataCharacter = linkerConcept.characterValue;\n let originalDataCharacter = linkerConcept.characterValue;\n let isComp = false;\n if (dataCharacter == \"\") {\n dataCharacter = mytype;\n dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);\n isComp = true;\n }\n let data = {\n [mytype]: value\n };\n if (isNaN(Number(dataCharacter))) {\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n // do nothing\n }\n else {\n if (typeof newData[key] == \"string\") {\n newData[key] = {};\n }\n if (isComp) {\n newData[key][dataCharacter] = value;\n }\n else {\n newData[key][dataCharacter] = data;\n }\n }\n }\n else {\n newData[key] = [];\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n/**\n * ## Format DATA-ID ##\n * this function takes in connections and creates a single level objects so that all the data are added to its object/ array.\n * This is then passed on further for stiching.\n * @param connections\n * @param compositionData\n * @param reverse\n * @returns\n */\nfunction FormatFunctionData(connections_1, compositionData_1) {\n return __awaiter(this, arguments, void 0, function* (connections, compositionData, reverse = []) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n if (reverseCharater.includes(\"_s_\")) {\n if (!(ofTheConcept.id in compositionData)) {\n compositionData[ofTheConcept.id] = {};\n }\n compositionData[ofTheConcept.id][mytype] = value;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n try {\n 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\";\n let value = toTheConcept.characterValue;\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(toTheConcept.id in compositionData)) {\n compositionData[toTheConcept.id] = {};\n }\n compositionData[toTheConcept.id][mytype] = value;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/Search/FormatData.ts?");
|
|
1708
1708
|
|
|
1709
1709
|
/***/ }),
|
|
1710
1710
|
|
|
@@ -1744,7 +1744,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1744
1744
|
\********************************************************/
|
|
1745
1745
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1746
1746
|
|
|
1747
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SearchWithTypeAndLinker: () => (/* binding */ SearchWithTypeAndLinker),\n/* harmony export */ SearchWithTypeAndLinkerDataId: () => (/* binding */ SearchWithTypeAndLinkerDataId),\n/* harmony export */ formatConnections: () => (/* binding */ formatConnections),\n/* harmony export */ formatConnectionsDataId: () => (/* binding */ formatConnectionsDataId),\n/* harmony export */ formatConnectionsJustId: () => (/* binding */ formatConnectionsJustId),\n/* harmony export */ formatDataArrayDataId: () => (/* binding */ formatDataArrayDataId),\n/* harmony export */ formatDataArrayNormal: () => (/* binding */ formatDataArrayNormal),\n/* harmony export */ formatLinkersNormal: () => (/* binding */ formatLinkersNormal)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ \"./src/app.ts\");\n/* harmony import */ var _GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../GetCompositionBulk */ \"./src/Services/GetCompositionBulk.ts\");\n/* harmony import */ var _FormatData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FormatData */ \"./src/Services/Search/FormatData.ts\");\n/* harmony import */ var _SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SearchLinkMultiple */ \"./src/Services/Search/SearchLinkMultiple.ts\");\n/* harmony import */ var _JustIdFormat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./JustIdFormat */ \"./src/Services/Search/JustIdFormat.ts\");\n/* harmony import */ var _DataIdFormat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DataIdFormat */ \"./src/Services/Search/DataIdFormat.ts\");\n/* harmony import */ var _Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/DecodeCountInfo */ \"./src/Services/Common/DecodeCountInfo.ts\");\n/* harmony import */ var _orderingConnections__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./orderingConnections */ \"./src/Services/Search/orderingConnections.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n\n\n\n/**\n * This function will help you search a concept by their type and also to query inside of it.\n * Put the number of compositions you want to get in the searchStructure which can be set by inpage and page\n * Then the type should be set in searchQuery for the compositionName.\n * Inside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\n * This will give the id of the structures.\n */\nfunction SearchWithTypeAndLinkerDataId(searchStructure_1, searchQuery_1) {\n return __awaiter(this, arguments, void 0, function* (searchStructure, searchQuery, token = \"\") {\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchWithTypeAndLinkerApi)(searchStructure, searchQuery, token);\n let conceptIds = result.compositionIds;\n let connections = result.internalConnections;\n let linkers = result.linkers;\n let reverse = result.reverse;\n let mainCompositionIds = result.mainCompositionIds;\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsWithDataIdInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatFromConnectionsAlteredArray)(prefetchConnections, concepts, conceptIds, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * This function will help you search a concept by their type and also to query inside of it.\n * Put the number of compositions you want to get in the searchStructure which can be set by inpage and page\n * Then the type should be set in searchQuery for the compositionName.\n * Inside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\n * This will not give the id of the structures.\n */\nfunction SearchWithTypeAndLinker(searchStructure_1, searchQuery_1) {\n return __awaiter(this, arguments, void 0, function* (searchStructure, searchQuery, token = \"\") {\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchWithTypeAndLinkerApi)(searchStructure, searchQuery, token);\n let conceptIds = result.compositionIds;\n let connections = result.internalConnections;\n let linkers = result.linkers;\n let reverse = result.reverse;\n let mainCompositionIds = result.mainCompositionIds;\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format dataid ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatDataArrayDataId(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsWithDataIdInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatFromConnectionsAlteredArray)(prefetchConnections, concepts, conceptIds, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatDataArrayNormal(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObjectNormal)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatLinkersNormal(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObjectNormal)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnections(linkers, conceptIds, mainCompositionIds, reverse, countInfos) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n //let CountDictionary:any = await GetConnectionTypeForCount(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunctionForData)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.FormatConceptsAndConnectionsNormalList)(prefetchConnections, compositionData, mainCompositionIds, newCompositionData, reverse);\n return output;\n });\n}\n/**\n * ## Format JustId ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnectionsJustId(linkers_1, conceptIds_1, mainCompositionIds_1, reverse_1, countInfos_1) {\n return __awaiter(this, arguments, void 0, function* (linkers, conceptIds, mainCompositionIds, reverse, countInfos, order = \"DESC\") {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let CountDictionary = yield (0,_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__.GetConnectionTypeForCount)(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections, order);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_JustIdFormat__WEBPACK_IMPORTED_MODULE_4__.FormatFunctionDataForDataJustId)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_JustIdFormat__WEBPACK_IMPORTED_MODULE_4__.FormatFromConnectionsAlteredArrayExternalJustId)(prefetchConnections, compositionData, mainCompositionIds, reverse, CountDictionary);\n return output;\n });\n}\n/**\n * ## Format DATA-ID ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnectionsDataId(linkers_1, conceptIds_1, mainCompositionIds_1, reverse_1, countInfos_1) {\n return __awaiter(this, arguments, void 0, function* (linkers, conceptIds, mainCompositionIds, reverse, countInfos, order = \"DESC\") {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let CountDictionary = yield (0,_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__.GetConnectionTypeForCount)(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections, order);\n console.log(\"this is the prfetch connections\", prefetchConnections);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionData)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionDataForData)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFromConnectionsAlteredArrayExternal)(prefetchConnections, compositionData, newCompositionData, mainCompositionIds, reverse, CountDictionary);\n return output;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/Search/SearchWithTypeAndLinker.ts?");
|
|
1747
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SearchWithTypeAndLinker: () => (/* binding */ SearchWithTypeAndLinker),\n/* harmony export */ SearchWithTypeAndLinkerDataId: () => (/* binding */ SearchWithTypeAndLinkerDataId),\n/* harmony export */ formatConnections: () => (/* binding */ formatConnections),\n/* harmony export */ formatConnectionsDataId: () => (/* binding */ formatConnectionsDataId),\n/* harmony export */ formatConnectionsJustId: () => (/* binding */ formatConnectionsJustId),\n/* harmony export */ formatDataArrayDataId: () => (/* binding */ formatDataArrayDataId),\n/* harmony export */ formatDataArrayNormal: () => (/* binding */ formatDataArrayNormal),\n/* harmony export */ formatLinkersNormal: () => (/* binding */ formatLinkersNormal)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ \"./src/app.ts\");\n/* harmony import */ var _GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../GetCompositionBulk */ \"./src/Services/GetCompositionBulk.ts\");\n/* harmony import */ var _FormatData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FormatData */ \"./src/Services/Search/FormatData.ts\");\n/* harmony import */ var _SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SearchLinkMultiple */ \"./src/Services/Search/SearchLinkMultiple.ts\");\n/* harmony import */ var _JustIdFormat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./JustIdFormat */ \"./src/Services/Search/JustIdFormat.ts\");\n/* harmony import */ var _DataIdFormat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DataIdFormat */ \"./src/Services/Search/DataIdFormat.ts\");\n/* harmony import */ var _Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/DecodeCountInfo */ \"./src/Services/Common/DecodeCountInfo.ts\");\n/* harmony import */ var _orderingConnections__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./orderingConnections */ \"./src/Services/Search/orderingConnections.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n\n\n\n/**\n * This function will help you search a concept by their type and also to query inside of it.\n * Put the number of compositions you want to get in the searchStructure which can be set by inpage and page\n * Then the type should be set in searchQuery for the compositionName.\n * Inside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\n * This will give the id of the structures.\n */\nfunction SearchWithTypeAndLinkerDataId(searchStructure_1, searchQuery_1) {\n return __awaiter(this, arguments, void 0, function* (searchStructure, searchQuery, token = \"\") {\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchWithTypeAndLinkerApi)(searchStructure, searchQuery, token);\n let conceptIds = result.compositionIds;\n let connections = result.internalConnections;\n let linkers = result.linkers;\n let reverse = result.reverse;\n let mainCompositionIds = result.mainCompositionIds;\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsWithDataIdInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatFromConnectionsAlteredArray)(prefetchConnections, concepts, conceptIds, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * This function will help you search a concept by their type and also to query inside of it.\n * Put the number of compositions you want to get in the searchStructure which can be set by inpage and page\n * Then the type should be set in searchQuery for the compositionName.\n * Inside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\n * This will not give the id of the structures.\n */\nfunction SearchWithTypeAndLinker(searchStructure_1, searchQuery_1) {\n return __awaiter(this, arguments, void 0, function* (searchStructure, searchQuery, token = \"\") {\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchWithTypeAndLinkerApi)(searchStructure, searchQuery, token);\n let conceptIds = result.compositionIds;\n let connections = result.internalConnections;\n let linkers = result.linkers;\n let reverse = result.reverse;\n let mainCompositionIds = result.mainCompositionIds;\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format dataid ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatDataArrayDataId(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsWithDataIdInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatFromConnectionsAlteredArray)(prefetchConnections, concepts, conceptIds, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatDataArrayNormal(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObjectNormal)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatLinkersNormal(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObjectNormal)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnections(linkers, conceptIds, mainCompositionIds, reverse, countInfos) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n //let CountDictionary:any = await GetConnectionTypeForCount(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections);\n let compositionData = [];\n let newCompositionData = [];\n let time1 = new Date().getTime();\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);\n console.log(\"format1\", new Date().getTime() - time1);\n let time2 = new Date().getTime();\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunctionForData)(prefetchConnections, compositionData, reverse);\n console.log(\"format2\", new Date().getTime() - time2);\n let time3 = new Date().getTime();\n let output = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.FormatConceptsAndConnectionsNormalList)(prefetchConnections, compositionData, mainCompositionIds, newCompositionData, reverse);\n console.log(\"format3\", new Date().getTime() - time3);\n return output;\n });\n}\n/**\n * ## Format JustId ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnectionsJustId(linkers_1, conceptIds_1, mainCompositionIds_1, reverse_1, countInfos_1) {\n return __awaiter(this, arguments, void 0, function* (linkers, conceptIds, mainCompositionIds, reverse, countInfos, order = \"DESC\") {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let CountDictionary = yield (0,_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__.GetConnectionTypeForCount)(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections, order);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_JustIdFormat__WEBPACK_IMPORTED_MODULE_4__.FormatFunctionDataForDataJustId)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_JustIdFormat__WEBPACK_IMPORTED_MODULE_4__.FormatFromConnectionsAlteredArrayExternalJustId)(prefetchConnections, compositionData, mainCompositionIds, reverse, CountDictionary);\n return output;\n });\n}\n/**\n * ## Format DATA-ID ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnectionsDataId(linkers_1, conceptIds_1, mainCompositionIds_1, reverse_1, countInfos_1) {\n return __awaiter(this, arguments, void 0, function* (linkers, conceptIds, mainCompositionIds, reverse, countInfos, order = \"DESC\") {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let CountDictionary = yield (0,_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__.GetConnectionTypeForCount)(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections, order);\n console.log(\"this is the prfetch connections\", prefetchConnections);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionData)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionDataForData)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFromConnectionsAlteredArrayExternal)(prefetchConnections, compositionData, newCompositionData, mainCompositionIds, reverse, CountDictionary);\n return output;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/Search/SearchWithTypeAndLinker.ts?");
|
|
1748
1748
|
|
|
1749
1749
|
/***/ }),
|
|
1750
1750
|
|
|
@@ -1994,7 +1994,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1994
1994
|
\*******************************************************/
|
|
1995
1995
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1996
1996
|
|
|
1997
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SchemaQueryListener: () => (/* binding */ SchemaQueryListener),\n/* harmony export */ SearchLinkMultipleAllObservable: () => (/* binding */ SearchLinkMultipleAllObservable)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\n/* harmony import */ var _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Constants/FormatConstants */ \"./src/Constants/FormatConstants.ts\");\n/* harmony import */ var _Services_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Services/Common/DecodeCountInfo */ \"./src/Services/Common/DecodeCountInfo.ts\");\n/* harmony import */ var _Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Services/Search/SearchWithTypeAndLinker */ \"./src/Services/Search/SearchWithTypeAndLinker.ts\");\n/* harmony import */ var _DepenedencyObserver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DepenedencyObserver */ \"./src/WrapperFunctions/DepenedencyObserver.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\nclass SearchLinkMultipleAllObservable extends _DepenedencyObserver__WEBPACK_IMPORTED_MODULE_4__.DependencyObserver {\n constructor(query, token) {\n super();\n this.mainCompositionIds = [];\n this.query = new _app__WEBPACK_IMPORTED_MODULE_0__.FreeschemaQuery();\n this.countInfoStrings = [];\n this.order = \"DESC\";\n this.query = query;\n this.format = query.outputFormat;\n this.order = query.order;\n }\n bind() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.isDataLoaded) {\n this.isDataLoaded = true;\n this.query.outputFormat = _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.ALLID;\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.FreeschemaQueryApi)(this.query, \"\");\n this.conceptIds = result.conceptIds;\n this.internalConnections = result.internalConnections;\n this.linkers = result.linkers;\n this.reverse = result.reverse;\n this.mainCompositionIds = result.mainCompositionIds;\n this.countInfoStrings = result.countinfo;\n }\n return yield this.build();\n });\n }\n build() {\n return __awaiter(this, void 0, void 0, function* () {\n let countInfos = (0,_Services_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_2__.DecodeCountInfo)(this.countInfoStrings);\n if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.DATAID) {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnectionsDataId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos, this.order);\n }\n else if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.JUSTDATA) {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnectionsJustId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos, this.order);\n }\n else {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnections)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos);\n //this.data = await formatDataArrayNormal(this.linkers, this.conceptIds, this.internalConnections, this.mainCompositionIds, this.reverse );\n }\n return this.data;\n });\n }\n}\n/**\n *\n * @param id this is the id whose links need to be found\n * @param linker this is the type connection that is connected to the mainConcept(id)\n * @param inpage number of outputs that has to be displayed\n * @param page the page which needs to be displayed as per the inpage parameter\n * @param format the format in which the output should be displayed (NORMAL, DATAID,JUSTDATA,DATAIDDATE)\n */\nfunction SchemaQueryListener(query, token) {\n return new SearchLinkMultipleAllObservable(query, token);\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/WrapperFunctions/SchemaQueryObservable.ts?");
|
|
1997
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SchemaQueryListener: () => (/* binding */ SchemaQueryListener),\n/* harmony export */ SearchLinkMultipleAllObservable: () => (/* binding */ SearchLinkMultipleAllObservable)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\n/* harmony import */ var _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Constants/FormatConstants */ \"./src/Constants/FormatConstants.ts\");\n/* harmony import */ var _Services_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Services/Common/DecodeCountInfo */ \"./src/Services/Common/DecodeCountInfo.ts\");\n/* harmony import */ var _Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Services/Search/SearchWithTypeAndLinker */ \"./src/Services/Search/SearchWithTypeAndLinker.ts\");\n/* harmony import */ var _DepenedencyObserver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DepenedencyObserver */ \"./src/WrapperFunctions/DepenedencyObserver.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\nclass SearchLinkMultipleAllObservable extends _DepenedencyObserver__WEBPACK_IMPORTED_MODULE_4__.DependencyObserver {\n constructor(query, token) {\n super();\n this.mainCompositionIds = [];\n this.query = new _app__WEBPACK_IMPORTED_MODULE_0__.FreeschemaQuery();\n this.countInfoStrings = [];\n this.order = \"DESC\";\n this.query = query;\n this.format = query.outputFormat;\n this.order = query.order;\n }\n bind() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.isDataLoaded) {\n this.isDataLoaded = true;\n this.query.outputFormat = _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.ALLID;\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.FreeschemaQueryApi)(this.query, \"\");\n this.conceptIds = result.conceptIds;\n this.internalConnections = result.internalConnections;\n this.linkers = result.linkers;\n this.reverse = result.reverse;\n this.mainCompositionIds = result.mainCompositionIds;\n this.countInfoStrings = result.countinfo;\n }\n return yield this.build();\n });\n }\n build() {\n return __awaiter(this, void 0, void 0, function* () {\n let countInfos = (0,_Services_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_2__.DecodeCountInfo)(this.countInfoStrings);\n if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.DATAID) {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnectionsDataId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos, this.order);\n }\n else if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.JUSTDATA) {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnectionsJustId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos, this.order);\n }\n else {\n console.time(\"format\");\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnections)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos);\n console.timeEnd(\"format\");\n //this.data = await formatDataArrayNormal(this.linkers, this.conceptIds, this.internalConnections, this.mainCompositionIds, this.reverse );\n }\n return this.data;\n });\n }\n}\n/**\n *\n * @param id this is the id whose links need to be found\n * @param linker this is the type connection that is connected to the mainConcept(id)\n * @param inpage number of outputs that has to be displayed\n * @param page the page which needs to be displayed as per the inpage parameter\n * @param format the format in which the output should be displayed (NORMAL, DATAID,JUSTDATA,DATAIDDATE)\n */\nfunction SchemaQueryListener(query, token) {\n return new SearchLinkMultipleAllObservable(query, token);\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/WrapperFunctions/SchemaQueryObservable.ts?");
|
|
1998
1998
|
|
|
1999
1999
|
/***/ }),
|
|
2000
2000
|
|
|
@@ -584,7 +584,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
584
584
|
\*******************************************/
|
|
585
585
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
586
586
|
|
|
587
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConceptsData: () => (/* binding */ ConceptsData)\n/* harmony export */ });\n/* harmony import */ var _Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Database/indexeddb */ \"./src/Database/indexeddb.ts\");\n/* harmony import */ var _BinaryTree__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BinaryTree */ \"./src/DataStructures/BinaryTree.ts\");\n/* harmony import */ var _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BinaryCharacterTree */ \"./src/DataStructures/BinaryCharacterTree.ts\");\n/* harmony import */ var _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./BinaryTypeTree */ \"./src/DataStructures/BinaryTypeTree.ts\");\n/* harmony import */ var _Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Services/CreateDefaultConcept */ \"./src/Services/CreateDefaultConcept.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n\nclass ConceptsData {\n constructor() {\n this.name = \"conceptsArray\";\n }\n static CheckContains(concept) {\n var contains = false;\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].id == concept.id) {\n contains = true;\n }\n }\n return contains;\n }\n static AddNpc(id) {\n if (!this.NPC.includes(id)) {\n if (this.NPC.length > 10) {\n this.NPC = [];\n }\n this.NPC.push(id);\n }\n }\n static GetNpc(id) {\n if (this.NPC.includes(id)) {\n return true;\n }\n return false;\n }\n static AddConceptToStorage(concept) {\n if (concept.id > 0) {\n (0,_Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__.UpdateToDatabase)(\"concept\", concept);\n }\n }\n static GetConceptBulkData(ids, connectionArray, remainingIds) {\n return __awaiter(this, void 0, void 0, function* () {\n yield _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.getConceptListFromIds(ids, connectionArray, remainingIds);\n });\n }\n static AddConcept(concept) {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__AddConcept', { concept }); // is async function\n // return res.data // remove comment when this function is async\n }\n catch (error) {\n console.error('Concept Data, Add Concpet sw error: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n if (concept.id > 0) {\n // console.log(\"added the concept to the tree\", concept);\n //var contains = this.CheckContains(concept);\n // this.conceptDictionary[concept.id] = concept;\n // if(contains){\n // this.RemoveConcept(concept);\n // }\n //UpdateToDatabase(\"concept\",concept);\n //IndexDbUpdate.UpdateConceptIndexDb(concept);\n console.log(\"this is the adding type concept\", concept);\n _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.addConceptToTree(concept);\n _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.addConceptToTree(concept);\n //BinaryCharacterTree.addConceptToTree(concept);\n }\n }\n static AddConceptToMemory(concept) {\n if (concept.id > 0) {\n //var contains = this.CheckContains(concept);\n // this.conceptDictionary[concept.id] = concept;\n // if(contains){\n // this.RemoveConcept(concept);\n // }\n _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.addConceptToTree(concept);\n _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.addConceptToTree(concept);\n // BinaryCharacterTree.addConceptToTree(concept);\n }\n }\n static AddConceptTemporary(concept) {\n var contains = this.CheckContains(concept);\n this.conceptDictionary[concept.id] = concept;\n if (contains) {\n this.RemoveConcept(concept);\n }\n this.conceptsArray.push(concept);\n }\n static RemoveConcept(concept) {\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].id == concept.id) {\n this.conceptsArray.splice(i, 1);\n }\n }\n (0,_Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__.removeFromDatabase)(\"concept\", concept.id);\n }\n static GetConcept(id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__GetConcept', { id });\n return res.data;\n }\n catch (error) {\n console.error('Concept Data, Get Concpet sw error: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n if (id == 0 || id == undefined || id == null) {\n return (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n }\n var myConcept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var node = yield _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.getNodeFromTree(id);\n if (node === null || node === void 0 ? void 0 : node.value) {\n var returnedConcept = node.value;\n if (returnedConcept) {\n myConcept = returnedConcept;\n // if(myConcept.count > IndexDbUpdate.MIN_USE_FOR_INDEX_DB){\n // IndexDbUpdate.UpdateConceptIndexDb(myConcept);\n // }\n }\n }\n return myConcept;\n });\n }\n static GetConceptByCharacter(characterValue) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getNodeFromTree(characterValue);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptByCharacterUpdated(characterValue) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getNodeFromTree(characterValue);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptByCharacterAndTypeLocal(character_value, typeId) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n //var Node = await BinaryCharacterTree.getCharacterAndTypeFromTree(character_value,typeId);\n concept = yield _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.getTypeVariantsWithCharacterValueNew(character_value, typeId);\n // if(Node){\n // concept = Node.value;\n // console.log(\"found the output\");\n // console.log(concept);\n // }\n return concept;\n });\n }\n static GetConceptByCharacterAndCategoryLocal(character_value, categoryId) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = yield _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getCharacterAndCategoryFromTree(character_value, categoryId);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptsByTypeId(typeId) {\n var myConcept;\n let ConceptList = [];\n myConcept = null;\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].typeId == typeId) {\n ConceptList.push(this.conceptsArray[i]);\n }\n }\n return ConceptList;\n }\n static GetConceptsByTypeIdAndUser(typeId, userId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__GetConceptsByTypeIdAndUser', { typeId, userId });\n return res.data;\n }\n catch (error) {\n console.error('Concept Data, Get Concpet sw error:', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n let ConceptList = [];\n ConceptList = yield _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.getTypeVariantsFromTreeWithUserIdNew(typeId, userId);\n return ConceptList;\n });\n }\n static GetBinaryCharacterTree() {\n return _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.characterRoot;\n }\n getName() {\n return this.name;\n }\n}\nConceptsData.conceptsArray = [];\nConceptsData.NPC = [];\nConceptsData.conceptDictionary = [];\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/DataStructures/ConceptData.ts?");
|
|
587
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ConceptsData: () => (/* binding */ ConceptsData)\n/* harmony export */ });\n/* harmony import */ var _Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Database/indexeddb */ \"./src/Database/indexeddb.ts\");\n/* harmony import */ var _BinaryTree__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BinaryTree */ \"./src/DataStructures/BinaryTree.ts\");\n/* harmony import */ var _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BinaryCharacterTree */ \"./src/DataStructures/BinaryCharacterTree.ts\");\n/* harmony import */ var _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./BinaryTypeTree */ \"./src/DataStructures/BinaryTypeTree.ts\");\n/* harmony import */ var _Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Services/CreateDefaultConcept */ \"./src/Services/CreateDefaultConcept.ts\");\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n\nclass ConceptsData {\n constructor() {\n this.name = \"conceptsArray\";\n }\n static CheckContains(concept) {\n var contains = false;\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].id == concept.id) {\n contains = true;\n }\n }\n return contains;\n }\n static AddNpc(id) {\n if (!this.NPC.includes(id)) {\n if (this.NPC.length > 10) {\n this.NPC = [];\n }\n this.NPC.push(id);\n }\n }\n static GetNpc(id) {\n if (this.NPC.includes(id)) {\n return true;\n }\n return false;\n }\n static AddConceptToStorage(concept) {\n if (concept.id > 0) {\n (0,_Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__.UpdateToDatabase)(\"concept\", concept);\n }\n }\n static GetConceptBulkData(ids, connectionArray, remainingIds) {\n return __awaiter(this, void 0, void 0, function* () {\n yield _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.getConceptListFromIds(ids, connectionArray, remainingIds);\n });\n }\n static AddConcept(concept) {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__AddConcept', { concept }); // is async function\n // return res.data // remove comment when this function is async\n }\n catch (error) {\n console.error('Concept Data, Add Concpet sw error: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n if (concept.id > 0) {\n // console.log(\"added the concept to the tree\", concept);\n //var contains = this.CheckContains(concept);\n // this.conceptDictionary[concept.id] = concept;\n // if(contains){\n // this.RemoveConcept(concept);\n // }\n //UpdateToDatabase(\"concept\",concept);\n //IndexDbUpdate.UpdateConceptIndexDb(concept);\n _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.addConceptToTree(concept);\n _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.addConceptToTree(concept);\n //BinaryCharacterTree.addConceptToTree(concept);\n }\n }\n static AddConceptToMemory(concept) {\n if (concept.id > 0) {\n //var contains = this.CheckContains(concept);\n // this.conceptDictionary[concept.id] = concept;\n // if(contains){\n // this.RemoveConcept(concept);\n // }\n _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.addConceptToTree(concept);\n _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.addConceptToTree(concept);\n // BinaryCharacterTree.addConceptToTree(concept);\n }\n }\n static AddConceptTemporary(concept) {\n var contains = this.CheckContains(concept);\n this.conceptDictionary[concept.id] = concept;\n if (contains) {\n this.RemoveConcept(concept);\n }\n this.conceptsArray.push(concept);\n }\n static RemoveConcept(concept) {\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].id == concept.id) {\n this.conceptsArray.splice(i, 1);\n }\n }\n (0,_Database_indexeddb__WEBPACK_IMPORTED_MODULE_0__.removeFromDatabase)(\"concept\", concept.id);\n }\n static GetConcept(id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__GetConcept', { id });\n return res.data;\n }\n catch (error) {\n console.error('Concept Data, Get Concpet sw error: ', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n if (id == 0 || id == undefined || id == null) {\n return (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n }\n var myConcept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var node = yield _BinaryTree__WEBPACK_IMPORTED_MODULE_1__.BinaryTree.getNodeFromTree(id);\n if (node === null || node === void 0 ? void 0 : node.value) {\n var returnedConcept = node.value;\n if (returnedConcept) {\n myConcept = returnedConcept;\n // if(myConcept.count > IndexDbUpdate.MIN_USE_FOR_INDEX_DB){\n // IndexDbUpdate.UpdateConceptIndexDb(myConcept);\n // }\n }\n }\n return myConcept;\n });\n }\n static GetConceptByCharacter(characterValue) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getNodeFromTree(characterValue);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptByCharacterUpdated(characterValue) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getNodeFromTree(characterValue);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptByCharacterAndTypeLocal(character_value, typeId) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n //var Node = await BinaryCharacterTree.getCharacterAndTypeFromTree(character_value,typeId);\n concept = yield _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.getTypeVariantsWithCharacterValueNew(character_value, typeId);\n // if(Node){\n // concept = Node.value;\n // console.log(\"found the output\");\n // console.log(concept);\n // }\n return concept;\n });\n }\n static GetConceptByCharacterAndCategoryLocal(character_value, categoryId) {\n return __awaiter(this, void 0, void 0, function* () {\n var concept = (0,_Services_CreateDefaultConcept__WEBPACK_IMPORTED_MODULE_4__.CreateDefaultConcept)();\n var Node = yield _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.getCharacterAndCategoryFromTree(character_value, categoryId);\n if (Node) {\n concept = Node.value;\n }\n return concept;\n });\n }\n static GetConceptsByTypeId(typeId) {\n var myConcept;\n let ConceptList = [];\n myConcept = null;\n for (var i = 0; i < this.conceptsArray.length; i++) {\n if (this.conceptsArray[i].typeId == typeId) {\n ConceptList.push(this.conceptsArray[i]);\n }\n }\n return ConceptList;\n }\n static GetConceptsByTypeIdAndUser(typeId, userId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {\n try {\n const res = yield (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__GetConceptsByTypeIdAndUser', { typeId, userId });\n return res.data;\n }\n catch (error) {\n console.error('Concept Data, Get Concpet sw error:', error);\n (0,_app__WEBPACK_IMPORTED_MODULE_5__.handleServiceWorkerException)(error);\n }\n }\n let ConceptList = [];\n ConceptList = yield _BinaryTypeTree__WEBPACK_IMPORTED_MODULE_3__.BinaryTypeTree.getTypeVariantsFromTreeWithUserIdNew(typeId, userId);\n return ConceptList;\n });\n }\n static GetBinaryCharacterTree() {\n return _BinaryCharacterTree__WEBPACK_IMPORTED_MODULE_2__.BinaryCharacterTree.characterRoot;\n }\n getName() {\n return this.name;\n }\n}\nConceptsData.conceptsArray = [];\nConceptsData.NPC = [];\nConceptsData.conceptDictionary = [];\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/DataStructures/ConceptData.ts?");
|
|
588
588
|
|
|
589
589
|
/***/ }),
|
|
590
590
|
|
|
@@ -1794,7 +1794,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1794
1794
|
\*******************************************/
|
|
1795
1795
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1796
1796
|
|
|
1797
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FormatConceptsAndConnectionsNormalList: () => (/* binding */ FormatConceptsAndConnectionsNormalList),\n/* harmony export */ FormatFunctionData: () => (/* binding */ FormatFunctionData),\n/* harmony export */ formatFunction: () => (/* binding */ formatFunction),\n/* harmony export */ formatFunctionForData: () => (/* binding */ formatFunctionForData)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ \"./src/app.ts\");\n/* harmony import */ var _Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/RegexFunction */ \"./src/Services/Common/RegexFunction.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n/**\n * ######### Format is normal ######### used for listing. This only provides type connections.\n * This is helpful in building a format that has multiple mainCompositions i.e. in the context of the list\n * The list format is helpful because you do not have to go over each individual query.\n * @param connections the type connections that need (external connections) to be passed\n * @param compositionData this is a dictionary type of format that has all the build compositions {id: { actual data}}\n * @param mainComposition this is list of ids of the main composition that builds the tree\n * @param reverse this is the list of connections ids that needs to go to the reverse direction (to---->from)\n * @returns\n */\nfunction FormatConceptsAndConnectionsNormalList(connections_1, compositionData_1, mainComposition_1, newCompositionData_1) {\n return __awaiter(this, arguments, void 0, function* (connections, compositionData, mainComposition, newCompositionData, reverse = []) {\n var _a, _b, _c, _d, _e;\n let mainData = [];\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n if (toTheConcept.id in compositionData) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n let data = compositionData[connections[i].ofTheConceptId];\n if (data) {\n if (Array.isArray(newData[key][reverseCharater])) {\n newData[key][reverseCharater].push(data);\n }\n else {\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n newData[key][reverseCharater] = [];\n newData[key][reverseCharater].push(data);\n }\n else {\n newData[key][reverseCharater] = data;\n }\n }\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n if (ofTheConcept.id in compositionData) {\n let newData;\n let key = (_d = (_c = ofTheConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n let newType = typeof newData[key];\n if (newType == \"string\") {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let isComp = false;\n let linkerConceptValue = linkerConcept.characterValue;\n if (linkerConceptValue == \"\") {\n linkerConceptValue = toTheConcept.characterValue;\n isComp = true;\n }\n if (linkerConceptValue == \"\") {\n linkerConceptValue = (_e = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue;\n }\n try {\n let data = compositionData[connections[i].toTheConceptId];\n if (data) {\n if (Array.isArray(newData[key])) {\n if (isComp) {\n console.log(\"this is the data\", data, connections[i].toTheConceptId);\n newData[key].push(data[linkerConceptValue]);\n }\n else {\n newData[key].push(data);\n }\n }\n else {\n if (Array.isArray(newData[key][linkerConceptValue])) {\n newData[key][linkerConceptValue].push(data);\n }\n else {\n if (linkerConceptValue.includes(\"_s_\")) {\n newData[key][linkerConceptValue] = [];\n if (isComp) {\n newData[key][linkerConceptValue].push(data[linkerConceptValue]);\n }\n else {\n newData[key][linkerConceptValue].push(data);\n }\n }\n else {\n if (isComp) {\n newData[key][linkerConceptValue] = data[linkerConceptValue];\n }\n else {\n newData[key][linkerConceptValue] = data;\n }\n }\n }\n }\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n }\n for (let i = 0; i < mainComposition.length; i++) {\n let mymainData = compositionData[mainComposition[i]];\n if (mymainData) {\n mymainData[\"id\"] = mainComposition[i];\n mainData.push(mymainData);\n }\n }\n return mainData;\n });\n}\n/**\n *\n * ## Format Normal ##\n * This function takes in the connections and then converts the connections to the single level objects for further processing\n * This function is the builder of the arrays/ objects from the connections.\n */\nfunction formatFunction(connections, compositionData, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let data = {\n [mytype]: value\n };\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(ofTheConcept.id in compositionData)) {\n compositionData[ofTheConcept.id] = {};\n }\n compositionData[ofTheConcept.id][mytype] = value;\n }\n compositionData[toTheConcept.id] = {};\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = toTheConcept.characterValue;\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(toTheConcept.id in compositionData)) {\n compositionData[toTheConcept.id] = {};\n }\n compositionData[toTheConcept.id][mytype] = value;\n }\n compositionData[ofTheConcept.id] = {};\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n/**\n*\n* ## Format Normal ##\n* This function takes in the connections and then converts the connections to the single level objects for further processing\n* This function is the builder of the arrays/ objects from the connections.\n*/\nfunction formatFunctionForData(connections, compositionData, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n if (!(key in newData)) {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let dataCharacter = linkerConcept.characterValue;\n if (dataCharacter == \"\") {\n dataCharacter = mytype;\n dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);\n }\n let data = {\n [mytype]: value\n };\n let reverseCharater = dataCharacter + \"_reverse\";\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n // do nothing\n }\n else {\n if (typeof newData[key] == \"string\") {\n newData[key] = {};\n }\n newData[key][reverseCharater] = data;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n if (!(key in newData)) {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = toTheConcept.characterValue;\n let dataCharacter = linkerConcept.characterValue;\n let originalDataCharacter = linkerConcept.characterValue;\n let isComp = false;\n if (dataCharacter == \"\") {\n dataCharacter = mytype;\n dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);\n isComp = true;\n }\n let data = {\n [mytype]: value\n };\n if (isNaN(Number(dataCharacter))) {\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n // do nothing\n }\n else {\n if (typeof newData[key] == \"string\") {\n newData[key] = {};\n }\n if (isComp) {\n newData[key][dataCharacter] = value;\n }\n else {\n newData[key][dataCharacter] = data;\n }\n }\n }\n else {\n newData[key] = [];\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n/**\n * ## Format DATA-ID ##\n * this function takes in connections and creates a single level objects so that all the data are added to its object/ array.\n * This is then passed on further for stiching.\n * @param connections\n * @param compositionData\n * @param reverse\n * @returns\n */\nfunction FormatFunctionData(connections_1, compositionData_1) {\n return __awaiter(this, arguments, void 0, function* (connections, compositionData, reverse = []) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n if (reverseCharater.includes(\"_s_\")) {\n if (!(ofTheConcept.id in compositionData)) {\n compositionData[ofTheConcept.id] = {};\n }\n compositionData[ofTheConcept.id][mytype] = value;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n try {\n 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\";\n let value = toTheConcept.characterValue;\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(toTheConcept.id in compositionData)) {\n compositionData[toTheConcept.id] = {};\n }\n compositionData[toTheConcept.id][mytype] = value;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/Search/FormatData.ts?");
|
|
1797
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FormatConceptsAndConnectionsNormalList: () => (/* binding */ FormatConceptsAndConnectionsNormalList),\n/* harmony export */ FormatFunctionData: () => (/* binding */ FormatFunctionData),\n/* harmony export */ formatFunction: () => (/* binding */ formatFunction),\n/* harmony export */ formatFunctionForData: () => (/* binding */ formatFunctionForData)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ \"./src/app.ts\");\n/* harmony import */ var _Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Common/RegexFunction */ \"./src/Services/Common/RegexFunction.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n/**\n * ######### Format is normal ######### used for listing. This only provides type connections.\n * This is helpful in building a format that has multiple mainCompositions i.e. in the context of the list\n * The list format is helpful because you do not have to go over each individual query.\n * @param connections the type connections that need (external connections) to be passed\n * @param compositionData this is a dictionary type of format that has all the build compositions {id: { actual data}}\n * @param mainComposition this is list of ids of the main composition that builds the tree\n * @param reverse this is the list of connections ids that needs to go to the reverse direction (to---->from)\n * @returns\n */\nfunction FormatConceptsAndConnectionsNormalList(connections_1, compositionData_1, mainComposition_1, newCompositionData_1) {\n return __awaiter(this, arguments, void 0, function* (connections, compositionData, mainComposition, newCompositionData, reverse = []) {\n var _a, _b, _c, _d, _e;\n let mainData = [];\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n if (toTheConcept.id in compositionData) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n let data = compositionData[connections[i].ofTheConceptId];\n if (data) {\n if (Array.isArray(newData[key][reverseCharater])) {\n newData[key][reverseCharater].push(data);\n }\n else {\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n newData[key][reverseCharater] = [];\n newData[key][reverseCharater].push(data);\n }\n else {\n newData[key][reverseCharater] = data;\n }\n }\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n if (ofTheConcept.id in compositionData) {\n let newData;\n let key = (_d = (_c = ofTheConcept.type) === null || _c === void 0 ? void 0 : _c.characterValue) !== null && _d !== void 0 ? _d : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n let newType = typeof newData[key];\n if (newType == \"string\") {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let isComp = false;\n let linkerConceptValue = linkerConcept.characterValue;\n if (linkerConceptValue == \"\") {\n linkerConceptValue = toTheConcept.characterValue;\n isComp = true;\n }\n if (linkerConceptValue == \"\") {\n linkerConceptValue = (_e = toTheConcept === null || toTheConcept === void 0 ? void 0 : toTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue;\n }\n try {\n let data = compositionData[connections[i].toTheConceptId];\n if (data) {\n if (Array.isArray(newData[key])) {\n if (isComp) {\n newData[key].push(data[linkerConceptValue]);\n }\n else {\n newData[key].push(data);\n }\n }\n else {\n if (Array.isArray(newData[key][linkerConceptValue])) {\n newData[key][linkerConceptValue].push(data);\n }\n else {\n if (linkerConceptValue.includes(\"_s_\")) {\n newData[key][linkerConceptValue] = [];\n if (isComp) {\n newData[key][linkerConceptValue].push(data[linkerConceptValue]);\n }\n else {\n newData[key][linkerConceptValue].push(data);\n }\n }\n else {\n if (isComp) {\n newData[key][linkerConceptValue] = data[linkerConceptValue];\n }\n else {\n newData[key][linkerConceptValue] = data;\n }\n }\n }\n }\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n }\n for (let i = 0; i < mainComposition.length; i++) {\n let mymainData = compositionData[mainComposition[i]];\n if (mymainData) {\n mymainData[\"id\"] = mainComposition[i];\n mainData.push(mymainData);\n }\n }\n return mainData;\n });\n}\n/**\n *\n * ## Format Normal ##\n * This function takes in the connections and then converts the connections to the single level objects for further processing\n * This function is the builder of the arrays/ objects from the connections.\n */\nfunction formatFunction(connections, compositionData, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let data = {\n [mytype]: value\n };\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(ofTheConcept.id in compositionData)) {\n compositionData[ofTheConcept.id] = {};\n }\n compositionData[ofTheConcept.id][mytype] = value;\n }\n compositionData[toTheConcept.id] = {};\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = toTheConcept.characterValue;\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(toTheConcept.id in compositionData)) {\n compositionData[toTheConcept.id] = {};\n }\n compositionData[toTheConcept.id][mytype] = value;\n }\n compositionData[ofTheConcept.id] = {};\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n/**\n*\n* ## Format Normal ##\n* This function takes in the connections and then converts the connections to the single level objects for further processing\n* This function is the builder of the arrays/ objects from the connections.\n*/\nfunction formatFunctionForData(connections, compositionData, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n if (!(key in newData)) {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let dataCharacter = linkerConcept.characterValue;\n if (dataCharacter == \"\") {\n dataCharacter = mytype;\n dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);\n }\n let data = {\n [mytype]: value\n };\n let reverseCharater = dataCharacter + \"_reverse\";\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n // do nothing\n }\n else {\n if (typeof newData[key] == \"string\") {\n newData[key] = {};\n }\n newData[key][reverseCharater] = data;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n if (!(key in newData)) {\n newData[key] = {};\n }\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n try {\n 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\";\n let value = toTheConcept.characterValue;\n let dataCharacter = linkerConcept.characterValue;\n let originalDataCharacter = linkerConcept.characterValue;\n let isComp = false;\n if (dataCharacter == \"\") {\n dataCharacter = mytype;\n dataCharacter = (0,_Common_RegexFunction__WEBPACK_IMPORTED_MODULE_1__.removeThePrefix)(dataCharacter);\n isComp = true;\n }\n let data = {\n [mytype]: value\n };\n if (isNaN(Number(dataCharacter))) {\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n // do nothing\n }\n else {\n if (typeof newData[key] == \"string\") {\n newData[key] = {};\n }\n if (isComp) {\n newData[key][dataCharacter] = value;\n }\n else {\n newData[key][dataCharacter] = data;\n }\n }\n }\n else {\n newData[key] = [];\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n/**\n * ## Format DATA-ID ##\n * this function takes in connections and creates a single level objects so that all the data are added to its object/ array.\n * This is then passed on further for stiching.\n * @param connections\n * @param compositionData\n * @param reverse\n * @returns\n */\nfunction FormatFunctionData(connections_1, compositionData_1) {\n return __awaiter(this, arguments, void 0, function* (connections, compositionData, reverse = []) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let myConcepts = [];\n for (let i = 0; i < connections.length; i++) {\n myConcepts.push(connections[i].toTheConceptId);\n myConcepts.push(connections[i].ofTheConceptId);\n myConcepts.push(connections[i].typeId);\n }\n connections.sort(function (x, y) {\n return y.id - x.id;\n });\n for (let i = 0; i < connections.length; i++) {\n let reverseFlag = false;\n let ofTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].ofTheConceptId);\n let toTheConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].toTheConceptId);\n if (reverse.includes(connections[i].id)) {\n reverseFlag = true;\n }\n if (reverseFlag == true) {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let key = (_b = (_a = toTheConcept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : \"self\";\n if (connections[i].toTheConceptId in compositionData) {\n newData = compositionData[connections[i].toTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].toTheConceptId] = newData;\n }\n try {\n 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\";\n let value = ofTheConcept.characterValue;\n let reverseCharater = linkerConcept.characterValue + \"_reverse\";\n if (reverseCharater.includes(\"_s_\")) {\n if (!(ofTheConcept.id in compositionData)) {\n compositionData[ofTheConcept.id] = {};\n }\n compositionData[ofTheConcept.id][mytype] = value;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n else {\n if (ofTheConcept.id != 0 && toTheConcept.id != 0) {\n let newData;\n let linkerConcept = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.GetTheConcept)(connections[i].typeId);\n let key = (_f = (_e = ofTheConcept.type) === null || _e === void 0 ? void 0 : _e.characterValue) !== null && _f !== void 0 ? _f : \"self\";\n if (connections[i].ofTheConceptId in compositionData) {\n newData = compositionData[connections[i].ofTheConceptId];\n }\n else {\n newData = {};\n newData[key] = {};\n compositionData[connections[i].ofTheConceptId] = newData;\n }\n try {\n 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\";\n let value = toTheConcept.characterValue;\n if (linkerConcept.characterValue.includes(\"_s_\")) {\n if (!(toTheConcept.id in compositionData)) {\n compositionData[toTheConcept.id] = {};\n }\n compositionData[toTheConcept.id][mytype] = value;\n }\n }\n catch (ex) {\n console.log(\"this is error\", ex);\n }\n }\n }\n }\n return compositionData;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/Search/FormatData.ts?");
|
|
1798
1798
|
|
|
1799
1799
|
/***/ }),
|
|
1800
1800
|
|
|
@@ -1834,7 +1834,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
1834
1834
|
\********************************************************/
|
|
1835
1835
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
1836
1836
|
|
|
1837
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SearchWithTypeAndLinker: () => (/* binding */ SearchWithTypeAndLinker),\n/* harmony export */ SearchWithTypeAndLinkerDataId: () => (/* binding */ SearchWithTypeAndLinkerDataId),\n/* harmony export */ formatConnections: () => (/* binding */ formatConnections),\n/* harmony export */ formatConnectionsDataId: () => (/* binding */ formatConnectionsDataId),\n/* harmony export */ formatConnectionsJustId: () => (/* binding */ formatConnectionsJustId),\n/* harmony export */ formatDataArrayDataId: () => (/* binding */ formatDataArrayDataId),\n/* harmony export */ formatDataArrayNormal: () => (/* binding */ formatDataArrayNormal),\n/* harmony export */ formatLinkersNormal: () => (/* binding */ formatLinkersNormal)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ \"./src/app.ts\");\n/* harmony import */ var _GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../GetCompositionBulk */ \"./src/Services/GetCompositionBulk.ts\");\n/* harmony import */ var _FormatData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FormatData */ \"./src/Services/Search/FormatData.ts\");\n/* harmony import */ var _SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SearchLinkMultiple */ \"./src/Services/Search/SearchLinkMultiple.ts\");\n/* harmony import */ var _JustIdFormat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./JustIdFormat */ \"./src/Services/Search/JustIdFormat.ts\");\n/* harmony import */ var _DataIdFormat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DataIdFormat */ \"./src/Services/Search/DataIdFormat.ts\");\n/* harmony import */ var _Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/DecodeCountInfo */ \"./src/Services/Common/DecodeCountInfo.ts\");\n/* harmony import */ var _orderingConnections__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./orderingConnections */ \"./src/Services/Search/orderingConnections.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n\n\n\n/**\n * This function will help you search a concept by their type and also to query inside of it.\n * Put the number of compositions you want to get in the searchStructure which can be set by inpage and page\n * Then the type should be set in searchQuery for the compositionName.\n * Inside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\n * This will give the id of the structures.\n */\nfunction SearchWithTypeAndLinkerDataId(searchStructure_1, searchQuery_1) {\n return __awaiter(this, arguments, void 0, function* (searchStructure, searchQuery, token = \"\") {\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchWithTypeAndLinkerApi)(searchStructure, searchQuery, token);\n let conceptIds = result.compositionIds;\n let connections = result.internalConnections;\n let linkers = result.linkers;\n let reverse = result.reverse;\n let mainCompositionIds = result.mainCompositionIds;\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsWithDataIdInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatFromConnectionsAlteredArray)(prefetchConnections, concepts, conceptIds, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * This function will help you search a concept by their type and also to query inside of it.\n * Put the number of compositions you want to get in the searchStructure which can be set by inpage and page\n * Then the type should be set in searchQuery for the compositionName.\n * Inside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\n * This will not give the id of the structures.\n */\nfunction SearchWithTypeAndLinker(searchStructure_1, searchQuery_1) {\n return __awaiter(this, arguments, void 0, function* (searchStructure, searchQuery, token = \"\") {\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchWithTypeAndLinkerApi)(searchStructure, searchQuery, token);\n let conceptIds = result.compositionIds;\n let connections = result.internalConnections;\n let linkers = result.linkers;\n let reverse = result.reverse;\n let mainCompositionIds = result.mainCompositionIds;\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format dataid ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatDataArrayDataId(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsWithDataIdInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatFromConnectionsAlteredArray)(prefetchConnections, concepts, conceptIds, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatDataArrayNormal(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObjectNormal)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatLinkersNormal(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObjectNormal)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnections(linkers, conceptIds, mainCompositionIds, reverse, countInfos) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n //let CountDictionary:any = await GetConnectionTypeForCount(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunctionForData)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.FormatConceptsAndConnectionsNormalList)(prefetchConnections, compositionData, mainCompositionIds, newCompositionData, reverse);\n return output;\n });\n}\n/**\n * ## Format JustId ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnectionsJustId(linkers_1, conceptIds_1, mainCompositionIds_1, reverse_1, countInfos_1) {\n return __awaiter(this, arguments, void 0, function* (linkers, conceptIds, mainCompositionIds, reverse, countInfos, order = \"DESC\") {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let CountDictionary = yield (0,_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__.GetConnectionTypeForCount)(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections, order);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_JustIdFormat__WEBPACK_IMPORTED_MODULE_4__.FormatFunctionDataForDataJustId)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_JustIdFormat__WEBPACK_IMPORTED_MODULE_4__.FormatFromConnectionsAlteredArrayExternalJustId)(prefetchConnections, compositionData, mainCompositionIds, reverse, CountDictionary);\n return output;\n });\n}\n/**\n * ## Format DATA-ID ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnectionsDataId(linkers_1, conceptIds_1, mainCompositionIds_1, reverse_1, countInfos_1) {\n return __awaiter(this, arguments, void 0, function* (linkers, conceptIds, mainCompositionIds, reverse, countInfos, order = \"DESC\") {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let CountDictionary = yield (0,_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__.GetConnectionTypeForCount)(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections, order);\n console.log(\"this is the prfetch connections\", prefetchConnections);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionData)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionDataForData)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFromConnectionsAlteredArrayExternal)(prefetchConnections, compositionData, newCompositionData, mainCompositionIds, reverse, CountDictionary);\n return output;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/Search/SearchWithTypeAndLinker.ts?");
|
|
1837
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SearchWithTypeAndLinker: () => (/* binding */ SearchWithTypeAndLinker),\n/* harmony export */ SearchWithTypeAndLinkerDataId: () => (/* binding */ SearchWithTypeAndLinkerDataId),\n/* harmony export */ formatConnections: () => (/* binding */ formatConnections),\n/* harmony export */ formatConnectionsDataId: () => (/* binding */ formatConnectionsDataId),\n/* harmony export */ formatConnectionsJustId: () => (/* binding */ formatConnectionsJustId),\n/* harmony export */ formatDataArrayDataId: () => (/* binding */ formatDataArrayDataId),\n/* harmony export */ formatDataArrayNormal: () => (/* binding */ formatDataArrayNormal),\n/* harmony export */ formatLinkersNormal: () => (/* binding */ formatLinkersNormal)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../app */ \"./src/app.ts\");\n/* harmony import */ var _GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../GetCompositionBulk */ \"./src/Services/GetCompositionBulk.ts\");\n/* harmony import */ var _FormatData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FormatData */ \"./src/Services/Search/FormatData.ts\");\n/* harmony import */ var _SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SearchLinkMultiple */ \"./src/Services/Search/SearchLinkMultiple.ts\");\n/* harmony import */ var _JustIdFormat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./JustIdFormat */ \"./src/Services/Search/JustIdFormat.ts\");\n/* harmony import */ var _DataIdFormat__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DataIdFormat */ \"./src/Services/Search/DataIdFormat.ts\");\n/* harmony import */ var _Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Common/DecodeCountInfo */ \"./src/Services/Common/DecodeCountInfo.ts\");\n/* harmony import */ var _orderingConnections__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./orderingConnections */ \"./src/Services/Search/orderingConnections.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\n\n\n\n/**\n * This function will help you search a concept by their type and also to query inside of it.\n * Put the number of compositions you want to get in the searchStructure which can be set by inpage and page\n * Then the type should be set in searchQuery for the compositionName.\n * Inside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\n * This will give the id of the structures.\n */\nfunction SearchWithTypeAndLinkerDataId(searchStructure_1, searchQuery_1) {\n return __awaiter(this, arguments, void 0, function* (searchStructure, searchQuery, token = \"\") {\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchWithTypeAndLinkerApi)(searchStructure, searchQuery, token);\n let conceptIds = result.compositionIds;\n let connections = result.internalConnections;\n let linkers = result.linkers;\n let reverse = result.reverse;\n let mainCompositionIds = result.mainCompositionIds;\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsWithDataIdInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatFromConnectionsAlteredArray)(prefetchConnections, concepts, conceptIds, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * This function will help you search a concept by their type and also to query inside of it.\n * Put the number of compositions you want to get in the searchStructure which can be set by inpage and page\n * Then the type should be set in searchQuery for the compositionName.\n * Inside the searchQuery array this you can set the full linker / listLinker in the searchQuery.\n * This will not give the id of the structures.\n */\nfunction SearchWithTypeAndLinker(searchStructure_1, searchQuery_1) {\n return __awaiter(this, arguments, void 0, function* (searchStructure, searchQuery, token = \"\") {\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.SearchWithTypeAndLinkerApi)(searchStructure, searchQuery, token);\n let conceptIds = result.compositionIds;\n let connections = result.internalConnections;\n let linkers = result.linkers;\n let reverse = result.reverse;\n let mainCompositionIds = result.mainCompositionIds;\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format dataid ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatDataArrayDataId(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsWithDataIdInObject)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatFromConnectionsAlteredArray)(prefetchConnections, concepts, conceptIds, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatDataArrayNormal(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObjectNormal)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * @param linkers\n * @param conceptIds\n * @param connections\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatLinkersNormal(linkers, conceptIds, connections, mainCompositionIds, reverse) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let concepts = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetCompositionFromConnectionsInObjectNormal)(conceptIds, connections);\n let output = yield (0,_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_3__.FormatConceptsAndConnections)(prefetchConnections, concepts, mainCompositionIds, reverse);\n return output;\n });\n}\n/**\n * ## Format Normal ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnections(linkers, conceptIds, mainCompositionIds, reverse, countInfos) {\n return __awaiter(this, void 0, void 0, function* () {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n //let CountDictionary:any = await GetConnectionTypeForCount(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections);\n let compositionData = [];\n let newCompositionData = [];\n let time1 = new Date().getTime();\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);\n console.log(\"format1\", new Date().getTime() - time1);\n let time2 = new Date().getTime();\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunctionForData)(prefetchConnections, compositionData, reverse);\n console.log(\"format2\", new Date().getTime() - time2);\n let time3 = new Date().getTime();\n let output = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.FormatConceptsAndConnectionsNormalList)(prefetchConnections, compositionData, mainCompositionIds, newCompositionData, reverse);\n console.log(\"format3\", new Date().getTime() - time3);\n return output;\n });\n}\n/**\n * ## Format JustId ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnectionsJustId(linkers_1, conceptIds_1, mainCompositionIds_1, reverse_1, countInfos_1) {\n return __awaiter(this, arguments, void 0, function* (linkers, conceptIds, mainCompositionIds, reverse, countInfos, order = \"DESC\") {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let CountDictionary = yield (0,_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__.GetConnectionTypeForCount)(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections, order);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_FormatData__WEBPACK_IMPORTED_MODULE_2__.formatFunction)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_JustIdFormat__WEBPACK_IMPORTED_MODULE_4__.FormatFunctionDataForDataJustId)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_JustIdFormat__WEBPACK_IMPORTED_MODULE_4__.FormatFromConnectionsAlteredArrayExternalJustId)(prefetchConnections, compositionData, mainCompositionIds, reverse, CountDictionary);\n return output;\n });\n}\n/**\n * ## Format DATA-ID ##\n * This function fetches all the connections and then converts all the connections to the single level connections\n * Then those single level objects are then stiched together to create a complex json/ array.\n * @param linkers\n * @param conceptIds\n * @param mainCompositionIds\n * @param reverse\n * @returns\n */\nfunction formatConnectionsDataId(linkers_1, conceptIds_1, mainCompositionIds_1, reverse_1, countInfos_1) {\n return __awaiter(this, arguments, void 0, function* (linkers, conceptIds, mainCompositionIds, reverse, countInfos, order = \"DESC\") {\n let prefetchConnections = yield (0,_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_1__.GetConnectionDataPrefetch)(linkers);\n let CountDictionary = yield (0,_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_6__.GetConnectionTypeForCount)(countInfos);\n prefetchConnections = (0,_orderingConnections__WEBPACK_IMPORTED_MODULE_7__.orderTheConnections)(prefetchConnections, order);\n console.log(\"this is the prfetch connections\", prefetchConnections);\n let compositionData = [];\n let newCompositionData = [];\n compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionData)(prefetchConnections, compositionData, reverse);\n compositionData = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFunctionDataForData)(prefetchConnections, compositionData, reverse);\n let output = yield (0,_DataIdFormat__WEBPACK_IMPORTED_MODULE_5__.FormatFromConnectionsAlteredArrayExternal)(prefetchConnections, compositionData, newCompositionData, mainCompositionIds, reverse, CountDictionary);\n return output;\n });\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/Services/Search/SearchWithTypeAndLinker.ts?");
|
|
1838
1838
|
|
|
1839
1839
|
/***/ }),
|
|
1840
1840
|
|
|
@@ -2084,7 +2084,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
2084
2084
|
\*******************************************************/
|
|
2085
2085
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
2086
2086
|
|
|
2087
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SchemaQueryListener: () => (/* binding */ SchemaQueryListener),\n/* harmony export */ SearchLinkMultipleAllObservable: () => (/* binding */ SearchLinkMultipleAllObservable)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\n/* harmony import */ var _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Constants/FormatConstants */ \"./src/Constants/FormatConstants.ts\");\n/* harmony import */ var _Services_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Services/Common/DecodeCountInfo */ \"./src/Services/Common/DecodeCountInfo.ts\");\n/* harmony import */ var _Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Services/Search/SearchWithTypeAndLinker */ \"./src/Services/Search/SearchWithTypeAndLinker.ts\");\n/* harmony import */ var _DepenedencyObserver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DepenedencyObserver */ \"./src/WrapperFunctions/DepenedencyObserver.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\nclass SearchLinkMultipleAllObservable extends _DepenedencyObserver__WEBPACK_IMPORTED_MODULE_4__.DependencyObserver {\n constructor(query, token) {\n super();\n this.mainCompositionIds = [];\n this.query = new _app__WEBPACK_IMPORTED_MODULE_0__.FreeschemaQuery();\n this.countInfoStrings = [];\n this.order = \"DESC\";\n this.query = query;\n this.format = query.outputFormat;\n this.order = query.order;\n }\n bind() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.isDataLoaded) {\n this.isDataLoaded = true;\n this.query.outputFormat = _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.ALLID;\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.FreeschemaQueryApi)(this.query, \"\");\n this.conceptIds = result.conceptIds;\n this.internalConnections = result.internalConnections;\n this.linkers = result.linkers;\n this.reverse = result.reverse;\n this.mainCompositionIds = result.mainCompositionIds;\n this.countInfoStrings = result.countinfo;\n }\n return yield this.build();\n });\n }\n build() {\n return __awaiter(this, void 0, void 0, function* () {\n let countInfos = (0,_Services_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_2__.DecodeCountInfo)(this.countInfoStrings);\n if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.DATAID) {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnectionsDataId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos, this.order);\n }\n else if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.JUSTDATA) {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnectionsJustId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos, this.order);\n }\n else {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnections)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos);\n //this.data = await formatDataArrayNormal(this.linkers, this.conceptIds, this.internalConnections, this.mainCompositionIds, this.reverse );\n }\n return this.data;\n });\n }\n}\n/**\n *\n * @param id this is the id whose links need to be found\n * @param linker this is the type connection that is connected to the mainConcept(id)\n * @param inpage number of outputs that has to be displayed\n * @param page the page which needs to be displayed as per the inpage parameter\n * @param format the format in which the output should be displayed (NORMAL, DATAID,JUSTDATA,DATAIDDATE)\n */\nfunction SchemaQueryListener(query, token) {\n return new SearchLinkMultipleAllObservable(query, token);\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/WrapperFunctions/SchemaQueryObservable.ts?");
|
|
2087
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SchemaQueryListener: () => (/* binding */ SchemaQueryListener),\n/* harmony export */ SearchLinkMultipleAllObservable: () => (/* binding */ SearchLinkMultipleAllObservable)\n/* harmony export */ });\n/* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../app */ \"./src/app.ts\");\n/* harmony import */ var _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Constants/FormatConstants */ \"./src/Constants/FormatConstants.ts\");\n/* harmony import */ var _Services_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Services/Common/DecodeCountInfo */ \"./src/Services/Common/DecodeCountInfo.ts\");\n/* harmony import */ var _Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Services/Search/SearchWithTypeAndLinker */ \"./src/Services/Search/SearchWithTypeAndLinker.ts\");\n/* harmony import */ var _DepenedencyObserver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DepenedencyObserver */ \"./src/WrapperFunctions/DepenedencyObserver.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\n\n\nclass SearchLinkMultipleAllObservable extends _DepenedencyObserver__WEBPACK_IMPORTED_MODULE_4__.DependencyObserver {\n constructor(query, token) {\n super();\n this.mainCompositionIds = [];\n this.query = new _app__WEBPACK_IMPORTED_MODULE_0__.FreeschemaQuery();\n this.countInfoStrings = [];\n this.order = \"DESC\";\n this.query = query;\n this.format = query.outputFormat;\n this.order = query.order;\n }\n bind() {\n return __awaiter(this, void 0, void 0, function* () {\n if (!this.isDataLoaded) {\n this.isDataLoaded = true;\n this.query.outputFormat = _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.ALLID;\n let result = yield (0,_app__WEBPACK_IMPORTED_MODULE_0__.FreeschemaQueryApi)(this.query, \"\");\n this.conceptIds = result.conceptIds;\n this.internalConnections = result.internalConnections;\n this.linkers = result.linkers;\n this.reverse = result.reverse;\n this.mainCompositionIds = result.mainCompositionIds;\n this.countInfoStrings = result.countinfo;\n }\n return yield this.build();\n });\n }\n build() {\n return __awaiter(this, void 0, void 0, function* () {\n let countInfos = (0,_Services_Common_DecodeCountInfo__WEBPACK_IMPORTED_MODULE_2__.DecodeCountInfo)(this.countInfoStrings);\n if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.DATAID) {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnectionsDataId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos, this.order);\n }\n else if (this.format == _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_1__.JUSTDATA) {\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnectionsJustId)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos, this.order);\n }\n else {\n console.time(\"format\");\n this.data = yield (0,_Services_Search_SearchWithTypeAndLinker__WEBPACK_IMPORTED_MODULE_3__.formatConnections)(this.linkers, this.conceptIds, this.mainCompositionIds, this.reverse, countInfos);\n console.timeEnd(\"format\");\n //this.data = await formatDataArrayNormal(this.linkers, this.conceptIds, this.internalConnections, this.mainCompositionIds, this.reverse );\n }\n return this.data;\n });\n }\n}\n/**\n *\n * @param id this is the id whose links need to be found\n * @param linker this is the type connection that is connected to the mainConcept(id)\n * @param inpage number of outputs that has to be displayed\n * @param page the page which needs to be displayed as per the inpage parameter\n * @param format the format in which the output should be displayed (NORMAL, DATAID,JUSTDATA,DATAIDDATE)\n */\nfunction SchemaQueryListener(query, token) {\n return new SearchLinkMultipleAllObservable(query, token);\n}\n\n\n//# sourceURL=webpack://mftsccs-browser/./src/WrapperFunctions/SchemaQueryObservable.ts?");
|
|
2088
2088
|
|
|
2089
2089
|
/***/ }),
|
|
2090
2090
|
|