mftsccs-node 0.2.13 → 0.2.15

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.
@@ -259,4 +259,14 @@ export declare class BaseUrl {
259
259
  * @returns {string} The bulk type concept retrieval API endpoint
260
260
  */
261
261
  static GetConceptConnectionByType(): string;
262
+ /**
263
+ * Returns the URL for OAuth token requests.
264
+ * @returns {string} The OAuth token API endpoint
265
+ */
266
+ static OAuthTokenUrl(): string;
267
+ /**
268
+ * Returns the URL for OAuth token refresh requests.
269
+ * @returns {string} The OAuth token refresh API endpoint
270
+ */
271
+ static OAuthRefreshUrl(): string;
262
272
  }
@@ -0,0 +1,169 @@
1
+ /**
2
+ * @fileoverview Configuration class for CCS initialization.
3
+ * This module provides a clean way to manage optional CCS configuration parameters.
4
+ * @module DataStructures/CCSConfig
5
+ */
6
+ /**
7
+ * Configuration class for CCS initialization.
8
+ *
9
+ * This class holds all optional configuration parameters for the CCS library,
10
+ * keeping the init() function clean with only essential parameters.
11
+ *
12
+ * @class CCSConfig
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * const config = new CCSConfig({
17
+ * aiUrl: "https://ai.example.com",
18
+ * accessToken: "jwt-token",
19
+ * enableAi: true,
20
+ * flags: { logApplication: true },
21
+ * storagePath: "./data/ccs/"
22
+ * });
23
+ *
24
+ * await init(
25
+ * "https://api.example.com",
26
+ * "http://localhost:5001",
27
+ * "MyApp",
28
+ * config
29
+ * );
30
+ * ```
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * // Minimal configuration with OAuth
35
+ * const config = new CCSConfig({
36
+ * clientId: "101084838",
37
+ * clientSecret: "your-secret"
38
+ * });
39
+ *
40
+ * await init("https://api.example.com", "", "MyApp", config);
41
+ * ```
42
+ */
43
+ export declare class CCSConfig {
44
+ /** URL for the AI service. Defaults to "https://ai.freeschema.com" */
45
+ aiUrl: string;
46
+ /** JWT bearer token for authentication. Can be set later via updateAccessToken() */
47
+ accessToken: string;
48
+ /** Whether to enable AI features. Defaults to true */
49
+ enableAi: boolean;
50
+ /**
51
+ * Dictionary of feature flags for controlling CCS behavior.
52
+ * Available flags:
53
+ * - logApplication: Enable application-level logging
54
+ * - logPackage: Enable package-level logging
55
+ * - accessTracker: Enable access tracking
56
+ * - isTest: Enable test mode
57
+ */
58
+ flags?: Record<string, boolean>;
59
+ /**
60
+ * Dictionary of additional parameters.
61
+ * Example: { logserver: "https://logs.example.com" }
62
+ */
63
+ parameters?: Record<string, string>;
64
+ /** Path for storing local data (ID counters, cached data, etc.) */
65
+ storagePath?: string;
66
+ /** OAuth client ID for authentication */
67
+ clientId?: string;
68
+ /** OAuth client secret for authentication */
69
+ clientSecret?: string;
70
+ /** Application name for OAuth and logging purposes */
71
+ applicationName?: string;
72
+ /**
73
+ * Creates a new CCSConfig instance.
74
+ *
75
+ * @param options - Partial configuration options to override defaults
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * // Use default values
80
+ * const config = new CCSConfig();
81
+ * ```
82
+ *
83
+ * @example
84
+ * ```typescript
85
+ * // Override specific values
86
+ * const config = new CCSConfig({
87
+ * aiUrl: "https://custom-ai.example.com",
88
+ * enableAi: false,
89
+ * clientId: "123456",
90
+ * clientSecret: "secret",
91
+ * flags: {
92
+ * logApplication: true,
93
+ * accessTracker: true
94
+ * }
95
+ * });
96
+ * ```
97
+ */
98
+ constructor(options?: Partial<CCSConfig>);
99
+ /**
100
+ * Returns true if OAuth credentials are configured.
101
+ * @returns {boolean} Whether both clientId and clientSecret are set
102
+ */
103
+ hasOAuthCredentials(): boolean;
104
+ /**
105
+ * Returns true if an access token is configured.
106
+ * @returns {boolean} Whether accessToken is set
107
+ */
108
+ hasAccessToken(): boolean;
109
+ /**
110
+ * Get a specific flag value with a default fallback.
111
+ *
112
+ * @param flagName - The name of the flag to retrieve
113
+ * @param defaultValue - Default value if flag is not set
114
+ * @returns {boolean} The flag value or default
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * const config = new CCSConfig({
119
+ * flags: { logApplication: true }
120
+ * });
121
+ * config.getFlag('logApplication', false); // returns true
122
+ * config.getFlag('unknownFlag', false); // returns false
123
+ * ```
124
+ */
125
+ getFlag(flagName: string, defaultValue?: boolean): boolean;
126
+ /**
127
+ * Get a specific parameter value with a default fallback.
128
+ *
129
+ * @param paramName - The name of the parameter to retrieve
130
+ * @param defaultValue - Default value if parameter is not set
131
+ * @returns {string} The parameter value or default
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * const config = new CCSConfig({
136
+ * parameters: { logserver: "https://logs.example.com" }
137
+ * });
138
+ * config.getParameter('logserver', ''); // returns "https://logs.example.com"
139
+ * config.getParameter('unknown', ''); // returns ""
140
+ * ```
141
+ */
142
+ getParameter(paramName: string, defaultValue?: string): string;
143
+ /**
144
+ * Set a flag value.
145
+ *
146
+ * @param flagName - The name of the flag to set
147
+ * @param value - The boolean value to set
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * const config = new CCSConfig();
152
+ * config.setFlag('logApplication', true);
153
+ * ```
154
+ */
155
+ setFlag(flagName: string, value: boolean): void;
156
+ /**
157
+ * Set a parameter value.
158
+ *
159
+ * @param paramName - The name of the parameter to set
160
+ * @param value - The string value to set
161
+ *
162
+ * @example
163
+ * ```typescript
164
+ * const config = new CCSConfig();
165
+ * config.setParameter('logserver', 'https://logs.example.com');
166
+ * ```
167
+ */
168
+ setParameter(paramName: string, value: string): void;
169
+ }
@@ -48,5 +48,78 @@ export declare class TokenStorage {
48
48
  * Consider clearing this value on logout or session expiration.
49
49
  */
50
50
  static BearerAccessToken: string;
51
- static JwtSecret: string;
51
+ /**
52
+ * OAuth client ID for token refresh
53
+ * @static
54
+ * @type {string}
55
+ * @default ""
56
+ */
57
+ static CLIENT_ID: string;
58
+ /**
59
+ * OAuth client secret for token refresh
60
+ * @static
61
+ * @type {string}
62
+ * @default ""
63
+ */
64
+ static CLIENT_SECRET: string;
65
+ /**
66
+ * Application name for OAuth
67
+ * @static
68
+ * @type {string}
69
+ * @default ""
70
+ */
71
+ static APPLICATION_NAME: string;
72
+ /**
73
+ * Token expiration timestamp (Unix timestamp in milliseconds)
74
+ * @static
75
+ * @type {number}
76
+ * @default 0
77
+ */
78
+ static TOKEN_EXPIRY: number;
79
+ /**
80
+ * Buffer time before token expiry to trigger refresh (in milliseconds)
81
+ * Default: 5 minutes (300000 ms)
82
+ * @static
83
+ * @type {number}
84
+ */
85
+ static EXPIRY_BUFFER_MS: number;
86
+ /**
87
+ * Gets authorization header object for HTTP requests.
88
+ * @returns {Record<string, string>} Headers object with Authorization header if token exists
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * const headers = TokenStorage.getAuthHeader();
93
+ * // Returns: { 'Authorization': 'Bearer your-token' } or {}
94
+ * ```
95
+ */
96
+ static getAuthHeader(): Record<string, string>;
97
+ /**
98
+ * Sets the access token and calculates expiry time.
99
+ * @param token - The access token
100
+ * @param expiresIn - Token lifetime in seconds (optional)
101
+ */
102
+ static setToken(token: string, expiresIn?: number): void;
103
+ /**
104
+ * Checks if the token is expired or near expiry.
105
+ * @returns {boolean} True if token is expired or within the buffer window
106
+ */
107
+ static isTokenExpiredOrNearExpiry(): boolean;
108
+ /**
109
+ * Gets the remaining time until token expiry in seconds.
110
+ * @returns {number} Seconds until expiry, or -1 if expired/no expiry set
111
+ */
112
+ static getTimeUntilExpiry(): number;
113
+ /**
114
+ * Checks if OAuth credentials are configured for automatic token refresh.
115
+ * @returns {boolean} True if client ID, secret, and app name are all set
116
+ */
117
+ static hasOAuthCredentials(): boolean;
118
+ /**
119
+ * Sets OAuth credentials for automatic token refresh.
120
+ * @param clientId - OAuth client ID
121
+ * @param clientSecret - OAuth client secret
122
+ * @param applicationName - Application name
123
+ */
124
+ static setOAuthCredentials(clientId: string, clientSecret: string, applicationName: string): void;
52
125
  }
