mftsccs-node 0.0.77 → 0.0.78-dev
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/bundle.js +1 -1
- package/dist/bundle.mjs +1 -1
- package/dist/types/Api/MakeTheTypeConceptApi.d.ts +1 -30
- package/dist/types/DataStructures/BaseUrl.d.ts +1 -0
- package/dist/types/DataStructures/CCSConfig.d.ts +8 -1
- package/dist/types/DataStructures/Transaction/Transaction.d.ts +2 -0
- package/dist/types/Services/CreateReferentConcept.d.ts +3 -0
- package/dist/types/Services/CreateTypeConcept.d.ts +3 -0
- package/dist/types/app.d.ts +2 -0
- package/package.json +1 -1
|
@@ -8,35 +8,6 @@
|
|
|
8
8
|
import { Concept } from "../DataStructures/Concept";
|
|
9
9
|
/**
|
|
10
10
|
* Retrieves or creates a type concept based on a string identifier.
|
|
11
|
-
* Type concepts
|
|
12
|
-
*
|
|
13
|
-
* This function first attempts to find an existing type concept locally, then queries the backend
|
|
14
|
-
* if not found. If the concept doesn't exist in the backend, it creates a new type concept.
|
|
15
|
-
* The function uses caching to prevent duplicate requests for the same type.
|
|
16
|
-
*
|
|
17
|
-
* @param type - The string identifier for the type concept (e.g., "the_person", "the_location")
|
|
18
|
-
* @param userId - The user ID associated with the request
|
|
19
|
-
* @returns A promise that resolves to the Concept object representing the type
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```typescript
|
|
23
|
-
* // Get or create a "person" type concept
|
|
24
|
-
* const personType = await MakeTheTypeConceptApi('the_person', 123);
|
|
25
|
-
* console.log('Person type ID:', personType.id);
|
|
26
|
-
*
|
|
27
|
-
* // Use the type concept when creating new concepts
|
|
28
|
-
* const newPerson = await CreateConcept('John Doe', personType.id);
|
|
29
|
-
* ```
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* - Uses local caching to prevent duplicate simultaneous requests
|
|
33
|
-
* - First searches for existing concept via GetConceptByCharacterAndCategory
|
|
34
|
-
* - Creates new type concept in backend if not found or if typeId is 4 (unknown type)
|
|
35
|
-
* - Automatically adds the retrieved concept to ConceptsData for local access
|
|
36
|
-
* - Cache entries are cleaned up after the fetch completes
|
|
37
|
-
* - Returns a default concept with id=0 if errors occur
|
|
38
|
-
*
|
|
39
|
-
* @see GetConceptByCharacterAndCategory for local concept searching
|
|
40
|
-
* @see MakeTheNameInBackend for creating named concepts
|
|
11
|
+
* Type concepts define categories and classifications used in the Concept Connection System.
|
|
41
12
|
*/
|
|
42
13
|
export declare function MakeTheTypeConceptApi(type: string, userId: number): Promise<Concept>;
|
|
@@ -254,6 +254,7 @@ export declare class BaseUrl {
|
|
|
254
254
|
* @returns {string} The type concept creation API endpoint
|
|
255
255
|
*/
|
|
256
256
|
static MakeTheTypeConceptUrl(): string;
|
|
257
|
+
static CreateTypeConceptUrl(): string;
|
|
257
258
|
/**
|
|
258
259
|
* Returns the URL for deleting a single connection.
|
|
259
260
|
* @returns {string} The connection deletion API endpoint
|
|
@@ -40,6 +40,12 @@
|
|
|
40
40
|
* await init("https://api.example.com", "", "MyApp", config);
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
|
+
type CCSConfigOptions = Partial<Omit<CCSConfig, "cacheServers">> & {
|
|
44
|
+
cacheServers?: string[] | string;
|
|
45
|
+
cacheServerUrl?: string;
|
|
46
|
+
cacheServer?: string;
|
|
47
|
+
cache_servers?: string[] | string;
|
|
48
|
+
};
|
|
43
49
|
export declare class CCSConfig {
|
|
44
50
|
/** URL for the AI service. Defaults to "https://ai.freeschema.com" */
|
|
45
51
|
aiUrl: string;
|
|
@@ -99,7 +105,7 @@ export declare class CCSConfig {
|
|
|
99
105
|
* });
|
|
100
106
|
* ```
|
|
101
107
|
*/
|
|
102
|
-
constructor(options?:
|
|
108
|
+
constructor(options?: CCSConfigOptions);
|
|
103
109
|
/**
|
|
104
110
|
* Returns true if OAuth credentials are configured.
|
|
105
111
|
* @returns {boolean} Whether both clientId and clientSecret are set
|
|
@@ -171,3 +177,4 @@ export declare class CCSConfig {
|
|
|
171
177
|
*/
|
|
172
178
|
setParameter(paramName: string, value: string): void;
|
|
173
179
|
}
|
|
180
|
+
export {};
|
|
@@ -214,6 +214,8 @@ export declare class Transaction {
|
|
|
214
214
|
* ```
|
|
215
215
|
*/
|
|
216
216
|
MakeTheInstanceConcept(type: string, referent: string, composition: boolean | undefined, userId: number, accessId: number, sessionInformationId?: number, referentId?: number): Promise<Concept>;
|
|
217
|
+
CreateReferentConcept(type: string, referentConcept: Concept | number, characterValue?: string, userId?: number, accessId?: number, sessionInformationId?: number): Promise<Concept>;
|
|
218
|
+
CreateTypeConcept(typeConcept: Concept | number, characterValue: string, userId?: number, accessId?: number, sessionInformationId?: number): Promise<Concept>;
|
|
217
219
|
/**
|
|
218
220
|
* Creates a connection between two concepts within the transaction.
|
|
219
221
|
* Establishes a typed relationship between source and target concepts.
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Concept } from "../DataStructures/Concept";
|
|
2
|
+
import { InnerActions } from "../DataStructures/Transaction/Transaction";
|
|
3
|
+
export declare function CreateReferentConcept(type: string, referentConcept: Concept | number, characterValue?: string, userId?: number, accessId?: number, sessionInformationId?: number, actions?: InnerActions): Promise<Concept>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Concept } from "../DataStructures/Concept";
|
|
2
|
+
import { InnerActions } from "../DataStructures/Transaction/Transaction";
|
|
3
|
+
export declare function CreateTypeConcept(typeConcept: Concept | number, characterValue: string, userId?: number, accessId?: number, sessionInformationId?: number, actions?: InnerActions): Promise<Concept>;
|
package/dist/types/app.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export { default as CreateComposition } from './Services/CreateTheComposition';
|
|
|
20
20
|
export { CreateConnectionBetweenTwoConcepts, CreateConnectionBetweenTwoConceptsGeneral } from './Services/CreateConnectionBetweenTwoConcepts';
|
|
21
21
|
export { default as GetTheConcept } from './Services/GetTheConcept';
|
|
22
22
|
export { default as MakeTheInstanceConcept } from './Services/MakeTheInstanceConcept';
|
|
23
|
+
export { CreateReferentConcept } from './Services/CreateReferentConcept';
|
|
24
|
+
export { CreateTypeConcept } from './Services/CreateTypeConcept';
|
|
23
25
|
export { storeToDatabase, getFromDatabaseWithType, getFromDatabaseWithTypeOld } from './Database/NoIndexDb';
|
|
24
26
|
export { default as GetConceptByCharacter } from './Services/GetConceptByCharacter';
|
|
25
27
|
export { GetLink, GetLinkRaw } from './Services/GetLink';
|