export { init, updateAccessToken }; export { SearchLinkMultipleApi } from './Api/Search/SearchLinkMultipleApi'; export { SplitStrings } from './Services/SplitStrings'; export { GetCompositionList, GetCompositionListWithId } from './Services/GetCompositionList'; export { GetCompositionListLocal, GetCompositionListLocalWithId } from './Services/Local/GetCompositionListLocal'; export { GetAllConnectionsOfComposition } from './Api/GetAllConnectionsOfComposition'; export { GetComposition, GetCompositionWithId, recursiveFetch, GetCompositionWithAllIds } from './Services/GetComposition'; export { GetCompositionLocal, GetCompositionLocalWithId } from './Services/Local/GetCompositionLocal'; export { default as CreateComposition } from './Services/CreateTheComposition'; export { CreateTheCompositionLocal } from './Services/Local/CreateTheCompositionLocal'; export { CreateConnectionBetweenTwoConcepts, CreateConnectionBetweenTwoConceptsGeneral } from './Services/CreateConnectionBetweenTwoConcepts'; export { default as GetTheConcept } from './Services/GetTheConcept'; export { default as MakeTheInstanceConcept } from './Services/MakeTheInstanceConcept'; export { MakeTheInstanceConceptLocal } from './Services/Local/MakeTheInstanceConceptLocal'; export { storeToDatabase, getFromDatabaseWithType, getObjectsFromIndexDb } from './Database/NoIndexDb'; export { createTheConnection as CreateTheConnection } from './Services/CreateTheConnection'; export { default as GetConceptByCharacter } from './Services/GetConceptByCharacter'; export { GetLink, GetLinkRaw } from './Services/GetLink'; export { CreateDefaultConcept } from './Services/CreateDefaultConcept'; export { MakeTheTypeConceptLocal } from './Services/Local/MakeTheTypeLocal'; export { MakeTheTypeConceptApi } from './Api/MakeTheTypeConceptApi'; export { GetLinkerConnectionFromConcepts, GetLinkerConnectionToConcepts } from './Services/GetLinkerConnectionFromConcept'; export { DeleteConceptById } from './Services/DeleteConcept'; export { DeleteConnectionById, DeleteConnectionByIdBulk } from './Services/DeleteConnection'; export { TrashTheConcept } from './Api/Delete/DeleteConceptInBackend'; export { GetConnectionById } from './Services/GetConnections'; export { MakeTheTimestamp } from './Services/MakeTheTimestamp'; export { RecursiveSearchApi, RecursiveSearchApiWithInternalConnections, RecursiveSearchApiRaw, RecursiveSearchApiRawFullLinker, RecursiveSearchApiNewRawFullLinker } from './Api/RecursiveSearch'; export { GetCompositionBulkWithDataId, GetCompositionFromConnectionsWithDataIdFromConnections, GetCompositionFromConnectionsWithIndexFromConnections, GetCompositionBulk, GetCompositionFromConnectionsWithDataId } from './Services/GetCompositionBulk'; export { uploadAttachment, getR2PresignedUploadUrl, getUploadFileLimit, uploadFile, uploadImage, uploadImageV2, uploadR2Storage, uploadToR2PresignedUrl, uploadWithR2PresignedUrl, validDocumentFormats, validImageFormats, } from './Services/Upload'; export type { R2PresignedUploadOptions, R2PresignedUploadResult, R2PresignedUploadUrlData, R2PresignedUploadUrlRequest, R2UploadData, UploadResponse, } from './Services/Upload'; export { GetConceptBulk } from './Api/GetConceptBulk'; export { GetConnectionBulk } from './Api/GetConnectionBulk'; export { GetAllConnectionsOfCompositionBulk } from './Api/GetAllConnectionsOfCompositionBulk'; export { LoginToBackend } from './Api/Login'; export { GetConnectionOfTheConcept } from './Api/GetConnectionOfTheConcept'; export { default as Signup } from './Api/Signup'; export { default as Signin } from './Api/Signin'; export { SignupEntity } from './Api/Signup'; export { default as UpdateComposition } from './Services/UpdateComposition'; export { SearchAllConcepts } from './Api/Search/Search'; export { SearchWithLinker } from './Api/Search/SearchWithLinker'; export { GetCompositionWithCache, GetCompositionWithDataIdWithCache, GetCompositionWithDataIdBulk } from './Services/Composition/CompositionCache'; export { CreateSession } from './Api/Session/CreateSession'; export { CreateSessionVisit } from './Api/Session/CreateSessionVisit'; export {} from './Api/GetConceptByCharacterAndType'; export { GetRelation, GetRelationRaw, GetRelationNew } from './Services/GetRelation'; export { recursiveFetchNew } from './Services/Composition/BuildComposition'; export { CreateTheCompositionWithCache } from './Services/Composition/CreateCompositionCache'; export { CreateDefaultLConcept } from './Services/Local/CreateDefaultLConcept'; export { CreateTheConnectionGeneral } from './Services/CreateTheConnectionGeneral'; export { CreateTheConnectionLocal, CreateConnection } from './Services/Local/CreateTheConnectionLocal'; export { GetCompositionListAll, GetCompositionListAllWithId, GetCompositionListWithIdUpdated } from './Services/GetCompositionList'; export { GetUserGhostId, AddGhostConcept } from './Services/User/UserTranslation'; export { SearchLinkMultipleAll, FormatFromConnections } from './Services/Search/SearchLinkMultiple'; export { GetTheConceptLocal } from './Services/Local/GetTheConceptLocal'; export { UpdateCompositionLocal } from './Services/Local/UpdateCompositionLocal'; export { GetCompositionFromConnectionsWithDataIdInObject, GetCompositionFromConnectionsWithIndex, GetCompositionFromConnectionsWithDataIdIndex } from './Services/GetCompositionBulk'; export { GetRelationLocal } from './Services/Local/GetRelationLocal'; export { GetConceptByCharacterAndCategoryLocal } from './Services/Local/GetConceptByCharacterLocal'; export { ViewInternalData } from './Services/View/ViewInternalData'; export { ViewInternalDataApi } from './Api/View/ViewInternalDataApi'; export { convertFromLConceptToConcept, convertFromConceptToLConcept } from './Services/Conversion/ConvertConcepts'; export { SearchLinkInternal, SearchLinkInternalAll } from './Services/Search/SearchLinkInternal'; export { CreateConnectionBetweenTwoConceptsLocal } from './Services/Local/CreateConnectionBetweenTwoConceptsLocal'; export { DeleteConceptLocal } from './Services/Local/DeleteConceptLocal'; export { GetConnectionBetweenTwoConceptsLinker } from './Services/GetConnectionBetweenTwoConceptsLinker'; export { DelayFunctionExecution } from './Services/Common/DelayFunction'; export { GetCompositionWithIdAndDateFromMemory, GetCompositionFromMemoryWithConnections } from './Services/GetComposition'; export { GetConceptByCharacterAndType } from './Api/GetConceptByCharacterAndType'; export { GetInstanceConceptByCharacterType } from './Api/GetInstanceConceptByCharacterType'; export { GetConnectionDataPrefetch } from './Services/GetCompositionBulk'; export { FormatFromConnectionsAltered } from './Services/Search/SearchLinkMultiple'; export { NORMAL, JUSTDATA, DATAID, DATAIDDATE, RAW, ALLID, LISTNORMAL, DATAV2 } from './Constants/FormatConstants'; export { PRIVATE, PUBLIC, ADMIN } from './Constants/AccessConstants'; export { SearchWithTypeAndLinkerApi } from './Api/Search/SearchWithTypeAndLinker'; export { DependencyObserver } from './WrapperFunctions/DepenedencyObserver'; export { SearchLinkMultipleAllObservable, searchLinkMultipleListener } from './WrapperFunctions/SearchLinkMultipleAllObservable'; export { GetCompositionListener } from './WrapperFunctions/GetCompositionObservable'; export { GetCompositionListListener } from './WrapperFunctions/GetCompositionListObservable'; export { SearchWithTypeAndLinker } from './Services/Search/SearchWithTypeAndLinker'; export { GetLinkListener } from './WrapperFunctions/GetLinkObservable'; export { RecursiveSearchListener } from './WrapperFunctions/RecursiveSearchObservable'; export { GetLinkListListener } from './WrapperFunctions/GetLinkListObservable'; export { GetConnectionTypeForCount } from './Services/Common/DecodeCountInfo'; export { orderTheConnections } from './Services/Search/orderingConnections'; export { SyncData } from './DataStructures/SyncData'; export { Concept } from './DataStructures/Concept'; export { LConcept } from './DataStructures/Local/LConcept'; export { LConnection } from './DataStructures/Local/LConnection'; export { Connection } from './DataStructures/Connection'; export { ConceptsData } from './DataStructures/ConceptData'; export { ConnectionData } from './DataStructures/ConnectionData'; export { BinaryTree } from './DataStructures/BinaryTree'; export { SearchQuery } from './DataStructures/SearchQuery'; export { SignupModel } from './DataStructures/SignupModel'; export { SigninModel } from './DataStructures/SigninModel'; export { FreeschemaResponse } from './DataStructures/Responses/StandardResponses'; export { PatcherStructure } from './DataStructures/PatcherStructure'; export { SessionData } from './DataStructures/Session/SessionData'; export { Composition } from './DataStructures/Composition/Composition'; export { CompositionBinaryTree } from './DataStructures/Composition/CompositionBinaryTree'; export { CompositionNode } from './DataStructures/Composition/CompositionNode'; export { LocalSyncData } from './DataStructures/Local/LocalSyncData'; export { UserBinaryTree } from './DataStructures/User/UserBinaryTree'; export { FilterSearch } from './DataStructures/FilterSearch'; export { SearchStructure } from './DataStructures/Search/SearchStructure'; export { LocalConceptsData } from './DataStructures/Local/LocalConceptData'; export { Logger } from "./Middleware/logger.service"; export { sendEmail, sendPersonalEmail } from "./Services/Mail"; export type { RecaptchaOptions, SendEmailOptions } from "./Services/Mail"; export { BuilderStatefulWidget } from "./Widgets/BuilderStatefulWidget"; export { LocalTransaction } from "./Services/Transaction/LocalTransaction"; export { InnerActions } from "./Constants/general.const"; export { Anomaly } from './Anomaly/anomaly'; export { Validator } from './Validator/validator'; export { createFormFieldData } from './Validator/utils'; export { BaseUrl } from './DataStructures/BaseUrl'; export { StatefulWidget } from './Widgets/StatefulWidget'; export { DeleteConnectionByType, DeleteConnectionByTypeBulk, GetAllTheConnectionsByTypeAndOfTheConcept } from './Services/DeleteConnectionByType'; export { GetConnectionsBetweenApi } from './Api/GetConnections/GetConnectionsBetweenApi'; export { FetchConnection, FetchConnectionQuery, buildFetchConnection } from './DataStructures/FetchConnection'; export { FreeschemaQuery } from './DataStructures/Search/FreeschemaQuery'; export { FreeschemaQueryApi } from './Api/Search/FreeschemaQueryApi'; export { SchemaQueryListener, SchemaQuery } from './WrapperFunctions/SchemaQueryObservable'; export { WidgetTree } from './Widgets/WidgetTree'; export { DeleteUser } from './Services/DeleteConcept'; export { AccessTracker } from './AccessTracker/accessTracker'; export { CreateConnectionBetweenEntityLocal } from './Services/CreateConnection/CreateConnectionEntity'; export { BuildWidgetFromId } from './Widgets/WidgetBuild'; export { clearAllCaches } from './Services/CacheClear'; export { removeAllChildren } from './Services/Common/RemoveAllChild'; export { getUserDetails, getUserDetailsWithRefresh } from './Services/User/UserFromLocalStorage'; export { TokenStorage } from './DataStructures/Security/TokenStorage'; export { CountInfo } from './DataStructures/Count/CountInfo'; export { LogEvent } from './Services/Logs/LogEvent'; export { Selector } from './Api/Prototype/Selector'; export { AccessControlService } from './Services/AccessControl/AccessControl'; export { importLatestWidget, importRecentWidget, renderImportedWidget, renderLatestWidget, renderPage, renderWidget, convertWidgetTreeToWidgetWithWrapper, getWidgetFromId, convertWidgetTreeToWidget, unwrapContainers, getWidgetBulkFromId } from './Widgets/RenderWidgetService'; export { CreateData } from './Services/automated/automated-concept-connection'; export { Prototype } from './DataStructures/Prototype/Prototype'; export { Environments } from './DataStructures/environments/environments'; export { createPrototypeLocal } from './prototype/prototype.service'; export { GetImageApi } from './Api/Images/GetImages'; export { GetAllLinkerConnectionsFromTheConcept } from "./Api/GetAllLinkerConnectionsFromTheConcept"; export { GetFreeschemaImage, GetFreeschemaImageUrl } from './Services/assets/GetImageService'; type listeners = { listenerId: string | number; callback: any; createdAt: number; }; export declare var serviceWorker: any; export declare let subscribedListeners: listeners[]; export declare let hasActivatedSW: boolean; export declare function setHasActivatedSW(value: boolean): void; /** * Updates the JWT access token used for authenticated API requests. * * This function should be called after user authentication to set or update the bearer token * that will be used for all subsequent authenticated operations. The token is stored in * TokenStorage and automatically included in API request headers. * * **When to Use:** * - After successful login (LoginToBackend or Signin) * - When refreshing an expired token * - When switching between user sessions * - When restoring a saved session on app reload * * **Token Flow:** * 1. User logs in via LoginToBackend() or Signin() * 2. Backend returns JWT token * 3. Call updateAccessToken() with the token * 4. Token is stored in memory (TokenStorage.BearerAccessToken) * 5. All API calls automatically use this token * 6. If service worker enabled, token is synced to service worker * * **Security Notes:** * - Token is stored in memory only (not persisted to disk) * - Token is cleared on page refresh (unless you save/restore it) * - Never expose token in logs or client-side code * - Token should be refreshed before expiration * * @param accessToken - The JWT bearer token obtained from authentication. * Format: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." * Pass empty string to clear the token (logout). * * @param session - Optional session information to sync with token. * Reserved for future use. Currently not fully implemented. * * @returns void * * @example * // After login, update token * const loginResult = await LoginToBackend("user@example.com", "password"); * updateAccessToken(loginResult.data.token); * console.log("Token updated - now authenticated"); * * @example * // Restore token from localStorage on app reload * const savedToken = localStorage.getItem("authToken"); * if (savedToken) { * updateAccessToken(savedToken); * } * * @example * // Clear token on logout * updateAccessToken(""); * console.log("Token cleared - logged out"); * * @example * // Refresh expired token * const newToken = await refreshTokenFromBackend(); * updateAccessToken(newToken); * * @see {@link LoginToBackend} for obtaining initial token * @see {@link Signin} for alternative authentication * @see {@link init} which can also set initial token */ declare function updateAccessToken(accessToken?: string, session?: any, refreshToken?: string): void; /** * Initializes the mftsccs-browser package and sets up all required subsystems. * * This is the FIRST function you must call before using any other functionality in the package. * It configures the backend connections, initializes local databases, sets up service workers, * and prepares the system for concept and connection operations. * * **Initialization Process:** * 1. Configures Base URLs for backend, AI, and node servers * 2. Sets up access token for authenticated requests * 3. Generates unique application randomizer for IndexedDB identification * 4. Initializes feature flags (logging, access tracking, etc.) * 5. Checks for service worker support * 6. Initializes local IndexedDB databases for caching * 7. Sets up message listeners for service worker communication * 8. Optionally registers and activates service worker * 9. Falls back to main thread if service worker unavailable * * **Subsystems Initialized:** * - IndexedDB databases (concepts, connections, settings) * - Service worker (if enabled and supported) * - Message passing between main thread and service worker * - Broadcast channel for cross-tab communication * - Access token storage * - Logging and monitoring systems * - Access tracking (if enabled) * * @param url - The backend API base URL (C# data fabric server). * This is the primary server for concept and connection data. * Example: "https://api.example.com" or "https://backend.yourdomain.com" * **Required** for most operations. * * @param aiurl - The AI service URL for AI-powered features and data preloading. * If not using AI features, pass empty string and set enableAi to false. * Example: "https://ai.example.com" * * @param accessToken - JWT bearer token for authenticated API requests. * Can be empty string on initialization - set later with updateAccessToken(). * Token is obtained through LoginToBackend() or Signin(). * Example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." * * @param nodeUrl - The Node.js server URL for business logic and security features. * Used for additional server-side operations. * Example: "https://node.example.com" * * @param enableAi - Flag to enable/disable AI features and AI data preloading to IndexedDB. * Set to false if not using AI features or if aiurl is not provided. * Default: true * * @param applicationName - Unique identifier for your application. * Used to create separate IndexedDB instances for different apps. * Example: "my-app-v1", "project-manager", "knowledge-base" * Useful when multiple applications share the same domain. * * @param enableSW - Service worker configuration object. Service worker enables background * processing for better performance and offline capabilities. * - activate: boolean - Enable/disable service worker * - scope: string (optional) - Service worker scope path (default: "/") * - pathToSW: string (optional) - Path to service worker file (default: "/service-worker.js") * - manual: boolean (optional) - If true, assumes SW already registered manually * Example: {activate: true, scope: "/", pathToSW: "/sw.js"} * * @param flags - Feature flags object for enabling/disabling various features: * - logApplication: boolean - Enable application-level logging * - logPackage: boolean - Enable package-level logging * - accessTracker: boolean - Enable access tracking/analytics * - isTest: boolean - Mark as test environment * All default to false if not specified. * * @param parameters - Additional configuration parameters: * - logserver: string - Custom log server URL (default: "https://logdev.freeschema.com") * - isPwa: boolean - Enable PWA offline persistence to IndexedDB (default: false) * - enableCache: boolean - Enable/disable widget and FreeschemaQuery caching. * When false, QueryCacheManager and WidgetCacheManager skip all reads and writes * (memory and IndexedDB). Stored in Environments under key 'enableCache' so it * can be read or changed at runtime via Environments.getValue/setValue. * Default: true. * * @returns Promise - Returns true if initialization succeeds, undefined if it fails. * On failure, falls back to main thread operation and logs warnings. * * @example * // Basic initialization (minimum required) * await init( * "https://api.myapp.com", // backend URL * "", // no AI * "", // no token yet * "", // no node server * false, // disable AI * "my-app" // app name * ); * * @example * // Full initialization with service worker * await init( * "https://api.myapp.com", * "https://ai.myapp.com", * "", * "https://node.myapp.com", * true, * "my-app-v2", * { * activate: true, * scope: "/", * pathToSW: "/service-worker.js" * }, * { * logApplication: true, * accessTracker: true * }, * { * logserver: "https://logs.myapp.com" * } * ); * * @example * // Initialize then login * await init("https://api.example.com", "", "", "", false, "my-app"); * const loginResult = await LoginToBackend("user@example.com", "password"); * updateAccessToken(loginResult.data.token); * // Now ready to use all authenticated operations * * @throws Does not throw - logs warnings and falls back to main thread on errors. * Common issues: Service worker registration failures, IndexedDB access denied. * * @see {@link updateAccessToken} for updating the access token after initialization * @see {@link LoginToBackend} for obtaining an access token * @see {@link sendMessage} for communicating with service worker after initialization * @param accessControlUrl This is the url for the access control system. This is another server in the data fabric that is used as server for business logic and security features. * */ declare function init(url?: string, aiurl?: string, accessToken?: string, nodeUrl?: string, enableAi?: boolean, applicationName?: string, enableSW?: { activate: boolean; scope?: string; pathToSW?: string; manual?: boolean; } | undefined, flags?: { logApplication?: boolean; logPackage?: boolean; accessTracker?: boolean; isTest?: boolean; accessControl?: boolean; }, parameters?: { logserver?: string; isPwa?: boolean; enableCache?: boolean; recaptchaSiteKey?: string; recaptchaAction?: string; }, accessControlUrl?: string): Promise; /** * Method to send message to the service worker from main thread * @param type string * @param payload any * @returns Promise */ export declare function sendMessage(type: string, payload: any, retryCount?: number): Promise; /** * Method to dispatch Event received from SW * @param id number|string * @param data any */ export declare function dispatchIdEvent(id: number | string, data?: any): void; /** * Method to handle global exception occured in service worker * @param error any */ export declare const handleServiceWorkerException: (error: any) => void;