@colabo-knalledge/i-core-services 1.5.3 → 1.7.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.
@@ -3,5 +3,5 @@ export { ColaboKnAllEdgeNodeService } from "./lib/kNode-service";
3
3
  export { ColaboKnAllEdgeNodeServiceExtended } from "./lib/kNode-service-extended";
4
4
  export { KnalledgeEdgeService } from "./lib/kEdge-service";
5
5
  export { KnalledgeEdgeServiceExtended } from "./lib/kEdge-service-extended";
6
- export { removeSecurityPrefix } from './lib/colabo-api-core.service';
6
+ export { addSecurityPrefix, removeSecurityPrefix } from './lib/colabo-api-core.service';
7
7
  export * from "./common";
@@ -12,7 +12,7 @@ export declare const HTTP_OPTIONS_CONST_JSON: {
12
12
  };
13
13
  export declare class CFServiceIsomorphic {
14
14
  protected utilsNotificationService?: UtilsNotificationService | undefined;
15
- static serverAP: string;
15
+ static get serverAP(): string;
16
16
  /**
17
17
  * processes array of VOs received from server to a local/fronted version
18
18
  * @param vofS
@@ -1,4 +1,5 @@
1
1
  import { AxiosStatic } from "axios";
2
+ export declare const addSecurityPrefix: (data: any) => string;
2
3
  export declare const removeSecurityPrefix: (data: string) => string;
3
4
  interface IAxiosImplementation {
4
5
  colaboApiInterceptorId: number;
@@ -13,7 +13,12 @@ export declare class ColaboKnAllEdgeContainerService extends CFServiceIsomorphic
13
13
  protected apiUrl: string;
14
14
  protected defaultAction: string;
15
15
  constructor(http: HttpClient, utilsNotificationService: UtilsNotificationService);
16
- getById(id: string): Promise<IKContainer>;
16
+ /**
17
+ * Retrieves the kContainer with a given ID. It retrieves only the kContainer kNode, not all the kNodes that are in the kContainer.
18
+ * @param id the id of the kContainer to be retrieved
19
+ * @returns
20
+ */
21
+ getById(id: string, fields?: string): Promise<IKContainer>;
17
22
  create(kContainerWContent: IKContainerWContent): Promise<IKContainerWContent>;
18
23
  update(kContainer: IKContainer): Promise<IKContainer>;
19
24
  /**
@@ -29,10 +34,11 @@ export declare class ColaboKnAllEdgeContainerService extends CFServiceIsomorphic
29
34
  /**
30
35
  * @param containerId The id of the kContainer to which we want to add kNodes
31
36
  * @param containedIds The list of ids of the kNodes we want to add to the container
37
+ * @param edgeDataContent Optional dataContent to set on the created edges (e.g. `{ type: "litterra.corpus.document" }`)
32
38
  * @description adds kNodes in a kContainer
33
39
  * @returns edges created between the container and entities added to the container
34
40
  */
35
- updateAddNodes(containerId: string, containedIds: string[]): Promise<IKEdge[]>;
41
+ updateAddNodes(containerId: string, containedIds: string[], edgeDataContent?: Record<string, unknown>): Promise<IKEdge[]>;
36
42
  /**
37
43
  * removes kNodes from a kContainer
38
44
  *
@@ -43,11 +49,11 @@ export declare class ColaboKnAllEdgeContainerService extends CFServiceIsomorphic
43
49
  updateRemoveNodes(id: string, ids: string[]): Promise<string[]>;
44
50
  /**
45
51
  *
46
- * @param id The id of the kContainer which knodes we want to retrieve
52
+ * @param id The id of the kContainer which kNodes we want to retrieve
47
53
  * @description retrieves kNodes in a kContainer
48
54
  */
49
- getInContainer(id: string): Promise<KNodeFrontend[]>;
50
- getVOs(type?: string, upperLayerType?: any): Promise<IKContainer[]>;
55
+ getInContainer(id: string, fields?: string, fetchFn?: (url: string) => Promise<unknown[]>): Promise<KNodeFrontend[]>;
56
+ getVOs(type?: string, upperLayerType?: any, fields?: string, fetchFn?: (url: string) => Promise<unknown[]>): Promise<IKContainer[]>;
51
57
  /**
52
58
  * Extracts upper-layer entity from kContainer and sets it up
53
59
  * @param kContainer - kContainer holding the upper-layer entity
@@ -13,7 +13,7 @@ export declare class KnalledgeEdgeServiceExtended extends KnalledgeEdgeService {
13
13
  * @param {function} callback Function to be called when the edge is retrieved
14
14
  * @returns {Observable<KEdge>} retrieved edge
15
15
  */
16
- getById(id: string, callback?: Function): Promise<KEdge>;
16
+ getById(id: string, fields?: string, callback?: Function): Promise<KEdge>;
17
17
  /**
18
18
  * Creates the provided edge on the server and returns its server-updated appearance
19
19
  * @param {KEdge} kEdge the pre-populated edge to be created on the server
@@ -8,7 +8,7 @@ export declare class KnalledgeEdgeService extends CFServiceIsomorphic {
8
8
  protected defaultAction: string;
9
9
  constructor(http: HttpClient, //@Inject('ENV') private ENV
10
10
  utilsNotificationService: UtilsNotificationService);
11
- getVosWithColaboApi(request: IApiRequest): Promise<IKEdge[]>;
11
+ getVosWithColaboApi(request: IApiRequest, fetchFn?: (url: string) => Promise<unknown[]>): Promise<IKEdge[]>;
12
12
  /** creates a new Element (VO) */
13
13
  createWithPromise(kEdge: IKEdge, callback?: Function): Promise<IKEdge[]>;
14
14
  /** creates a new Element (VO) */
@@ -5,11 +5,11 @@ import { UtilsNotificationService } from "@colabo-headless/i-core";
5
5
  export declare class ColaboKnAllEdgeNodeServiceExtended extends ColaboKnAllEdgeNodeService {
6
6
  private knalledgeMapQueue;
7
7
  private knAllEdgeRealTimeService;
8
- protected static mapId: string;
8
+ protected static get mapId(): string;
9
9
  static UPDATE_NODE_NAME_FINAL: string;
10
10
  static UPDATE_NODE_NAME: string;
11
11
  constructor(http: HttpClient, utilsNotificationService: UtilsNotificationService);
12
- queryByIds(ids: string[], callback?: Function): Promise<KNodeFrontend[]>;
12
+ queryByIds(ids: string[], fields?: string, callback?: Function, fetchFn?: (url: string) => Promise<unknown[]>): Promise<KNodeFrontend[]>;
13
13
  /**
14
14
  * BREAKING CHANGE: removed as the code is old, sending raw request to backend instead of `IApiRequest`. The right version is available in the `ColaboKnAllEdgeNodeService` class with the same name
15
15
  * Creates the provided node on the server and returns its server-updated appearance
@@ -32,11 +32,13 @@ export declare class ColaboKnAllEdgeNodeService extends CFServiceIsomorphic impl
32
32
  * @returns {Promise<KNodeFrontend>} the retrieved node
33
33
  * @throws `ColaboError (REQUEST_BAD | DATA_MISSING | DATA_INCORRECT_FORMAT)`
34
34
  */
35
- getById(id: string): Promise<KNodeFrontend>;
36
- getVosWithColaboApi(request: IApiRequest): Promise<IKNode[]>;
35
+ getById(id: string, fields?: string): Promise<KNodeFrontend>;
36
+ getVosWithColaboApi(request: IApiRequest, fetchFn?: (url: string) => Promise<unknown[]>): Promise<IKNode[]>;
37
37
  updateSingleWithColaboApi(request: IApiRequest): Promise<IKNode>;
38
38
  updateWithColaboApi(request: IApiRequest): Promise<IKNode[]>;
39
39
  createSingle(kNode: IKNode): Promise<IKNode>;
40
+ /** creates multiple KNodes in a single bulk request */
41
+ createBulk(kNodes: IKNode[]): Promise<IKNode[]>;
40
42
  /** creates a new Element (VO) */
41
43
  create(kNode: IKNode, callback?: Function): Promise<IKNode[]>;
42
44
  createWithColaboApi(request: IApiRequest): Promise<IKNode[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colabo-knalledge/i-core-services",
3
- "version": "1.5.3",
3
+ "version": "1.7.0",
4
4
  "description": "Core isomorphic code for the KnAllEdge module - services",
5
5
  "private": false,
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "package_post_publish": "tsx $COLABO_FOLDER/scripts/post-publish/single.ts",
33
33
  "package_publish": "echo \"${npm_package_name}:package_publish ----- Publishing the package ----\"",
34
34
  "package_update_dependencies_versions": "tsx $COLABO_FOLDER/scripts/update-dependencies-versions/single.ts",
35
- "package_install": "yarn install",
35
+ "package_install": "yarn install --mutex file:/tmp/yarn-colabo.lock",
36
36
  "package_rm_install_lock": "rm -f yarn.lock"
37
37
  },
38
38
  "main": "dist/cjs/index.js",
@@ -49,10 +49,10 @@
49
49
  "esm": "^3.2.25",
50
50
  "mocha-clearscreen-reporter": "^1.0.1",
51
51
  "rxjs": "7.8.1",
52
- "@colabo-knalledge/i-core": "1.3.2",
53
- "@colabo-headless/i-core": "npm:@colabo-headless/f-core-frontend-vanilla@1.4.4",
54
- "@colabo-utils/i-config": "1.5.1",
55
- "@colabo-utils/i-notifications": "1.3.2"
52
+ "@colabo-knalledge/i-core": "1.4.0",
53
+ "@colabo-headless/i-core": "npm:@colabo-headless/f-core-frontend-vanilla@1.4.5",
54
+ "@colabo-utils/i-config": "1.6.0",
55
+ "@colabo-utils/i-notifications": "1.3.3"
56
56
  },
57
57
  "module": "dist/esm/index.js",
58
58
  "exports": {
@@ -80,10 +80,10 @@
80
80
  ]
81
81
  },
82
82
  "liveDependencies": {
83
- "@colabo-knalledge/i-core": "1.3.2",
84
- "@colabo-headless/i-core": "npm:@colabo-headless/f-core-frontend-vanilla@1.4.4",
85
- "@colabo-utils/i-config": "1.5.1",
86
- "@colabo-utils/i-notifications": "1.3.2"
83
+ "@colabo-knalledge/i-core": "1.4.0",
84
+ "@colabo-headless/i-core": "npm:@colabo-headless/f-core-frontend-vanilla@1.4.5",
85
+ "@colabo-utils/i-config": "1.6.0",
86
+ "@colabo-utils/i-notifications": "1.3.3"
87
87
  },
88
88
  "build": {
89
89
  "format": [