@putkoff/abstract-utilities 1.0.50 → 1.0.63
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/cjs/index.js +504 -477
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +479 -454
- package/dist/esm/index.js.map +1 -1
- package/dist/index.d.ts +78 -93
- package/dist/types/client/auth/index.d.ts +1 -0
- package/dist/types/client/auth/src/index.d.ts +1 -0
- package/dist/types/client/auth/src/token_client.d.ts +15 -0
- package/dist/types/client/fetch/src/fetch_auth.d.ts +3 -0
- package/dist/types/client/fetch/src/index.d.ts +1 -0
- package/dist/types/client/index.d.ts +2 -0
- package/dist/types/client/ui_utils/index.d.ts +1 -0
- package/dist/types/client/ui_utils/src/button.d.ts +6 -0
- package/dist/types/client/ui_utils/src/checkbox.d.ts +4 -0
- package/dist/types/client/ui_utils/src/index.d.ts +4 -0
- package/dist/types/client/ui_utils/src/input.d.ts +5 -0
- package/dist/types/client/ui_utils/src/spinner.d.ts +1 -0
- package/dist/types/functions/auth_utils/imports.d.ts +0 -0
- package/dist/types/functions/auth_utils/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/index.d.ts +1 -1
- package/dist/types/functions/auth_utils/src/jwt_core.d.ts +7 -0
- package/dist/types/functions/auth_utils/src/token_utils (Copy).d.ts +7 -0
- package/dist/types/functions/auth_utils/src/token_utils.d.ts +0 -0
- package/dist/types/functions/config_utils/imports.d.ts +0 -0
- package/dist/types/functions/config_utils/index.d.ts +0 -0
- package/dist/types/functions/config_utils/src/config_utils.d.ts +0 -0
- package/dist/types/functions/config_utils/src/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/constants.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/imports.d.ts +0 -0
- package/dist/types/functions/env_utils/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/window_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/imports.d.ts +0 -1
- package/dist/types/functions/fetch_utils/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/fetch_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/url_utils.d.ts +1 -0
- package/dist/types/functions/fetch_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/index.d.ts +0 -2
- package/dist/types/functions/math_utils/constants.d.ts +0 -0
- package/dist/types/functions/math_utils/conversions.d.ts +0 -0
- package/dist/types/functions/math_utils/index.d.ts +0 -0
- package/dist/types/functions/math_utils/safe_math.d.ts +0 -0
- package/dist/types/functions/math_utils/scaleInterfaces.d.ts +0 -0
- package/dist/types/functions/path_utils/imports.d.ts +0 -0
- package/dist/types/functions/path_utils/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/base_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/function_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/misc_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/path_utils.d.ts +42 -6
- package/dist/types/functions/path_utils/src/paths.d.ts +0 -0
- package/dist/types/functions/path_utils/src/src_dirs.d.ts +0 -0
- package/dist/types/functions/read_utils/imports.d.ts +0 -0
- package/dist/types/functions/read_utils/index.d.ts +0 -0
- package/dist/types/functions/read_utils/src/index.d.ts +0 -0
- package/dist/types/functions/read_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/rndm_utils/imports.d.ts +0 -0
- package/dist/types/functions/rndm_utils/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/safe_utils/imports.d.ts +0 -0
- package/dist/types/functions/safe_utils/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_document.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_globals.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_storage.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_window.d.ts +0 -0
- package/dist/types/functions/string_utils/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/string_utils.d.ts +12 -28
- package/dist/types/functions/type_utils/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/clean_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/ensure_utils.d.ts +22 -14
- package/dist/types/functions/type_utils/src/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/src/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/json_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/list_utils.d.ts +4 -0
- package/dist/types/functions/type_utils/src/mime_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/type_utils.d.ts +0 -0
- package/dist/types/functions/ui_utils/imports.d.ts +0 -0
- package/dist/types/functions/ui_utils/index.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/button.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/checkbox.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/index.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/input.d.ts +0 -0
- package/dist/types/functions/ui_utils/src/spinner.d.ts +0 -0
- package/dist/types/functions/variable_utils/imports.d.ts +0 -0
- package/dist/types/functions/variable_utils/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/variable_utils.d.ts +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/types/index.d.ts +0 -0
- package/dist/types/types/src/ChangePassword.d.ts +0 -0
- package/dist/types/types/src/Files.d.ts +0 -0
- package/dist/types/types/src/index.d.ts +0 -0
- package/dist/types/types/src/login.d.ts +0 -0
- package/dist/types/types/src/logout.d.ts +0 -0
- package/dist/types/types/src/utils.d.ts +0 -0
- package/dist/types/ui/Navbar/DropDowns/DropDownElements.d.ts +8 -0
- package/dist/types/ui/Navbar/DropDowns/ForumsDropdown.d.ts +2 -0
- package/dist/types/ui/Navbar/DropDowns/index.d.ts +3 -0
- package/dist/types/ui/Navbar/NavBar.d.ts +8 -0
- package/dist/types/ui/Navbar/index.d.ts +3 -0
- package/dist/types/ui/index.d.ts +1 -0
- package/dist/types/utils/imports.d.ts +0 -0
- package/dist/types/utils/index.d.ts +0 -0
- package/dist/types/utils/src/Input.d.ts +0 -0
- package/dist/types/utils/src/config.d.ts +0 -0
- package/dist/types/utils/src/index.d.ts +0 -0
- package/package.json +11 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import React$1 from 'react';
|
|
2
|
-
export { useCallback, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
|
|
5
1
|
interface FileItem {
|
|
6
2
|
id: number | string;
|
|
7
3
|
filename: string;
|
|
@@ -154,31 +150,8 @@ declare function getWindowHost(): string | undefined;
|
|
|
154
150
|
* Helpers for dealing with the JWT stored in localStorage.
|
|
155
151
|
*/
|
|
156
152
|
|
|
157
|
-
/**
|
|
158
|
-
***Changes**:
|
|
159
|
-
*- Updated import path for `InputProps` to `../../types/interfaces`.
|
|
160
|
-
*
|
|
161
|
-
*3. **Token Utilities** (`src/functions/auth/token_utils.ts`):
|
|
162
|
-
* Copy from `/var/www/abstractendeavors/my-login-app/src/functions/auth_utils/token_utils.ts`.
|
|
163
|
-
*
|
|
164
|
-
*/
|
|
165
|
-
/** Read raw JWT from LocalStorage (or null if absent) */
|
|
166
|
-
declare function getToken(): string | null | any;
|
|
167
|
-
declare function isLoggedIn(): boolean;
|
|
168
|
-
/**
|
|
169
|
-
* Add a Bearer Authorization header.
|
|
170
|
-
* A shallow copy of headers is returned so callers can keep chaining.
|
|
171
|
-
*/
|
|
172
|
-
declare function getAuthorizationHeader(headers?: Record<string, string> | null, token?: string | null): Record<string, string>;
|
|
173
|
-
/** Throw + redirect if there’s no valid token; otherwise return it. */
|
|
174
|
-
declare function requireToken(): string;
|
|
175
153
|
/** True if token is structurally bad or its exp ≤ now. */
|
|
176
154
|
declare function isTokenExpired(token: string): boolean;
|
|
177
|
-
/** Convenience wrapper: return username from the JWT (or null). */
|
|
178
|
-
declare function currentUsername(): string | null;
|
|
179
|
-
declare function currentUsernames(): any;
|
|
180
|
-
/** Remove the JWT from LocalStorage */
|
|
181
|
-
declare function removeToken(): void;
|
|
182
155
|
declare function decodeJwt(token: string): JwtPayload;
|
|
183
156
|
|
|
184
157
|
declare const PROTOCOL = "https://";
|
|
@@ -247,10 +220,11 @@ declare function path_to_url(filePath: string, all_paths: any): string | null;
|
|
|
247
220
|
* It checks against the known URL prefixes in all_paths and replaces the matching base.
|
|
248
221
|
*/
|
|
249
222
|
declare function url_to_path(urlStr: string, all_paths: any): string | null;
|
|
223
|
+
declare function urljoin(...parts: (string | undefined | null)[]): string;
|
|
250
224
|
|
|
251
225
|
declare function get_dirname(filePath: string | null): string;
|
|
252
226
|
declare function get_basename(filePath: string | null): string;
|
|
253
|
-
declare function get_filename(
|
|
227
|
+
declare function get_filename(filePath: string): string;
|
|
254
228
|
declare function get_extname(filePath: string | null): string;
|
|
255
229
|
declare function get_splitext(filePath: string | null): {
|
|
256
230
|
filename: string;
|
|
@@ -271,16 +245,52 @@ declare function get_splitext(filePath: string | null): {
|
|
|
271
245
|
*/
|
|
272
246
|
declare function get_relative_path(basePath: string, targetPath: string): string;
|
|
273
247
|
/**
|
|
274
|
-
* Join multiple path segments,
|
|
248
|
+
* Join multiple path segments — clean, predictable, bulletproof.
|
|
249
|
+
*
|
|
250
|
+
* Accepts ANYTHING that ensure_list can handle:
|
|
251
|
+
* • 'a,b,c'
|
|
252
|
+
* • ['a', 'b,c']
|
|
253
|
+
* • 'a/b/c'
|
|
254
|
+
* • '/a/', 'b//c'
|
|
255
|
+
* • mixed arrays, comma strings, whatever
|
|
275
256
|
*
|
|
276
|
-
*
|
|
277
|
-
* make_path('/foo','bar','baz')
|
|
278
|
-
* make_path(['/foo','bar','baz'])
|
|
257
|
+
* Always returns a clean POSIX path string. Never a list.
|
|
279
258
|
*/
|
|
280
|
-
declare function make_path(...
|
|
259
|
+
declare function make_path(...parts: any[]): string;
|
|
281
260
|
declare function sanitizeFilename(filename: string): string;
|
|
282
261
|
declare function make_sanitized_path(...paths: string[]): string;
|
|
283
262
|
declare function normalizeUrl(base: string, p?: string): string;
|
|
263
|
+
declare function pathjoin(...parts: any[]): string;
|
|
264
|
+
declare function pathJoin(...parts: any[]): string;
|
|
265
|
+
declare function makepath(...parts: any[]): string;
|
|
266
|
+
declare function makePath(...parts: any[]): string;
|
|
267
|
+
declare function path_join(...parts: any[]): string;
|
|
268
|
+
declare function getSplitext(filePath: string | null): {
|
|
269
|
+
filename: string;
|
|
270
|
+
extname: string;
|
|
271
|
+
ext?: undefined;
|
|
272
|
+
} | {
|
|
273
|
+
filename: string;
|
|
274
|
+
ext: string;
|
|
275
|
+
extname?: undefined;
|
|
276
|
+
};
|
|
277
|
+
declare function getsplitext(filePath: string | null): {
|
|
278
|
+
filename: string;
|
|
279
|
+
extname: string;
|
|
280
|
+
ext?: undefined;
|
|
281
|
+
} | {
|
|
282
|
+
filename: string;
|
|
283
|
+
ext: string;
|
|
284
|
+
extname?: undefined;
|
|
285
|
+
};
|
|
286
|
+
declare function getextname(filePath: string | null): string;
|
|
287
|
+
declare function getExtname(filePath: string | null): string;
|
|
288
|
+
declare function getfilename(filePath: string): string;
|
|
289
|
+
declare function getFilename(filePath: string): string;
|
|
290
|
+
declare function getbasename(filePath: string | null): string;
|
|
291
|
+
declare function getBasename(filePath: string | null): string;
|
|
292
|
+
declare function getdirname(filePath: string | null): string;
|
|
293
|
+
declare function getDirname(filePath: string | null): string;
|
|
284
294
|
|
|
285
295
|
/**
|
|
286
296
|
* Returns the absolute path of the current file.
|
|
@@ -323,36 +333,20 @@ declare function truncateString(obj: string, maxLength?: number): string;
|
|
|
323
333
|
declare function capitalize_str(string: any): string;
|
|
324
334
|
declare function capitalize(string: any): string;
|
|
325
335
|
declare function stripPrefixes(str: string, bases?: string | string[]): string;
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
*/
|
|
334
|
-
declare function
|
|
335
|
-
/**
|
|
336
|
-
* Removes characters from the end of the string
|
|
337
|
-
* if they are found in the list of characters.
|
|
338
|
-
*
|
|
339
|
-
* @param str - The input string.
|
|
340
|
-
* @param listObjects - A string or an array of characters to remove.
|
|
341
|
-
* @returns The modified string.
|
|
342
|
-
*/
|
|
343
|
-
declare function eatOuter(str: string, listObjects: string | string[]): string;
|
|
344
|
-
/**
|
|
345
|
-
* Removes characters from both the beginning and the end of the string
|
|
346
|
-
* if they are found in the list of characters.
|
|
347
|
-
*
|
|
348
|
-
* @param str - The input string.
|
|
349
|
-
* @param listObjects - A string or an array of characters to remove.
|
|
350
|
-
* @returns The modified string.
|
|
351
|
-
*/
|
|
352
|
-
declare function eatAll(str: string, listObjects: string | string[]): string;
|
|
353
|
-
declare function eatEnd(obj: string, endings?: string[]): string;
|
|
336
|
+
declare function tryEatPrefix(str: string, length: number, ...objs: any[]): [string, boolean];
|
|
337
|
+
/** Python-equivalent eatInner */
|
|
338
|
+
declare function eatInner(str: any, listObjects: any): string;
|
|
339
|
+
/** Python-equivalent eatOuter */
|
|
340
|
+
declare function eatOuter(str: any, listObjects: any): string;
|
|
341
|
+
/** Python-equivalent eatAll */
|
|
342
|
+
declare function eatAll(str: any, listObjects: any): string;
|
|
343
|
+
/** Python-equivalent eatElse */
|
|
344
|
+
declare function eatElse(stringObj: any, chars?: any, ints?: boolean, alpha?: boolean, lower?: boolean, capitalize?: boolean, string?: boolean, listObj?: boolean): string;
|
|
354
345
|
declare function tryParse(obj: any): any;
|
|
355
346
|
declare function create_list_string(array_obj: any): string;
|
|
347
|
+
declare function eatall(str: any, listObjects: any): string;
|
|
348
|
+
declare function eatinner(str: any, listObjects: any): string;
|
|
349
|
+
declare function eatouter(str: any, listObjects: any): string;
|
|
356
350
|
|
|
357
351
|
declare function safeNums(...args: Array<number | string | null | undefined>): number[];
|
|
358
352
|
declare function safeDivide(...args: Array<number | string | null | undefined>): number;
|
|
@@ -551,22 +545,30 @@ declare function cleanArray(obj: any): unknown[];
|
|
|
551
545
|
declare function getCleanArray(obj: any): unknown[];
|
|
552
546
|
declare function formatNumber<T>(value: T): string | T;
|
|
553
547
|
|
|
554
|
-
declare function ensure_list
|
|
548
|
+
declare function ensure_list(obj: any): any[];
|
|
555
549
|
declare function ensure_number(x: any): number;
|
|
556
|
-
declare function ensure_array(input: string | string[]): any;
|
|
557
550
|
declare function ensure_string(obj: any): string;
|
|
558
|
-
declare
|
|
559
|
-
declare
|
|
560
|
-
declare
|
|
561
|
-
declare
|
|
562
|
-
declare
|
|
563
|
-
declare
|
|
564
|
-
declare
|
|
565
|
-
declare
|
|
566
|
-
declare
|
|
567
|
-
declare
|
|
568
|
-
declare
|
|
569
|
-
declare
|
|
551
|
+
declare function ensurelist(obj: any): any[];
|
|
552
|
+
declare function assureList(obj: any): any[];
|
|
553
|
+
declare function assure_list(obj: any): any[];
|
|
554
|
+
declare function ensureList(obj: any): any[];
|
|
555
|
+
declare function assurelist(obj: any): any[];
|
|
556
|
+
declare function ensurenumber(x: any): number;
|
|
557
|
+
declare function assureNumber(x: any): number;
|
|
558
|
+
declare function ensureNumber(x: any): number;
|
|
559
|
+
declare function assurenumber(x: any): number;
|
|
560
|
+
declare function assure_number(x: any): number;
|
|
561
|
+
declare function ensurestring(obj: any): string;
|
|
562
|
+
declare function ensureString(obj: any): string;
|
|
563
|
+
declare function assureString(obj: any): string;
|
|
564
|
+
declare function assurestring(obj: any): string;
|
|
565
|
+
declare function assure_string(obj: any): string;
|
|
566
|
+
declare function assurearray(obj: any): any[];
|
|
567
|
+
declare function ensurearray(obj: any): any[];
|
|
568
|
+
declare function ensure_array(obj: any): any[];
|
|
569
|
+
declare function ensureArray(obj: any): any[];
|
|
570
|
+
declare function assure_array(obj: any): any[];
|
|
571
|
+
declare function assureArray(obj: any): any[];
|
|
570
572
|
|
|
571
573
|
declare function get_key_value<T extends object>(obj: T, key: string): any;
|
|
572
574
|
declare function get<T extends object>(obj: T | null | undefined, keys: string | string[], defaultValue?: any): any;
|
|
@@ -752,23 +754,6 @@ declare const confirm_type: typeof confirmType;
|
|
|
752
754
|
declare const is_media_type: typeof isMediaType;
|
|
753
755
|
declare const get_mime_type: typeof getMimeType;
|
|
754
756
|
|
|
755
|
-
declare function Button({ children, color, variant, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
756
|
-
color?: 'gray' | 'green' | 'blue';
|
|
757
|
-
variant?: 'default' | 'icon' | 'primary' | 'secondary';
|
|
758
|
-
className?: string;
|
|
759
|
-
}): react_jsx_runtime.JSX.Element;
|
|
760
|
-
|
|
761
|
-
declare function Checkbox({ label, ...rest }: React$1.InputHTMLAttributes<HTMLInputElement> & {
|
|
762
|
-
label: string;
|
|
763
|
-
}): react_jsx_runtime.JSX.Element;
|
|
764
|
-
|
|
765
|
-
declare function Input({ label, trailing, ...rest }: React$1.InputHTMLAttributes<HTMLInputElement> & {
|
|
766
|
-
label: string;
|
|
767
|
-
trailing?: React$1.ReactNode;
|
|
768
|
-
}): react_jsx_runtime.JSX.Element;
|
|
769
|
-
|
|
770
|
-
declare function Spinner(): react_jsx_runtime.JSX.Element;
|
|
771
|
-
|
|
772
757
|
declare function loadConfig(filePath?: string | null): Promise<AppConfig>;
|
|
773
758
|
/**
|
|
774
759
|
* getConfig(): Promise<AppConfig>
|
|
@@ -793,5 +778,5 @@ declare function processKeywords(keywords: string | string[]): string[];
|
|
|
793
778
|
*/
|
|
794
779
|
declare function get_keyword_string(keywords: any): string;
|
|
795
780
|
|
|
796
|
-
export { API_PREFIX, ATTOSECOND, BASE_URL,
|
|
781
|
+
export { API_PREFIX, ATTOSECOND, BASE_URL, CENTISECOND, DAY, DAY_IN_S, DECISECOND, DEV_PREFIX, DIST_ALIASES, DIST_FACTORS, DOMAIN_NAME, DistanceConverter, FEET_PER_METER, FEMTOSECOND, HOUR, HOUR_IN_S, KMS_PER_METER, MEDIA_TYPES, METERS_PER_FOOT, METERS_PER_KM, METERS_PER_MILE, MICROSECOND, MILES_PER_METER, MILISECOND, MIME_TYPES, MINUTE, MIN_IN_S, MONTH, MONTH_IN_S, MPerS_TO_MiPerH, MiPerH_TO_MPerS, NANOSECOND, PI, PI2, PICOSECOND, PROD_PREFIX, PROTOCOL, SECOND, SECONDS_PER_DAY, SECONDS_PER_HOUR, SECONDS_PER_MINUTE, SUB_DIR, SpeedConverter, TIME_ALIASES, TIME_FACTORS, TimeConverter, YEAR, YEAR_IN_S, ZEPTOSECOND, alertit, assureArray, assureList, assureNumber, assureString, assure_array, assure_list, assure_number, assure_string, assurearray, assurelist, assurenumber, assurestring, callStorage, callWindowMethod, canonDist, canonTime, capitalize, capitalize_str, checkResponse, cleanArray, cleanText, confirmType, confirm_type, convertDistance, convertSpeed, convertTime, create_list_string, decodeJwt, distanceToMeters, eatAll, eatElse, eatInner, eatOuter, eatall, eatinner, eatouter, ensureArray, ensureList, ensureNumber, ensureString, ensure_array, ensure_list, ensure_number, ensure_string, ensurearray, ensurelist, ensurenumber, ensurestring, exponential, fetchIndexHtml, fetchIndexHtmlContainer, fetchIt, fmt, formatNumber, fromMeters, fromMps, fromSeconds, geAuthsUtilsDirectory, geBackupsUtilsDirectory, geConstantsUtilsDirectory, geEnvUtilsDirectory, geFetchUtilsDirectory, geFileUtilsDirectory, gePathUtilsDirectory, geStaticDirectory, geStringUtilsDirectory, geTypeUtilsDirectory, get, getAbsDir, getAbsPath, getAllFileTypes, getAllFileTypesSync, getAlphaNum, getAlphas, getBaseDir, getBasename, getBody, getChar, getCleanArray, getComponentsUtilsDirectory, getConfig, getConfigContent, getConfigVar, getDbConfigsPath, getDirname, getDistDir, getDocumentProp, getEnvDir, getEnvPath, getExtname, getFetchVars, getFilename, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getLibUtilsDirectory, getMediaExts, getMediaMap, getMethod, getMimeType, getNums, getPublicDir, getResult, getSafeDocument, getSafeLocalStorage, getSafeWindow, getSchemasDirPath, getSchemasPath, getSplitext, getSrcDir, getSubstring, getWindowHost, getWindowProp, get_all_file_types, get_basename, get_dirname, get_extname, get_filename, get_full_path, get_full_url, get_key_value, get_keyword_string, get_media_exts, get_media_map, get_mime_type, get_relative_path, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, getbasename, getdirname, getextname, getfilename, getsplitext, isFiniteNum, isMediaType, isNum, isStrInString, isTokenExpired, isType, is_media_type, loadConfig, makePath, make_path, make_sanitized_path, makepath, metersToDistance, mpsToSpeed, normalizeUrl, parseResult, pathJoin, path_join, path_to_url, pathjoin, processKeywords, readJsonFile, roundPercentage, safeDivide, safeGlobalProp, safeMultiply, safeNums, safeStorage, sanitizeFilename, secondsToTime, speedToMps, stripPrefixes, timeToSeconds, toMeters, toSeconds, truncateString, tryEatPrefix, tryParse, urlJoin, url_to_path, urljoin, velocityFromMs, velocityToMs };
|
|
797
782
|
export type { ApiRow, AppConfig, CanonDist, CanonTime, ChangePasswordFormProps, ChangePasswordProps, ConvertDistance, ConvertSpeed, ConvertTime, Day, DistanceUnit, FetchVariables, FileItem, FileListResponse, Foot, Hour, InputProps, JwtPayload, Kilometer, LoginFormProps, LoginProps, LogoutButtonProps, MediaCategory, MediaMap, MediaOptions, Meter, Mile, MimeByExt, Minute, OutDist, OutDistance, OutSpeed, OutSpeedType, OutSpeeds, OutTime, OutTimeType, OutTimes, Promise$1 as Promise, Second, StartVelIn, TargetAltIn, TargetVelIn, TimeUnit, UnitConverter, UrlKey, VelocityUnit };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './token_client';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Read raw JWT from LocalStorage (or null if absent) */
|
|
2
|
+
export declare function getToken(): string | null | any;
|
|
3
|
+
export declare function isLoggedIn(): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Add a Bearer Authorization header.
|
|
6
|
+
* A shallow copy of headers is returned so callers can keep chaining.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getAuthorizationHeader(headers?: Record<string, string> | null, token?: string | null): Record<string, string>;
|
|
9
|
+
/** Throw + redirect if there’s no valid token; otherwise return it. */
|
|
10
|
+
export declare function requireToken(): string;
|
|
11
|
+
/** Convenience wrapper: return username from the JWT (or null). */
|
|
12
|
+
export declare function currentUsername(): string | null;
|
|
13
|
+
export declare function currentUsernames(): any;
|
|
14
|
+
/** Remove the JWT from LocalStorage */
|
|
15
|
+
export declare function removeToken(): void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { fetchIt as fetchCore } from './../../../functions';
|
|
2
|
+
export declare function fetchIt<T = any>(endpoint: string, options?: Parameters<typeof fetchCore>[1]): Promise<T>;
|
|
3
|
+
export declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fetch_auth';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function Button({ children, color, variant, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
3
|
+
color?: 'gray' | 'green' | 'blue';
|
|
4
|
+
variant?: 'default' | 'icon' | 'primary' | 'secondary';
|
|
5
|
+
className?: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Spinner(): import("react/jsx-runtime").JSX.Element;
|
|
File without changes
|
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./jwt_core";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for dealing with the JWT stored in localStorage.
|
|
3
|
+
*/
|
|
4
|
+
import type { JwtPayload } from './../imports';
|
|
5
|
+
/** True if token is structurally bad or its exp ≤ now. */
|
|
6
|
+
export declare function isTokenExpired(token: string): boolean;
|
|
7
|
+
export declare function decodeJwt(token: string): JwtPayload;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for dealing with the JWT stored in localStorage.
|
|
3
|
+
*/
|
|
4
|
+
import type { JwtPayload } from './../imports';
|
|
5
|
+
/** True if token is structurally bad or its exp ≤ now. */
|
|
6
|
+
export declare function isTokenExpired(token: string): boolean;
|
|
7
|
+
export declare function decodeJwt(token: string): JwtPayload;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -21,3 +21,4 @@ export declare function path_to_url(filePath: string, all_paths: any): string |
|
|
|
21
21
|
* It checks against the known URL prefixes in all_paths and replaces the matching base.
|
|
22
22
|
*/
|
|
23
23
|
export declare function url_to_path(urlStr: string, all_paths: any): string | null;
|
|
24
|
+
export declare function urljoin(...parts: (string | undefined | null)[]): string;
|
|
File without changes
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export { useCallback, useRef, useState, useEffect } from "react";
|
|
2
1
|
export * from './auth_utils';
|
|
3
2
|
export * from './constants_utils';
|
|
4
3
|
export * from './env_utils';
|
|
@@ -8,7 +7,6 @@ export * from './rndm_utils';
|
|
|
8
7
|
export * from './string_utils';
|
|
9
8
|
export * from './math_utils';
|
|
10
9
|
export * from './type_utils';
|
|
11
|
-
export * from './ui_utils';
|
|
12
10
|
export * from './config_utils';
|
|
13
11
|
export * from './read_utils';
|
|
14
12
|
export * from './safe_utils';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare function get_dirname(filePath: string | null): string;
|
|
2
2
|
export declare function get_basename(filePath: string | null): string;
|
|
3
|
-
export declare function get_filename(
|
|
3
|
+
export declare function get_filename(filePath: string): string;
|
|
4
4
|
export declare function get_extname(filePath: string | null): string;
|
|
5
5
|
export declare function get_splitext(filePath: string | null): {
|
|
6
6
|
filename: string;
|
|
@@ -21,13 +21,49 @@ export declare function get_splitext(filePath: string | null): {
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function get_relative_path(basePath: string, targetPath: string): string;
|
|
23
23
|
/**
|
|
24
|
-
* Join multiple path segments,
|
|
24
|
+
* Join multiple path segments — clean, predictable, bulletproof.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* Accepts ANYTHING that ensure_list can handle:
|
|
27
|
+
* • 'a,b,c'
|
|
28
|
+
* • ['a', 'b,c']
|
|
29
|
+
* • 'a/b/c'
|
|
30
|
+
* • '/a/', 'b//c'
|
|
31
|
+
* • mixed arrays, comma strings, whatever
|
|
32
|
+
*
|
|
33
|
+
* Always returns a clean POSIX path string. Never a list.
|
|
29
34
|
*/
|
|
30
|
-
export declare function make_path(...
|
|
35
|
+
export declare function make_path(...parts: any[]): string;
|
|
31
36
|
export declare function sanitizeFilename(filename: string): string;
|
|
32
37
|
export declare function make_sanitized_path(...paths: string[]): string;
|
|
33
38
|
export declare function normalizeUrl(base: string, p?: string): string;
|
|
39
|
+
export declare function pathjoin(...parts: any[]): string;
|
|
40
|
+
export declare function pathJoin(...parts: any[]): string;
|
|
41
|
+
export declare function makepath(...parts: any[]): string;
|
|
42
|
+
export declare function makePath(...parts: any[]): string;
|
|
43
|
+
export declare function path_join(...parts: any[]): string;
|
|
44
|
+
export declare function getSplitext(filePath: string | null): {
|
|
45
|
+
filename: string;
|
|
46
|
+
extname: string;
|
|
47
|
+
ext?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
filename: string;
|
|
50
|
+
ext: string;
|
|
51
|
+
extname?: undefined;
|
|
52
|
+
};
|
|
53
|
+
export declare function getsplitext(filePath: string | null): {
|
|
54
|
+
filename: string;
|
|
55
|
+
extname: string;
|
|
56
|
+
ext?: undefined;
|
|
57
|
+
} | {
|
|
58
|
+
filename: string;
|
|
59
|
+
ext: string;
|
|
60
|
+
extname?: undefined;
|
|
61
|
+
};
|
|
62
|
+
export declare function getextname(filePath: string | null): string;
|
|
63
|
+
export declare function getExtname(filePath: string | null): string;
|
|
64
|
+
export declare function getfilename(filePath: string): string;
|
|
65
|
+
export declare function getFilename(filePath: string): string;
|
|
66
|
+
export declare function getbasename(filePath: string | null): string;
|
|
67
|
+
export declare function getBasename(filePath: string | null): string;
|
|
68
|
+
export declare function getdirname(filePath: string | null): string;
|
|
69
|
+
export declare function getDirname(filePath: string | null): string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -3,33 +3,17 @@ export declare function truncateString(obj: string, maxLength?: number): string;
|
|
|
3
3
|
export declare function capitalize_str(string: any): string;
|
|
4
4
|
export declare function capitalize(string: any): string;
|
|
5
5
|
export declare function stripPrefixes(str: string, bases?: string | string[]): string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
*/
|
|
14
|
-
export declare function
|
|
15
|
-
/**
|
|
16
|
-
* Removes characters from the end of the string
|
|
17
|
-
* if they are found in the list of characters.
|
|
18
|
-
*
|
|
19
|
-
* @param str - The input string.
|
|
20
|
-
* @param listObjects - A string or an array of characters to remove.
|
|
21
|
-
* @returns The modified string.
|
|
22
|
-
*/
|
|
23
|
-
export declare function eatOuter(str: string, listObjects: string | string[]): string;
|
|
24
|
-
/**
|
|
25
|
-
* Removes characters from both the beginning and the end of the string
|
|
26
|
-
* if they are found in the list of characters.
|
|
27
|
-
*
|
|
28
|
-
* @param str - The input string.
|
|
29
|
-
* @param listObjects - A string or an array of characters to remove.
|
|
30
|
-
* @returns The modified string.
|
|
31
|
-
*/
|
|
32
|
-
export declare function eatAll(str: string, listObjects: string | string[]): string;
|
|
33
|
-
export declare function eatEnd(obj: string, endings?: string[]): string;
|
|
6
|
+
export declare function tryEatPrefix(str: string, length: number, ...objs: any[]): [string, boolean];
|
|
7
|
+
/** Python-equivalent eatInner */
|
|
8
|
+
export declare function eatInner(str: any, listObjects: any): string;
|
|
9
|
+
/** Python-equivalent eatOuter */
|
|
10
|
+
export declare function eatOuter(str: any, listObjects: any): string;
|
|
11
|
+
/** Python-equivalent eatAll */
|
|
12
|
+
export declare function eatAll(str: any, listObjects: any): string;
|
|
13
|
+
/** Python-equivalent eatElse */
|
|
14
|
+
export declare function eatElse(stringObj: any, chars?: any, ints?: boolean, alpha?: boolean, lower?: boolean, capitalize?: boolean, string?: boolean, listObj?: boolean): string;
|
|
34
15
|
export declare function tryParse(obj: any): any;
|
|
35
16
|
export declare function create_list_string(array_obj: any): string;
|
|
17
|
+
export declare function eatall(str: any, listObjects: any): string;
|
|
18
|
+
export declare function eatinner(str: any, listObjects: any): string;
|
|
19
|
+
export declare function eatouter(str: any, listObjects: any): string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|