@colabo-knalledge/i-core-services 1.6.0 → 1.8.0
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/CHANGELOG.md +32 -0
- package/dist/cjs/index.js +29 -11
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +29 -11
- package/dist/esm/index.js.map +2 -2
- package/dist/types/lib/kContainer-service.d.ts +3 -3
- package/dist/types/lib/kEdge-service.d.ts +1 -1
- package/dist/types/lib/kNode-service-extended.d.ts +1 -1
- package/dist/types/lib/kNode-service.d.ts +1 -1
- package/package.json +11 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
+
# [@colabo-knalledge/i-core-services-v1.8.0](https://github.com/Cha-OS/colabo/compare/@colabo-knalledge/i-core-services-v1.7.0...@colabo-knalledge/i-core-services-v1.8.0) (2026-12-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **flow-core:** replace self-imports with relative paths for esbuild ([5cf0a72](https://github.com/Cha-OS/colabo/commit/5cf0a727eac0e1306b8949fe419b9fde0b8394fd))
|
|
7
|
+
* **knalledge:** 🔧 move rxjs from peerDependencies to devDependencies and bump to ^7.8.2 ([374c4a4](https://github.com/Cha-OS/colabo/commit/374c4a4f7abfbf1eb1e527e8fd97671a77f3e0cf))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **knalledge,dataset:** 🔗 пропагација mapId кроз едгеве и датасете ([a7edf7a](https://github.com/Cha-OS/colabo/commit/a7edf7a24532d1c124de876a878d18fe595f5843))
|
|
13
|
+
|
|
14
|
+
# [@colabo-knalledge/i-core-services-v1.8.0](https://github.com/Cha-OS/colabo/compare/@colabo-knalledge/i-core-services-v1.7.0...@colabo-knalledge/i-core-services-v1.8.0) (2026-12-05)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **knalledge:** 🔧 move rxjs from peerDependencies to devDependencies and bump to ^7.8.2 ([374c4a4](https://github.com/Cha-OS/colabo/commit/374c4a4f7abfbf1eb1e527e8fd97671a77f3e0cf))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **knalledge,dataset:** 🔗 пропагација mapId кроз едгеве и датасете ([a7edf7a](https://github.com/Cha-OS/colabo/commit/a7edf7a24532d1c124de876a878d18fe595f5843))
|
|
25
|
+
|
|
26
|
+
# [@colabo-knalledge/i-core-services-v1.7.0](https://github.com/Cha-OS/colabo/compare/@colabo-knalledge/i-core-services-v1.6.0...@colabo-knalledge/i-core-services-v1.7.0) (2026-06-08)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* **knalledge:** add fetchFn injection to all GET service methods for worker-based fetch ([275eb46](https://github.com/Cha-OS/colabo/commit/275eb462595cd57b5bc4ad28bdb7bc8bff4ebe34))
|
|
32
|
+
|
|
1
33
|
# [@colabo-knalledge/i-core-services-v1.6.0](https://github.com/Cha-OS/colabo/compare/@colabo-knalledge/i-core-services-v1.5.3...@colabo-knalledge/i-core-services-v1.6.0) (2026-06-08)
|
|
2
34
|
|
|
3
35
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -386,14 +386,16 @@ var ColaboKnAllEdgeContainerService = class extends CFServiceIsomorphic {
|
|
|
386
386
|
* @description adds kNodes in a kContainer
|
|
387
387
|
* @returns edges created between the container and entities added to the container
|
|
388
388
|
*/
|
|
389
|
-
async updateAddNodes(containerId, containedIds, edgeDataContent) {
|
|
389
|
+
async updateAddNodes(containerId, containedIds, edgeDataContent, mapId) {
|
|
390
390
|
if (DEBUG) console.log("[ColaboKnAllEdgeContainerService::updateAddNodes(containerId, containedIds)", containerId, containedIds);
|
|
391
391
|
let result;
|
|
392
392
|
const idsStr = containedIds.join(",");
|
|
393
393
|
const url = this.apiUrl + this.defaultAction + "/" + import_i_core4.KCONTAINER_API_TYPE.UPDATE_ADD_KNODE_BY_IDS + "/" + containerId + "/" + idsStr;
|
|
394
394
|
if (DEBUG) console.log("updateAddNodes called", url);
|
|
395
395
|
try {
|
|
396
|
-
const body =
|
|
396
|
+
const body = {};
|
|
397
|
+
if (edgeDataContent) body.edgeDataContent = edgeDataContent;
|
|
398
|
+
if (mapId) body.mapId = mapId;
|
|
397
399
|
const mResult = await import_axios2.default.put(url, body, HTTP_OPTIONS_CONST_JSON);
|
|
398
400
|
const serverData = mResult.data;
|
|
399
401
|
result = import_i_core4.ColaboApiOperators.extractVosFromServerData(serverData);
|
|
@@ -431,11 +433,13 @@ var ColaboKnAllEdgeContainerService = class extends CFServiceIsomorphic {
|
|
|
431
433
|
* @param id The id of the kContainer which kNodes we want to retrieve
|
|
432
434
|
* @description retrieves kNodes in a kContainer
|
|
433
435
|
*/
|
|
434
|
-
async getInContainer(id, fields) {
|
|
435
|
-
let result;
|
|
436
|
+
async getInContainer(id, fields, fetchFn) {
|
|
436
437
|
const url = import_i_core4.ColaboApiOperators.appendFieldsParam(this.apiUrl + this.defaultAction + "/" + import_i_core4.KCONTAINER_API_TYPE.INDEX_IN_CONTAINER + "/" + id + ".json", fields);
|
|
437
438
|
if (DEBUG) console.log(`this.apiUrl:${this.apiUrl}, this.defaultAction:${this.defaultAction}`);
|
|
438
439
|
try {
|
|
440
|
+
if (fetchFn) {
|
|
441
|
+
return await fetchFn(url);
|
|
442
|
+
}
|
|
439
443
|
const response = await this.http.get(url).toPromise();
|
|
440
444
|
if (DEBUG_VERBOSE) console.log(`[ColaboKnAllEdgeContainerService::getInContainer] response`, response);
|
|
441
445
|
if (!response) {
|
|
@@ -450,11 +454,14 @@ var ColaboKnAllEdgeContainerService = class extends CFServiceIsomorphic {
|
|
|
450
454
|
}
|
|
451
455
|
}
|
|
452
456
|
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
|
|
453
|
-
async getVOs(type, upperLayerType, fields) {
|
|
457
|
+
async getVOs(type, upperLayerType, fields, fetchFn) {
|
|
454
458
|
let result;
|
|
455
459
|
const url = import_i_core4.ColaboApiOperators.appendFieldsParam(`${this.apiUrl}${this.defaultAction}/${import_i_core4.KCONTAINER_API_TYPE.INDEX_BY_TYPE}/${type}${upperLayerType ? "/" + upperLayerType : ""}.json`, fields);
|
|
456
|
-
const mResult = await import_axios2.default.get(url);
|
|
457
460
|
try {
|
|
461
|
+
if (fetchFn) {
|
|
462
|
+
return await fetchFn(url);
|
|
463
|
+
}
|
|
464
|
+
const mResult = await import_axios2.default.get(url);
|
|
458
465
|
const serverData = mResult.data;
|
|
459
466
|
result = import_i_core4.ColaboApiOperators.extractVosFromServerData(serverData);
|
|
460
467
|
if (!result) {
|
|
@@ -600,14 +607,17 @@ var ColaboKnAllEdgeNodeService = class extends CFServiceIsomorphic {
|
|
|
600
607
|
throw new Error("This should never be reached, but throwing just because of TS error in diagnosing unreachable end");
|
|
601
608
|
}
|
|
602
609
|
}
|
|
603
|
-
async getVosWithColaboApi(request) {
|
|
610
|
+
async getVosWithColaboApi(request, fetchFn) {
|
|
604
611
|
request.type = import_i_core10.KNODE_API_TYPE.INDEX_COLABO_API;
|
|
605
612
|
const requestSerialized = import_i_core10.ColaboApiOperators.serializeApiRequest(request);
|
|
606
613
|
let result = [];
|
|
607
614
|
const url = import_i_core10.ColaboApiOperators.appendFieldsParam(this.apiUrl + import_i_core10.KNODE_API_TYPE.INDEX_COLABO_API + "/" + this.defaultAction + "/" + requestSerialized + ".json", request.fields);
|
|
608
615
|
if (DEBUG3) console.log("[getVos] url: ", url);
|
|
609
|
-
const mResult = await import_axios3.default.get(url);
|
|
610
616
|
try {
|
|
617
|
+
if (fetchFn) {
|
|
618
|
+
return await fetchFn(url);
|
|
619
|
+
}
|
|
620
|
+
const mResult = await import_axios3.default.get(url);
|
|
611
621
|
const serverData = mResult.data;
|
|
612
622
|
if (!serverData) return result;
|
|
613
623
|
result = import_i_core10.ColaboApiOperators.extractVosFromServerData(serverData);
|
|
@@ -789,11 +799,16 @@ var ColaboKnAllEdgeNodeServiceExtended = class extends ColaboKnAllEdgeNodeServic
|
|
|
789
799
|
static get mapId() {
|
|
790
800
|
return config2.GetString("mapId");
|
|
791
801
|
}
|
|
792
|
-
async queryByIds(ids, fields, callback) {
|
|
802
|
+
async queryByIds(ids, fields, callback, fetchFn) {
|
|
793
803
|
if (DEBUG4) console.log("queryByIds", ids);
|
|
794
804
|
const idsStr = ids.join(",");
|
|
795
805
|
const url = import_i_core15.ColaboApiOperators.appendFieldsParam(this.apiUrl + import_i_core15.KNODE_API_TYPE.INDEX_ID_IN + "/" + this.defaultAction + "/" + idsStr + ".json", fields);
|
|
796
806
|
try {
|
|
807
|
+
if (fetchFn) {
|
|
808
|
+
const rawNodes = await fetchFn(url);
|
|
809
|
+
if (callback) callback(rawNodes);
|
|
810
|
+
return rawNodes;
|
|
811
|
+
}
|
|
797
812
|
const mResult = await import_axios4.default.get(url);
|
|
798
813
|
const serverData = mResult.data;
|
|
799
814
|
const result = CFServiceIsomorphic.processVOs(serverData, import_i_core14.KNodeFrontend);
|
|
@@ -1128,15 +1143,18 @@ var KnalledgeEdgeService = class extends CFServiceIsomorphic {
|
|
|
1128
1143
|
this.apiUrl = KnalledgeEdgeService.serverAP + "/" + import_i_core18.KEDGE_API_PARAMS.API_PATH + "/";
|
|
1129
1144
|
console.log("[KnalledgeEdgeService] REST API URL: ", import_i_core19.chalk.bold.white(this.apiUrl));
|
|
1130
1145
|
}
|
|
1131
|
-
async getVosWithColaboApi(request) {
|
|
1146
|
+
async getVosWithColaboApi(request, fetchFn) {
|
|
1132
1147
|
request.type = import_i_core18.KEDGE_API_TYPE.INDEX_COLABO_API;
|
|
1133
1148
|
console.log(`[KnalledgeEdgeService.getVosWithColaboApi] request: ${JSON.stringify(request, null, 4)}`);
|
|
1134
1149
|
const requestSerialized = import_i_core18.ColaboApiOperators.serializeApiRequest(request);
|
|
1135
1150
|
let result;
|
|
1136
1151
|
const url = import_i_core18.ColaboApiOperators.appendFieldsParam(this.apiUrl + import_i_core18.KEDGE_API_TYPE.INDEX_COLABO_API + "/" + requestSerialized, request.fields);
|
|
1137
1152
|
console.log("[getVos] url: ", url);
|
|
1138
|
-
const mResult = await import_axios5.default.get(url);
|
|
1139
1153
|
try {
|
|
1154
|
+
if (fetchFn) {
|
|
1155
|
+
return await fetchFn(url);
|
|
1156
|
+
}
|
|
1157
|
+
const mResult = await import_axios5.default.get(url);
|
|
1140
1158
|
const serverData = mResult.data;
|
|
1141
1159
|
result = import_i_core18.ColaboApiOperators.extractVosFromServerData(serverData);
|
|
1142
1160
|
if (!result) {
|