@@ -2,6 +2,7 @@
2
2
  * @module ErrorPosting
3
3
  * @description Provides error handling functions for HTTP and internal errors with structured error responses
4
4
  */
5
+ import { HttpResponse } from "../Http/HttpClient.service";
5
6
  /**
6
7
  * Handles HTTP errors by creating and throwing structured error responses.
7
8
  * Specifically handles 401 Unauthorized errors.
@@ -23,6 +24,7 @@
23
24
  * - Useful for API call error handling
24
25
  */
25
26
  export declare function HandleHttpError(response: Response): void;
27
+ export declare function HandleHttpErrorHttp(response: HttpResponse): void;
26
28
  /**
27
29
  * Handles internal application errors by creating and throwing structured error responses.
28
30
  * Wraps any error object into a FreeSchemaResponse.
@@ -0,0 +1,205 @@
1
+ /**
2
+ * @fileoverview HTTP Client - Handles API requests with automatic token refresh on 401 errors.
3
+ * This module provides a robust HTTP client that automatically refreshes OAuth tokens
4
+ * when receiving 401 Unauthorized responses, ensuring seamless API access.
5
+ * @module Services/Http/HttpClient
6
+ */
7
+ /**
8
+ * Custom error thrown when token refresh fails.
9
+ */
10
+ export declare class TokenRefreshError extends Error {
11
+ constructor(message: string);
12
+ }
13
+ /**
14
+ * Container for HTTP response data.
15
+ * Provides convenient methods to parse response body as JSON or text.
16
+ */
17
+ export declare class HttpResponse {
18
+ status: number;
19
+ body: string;
20
+ headers: Record<string, string>;
21
+ /**
22
+ * Creates a new HttpResponse instance.
23
+ * @param status - HTTP status code
24
+ * @param body - Response body as string
25
+ * @param headers - Response headers
26
+ */
27
+ constructor(status: number, body: string, headers: Record<string, string>);
28
+ /**
29
+ * Parse response body as JSON.
30
+ * @returns {Promise<any>} Parsed JSON object
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const response = await requestWithRetry('GET', url);
35
+ * const data = await response.json();
36
+ * console.log(data.id);
37
+ * ```
38
+ */
39
+ json(): Promise<any>;
40
+ /**
41
+ * Get response body as text.
42
+ * @returns {Promise<string>} Response body as string
43
+ *
44
+ * @example
45
+ * ```typescript
46
+ * const response = await requestWithRetry('GET', url);
47
+ * const text = await response.text();
48
+ * console.log(text);
49
+ * ```
50
+ */
51
+ text(): Promise<string>;
52
+ /**
53
+ * Checks if the response status indicates success (200-299).
54
+ * @returns {boolean} True if status is in the 2xx range
55
+ */
56
+ get ok(): boolean;
57
+ }
58
+ /**
59
+ * Make an HTTP request with automatic retry on 401 Unauthorized.
60
+ *
61
+ * If a 401 error occurs and OAuth credentials are available, this function
62
+ * will automatically refresh the token and retry the request once.
63
+ *
64
+ * @async
65
+ * @param {string} method - HTTP method (GET, POST, PUT, DELETE, etc.)
66
+ * @param {string} url - The URL to request
67
+ * @param {Record<string, string>} [headers] - Optional headers dict
68
+ * @param {any} [body] - Optional request body (JSON will be stringified)
69
+ * @param {number} [maxRetries=1] - Maximum number of retries on 401
70
+ * @returns {Promise<HttpResponse>} HttpResponse object with status, body, and headers
71
+ * @throws {TokenRefreshError} If token refresh fails
72
+ * @throws {Error} For other network errors
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * const headers = { "Content-Type": "application/json" };
77
+ * const response = await requestWithRetry(
78
+ * "POST",
79
+ * url,
80
+ * headers,
81
+ * { id: 123 }
82
+ * );
83
+ * if (response.ok) {
84
+ * const data = await response.json();
85
+ * console.log(data);
86
+ * }
87
+ * ```
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * // Automatic token refresh on 401
92
+ * try {
93
+ * const response = await requestWithRetry("GET", url);
94
+ * // If receives 401, will automatically refresh token and retry
95
+ * } catch (error) {
96
+ * if (error instanceof TokenRefreshError) {
97
+ * console.error('Authentication failed:', error.message);
98
+ * }
99
+ * }
100
+ * ```
101
+ */
102
+ export declare function requestWithRetry(method: string, url: string, headers?: Record<string, string>, body?: any, maxRetries?: number): Promise<HttpResponse>;
103
+ /**
104
+ * Convenience method for POST requests with automatic retry on 401.
105
+ *
106
+ * @async
107
+ * @param {string} url - The URL to request
108
+ * @param {Record<string, string>} [headers] - Optional headers dict
109
+ * @param {any} [body] - Optional request body (will be JSON stringified if object)
110
+ * @returns {Promise<HttpResponse>} HttpResponse object
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * const response = await postWithRetry(
115
+ * "https://api.example.com/concepts",
116
+ * { "Content-Type": "application/json" },
117
+ * { name: "Test", value: 123 }
118
+ * );
119
+ * if (response.ok) {
120
+ * const data = await response.json();
121
+ * console.log('Created:', data);
122
+ * }
123
+ * ```
124
+ */
125
+ export declare function postWithRetry(url: string, headers?: Record<string, string>, body?: any): Promise<HttpResponse>;
126
+ /**
127
+ * Convenience method for GET requests with automatic retry on 401.
128
+ *
129
+ * @async
130
+ * @param {string} url - The URL to request
131
+ * @param {Record<string, string>} [headers] - Optional headers dict
132
+ * @param {Record<string, any>} [params] - Optional query parameters
133
+ * @returns {Promise<HttpResponse>} HttpResponse object
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * const response = await getWithRetry(
138
+ * "https://api.example.com/concepts",
139
+ * undefined,
140
+ * { id: 123, type: "test" }
141
+ * );
142
+ * if (response.ok) {
143
+ * const data = await response.json();
144
+ * console.log(data);
145
+ * }
146
+ * ```
147
+ */
148
+ export declare function getWithRetry(url: string, headers?: Record<string, string>, params?: Record<string, any>): Promise<HttpResponse>;
149
+ /**
150
+ * Convenience method for PUT requests with automatic retry on 401.
151
+ *
152
+ * @async
153
+ * @param {string} url - The URL to request
154
+ * @param {Record<string, string>} [headers] - Optional headers dict
155
+ * @param {any} [body] - Optional request body
156
+ * @returns {Promise<HttpResponse>} HttpResponse object
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * const response = await putWithRetry(
161
+ * "https://api.example.com/concepts/123",
162
+ * { "Content-Type": "application/json" },
163
+ * { name: "Updated Name" }
164
+ * );
165
+ * ```
166
+ */
167
+ export declare function putWithRetry(url: string, headers?: Record<string, string>, body?: any): Promise<HttpResponse>;
168
+ /**
169
+ * Convenience method for DELETE requests with automatic retry on 401.
170
+ *
171
+ * @async
172
+ * @param {string} url - The URL to request
173
+ * @param {Record<string, string>} [headers] - Optional headers dict
174
+ * @returns {Promise<HttpResponse>} HttpResponse object
175
+ *
176
+ * @example
177
+ * ```typescript
178
+ * const response = await deleteWithRetry(
179
+ * "https://api.example.com/concepts/123"
180
+ * );
181
+ * if (response.ok) {
182
+ * console.log('Deleted successfully');
183
+ * }
184
+ * ```
185
+ */
186
+ export declare function deleteWithRetry(url: string, headers?: Record<string, string>): Promise<HttpResponse>;
187
+ /**
188
+ * Convenience method for PATCH requests with automatic retry on 401.
189
+ *
190
+ * @async
191
+ * @param {string} url - The URL to request
192
+ * @param {Record<string, string>} [headers] - Optional headers dict
193
+ * @param {any} [body] - Optional request body
194
+ * @returns {Promise<HttpResponse>} HttpResponse object
195
+ *
196
+ * @example
197
+ * ```typescript
198
+ * const response = await patchWithRetry(
199
+ * "https://api.example.com/concepts/123",
200
+ * { "Content-Type": "application/json" },
201
+ * { status: "active" }
202
+ * );
203
+ * ```
204
+ */
205
+ export declare function patchWithRetry(url: string, headers?: Record<string, string>, body?: any): Promise<HttpResponse>;
@@ -1,10 +1,58 @@
1
- export declare function GetRequestHeader(contentType?: string, Accept?: string): {
2
- 'Content-Type': string;
3
- Authorization: string;
4
- Accept: string;
5
- };
6
- export declare function GetRequestHeaderWithAuthorization(contentType?: string, token?: string, Accept?: string): {
7
- 'Content-Type': string;
8
- Authorization: string;
9
- Accept: string;
10
- };
1
+ /**
2
+ * Gets request headers with automatic token refresh if expired or near expiry.
3
+ * This is the async version that checks token expiry and refreshes if needed.
4
+ *
5
+ * @async
6
+ * @param {string} [contentType='application/json'] - Content-Type header value
7
+ * @param {string} [Accept='application/json'] - Accept header value
8
+ * @returns {Promise<Record<string, string>>} Headers object with refreshed token if needed
9
+ *
10
+ * @example
11
+ * ```typescript
12
+ * // Automatically refreshes token if expired/near expiry
13
+ * const headers = await GetRequestHeaderWithRefresh();
14
+ * const response = await fetch(url, { headers });
15
+ * ```
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * // With custom content type
20
+ * const headers = await GetRequestHeaderWithRefresh('application/x-www-form-urlencoded');
21
+ * ```
22
+ */
23
+ export declare function GetRequestHeader(contentType?: string, Accept?: string): Promise<Record<string, string>>;
24
+ /**
25
+ * Gets request headers with automatic token refresh and custom token override.
26
+ * This is the async version that checks token expiry and refreshes if needed.
27
+ *
28
+ * @async
29
+ * @param {string} [contentType='application/json'] - Content-Type header value
30
+ * @param {string} [token=''] - Optional token override. If empty, uses TokenStorage token
31
+ * @param {string} [Accept='application/json'] - Accept header value
32
+ * @returns {Promise<Record<string, string>>} Headers object with refreshed token if needed
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * // Use stored token with automatic refresh
37
+ * const headers = await GetRequestHeaderWithAuthorizationAndRefresh();
38
+ * ```
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * // Use custom token (no refresh)
43
+ * const headers = await GetRequestHeaderWithAuthorizationAndRefresh(
44
+ * 'application/json',
45
+ * 'custom-token-here'
46
+ * );
47
+ * ```
48
+ *
49
+ * @example
50
+ * ```typescript
51
+ * // Check token expiry status
52
+ * const timeRemaining = TokenStorage.getTimeUntilExpiry();
53
+ * console.log(`Token expires in ${timeRemaining} seconds`);
54
+ *
55
+ * const headers = await GetRequestHeaderWithAuthorizationAndRefresh();
56
+ * ```
57
+ */
58
+ export declare function GetRequestHeaderWithAuthorization(contentType?: string, token?: string, Accept?: string): Promise<Record<string, string>>;
@@ -1 +0,0 @@
1
- export declare const getServerJwtToken: () => string;
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @fileoverview OAuth API - Handles OAuth token requests for authentication.
3
+ * This module provides functions for obtaining and refreshing OAuth access tokens
4
+ * from the authentication server.
5
+ * @module Services/oauth/CallOauth
6
+ */
7
+ /**
8
+ * Response from OAuth token request.
9
+ * Contains either successful token data or error information.
10
+ *
11
+ * @interface OAuthResponse
12
+ */
13
+ export interface OAuthResponse {
14
+ /** Whether the OAuth request was successful */
15
+ success: boolean;
16
+ /** The OAuth access token (empty if request failed) */
17
+ access_token?: string;
18
+ /** The token type (typically "Bearer") */
19
+ token_type?: string;
20
+ /** Number of seconds until the token expires */
21
+ expires_in?: number;
22
+ /** Error message if the request failed */
23
+ error?: string;
24
+ }
25
+ /**
26
+ * Request an OAuth access token from the server.
27
+ *
28
+ * This function authenticates with the OAuth endpoint using client credentials
29
+ * and returns an access token that can be used for API requests.
30
+ *
31
+ * @async
32
+ * @param {string} client_id - The OAuth client ID.
33
+ * @param {string} client_secret - The OAuth client secret.
34
+ * @param {string} application_name - The name of the application requesting the token.
35
+ * @param {boolean} [auto_set_token=true] - If true, automatically sets the token in TokenStorage
36
+ * for subsequent API calls.
37
+ * @returns {Promise<OAuthResponse>} OAuthResponse with the access token if successful,
38
+ * or error details if failed.
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * import { getOAuthToken } from './Services/oauth/CallOauth.service';
43
+ *
44
+ * const response = await getOAuthToken(
45
+ * "101084838",
46
+ * "your-client-secret",
47
+ * "myapp"
48
+ * );
49
+ * if (response.success) {
50
+ * console.log(`Token: ${response.access_token}`);
51
+ * } else {
52
+ * console.log(`Error: ${response.error}`);
53
+ * }
54
+ * ```
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * // Get token without auto-setting
59
+ * const response = await getOAuthToken(
60
+ * "101084838",
61
+ * "secret",
62
+ * "myapp",
63
+ * false
64
+ * );
65
+ * // Manually set token later
66
+ * if (response.success) {
67
+ * TokenStorage.BearerAccessToken = response.access_token || "";
68
+ * }
69
+ * ```
70
+ */
71
+ export declare function getOAuthToken(client_id: string, client_secret: string, application_name: string, auto_set_token?: boolean): Promise<OAuthResponse>;
72
+ /**
73
+ * Refresh an OAuth access token using a refresh token.
74
+ *
75
+ * This function uses a refresh token from a previous authentication to obtain
76
+ * a new access token without requiring the user to re-authenticate.
77
+ *
78
+ * @async
79
+ * @param {string} client_id - The OAuth client ID.
80
+ * @param {string} client_secret - The OAuth client secret.
81
+ * @param {string} refresh_token - The refresh token from a previous authentication.
82
+ * @param {boolean} [auto_set_token=true] - If true, automatically sets the new token in TokenStorage.
83
+ * @returns {Promise<OAuthResponse>} OAuthResponse with the new access token if successful.
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * import { refreshOAuthToken } from './Services/oauth/CallOauth.service';
88
+ *
89
+ * const response = await refreshOAuthToken(
90
+ * "101084838",
91
+ * "your-client-secret",
92
+ * "your-refresh-token"
93
+ * );
94
+ * if (response.success) {
95
+ * console.log(`New Token: ${response.access_token}`);
96
+ * } else {
97
+ * console.log(`Error: ${response.error}`);
98
+ * }
99
+ * ```
100
+ */
101
+ export declare function refreshOAuthToken(client_id: string, client_secret: string, refresh_token: string, auto_set_token?: boolean): Promise<OAuthResponse>;