mftsccs-node 0.2.4 → 0.2.5

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.
Files changed (114) hide show
  1. package/dist/bundle.js +2 -0
  2. package/dist/bundle.js.LICENSE.txt +1 -0
  3. package/dist/types/Api/Create/CreateTheConceptApi.d.ts +1 -1
  4. package/dist/types/Api/DeleteTheConcept.d.ts +1 -1
  5. package/dist/types/Api/DeleteTheConnection.d.ts +1 -1
  6. package/dist/types/Api/GetAllConnectionsOfComposition.d.ts +1 -1
  7. package/dist/types/Api/GetAllConnectionsOfCompositionBulk.d.ts +2 -2
  8. package/dist/types/Api/GetCharacterDataByCharacter.d.ts +1 -1
  9. package/dist/types/Api/GetCompositionConnectionsBetweenTwoConcepts.d.ts +2 -1
  10. package/dist/types/Api/GetConcept.d.ts +2 -6
  11. package/dist/types/Api/GetConceptBulk.d.ts +1 -8
  12. package/dist/types/Api/GetConceptByCharacterAndType.d.ts +2 -1
  13. package/dist/types/Api/GetConnection.d.ts +1 -1
  14. package/dist/types/Api/GetConnectionBulk.d.ts +0 -5
  15. package/dist/types/Api/GetConnectionOfTheConcept.d.ts +2 -1
  16. package/dist/types/Api/Login.d.ts +1 -1
  17. package/dist/types/Api/MakeTheTypeConceptApi.d.ts +0 -7
  18. package/dist/types/Api/RecursiveSearch.d.ts +1 -6
  19. package/dist/types/Api/Search/FreeschemaQueryApi.d.ts +1 -1
  20. package/dist/types/Api/Search/SearchInternalApi.d.ts +0 -1
  21. package/dist/types/Api/SearchConcept/GetConceptByCharacterAndCategoryApi.d.ts +1 -1
  22. package/dist/types/Api/Signin.d.ts +1 -1
  23. package/dist/types/Api/Signup.d.ts +1 -17
  24. package/dist/types/Constants/FormatConstants.d.ts +0 -1
  25. package/dist/types/DataStructures/BaseUrl.d.ts +0 -33
  26. package/dist/types/DataStructures/BinaryTree.d.ts +0 -1
  27. package/dist/types/DataStructures/BinaryTypeTree.d.ts +5 -7
  28. package/dist/types/DataStructures/Concept.d.ts +15 -11
  29. package/dist/types/DataStructures/ConceptData.d.ts +2 -7
  30. package/dist/types/DataStructures/Connection.d.ts +10 -6
  31. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.d.ts +1 -3
  32. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionNode.d.ts +0 -3
  33. package/dist/types/DataStructures/ConnectionBinaryTree/ConnectionTypeTree.d.ts +9 -16
  34. package/dist/types/DataStructures/ConnectionData.d.ts +3 -11
  35. package/dist/types/DataStructures/Local/LConcept.d.ts +3 -5
  36. package/dist/types/DataStructures/Local/LConnection.d.ts +3 -3
  37. package/dist/types/DataStructures/Local/LNode.d.ts +3 -5
  38. package/dist/types/DataStructures/Local/LocalBinaryCharacterTree.d.ts +2 -3
  39. package/dist/types/DataStructures/Local/LocalBinaryTree.d.ts +2 -3
  40. package/dist/types/DataStructures/Local/LocalBinaryTypeTree.d.ts +4 -4
  41. package/dist/types/DataStructures/Local/LocalConceptData.d.ts +9 -16
  42. package/dist/types/DataStructures/Local/LocalConnectionData.d.ts +9 -13
  43. package/dist/types/DataStructures/Local/LocalSyncData.d.ts +10 -29
  44. package/dist/types/DataStructures/Node.d.ts +0 -1
  45. package/dist/types/DataStructures/Search/FreeschemaQuery.d.ts +1 -2
  46. package/dist/types/DataStructures/Search/SearchStructure.d.ts +0 -1
  47. package/dist/types/DataStructures/SearchQuery.d.ts +0 -1
  48. package/dist/types/DataStructures/Security/TokenStorage.d.ts +1 -2
  49. package/dist/types/DataStructures/SyncData.d.ts +13 -1
  50. package/dist/types/DataStructures/Transaction/Transaction.d.ts +30 -0
  51. package/dist/types/DataStructures/User/UserBinaryTree.d.ts +7 -5
  52. package/dist/types/DataStructures/User/UserNode.d.ts +5 -3
  53. package/dist/types/Database/NoIndexDb.d.ts +1 -1
  54. package/dist/types/Database/indexdblocal.d.ts +0 -40
  55. package/dist/types/Database/indexeddb.d.ts +0 -50
  56. package/dist/types/Helpers/CheckIfExists.d.ts +3 -2
  57. package/dist/types/Helpers/RemoveFromArray.d.ts +2 -1
  58. package/dist/types/Services/AccessControl/AccessControlCacheService.d.ts +19 -0
  59. package/dist/types/Services/AccessControl/AccessControlService.d.ts +267 -0
  60. package/dist/types/Services/AccessControl/PermissionSet.d.ts +8 -0
  61. package/dist/types/Services/Common/ErrorPosting.d.ts +0 -8
  62. package/dist/types/Services/ConceptFinding/GetConceptByCharacterAndCategory.d.ts +1 -0
  63. package/dist/types/Services/Conversion/ConvertConcepts.d.ts +5 -3
  64. package/dist/types/Services/CreateBinaryTreeFromData.d.ts +1 -4
  65. package/dist/types/Services/CreateCharacterBinaryTreeFromData.d.ts +0 -4
  66. package/dist/types/Services/CreateConnectionBetweenTwoConcepts.d.ts +1 -1
  67. package/dist/types/Services/CreateTheComposition.d.ts +2 -1
  68. package/dist/types/Services/CreateTheConcept.d.ts +4 -3
  69. package/dist/types/Services/CreateTheConnection.d.ts +1 -9
  70. package/dist/types/Services/CreateTheConnectionGeneral.d.ts +4 -1
  71. package/dist/types/Services/Delete/GetAllConnectionByType.d.ts +16 -0
  72. package/dist/types/Services/DeleteConcept.d.ts +1 -2
  73. package/dist/types/Services/DeleteConnection.d.ts +1 -2
  74. package/dist/types/Services/FindConeceptsFromConnection.d.ts +0 -4
  75. package/dist/types/Services/FindConnectionsOfCompositionBulkInMemory.d.ts +2 -1
  76. package/dist/types/Services/GetComposition.d.ts +2 -139
  77. package/dist/types/Services/GetCompositionBulk.d.ts +5 -94
  78. package/dist/types/Services/GetCompositionList.d.ts +0 -5
  79. package/dist/types/Services/GetConceptByCharacter.d.ts +3 -2
  80. package/dist/types/Services/GetConnections.d.ts +2 -1
  81. package/dist/types/Services/GetDataFromIndexDb.d.ts +2 -2
  82. package/dist/types/Services/GetLink.d.ts +1 -1
  83. package/dist/types/Services/GetRelation.d.ts +5 -2
  84. package/dist/types/Services/GetTheConcept.d.ts +0 -7
  85. package/dist/types/Services/InitializeSystem.d.ts +1 -1
  86. package/dist/types/Services/Local/CreateDefaultLConcept.d.ts +2 -2
  87. package/dist/types/Services/Local/CreateLocalBinaryTreeFromData.d.ts +1 -29
  88. package/dist/types/Services/Local/CreateTheCompositionLocal.d.ts +2 -14
  89. package/dist/types/Services/Local/CreateTheConceptLocal.d.ts +2 -22
  90. package/dist/types/Services/Local/CreateTheConnectionLocal.d.ts +2 -16
  91. package/dist/types/Services/Local/GetCompositionListLocal.d.ts +0 -12
  92. package/dist/types/Services/Local/GetConceptByCharacterLocal.d.ts +1 -10
  93. package/dist/types/Services/Local/MakeTheConceptLocal.d.ts +2 -2
  94. package/dist/types/Services/Local/MakeTheInstanceConceptLocal.d.ts +2 -18
  95. package/dist/types/Services/Local/MakeTheTypeLocal.d.ts +2 -16
  96. package/dist/types/Services/Local/UpdateCompositionLocal.d.ts +2 -3
  97. package/dist/types/Services/MakeTheConcept.d.ts +1 -1
  98. package/dist/types/Services/MakeTheInstanceConcept.d.ts +3 -15
  99. package/dist/types/Services/MakeTheLocalConcept.d.ts +0 -0
  100. package/dist/types/Services/MakeTheName.d.ts +2 -0
  101. package/dist/types/Services/MakeTheTimestamp.d.ts +2 -1
  102. package/dist/types/Services/MakeTheTypeConcept.d.ts +3 -1
  103. package/dist/types/Services/Search/DataIdFormat.d.ts +18 -18
  104. package/dist/types/Services/Search/FormatData.d.ts +10 -20
  105. package/dist/types/Services/Search/SearchLinkInternal.d.ts +0 -1
  106. package/dist/types/Services/Search/SearchLinkMultiple.d.ts +1 -53
  107. package/dist/types/Services/Search/SearchWithTypeAndLinker.d.ts +5 -53
  108. package/dist/types/Services/Security/GetRequestHeader.d.ts +10 -3
  109. package/dist/types/Services/UpdateComposition.d.ts +1 -1
  110. package/dist/types/Services/User/UserTranslation.d.ts +6 -3
  111. package/dist/types/Services/auth/AuthService.d.ts +1 -0
  112. package/dist/types/WrapperFunctions/SchemaQueryObservable.d.ts +11 -9
  113. package/dist/types/app.d.ts +24 -128
  114. package/package.json +1 -1
