mftsccs-node 0.0.76 → 0.0.77

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.
@@ -26,6 +26,12 @@
26
26
  export declare class BaseUrl {
27
27
  /** Base URL for the main CCS backend API server */
28
28
  static BASE_URL: string;
29
+ /** Current cache server URL used for read-heavy concept and connection endpoints */
30
+ static NODE_CACHE_URL: string;
31
+ /** Ordered cache servers, nearest first. Falls back to BASE_URL when exhausted. */
32
+ static CACHE_SERVERS: string[];
33
+ /** Indicates whether the current cache server is still the nearest configured server */
34
+ static isNearestCache: boolean;
29
35
  /** URL for AI service endpoints */
30
36
  static AI_URL: string;
31
37
  /** MQTT broker URL for real-time messaging */
@@ -34,6 +40,10 @@ export declare class BaseUrl {
34
40
  static NODE_URL: string;
35
41
  /** Active MQTT connection instance */
36
42
  static MQTT_CONNECTION: any;
43
+ static setNodeCacheUrl(cacheServerUrl?: string): void;
44
+ static setCacheServers(cacheServers?: string[]): void;
45
+ static GetReadBaseUrl(): string;
46
+ static GetReadBaseUrlCandidates(): string[];
37
47
  /**
38
48
  * Returns the URL for retrieving a single concept by ID.
39
49
  * @returns {string} The concept retrieval API endpoint
@@ -43,6 +43,10 @@
43
43
  export declare class CCSConfig {
44
44
  /** URL for the AI service. Defaults to "https://ai.freeschema.com" */
45
45
  aiUrl: string;
46
+ /** Single cache server URL for read-heavy concept and connection endpoints */
47
+ cacheServerUrl: string;
48
+ /** Ordered cache server URLs, nearest first */
49
+ cacheServers: string[];
46
50
  /** JWT bearer token for authentication. Can be set later via updateAccessToken() */
47
51
  accessToken: string;
48
52
  /** Whether to enable AI features. Defaults to true */
@@ -58,7 +62,7 @@ export declare class CCSConfig {
58
62
  flags?: Record<string, boolean>;
59
63
  /**
60
64
  * Dictionary of additional parameters.
61
- * Example: { logserver: "https://logs.example.com" }
65
+ * Example: { logserver: "https://logs.example.com", cacheServers: "https://cache-1.example.com,https://cache-2.example.com" }
62
66
  */
63
67
  parameters?: Record<string, string>;
64
68
  /** Path for storing local data (ID counters, cached data, etc.) */
@@ -0,0 +1,6 @@
1
+ import { HttpResponse } from "./Http/HttpClient.service";
2
+ /**
3
+ * Fetch from the nearest configured cache server first, then rotate through the
4
+ * remaining cache servers and finally the main backend when a cache server is down.
5
+ */
6
+ export declare function fetchWithCacheServerFallback(path: string, init?: RequestInit, maxRetries?: number): Promise<HttpResponse>;
@@ -8,6 +8,7 @@
8
8
  */
9
9
  export { init, updateAccessToken };
10
10
  export { getOAuthToken, refreshOAuthToken } from './Services/oauth/CallOauth.service';
11
+ export { fetchWithCacheServerFallback } from './Services/cacheService';
11
12
  export type { OAuthResponse } from './Services/oauth/CallOauth.service';
12
13
  export { requestWithRetry, postWithRetry, getWithRetry, putWithRetry, deleteWithRetry, patchWithRetry, fetchWithRetry, HttpResponse, TokenRefreshError } from './Services/Http/HttpClient.service';
13
14
  export { SplitStrings } from './Services/SplitStrings';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mftsccs-node",
3
- "version": "0.0.76",
3
+ "version": "0.0.77",
4
4
  "environment": "production",
5
5
  "description": "Full Pack of concept and connection system",
6
6
  "main": "dist/bundle.js",