@@ -1,20 +1,16 @@
1
- import { Connection } from "../Connection";
1
+ import { LConnection } from "./LConnection";
2
2
  export declare class LocalConnectionData {
3
3
  name: string;
4
4
  constructor();
5
- static connectionArray: Connection[];
6
- static connectionDictionary: Connection[];
7
- static CheckContains(connection: Connection): boolean;
8
- static AddConnection(connection: Connection): void;
9
- static AddConnectionToMemory(connection: Connection): void;
10
- static AddToDictionary(connection: Connection): void;
11
- static RemoveConnection(connection: Connection): void;
12
- static RemoveConnectionById(connectionId: number): void;
13
- static AddPermanentConnection(connection: Connection): void;
14
- static GetConnection(id: number): Connection | null;
5
+ static connectionArray: LConnection[];
6
+ static connectionDictionary: LConnection[];
7
+ static CheckContains(connection: LConnection): boolean;
8
+ static AddConnection(connection: LConnection): void;
9
+ static AddToDictionary(connection: LConnection): void;
10
+ static RemoveConnection(connection: LConnection): void;
11
+ static GetConnection(id: number): LConnection | null;
15
12
  static waitForDataToLoad(): Promise<unknown>;
16
13
  static checkFlag(resolve: any): any;
17
- static GetConnectionsOfCompositionLocal(id: number): Promise<Connection[]>;
18
- static GetConnectionOfCompositionAndTypeLocal(typeId: number, ofTheConceptId: number): Promise<Connection[]>;
14
+ static GetConnectionsOfCompositionLocal(id: number): Promise<LConnection[]>;
19
15
  getName(): string;
20
16
  }
@@ -1,33 +1,14 @@
1
- import { Concept } from "./../Concept";
2
- import { Connection } from "../Connection";
3
- import { InnerActions } from "../../app";
4
- type syncContainer = {
5
- id: string;
6
- data: InnerActions;
7
- createdDate: string;
8
- };
1
+ import { LConcept } from "./LConcept";
2
+ import { LConnection } from "./LConnection";
9
3
  export declare class LocalSyncData {
10
- static conceptsSyncArray: Concept[];
11
- static connectionSyncArray: Connection[];
12
- static ghostIdMap: Map<any, any>;
13
- static transactionCollections: syncContainer[];
14
- static CheckContains(concept: Concept): boolean;
4
+ static conceptsSyncArray: LConcept[];
5
+ static connectionSyncArray: LConnection[];
6
+ static CheckContains(concept: LConcept): boolean;
15
7
  static SyncDataDelete(id: number): void;
16
- static CheckContainsConnection(connection: Connection): boolean;
17
- static AddConcept(concept: Concept): void;
18
- static RemoveConcept(concept: Concept): void;
19
- static SyncDataOnlineWithoutAuth(transactionId?: string, actions?: InnerActions, withAuth?: boolean): Promise<any>;
20
- static SyncDataOnline(transactionId?: string, actions?: InnerActions, withAuth?: boolean): Promise<any>;
21
- static ConvertGhostIdsInConnections(connectionArray: Connection[]): void;
22
- static UpdateConceptListToIncludeRelatedConcepts(connectionArray: Connection[], conceptsArray: Concept[]): Promise<void>;
23
- static AddConceptIfDoesNotExist(concept: Concept, conceptList?: Concept[]): void;
24
- static CheckIfTheConceptIdExists(id: number, conceptList?: Concept[]): Concept;
25
- static AddConnection(connection: Connection): void;
26
- static RemoveConnection(connection: Connection): void;
27
- static RemoveConnectionById(connectionId: number): void;
8
+ static CheckContainsConnection(connection: LConnection): boolean;
9
+ static AddConcept(concept: LConcept): void;
10
+ static RemoveConcept(concept: LConcept): void;
11
+ static AddConnection(connection: LConnection): void;
12
+ static RemoveConnection(connection: LConnection): void;
28
13
  static syncDataLocalDb(): Promise<string>;
29
- static initializeTransaction(transactionId: string): Promise<any>;
30
- static markTransactionActions(transactionId: string, actions: InnerActions): Promise<any>;
31
- static rollbackTransaction(transactionId: string, actions: InnerActions): Promise<any>;
32
14
  }
33
- export {};
@@ -11,7 +11,6 @@ export declare class Node {
11
11
  addCurrentNode(passedNode: Node, node: Node | null): Node;
12
12
  addCurrentNodeType(passedNode: Node, node: Node | null): Node;
13
13
  addNode(passedNode: Node, node: Node | null, height: number): Node | null;
14
- checkIfIdsInNode(node: Node | null, ids: number[], connectionArray: Concept[], remainingIds: any): void;
15
14
  addCharacterNode(passedNode: Node, node: Node | null, height: number): Node | null;
16
15
  addTypeNode(passedNode: Node, node: Node | null, height: number): Node | null;
17
16
  rightRotate(y: Node | null): Node | null;
@@ -14,10 +14,9 @@ export declare class FreeschemaQuery {
14
14
  order: string;
15
15
  outputFormat: number;
16
16
  name: string;
17
- filterAncestor: string;
18
17
  reverse: boolean;
19
18
  limit: boolean;
20
- isSecure: boolean;
19
+ filterAncestor: string;
21
20
  includeInFilter: boolean;
22
21
  isOldConnectionType: boolean;
23
22
  }
@@ -6,5 +6,4 @@ export declare class SearchStructure {
6
6
  userId: number;
7
7
  inpage: number;
8
8
  page: number;
9
- auth: boolean;
10
9
  }
@@ -13,5 +13,4 @@ export declare class SearchQuery {
13
13
  doFilter: boolean;
14
14
  filterSearches: FilterSearch[];
15
15
  selectors: string[];
16
- ofCompositions: number[];
17
16
  }
@@ -1,5 +1,4 @@
1
1
  export declare class TokenStorage {
2
2
  static BearerAccessToken: string;
3
- static sessionId: number;
4
- static setSession(sessionId: any): void;
3
+ static JwtSecret: string;
5
4
  }
@@ -1,8 +1,15 @@
1
1
  import { Concept } from "./Concept";
2
2
  import { Connection } from "./Connection";
3
+ import { InnerActions } from "./Transaction/Transaction";
4
+ type syncContainer = {
5
+ id: string;
6
+ data: InnerActions;
7
+ createdDate: string;
8
+ };
3
9
  export declare class SyncData {
4
10
  static conceptsSyncArray: Concept[];
5
11
  static connectionSyncArray: Connection[];
12
+ static transactionCollections: syncContainer[];
6
13
  static CheckContains(concept: Concept): boolean;
7
14
  static SyncDataDelete(id: number): void;
8
15
  static CheckContainsConnection(connection: Connection): boolean;
@@ -10,5 +17,10 @@ export declare class SyncData {
10
17
  static RemoveConcept(concept: Concept): void;
11
18
  static AddConnection(connection: Connection): void;
12
19
  static RemoveConnection(connection: Connection): void;
13
- static SyncDataOnline(): Promise<any>;
20
+ static SyncDataOnline(transactionId?: string): Promise<"done" | undefined>;
21
+ static initializeTransaction(transactionId: string): Promise<void>;
22
+ static markTransactionActions(transactionId: string, actions: InnerActions): Promise<void>;
23
+ static rollbackTransaction(transactionId: string, actions: InnerActions): Promise<void>;
24
+ static syncDataLocalDb(): Promise<string>;
14
25
  }
26
+ export {};
@@ -0,0 +1,30 @@
1
+ import { Concept } from "../Concept";
2
+ import { Connection } from "../Connection";
3
+ export declare class Transaction {
4
+ protected transactionId: string;
5
+ actions: InnerActions;
6
+ protected success: boolean;
7
+ constructor();
8
+ initialize(): Promise<void>;
9
+ /**
10
+ * Method to move concepts and connection to transaction collection
11
+ * @param concept Concept
12
+ */
13
+ protected markAction(): Promise<void>;
14
+ /**
15
+ * Method to rollback all the tranctions occured
16
+ */
17
+ rollbackTransaction(): Promise<void>;
18
+ commitTransaction(): Promise<void>;
19
+ /**
20
+ * Concepts
21
+ */
22
+ MakeTheInstanceConcept(type: string, referent: string, composition: boolean | undefined, userId: number, accessId: number, sessionInformationId?: number, referentId?: number): Promise<Concept>;
23
+ CreateConnection(ofTheConcept: Concept, toTheConcept: Concept, typeConnection: string): Promise<Connection>;
24
+ MakeTheTypeConcept(typeString: string, sessionId: number, sessionUserId: number, userId: number): Promise<Concept>;
25
+ CreateTheConnectionGeneral(ofTheConceptId: number, ofTheConceptUserId: number, toTheConceptId: number, toTheConceptUserId: number, typeId: number, sessionInformationId: number, sessionInformationUserId: number, orderId?: number, accessId?: number, passedUserId?: number): Promise<Connection>;
26
+ }
27
+ export interface InnerActions {
28
+ concepts: Concept[];
29
+ connections: Connection[];
30
+ }
@@ -1,13 +1,15 @@
1
- import { Concept } from "../../DataStructures/Concept";
1
+ import { LConcept } from "../../DataStructures/Local/LConcept";
2
2
  import { UserNode } from "./UserNode";
3
+ import { LConnection } from "../Local/LConnection";
3
4
  export declare class UserBinaryTree {
4
5
  static root: UserNode | null;
5
- static compositeKey(userId: number, sessionId: number): string;
6
+ static compositeKey(userId: number, sessionId: number, randomizer?: number): string;
6
7
  static addNodeToTree(node: UserNode): UserNode | undefined;
7
8
  static waitForDataToLoad(): Promise<unknown>;
8
9
  static checkFlag(resolve: any): any;
9
- static addConceptToTree(concept: Concept, userId: number, sessionId?: number): void;
10
- static getNodeFromTree(userId: number, sessionId: number): Promise<UserNode | null>;
11
- static removeNodeFromTree(userId: number, sessionId?: number): Promise<void>;
10
+ static addConceptToTree(concept: LConcept, userId: number, sessionId?: number): void;
11
+ static addConnectionToTree(connection: LConnection, userId: number, sessionId?: number): void;
12
+ static getNodeFromTree(userId: number, sessionId: number, randomizer?: number): Promise<UserNode | null>;
13
+ static removeNodeFromTree(userId: number, sessionId?: number, randomizer?: number): Promise<void>;
12
14
  static countNumberOfNodes(): number;
13
15
  }
@@ -1,11 +1,13 @@
1
- import { Concept } from "../Concept";
1
+ import { LConcept } from "../Local/LConcept";
2
+ import { LConnection } from "../Local/LConnection";
2
3
  export declare class UserNode {
3
4
  key: any;
4
- value: Concept[];
5
+ connectionValue: LConnection[];
6
+ value: LConcept[];
5
7
  leftNode: UserNode | null;
6
8
  rightNode: UserNode | null;
7
9
  height: number;
8
- constructor(key: any, value: Concept, leftNode: UserNode | null, rightNode: UserNode | null);
10
+ constructor(key: any, value: LConcept, connectionValue: LConnection, leftNode: UserNode | null, rightNode: UserNode | null);
9
11
  addNode(passedNode: UserNode, node: UserNode | null, height: number): UserNode | null;
10
12
  rightRotate(y: UserNode | null): UserNode | null;
11
13
  leftRotate(x: UserNode | null): UserNode | null;
@@ -4,6 +4,6 @@ export declare function storeToDatabase(databaseName: string, object: any): void
4
4
  export declare function GetStatsFromDatabase(): SettingData;
5
5
  export declare function AiUpdateFlag(object: SettingData): void;
6
6
  export declare function getFromDatabaseWithType(databaseName: string, type: string, id: number): Promise<void>;
7
- export declare function getObjectsFromIndexDb(databaseName: string): Promise<void>;
7
+ export declare function getFromDatabaseWithTypeOld(databaseName: string): Promise<void>;
8
8
  export declare function removeFromDatabase(databaseName: string, id: number): void;
9
9
  export declare function getAllFromLocalDb(databaseName: string): Promise<void>;
@@ -1,43 +1,3 @@
1
- /**
2
- * This class will help us store the indexdb reference in memory and not go back to index db.
3
- */
4
1
  export declare class LocalIndexDb {
5
2
  static db: IDBDatabase;
6
3
  }
7
- /**
8
- *
9
- * @param databaseName not required actually. This is not used you can pass anything.
10
- * @returns a promise that either resolves or rejects opening the database.
11
- */
12
- export declare function openDatabase(databaseName: string): Promise<IDBDatabase>;
13
- export declare function LockTheDatabase(databaseName: string): Promise<void>;
14
- export declare function UnlockDatabase(databaseName: string): Promise<void>;
15
- export declare function GetLockStatus(databaseName: string): Promise<any>;
16
- /**
17
- * this function will return all the objects that are in the database
18
- * @param databaseName name of the database
19
- * @returns all the objects that are in the database
20
- */
21
- export declare function getObjectsFromLocalIndexDb(databaseName: string): Promise<unknown>;
22
- /**
23
- *
24
- * @param databaseName name of the database that you want to store data to.
25
- * @param object any object that can be stored but keep in mind it must follow the convention that we created
26
- * while creating the datbase.
27
- * @returns a promise that if a store is successful then the obejct is returned else rejects with the event.
28
- */
29
- export declare function storeToDatabase(databaseName: string, object: any): Promise<unknown>;
30
- /**
31
- *
32
- * @param databaseName name of the database
33
- * @param object this is the object that you want to update
34
- * @returns returns the object if it is updated successfully.
35
- */
36
- export declare function UpdateToDatabase(databaseName: string, object: any): Promise<unknown>;
37
- /**
38
- *
39
- * @param databaseName name of the database
40
- * @param id the id that we need to remove from the database (this is the index)
41
- * @returns an id if the deletion is successful and error with even in case it cannot.
42
- */
43
- export declare function removeFromDatabase(databaseName: string, id: number): Promise<unknown>;
@@ -1,53 +1,3 @@
1
- import { SettingData } from "../DataStructures/SettingData";
2
- /**
3
- * This class will help us store the indexdb reference in memory and not go back to index db.
4
- */
5
1
  export declare class IndexDb {
6
2
  static db: IDBDatabase;
7
3
  }
8
- /**
9
- *
10
- * @param databaseName not required actually. This is not used you can pass anything.
11
- * @returns a promise that either resolves or rejects opening the database.
12
- */
13
- export declare function openDatabase(databaseName: string): Promise<IDBDatabase>;
14
- /**
15
- *
16
- * @param databaseName name of the database that you want to store data to.
17
- * @param object any object that can be stored but keep in mind it must follow the convention that we created
18
- * while creating the datbase.
19
- * @returns a promise that if a store is successful then the obejct is returned else rejects with the event.
20
- */
21
- export declare function storeToDatabase(databaseName: string, object: any): Promise<any>;
22
- /**
23
- *
24
- * @param databaseName name of the database
25
- * @param object this is the object that you want to update
26
- * @returns returns the object if it is updated successfully.
27
- */
28
- export declare function UpdateToDatabase(databaseName: string, object: any): Promise<unknown>;
29
- /**
30
- *
31
- * @returns This returns the last object from the database.
32
- */
33
- export declare function GetLastSettingsFromDatabase(): Promise<unknown>;
34
- /**
35
- *
36
- * @param object SettingData
37
- * @returns this will update the indexdb with the ai flag so that another time we do not have to pull
38
- * ai data from the api.
39
- */
40
- export declare function AiUpdateFlag(object: SettingData): Promise<unknown>;
41
- /**
42
- * this function will return all the objects that are in the database
43
- * @param databaseName name of the database
44
- * @returns all the objects that are in the database
45
- */
46
- export declare function getObjectsFromIndexDb(databaseName: string): Promise<unknown>;
47
- /**
48
- *
49
- * @param databaseName name of the database
50
- * @param id the id that we need to remove from the database (this is the index)
51
- * @returns an id if the deletion is successful and error with even in case it cannot.
52
- */
53
- export declare function removeFromDatabase(databaseName: string, id: number): Promise<unknown>;
@@ -1,9 +1,10 @@
1
1
  import { Concept } from "../DataStructures/Concept";
2
2
  import { Connection } from "../DataStructures/Connection";
3
+ import { LConcept, LConnection } from "../app";
3
4
  export declare function CheckIfConceptsExistsInArray(conceptList: Concept[] | undefined, concept: Concept): Concept;
4
5
  export declare function CheckIfTypeConceptsExistsInArray(conceptList: Concept[] | undefined, concept: Concept): Concept[];
5
- export declare function CheckIfTypeLConceptsExistsInArray(conceptList: Concept[] | undefined, concept: Concept): Concept[];
6
+ export declare function CheckIfTypeLConceptsExistsInArray(conceptList: LConcept[] | undefined, concept: LConcept): LConcept[];
6
7
  export declare function CheckIfConnectionExistsInArray(connectionList: Connection[] | undefined, connection: Connection): Connection;
7
8
  export declare function CheckIfToTheConceptExistsInConnectionArray(connectionList: Connection[] | undefined, conceptId: number): Connection;
8
9
  export declare function CheckAllConnectionsConnectedInConnectionArray(connectionList: Connection[] | undefined, conceptId: number): Connection[];
9
- export declare function CheckAllConnectionsConnectedInLConnectionArray(connectionList: Connection[] | undefined, conceptId: number): Connection[];
10
+ export declare function CheckAllConnectionsConnectedInLConnectionArray(connectionList: LConnection[] | undefined, conceptId: number): LConnection[];
@@ -1,5 +1,6 @@
1
1
  import { Concept } from "../DataStructures/Concept";
2
2
  import { Connection } from "../DataStructures/Connection";
3
+ import { LConnection } from "../app";
3
4
  export declare function RemoveConceptFromList(conceptList: Concept[] | undefined, concept: Concept): void;
4
5
  export declare function RemoveConnectionFromList(connectionList: Connection[] | undefined, connection: Connection): void;
5
- export declare function RemoveLConnectionFromList(connectionList: Connection[] | undefined, connection: Connection): void;
6
+ export declare function RemoveLConnectionFromList(connectionList: LConnection[] | undefined, connection: LConnection): void;
@@ -0,0 +1,19 @@
1
+ import { PermissionSet } from './PermissionSet';
2
+ export declare class AccessControlCacheService {
3
+ private readonly userAccessCache;
4
+ private readonly publicAccessCache;
5
+ private readonly baseUrl;
6
+ constructor();
7
+ loadCacheFromApi(entityId?: number): Promise<void>;
8
+ loadCacheFromJson(jsonData: any): void;
9
+ hasAccess(entityId: number, conceptId: number, required: PermissionSet): Promise<boolean>;
10
+ getAccessibleConcepts(entityId: number, conceptIds: number[], required: PermissionSet): Promise<number[]>;
11
+ getAccessByUser(entityId: number): Promise<Map<number, PermissionSet>>;
12
+ getAccessByConcept(conceptId: number): Promise<Map<number, PermissionSet>>;
13
+ deleteRecordByUserId(entityId: number): void;
14
+ deletePublicAccessRecordById(conceptId: number): void;
15
+ clearCache(): void;
16
+ getConceptsByPublicAccess(): Promise<Record<number, string[]>>;
17
+ hasPublicAccess(conceptId: number, required: PermissionSet): Promise<boolean>;
18
+ getConceptsWithPublicAccess(conceptIds: number[], required: PermissionSet): Promise<number[]>;
19
+ }
@@ -0,0 +1,267 @@
1
+ import { PermissionSet } from "./PermissionSet";
2
+ export declare class AccessControlService {
3
+ private static accessCache;
4
+ private static baseUrl;
5
+ private static initialize;
6
+ /**
7
+ * Checks if a user or entity has the specified access for a single concept.
8
+ * @param userId - The user's ID.
9
+ * @param access - The required PermissionSet.
10
+ * @param conceptId - The concept ID to check.
11
+ * @param entityId - Optional entity ID (defaults to userId).
12
+ * @returns Promise<boolean> - True if access is granted, false otherwise.
13
+ */
14
+ static checkAccessOfConcept(userId: number, access: PermissionSet, conceptId: number, entityId?: number): Promise<boolean>;
15
+ /**
16
+ * Checks if a user or entity has the specified access for all concepts in a list.
17
+ * @param userId - The user's ID.
18
+ * @param access - The required PermissionSet.
19
+ * @param conceptIdList - Array of concept IDs to check.
20
+ * @param entityId - Optional entity ID (defaults to userId).
21
+ * @returns Promise<boolean> - True if access is granted for all, false otherwise.
22
+ */
23
+ static checkAccessOfConceptList(userId: number, access: PermissionSet, conceptIdList: number[], entityId?: number): Promise<boolean>;
24
+ /**
25
+ * Filters a list of concept IDs, returning only those for which the user or entity has the specified access.
26
+ * @param userId - The user's ID.
27
+ * @param access - The required PermissionSet.
28
+ * @param conceptIdList - Array of concept IDs to filter.
29
+ * @param entityId - Optional entity ID (defaults to userId).
30
+ * @returns Promise<number[]> - Array of concept IDs with access.
31
+ */
32
+ static filterConceptListByAccess(userId: number, access: PermissionSet, conceptIdList: number[], entityId?: number): Promise<number[]>;
33
+ /**
34
+ * Gets the entity ID for a given user ID.
35
+ * @param userId - The user's ID.
36
+ * @returns number - The entity ID (default: userId).
37
+ */
38
+ private static getEntityIdConceptByUserId;
39
+ /**
40
+ * Assigns access to a specific entity for a concept.
41
+ * @param request - Object containing conceptId, access, entityId, makePublic.
42
+ * @returns Promise<any> - API response.
43
+ */
44
+ static assignAccessToEntity(request: {
45
+ conceptId: number;
46
+ access: string;
47
+ entityId: number;
48
+ makePublic: boolean;
49
+ }): Promise<any>;
50
+ /**
51
+ * Assigns public access to a concept or list of concepts.
52
+ * @param request - Object containing conceptId, accessList, connectionTypeList, nestedAccessLevel, conceptIdList.
53
+ * @returns Promise<any> - API response.
54
+ */
55
+ static assignPublicAccess(request: {
56
+ conceptId: number;
57
+ accessList: string[];
58
+ connectionTypeList?: string[];
59
+ nestedAccessLevel?: number;
60
+ conceptIdList?: number[];
61
+ }): Promise<any>;
62
+ /**
63
+ * Assigns public access to multiple concepts in bulk.
64
+ * @param request - Object containing conceptIdList, accessList, connectionTypeList, nestedAccessLevel, conceptId.
65
+ * @returns Promise<any> - API response.
66
+ */
67
+ static assignPublicAccessBlukConcept(request: {
68
+ conceptIdList: number[];
69
+ accessList: string[];
70
+ connectionTypeList?: string[];
71
+ nestedAccessLevel?: number;
72
+ conceptId?: number;
73
+ }): Promise<any>;
74
+ /**
75
+ * Assigns access to multiple entities and concepts in bulk.
76
+ * @param request - Object containing conceptId, conceptIdList, entityIdList, accessList, connectionTypeList, nestedAccessLevel.
77
+ * @returns Promise<any> - API response.
78
+ */
79
+ static assignAccessToEntityBulk(request: {
80
+ conceptId: number;
81
+ conceptIdList?: number[];
82
+ entityIdList: number[];
83
+ accessList: string[];
84
+ connectionTypeList?: string[];
85
+ nestedAccessLevel?: number;
86
+ }): Promise<any>;
87
+ /**
88
+ * Assigns access to a user for a concept.
89
+ * @param request - Object containing conceptId, access, userId, makePublic.
90
+ * @returns Promise<any> - API response.
91
+ */
92
+ static assignAccessByUser(request: {
93
+ conceptId: number;
94
+ access: string;
95
+ userId: number;
96
+ makePublic: boolean;
97
+ }): Promise<any>;
98
+ /**
99
+ * Revokes access for an entity from a concept.
100
+ * @param params - Object containing conceptId, access, entityId.
101
+ * @returns Promise<any> - API response.
102
+ */
103
+ static revokeAccess(params: {
104
+ conceptId: number;
105
+ access: string;
106
+ entityId: number;
107
+ }): Promise<any>;
108
+ /**
109
+ * Revokes access for multiple entities in bulk.
110
+ * @param request - Object containing conceptId, entityIdList, accessList.
111
+ * @returns Promise<any> - API response.
112
+ */
113
+ static revokeAccessBulk(request: {
114
+ conceptId: number;
115
+ entityIdList: number[];
116
+ accessList: string[];
117
+ }): Promise<any>;
118
+ /**
119
+ * Gets the access list for a concept and user.
120
+ * @param conceptId - The concept ID.
121
+ * @param userId - The user ID.
122
+ * @returns Promise<any> - API response.
123
+ */
124
+ static getAccessList(conceptId: number, userId: number): Promise<any>;
125
+ /**
126
+ * Gets the public access list for a list of concept IDs.
127
+ * @param conceptIdList - Array of concept IDs.
128
+ * @returns Promise<any> - API response.
129
+ */
130
+ static getPublicAccessList(conceptIdList: number[]): Promise<any>;
131
+ /**
132
+ * Revokes public access for a concept.
133
+ * @param request - Object containing conceptId, accessList.
134
+ * @returns Promise<any> - API response.
135
+ */
136
+ static revokePublicAccess(request: {
137
+ conceptId: number;
138
+ accessList: string[];
139
+ }): Promise<any>;
140
+ /**
141
+ * Checks if an entity has a specific permission for a concept.
142
+ * @param params - Object containing conceptId, permission, entityId.
143
+ * @returns Promise<any> - API response.
144
+ */
145
+ static checkAccess(params: {
146
+ conceptId: number;
147
+ permission: string;
148
+ entityId: number;
149
+ }): Promise<any>;
150
+ /**
151
+ * Checks if a user has a specific access for a concept.
152
+ * @param request - Object containing conceptId, access, userId.
153
+ * @returns Promise<any> - API response.
154
+ */
155
+ static checkAccessByUser(request: {
156
+ conceptId: number;
157
+ access: string;
158
+ userId: number;
159
+ }): Promise<any>;
160
+ /**
161
+ * Filters concepts by access for a user.
162
+ * @param request - Object containing userId, access, conceptIdList, connectionIdList.
163
+ * @returns Promise<any> - API response.
164
+ */
165
+ static filterConceptsByAccess(request: {
166
+ userId: number;
167
+ access: string;
168
+ conceptIdList?: number[];
169
+ connectionIdList?: number[];
170
+ }): Promise<any>;
171
+ /**
172
+ * Checks access for a user on multiple concepts in bulk.
173
+ * @param request - Object containing userId, access, conceptIdList.
174
+ * @returns Promise<any> - API response.
175
+ */
176
+ static checkAccessOfConceptBulk(request: {
177
+ userId: number;
178
+ access: string;
179
+ conceptIdList: number[];
180
+ }): Promise<any>;
181
+ /**
182
+ * Gets entities with a specific access for a concept.
183
+ * @param conceptId - The concept ID.
184
+ * @param access - The access type.
185
+ * @returns Promise<any> - API response.
186
+ */
187
+ static getEntitiesByAccess(conceptId: number, access: string): Promise<any>;
188
+ /**
189
+ * Gets all entities with any access for a concept.
190
+ * @param conceptId - The concept ID.
191
+ * @returns Promise<any> - API response.
192
+ */
193
+ static getEntitiesWithAccess(conceptId: number): Promise<any>;
194
+ /**
195
+ * Gets access groups by entity.
196
+ * @param entityId - Optional entity ID.
197
+ * @returns Promise<any> - API response.
198
+ */
199
+ static getAccessGroupByEntity(entityId?: number): Promise<any>;
200
+ /**
201
+ * Gets access groups by user.
202
+ * @param userId - Optional user ID.
203
+ * @returns Promise<any> - API response.
204
+ */
205
+ static getAccessGroupByUser(userId?: number): Promise<any>;
206
+ /**
207
+ * Gets public access by access IDs.
208
+ * @param accessIdList - Array of access IDs.
209
+ * @returns Promise<any> - API response.
210
+ */
211
+ static getPublicAccessByAccessIds(accessIdList: number[]): Promise<any>;
212
+ /**
213
+ * Gets the full access mapping for public users.
214
+ * @returns Promise<any> - API response.
215
+ */
216
+ static getFullAccessMappingForPublic(): Promise<any>;
217
+ /**
218
+ * Assigns public access for all users.
219
+ * @returns Promise<any> - API response.
220
+ */
221
+ static assignPublicAccessForAllUser(): Promise<any>;
222
+ /**
223
+ * Assigns access by connection type for users.
224
+ * @returns Promise<any> - API response.
225
+ */
226
+ static assignAccessByConncetionTypeOfUser(): Promise<any>;
227
+ /**
228
+ * Sets access inheritance for a concept.
229
+ * @param request - Object containing mainConceptId, enable, connectionTypeId.
230
+ * @returns Promise<any> - API response.
231
+ */
232
+ static setAccessInheritance(request: {
233
+ mainConceptId: number;
234
+ enable: boolean;
235
+ connectionTypeId?: number;
236
+ }): Promise<any>;
237
+ /**
238
+ * Gets the status of access inheritance for a concept.
239
+ * @param mainConceptId - The main concept ID.
240
+ * @param connectionTypeId - The connection type ID (default: 999).
241
+ * @returns Promise<any> - API response.
242
+ */
243
+ static getAccessInheritanceStatus(mainConceptId: number, connectionTypeId?: number): Promise<any>;
244
+ /**
245
+ * Performs a GET request to the backend API.
246
+ * @param path - The API path.
247
+ * @param errorMsg - Error message to throw if request fails.
248
+ * @returns Promise<any> - API response.
249
+ */
250
+ private static _get;
251
+ /**
252
+ * Performs a POST request to the backend API.
253
+ * @param path - The API path.
254
+ * @param body - Request body.
255
+ * @param errorMsg - Error message to throw if request fails.
256
+ * @returns Promise<any> - API response.
257
+ */
258
+ private static _post;
259
+ /**
260
+ * Performs a DELETE request to the backend API.
261
+ * @param path - The API path.
262
+ * @param body - Optional request body.
263
+ * @param errorMsg - Error message to throw if request fails.
264
+ * @returns Promise<any> - API response.
265
+ */
266
+ private static _delete;
267
+ }
@@ -0,0 +1,8 @@
1
+ export declare enum PermissionSet {
2
+ None = 0,
3
+ Read = 1,
4
+ Write = 2,
5
+ Execute = 4,
6
+ Delete = 8
7
+ }
8
+ export declare function getPermissionSetFromStrings(permissions: string[]): PermissionSet;
@@ -1,10 +1,2 @@
1
1
  export declare function HandleHttpError(response: Response): void;
2
- export declare function HandleHttpErrorObject(response: Response, output?: any): void;
3
2
  export declare function HandleInternalError(error: any, url?: string): void;
4
- /**
5
- * Handle errors inside package functions
6
- * @updateLog existing function log at start
7
- * @param functionName name of the function that encountered the error
8
- * @param error error appeared
9
- */
10
- export declare function UpdatePackageLogWithError(logData: any, functionName: string, error: any): void;