@putkoff/abstract-utilities 0.1.160 → 0.1.162

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.
Files changed (126) hide show
  1. package/dist/index.d.ts +0 -205
  2. package/package.json +17 -10
  3. package/dist/cjs/functions/auth_utils/imports.d.ts +0 -1
  4. package/dist/cjs/functions/auth_utils/index.d.ts +0 -1
  5. package/dist/cjs/functions/auth_utils/src/index.d.ts +0 -1
  6. package/dist/cjs/functions/auth_utils/src/token_utils.d.ts +0 -28
  7. package/dist/cjs/functions/config_utils/imports.d.ts +0 -1
  8. package/dist/cjs/functions/config_utils/index.d.ts +0 -1
  9. package/dist/cjs/functions/config_utils/src/config_utils.d.ts +0 -8
  10. package/dist/cjs/functions/config_utils/src/index.d.ts +0 -1
  11. package/dist/cjs/functions/constants_utils/index.d.ts +0 -1
  12. package/dist/cjs/functions/constants_utils/src/constants.d.ts +0 -7
  13. package/dist/cjs/functions/constants_utils/src/index.d.ts +0 -1
  14. package/dist/cjs/functions/env_utils/imports.d.ts +0 -1
  15. package/dist/cjs/functions/env_utils/index.d.ts +0 -1
  16. package/dist/cjs/functions/env_utils/src/index.d.ts +0 -1
  17. package/dist/cjs/functions/env_utils/src/window_utils.d.ts +0 -4
  18. package/dist/cjs/functions/fetch_utils/imports.d.ts +0 -7
  19. package/dist/cjs/functions/fetch_utils/index.d.ts +0 -1
  20. package/dist/cjs/functions/fetch_utils/src/fetchIt_utils.d.ts +0 -10
  21. package/dist/cjs/functions/fetch_utils/src/index.d.ts +0 -2
  22. package/dist/cjs/functions/fetch_utils/src/utils.d.ts +0 -24
  23. package/dist/cjs/functions/index.d.ts +0 -12
  24. package/dist/cjs/functions/path_utils/imports.d.ts +0 -21
  25. package/dist/cjs/functions/path_utils/index.d.ts +0 -1
  26. package/dist/cjs/functions/path_utils/src/base_dirs.d.ts +0 -4
  27. package/dist/cjs/functions/path_utils/src/function_dirs.d.ts +0 -10
  28. package/dist/cjs/functions/path_utils/src/index.d.ts +0 -6
  29. package/dist/cjs/functions/path_utils/src/misc_dirs.d.ts +0 -4
  30. package/dist/cjs/functions/path_utils/src/path_utils.d.ts +0 -17
  31. package/dist/cjs/functions/path_utils/src/paths.d.ts +0 -5
  32. package/dist/cjs/functions/path_utils/src/src_dirs.d.ts +0 -6
  33. package/dist/cjs/functions/read_utils/index.d.ts +0 -1
  34. package/dist/cjs/functions/read_utils/src/index.d.ts +0 -1
  35. package/dist/cjs/functions/read_utils/src/read_utils.d.ts +0 -9
  36. package/dist/cjs/functions/rndm_utils/index.d.ts +0 -1
  37. package/dist/cjs/functions/rndm_utils/src/index.d.ts +0 -1
  38. package/dist/cjs/functions/rndm_utils/src/utils.d.ts +0 -1
  39. package/dist/cjs/functions/string_utils/index.d.ts +0 -1
  40. package/dist/cjs/functions/string_utils/src/index.d.ts +0 -1
  41. package/dist/cjs/functions/string_utils/src/string_utils.d.ts +0 -31
  42. package/dist/cjs/functions/type_utils/index.d.ts +0 -1
  43. package/dist/cjs/functions/type_utils/src/index.d.ts +0 -1
  44. package/dist/cjs/functions/type_utils/src/type_utils.d.ts +0 -1
  45. package/dist/cjs/functions/ui_utils/imports.d.ts +0 -4
  46. package/dist/cjs/functions/ui_utils/index.d.ts +0 -1
  47. package/dist/cjs/functions/ui_utils/src/button.d.ts +0 -5
  48. package/dist/cjs/functions/ui_utils/src/checkbox.d.ts +0 -4
  49. package/dist/cjs/functions/ui_utils/src/index.d.ts +0 -4
  50. package/dist/cjs/functions/ui_utils/src/input.d.ts +0 -5
  51. package/dist/cjs/functions/ui_utils/src/spinner.d.ts +0 -1
  52. package/dist/cjs/index.d.ts +0 -2
  53. package/dist/cjs/types/index.d.ts +0 -1
  54. package/dist/cjs/types/src/ChangePassword.d.ts +0 -16
  55. package/dist/cjs/types/src/Files.d.ts +0 -27
  56. package/dist/cjs/types/src/index.d.ts +0 -5
  57. package/dist/cjs/types/src/login.d.ts +0 -12
  58. package/dist/cjs/types/src/logout.d.ts +0 -4
  59. package/dist/cjs/types/src/utils.d.ts +0 -38
  60. package/dist/cjs/utils/imports.d.ts +0 -1
  61. package/dist/cjs/utils/index.d.ts +0 -1
  62. package/dist/cjs/utils/src/Input.d.ts +0 -17
  63. package/dist/cjs/utils/src/config.d.ts +0 -5
  64. package/dist/cjs/utils/src/index.d.ts +0 -2
  65. package/dist/esm/functions/auth_utils/imports.d.ts +0 -1
  66. package/dist/esm/functions/auth_utils/index.d.ts +0 -1
  67. package/dist/esm/functions/auth_utils/src/index.d.ts +0 -1
  68. package/dist/esm/functions/auth_utils/src/token_utils.d.ts +0 -28
  69. package/dist/esm/functions/config_utils/imports.d.ts +0 -1
  70. package/dist/esm/functions/config_utils/index.d.ts +0 -1
  71. package/dist/esm/functions/config_utils/src/config_utils.d.ts +0 -8
  72. package/dist/esm/functions/config_utils/src/index.d.ts +0 -1
  73. package/dist/esm/functions/constants_utils/index.d.ts +0 -1
  74. package/dist/esm/functions/constants_utils/src/constants.d.ts +0 -7
  75. package/dist/esm/functions/constants_utils/src/index.d.ts +0 -1
  76. package/dist/esm/functions/env_utils/imports.d.ts +0 -1
  77. package/dist/esm/functions/env_utils/index.d.ts +0 -1
  78. package/dist/esm/functions/env_utils/src/index.d.ts +0 -1
  79. package/dist/esm/functions/env_utils/src/window_utils.d.ts +0 -4
  80. package/dist/esm/functions/fetch_utils/imports.d.ts +0 -7
  81. package/dist/esm/functions/fetch_utils/index.d.ts +0 -1
  82. package/dist/esm/functions/fetch_utils/src/fetchIt_utils.d.ts +0 -10
  83. package/dist/esm/functions/fetch_utils/src/index.d.ts +0 -2
  84. package/dist/esm/functions/fetch_utils/src/utils.d.ts +0 -24
  85. package/dist/esm/functions/index.d.ts +0 -12
  86. package/dist/esm/functions/path_utils/imports.d.ts +0 -21
  87. package/dist/esm/functions/path_utils/index.d.ts +0 -1
  88. package/dist/esm/functions/path_utils/src/base_dirs.d.ts +0 -4
  89. package/dist/esm/functions/path_utils/src/function_dirs.d.ts +0 -10
  90. package/dist/esm/functions/path_utils/src/index.d.ts +0 -6
  91. package/dist/esm/functions/path_utils/src/misc_dirs.d.ts +0 -4
  92. package/dist/esm/functions/path_utils/src/path_utils.d.ts +0 -17
  93. package/dist/esm/functions/path_utils/src/paths.d.ts +0 -5
  94. package/dist/esm/functions/path_utils/src/src_dirs.d.ts +0 -6
  95. package/dist/esm/functions/read_utils/index.d.ts +0 -1
  96. package/dist/esm/functions/read_utils/src/index.d.ts +0 -1
  97. package/dist/esm/functions/read_utils/src/read_utils.d.ts +0 -9
  98. package/dist/esm/functions/rndm_utils/index.d.ts +0 -1
  99. package/dist/esm/functions/rndm_utils/src/index.d.ts +0 -1
  100. package/dist/esm/functions/rndm_utils/src/utils.d.ts +0 -1
  101. package/dist/esm/functions/string_utils/index.d.ts +0 -1
  102. package/dist/esm/functions/string_utils/src/index.d.ts +0 -1
  103. package/dist/esm/functions/string_utils/src/string_utils.d.ts +0 -31
  104. package/dist/esm/functions/type_utils/index.d.ts +0 -1
  105. package/dist/esm/functions/type_utils/src/index.d.ts +0 -1
  106. package/dist/esm/functions/type_utils/src/type_utils.d.ts +0 -1
  107. package/dist/esm/functions/ui_utils/imports.d.ts +0 -4
  108. package/dist/esm/functions/ui_utils/index.d.ts +0 -1
  109. package/dist/esm/functions/ui_utils/src/button.d.ts +0 -5
  110. package/dist/esm/functions/ui_utils/src/checkbox.d.ts +0 -4
  111. package/dist/esm/functions/ui_utils/src/index.d.ts +0 -4
  112. package/dist/esm/functions/ui_utils/src/input.d.ts +0 -5
  113. package/dist/esm/functions/ui_utils/src/spinner.d.ts +0 -1
  114. package/dist/esm/index.d.ts +0 -2
  115. package/dist/esm/types/index.d.ts +0 -1
  116. package/dist/esm/types/src/ChangePassword.d.ts +0 -16
  117. package/dist/esm/types/src/Files.d.ts +0 -27
  118. package/dist/esm/types/src/index.d.ts +0 -5
  119. package/dist/esm/types/src/login.d.ts +0 -12
  120. package/dist/esm/types/src/logout.d.ts +0 -4
  121. package/dist/esm/types/src/utils.d.ts +0 -38
  122. package/dist/esm/utils/imports.d.ts +0 -1
  123. package/dist/esm/utils/index.d.ts +0 -1
  124. package/dist/esm/utils/src/Input.d.ts +0 -17
  125. package/dist/esm/utils/src/config.d.ts +0 -5
  126. package/dist/esm/utils/src/index.d.ts +0 -2
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;
@@ -104,205 +100,4 @@ interface LoginFormProps {
104
100
  onSubmit: (e: React.FormEvent) => void;
105
101
  }
106
102
 
107
- /**
108
- * Helpers for dealing with the JWT stored in localStorage.
109
- */
110
-
111
- /**
112
- ***Changes**:
113
- *- Updated import path for `InputProps` to `../../types/interfaces`.
114
- *
115
- *3. **Token Utilities** (`src/functions/auth/token_utils.ts`):
116
- * Copy from `/var/www/abstractendeavors/my-login-app/src/functions/auth_utils/token_utils.ts`.
117
- *
118
- */
119
- declare function isLoggedIn(): boolean;
120
- /** Read raw JWT from LocalStorage (or null if absent) */
121
- declare function getToken(): string | null;
122
- /**
123
- * Add a Bearer Authorization header.
124
- * A shallow copy of headers is returned so callers can keep chaining.
125
- */
126
- declare function getAuthorizationHeader(headers?: Record<string, string> | null, token?: string | null): Record<string, string>;
127
- /** Throw + redirect if there’s no valid token; otherwise return it. */
128
- declare function requireToken(): string;
129
- /** True if token is structurally bad or its exp ≤ now. */
130
- declare function isTokenExpired(token: string): boolean;
131
- /** Convenience wrapper: return username from the JWT (or null). */
132
- declare function currentUsername(): string | null;
133
- declare function currentUsernames(): any;
134
- declare function decodeJwt(token: string): JwtPayload;
135
-
136
- declare const PROTOCOL = "https://";
137
- declare const DOMAIN_NAME = "abstractendeavors";
138
- declare const BASE_URL = "https://abstractendeavors.com";
139
- declare const SUB_DIR = "secure-files";
140
- declare const PROD_PREFIX = "/secure-files/";
141
- declare const API_PREFIX = "/secure-files/api";
142
- declare const DEV_PREFIX = "/secure-files-dev/";
143
-
144
- declare function get_window(): (Window & typeof globalThis) | null;
145
- declare function get_window_location(): Location | "https://abstractendeavors.com" | null;
146
- declare function get_window_pathname(): string | null;
147
- declare function get_window_parts(): Location | "https://abstractendeavors.com" | null;
148
-
149
- /**
150
- * Given an “endpoint” slug like "api/list", build the full URL
151
- * from the BASE_API_URL entry in your JSON config.
152
- */
153
- declare function get_app_config_url(endpoint: string): Promise<any>;
154
- declare function fetchIt(endpoint: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<any>;
155
- declare function secureFetchIt<T>(endpoint: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<T>;
156
- declare function secureFetchIt(endpoint: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<Blob>;
157
- declare function requestPatch(url: string, body?: unknown): Promise<Response>;
158
- declare function fetchSharePatch(file: unknown, appKey?: any): Promise<void>;
159
-
160
- declare function get_dirname(filePath: string | null): string;
161
- declare function get_basename(filePath: string | null): string;
162
- declare function get_filename(file_path: string): string;
163
- declare function get_extname(filePath: string | null): string;
164
- declare function get_splitext(filePath: string | null): {
165
- filename: string;
166
- extname: string;
167
- ext?: undefined;
168
- } | {
169
- filename: string;
170
- ext: string;
171
- extname?: undefined;
172
- };
173
- declare function make_path(...segments: string[]): string;
174
- declare function sanitizeFilename(filename: string): string;
175
- declare function make_sanitized_path(...paths: string[]): string;
176
- declare function normalizeUrl(base: string, p?: string): string;
177
-
178
- /**
179
- * Returns the absolute path of the current file.
180
- */
181
- declare function getAbsDir(): string;
182
- declare function getAbsPath(subPath: string): string;
183
-
184
- declare function getFunctionsDir(): string;
185
- declare function geAuthsUtilsDirectory(): string;
186
- declare function geBackupsUtilsDirectory(): string;
187
- declare function geConstantsUtilsDirectory(): string;
188
- declare function geEnvUtilsDirectory(): string;
189
- declare function geFetchUtilsDirectory(): string;
190
- declare function geFileUtilsDirectory(): string;
191
- declare function gePathUtilsDirectory(): string;
192
- declare function geStringUtilsDirectory(): string;
193
- declare function geTypeUtilsDirectory(): string;
194
-
195
- declare function getSrcDir(): string;
196
- declare function geStaticDirectory(): string;
197
- declare function getLibUtilsDirectory(): string;
198
- declare function getHooksUtilsDirectory(): string;
199
- declare function getFunctionsUtilsDirectory(): string;
200
- declare function getComponentsUtilsDirectory(): string;
201
-
202
- declare function getBaseDir(): string;
203
- declare function getPublicDir(): string;
204
- declare function getDistDir(): string;
205
- declare function getEnvDir(): string;
206
-
207
- declare function getEnvPath(string?: string): string;
208
- declare function getDbConfigsPath(): string;
209
- declare function getSchemasPath(): string;
210
- declare function getSchemasDirPath(subPath: string): string;
211
-
212
- declare function alertit(obj?: any): void;
213
-
214
- declare function ensure_list<T>(obj: T | T[]): T[];
215
-
216
- declare function getSubstring(obj: string, maxLength?: number | null, minLength?: number | null): string;
217
- declare function truncateString(obj: string, maxLength?: number): string;
218
- declare function stripPrefixes(str: string, bases?: string | string[]): string;
219
- /**
220
- * Removes characters from the beginning of the string
221
- * if they are found in the list of characters.
222
- *
223
- * @param str - The input string.
224
- * @param listObjects - A string or an array of characters to remove.
225
- * @returns The modified string.
226
- */
227
- declare function eatInner(str: string, listObjects: string | string[]): string;
228
- /**
229
- * Removes characters from the end of the string
230
- * if they are found in the list of characters.
231
- *
232
- * @param str - The input string.
233
- * @param listObjects - A string or an array of characters to remove.
234
- * @returns The modified string.
235
- */
236
- declare function eatOuter(str: string, listObjects: string | string[]): string;
237
- /**
238
- * Removes characters from both the beginning and the end of the string
239
- * if they are found in the list of characters.
240
- *
241
- * @param str - The input string.
242
- * @param listObjects - A string or an array of characters to remove.
243
- * @returns The modified string.
244
- */
245
- declare function eatAll(str: string, listObjects: string | string[]): string;
246
- declare function eatEnd(obj: string, endings?: string[]): string;
247
-
248
- declare function loadConfig(filePath?: string | null): Promise<AppConfig>;
249
- /**
250
- * getConfig(): load the full AppConfig
251
- * getConfig(key): load just that key
252
- */
253
- declare function getConfig(): Promise<AppConfig>;
254
- declare function getConfig<K extends keyof AppConfig>(key: K): Promise<AppConfig[K]>;
255
-
256
- declare function ensureAbstractUrl(endpoint: string, slices?: string[]): string;
257
- /**
258
- * Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
259
- */
260
- declare function getResult<T>(obj: unknown): T;
261
- declare function api(endpoint: string): string;
262
- /**
263
- * Intercept 401/403 and force a clean redirect to login
264
- * without ever showing an alert.
265
- */
266
- declare function checkResponse(res: Response): Response;
267
- /**
268
- * parseResult no longer needs to worry about JSON vs HTML redirect errors;
269
- * all 401/403 have already been handled above.
270
- */
271
- declare function parseResult(res: Response): Promise<unknown>;
272
- declare function getMethod(method?: string | null, body?: unknown): string;
273
- declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
274
- declare function getBody(body?: unknown, method?: string | null): string | undefined;
275
- declare function getFetchVars(headers?: Record<string, string> | null, method?: string | null, body?: any): FetchVariables;
276
- declare function getHtmlDirectory(directory: string, filename: string): string;
277
- declare function fetchIndexHtml(filename: string, directory?: string, base?: string): Promise<string>;
278
- declare function fetchIndexHtmlContainer(filename: string, doc?: Document, directory?: string): Promise<void>;
279
-
280
- declare function Button({ children, color, variant, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
281
- color?: 'gray' | 'green' | 'blue';
282
- variant?: 'default' | 'icon' | 'primary' | 'secondary';
283
- className?: string;
284
- }): react_jsx_runtime.JSX.Element;
285
-
286
- declare function Checkbox({ label, ...rest }: React$1.InputHTMLAttributes<HTMLInputElement> & {
287
- label: string;
288
- }): react_jsx_runtime.JSX.Element;
289
-
290
- declare function Input({ label, trailing, ...rest }: React$1.InputHTMLAttributes<HTMLInputElement> & {
291
- label: string;
292
- trailing?: React$1.ReactNode;
293
- }): react_jsx_runtime.JSX.Element;
294
-
295
- declare function Spinner(): react_jsx_runtime.JSX.Element;
296
-
297
- /**
298
- * Reads a file at `relativeOrAbsolutePath` and returns its contents as a string.
299
- * In a browser this will reject immediately.
300
- */
301
- declare function readFileContents(relativeOrAbsolutePath: string): Promise<string>;
302
- /**
303
- * Reads a JSON file and returns the parsed object.
304
- */
305
- declare function readJsonFile<T = any>(relativeOrAbsolutePath: string): Promise<T>;
306
-
307
- export { API_PREFIX, BASE_URL, Button, Checkbox, DEV_PREFIX, DOMAIN_NAME, Input, PROD_PREFIX, PROTOCOL, SUB_DIR, Spinner, alertit, api, checkResponse, currentUsername, currentUsernames, decodeJwt, eatAll, eatEnd, eatInner, eatOuter, ensureAbstractUrl, ensure_list, fetchIndexHtml, fetchIndexHtmlContainer, fetchIt, fetchSharePatch, geAuthsUtilsDirectory, geBackupsUtilsDirectory, geConstantsUtilsDirectory, geEnvUtilsDirectory, geFetchUtilsDirectory, geFileUtilsDirectory, gePathUtilsDirectory, geStaticDirectory, geStringUtilsDirectory, geTypeUtilsDirectory, getAbsDir, getAbsPath, getAuthorizationHeader, getBaseDir, getBody, getComponentsUtilsDirectory, getConfig, getDbConfigsPath, getDistDir, getEnvDir, getEnvPath, getFetchVars, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getLibUtilsDirectory, getMethod, getPublicDir, getResult, getSchemasDirPath, getSchemasPath, getSrcDir, getSubstring, getToken, get_app_config_url, get_basename, get_dirname, get_extname, get_filename, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, isLoggedIn, isTokenExpired, loadConfig, make_path, make_sanitized_path, normalizeUrl, parseResult, readFileContents, readJsonFile, requestPatch, requireToken, sanitizeFilename, secureFetchIt, stripPrefixes, truncateString };
308
103
  export type { ApiRow, AppConfig, ChangePasswordFormProps, ChangePasswordProps, FetchVariables, FileItem, FileListResponse, InputProps, JwtPayload, LoginFormProps, LoginProps, LogoutButtonProps, Promise$1 as Promise, UrlKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.160",
3
+ "version": "0.1.162",
4
4
  "type": "module",
5
5
  "description": "A reusable React Login component with JWT authentication",
6
6
  "main": "dist/cjs/index.js",
@@ -25,10 +25,19 @@
25
25
  "react": "^17.0.0 || ^18.0.0",
26
26
  "react-dom": "^17.0.0 || ^18.0.0"
27
27
  },
28
+ "dependencies": {
29
+ "path-browserify": "^1.0.1"
30
+ },
28
31
  "devDependencies": {
29
32
  "@rollup/plugin-commonjs": "^25.0.7",
30
33
  "@rollup/plugin-node-resolve": "^15.2.3",
31
34
  "@rollup/plugin-typescript": "^11.1.5",
35
+ "@rollup/plugin-json": "^6.1.0",
36
+ "rollup": "^4.12.0",
37
+ "rollup-plugin-dts": "^6.1.0",
38
+ "rollup-plugin-peer-deps-external": "^2.2.4",
39
+ "rollup-plugin-postcss": "^4.0.2",
40
+ "postcss": "^8.5.6",
32
41
  "@testing-library/jest-dom": "^6.4.2",
33
42
  "@testing-library/react": "^14.2.1",
34
43
  "@types/jest": "^29.5.12",
@@ -36,11 +45,6 @@
36
45
  "@types/react": "^18.2.55",
37
46
  "@types/react-dom": "^18.2.19",
38
47
  "jest": "^29.7.0",
39
- "postcss": "^8.5.6",
40
- "rollup": "^4.12.0",
41
- "rollup-plugin-dts": "^6.1.0",
42
- "rollup-plugin-peer-deps-external": "^2.2.4",
43
- "rollup-plugin-postcss": "^4.0.2",
44
48
  "ts-jest": "^29.1.2",
45
49
  "ts-node": "^10.9.2",
46
50
  "tslib": "^2.8.1",
@@ -70,15 +74,18 @@
70
74
  "node_modules",
71
75
  "dist"
72
76
  ],
77
+ "exports": {
78
+ ".": {
79
+ "import": "./dist/esm/index.js",
80
+ "require": "./dist/cjs/index.js"
81
+ },
82
+ "./package.json": "./package.json"
83
+ },
73
84
  "files": [
74
85
  "dist/",
75
86
  "src/components/Login/login_style.css",
76
87
  "src/components/ChangePassword/change_password.css"
77
88
  ],
78
- "dependencies": {
79
- "@rollup/plugin-json": "^6.1.0",
80
- "path-browserify": "^1.0.1"
81
- },
82
89
  "ts-node": {
83
90
  "esm": true
84
91
  }
@@ -1 +0,0 @@
1
- export type { JwtPayload } from './../../types';
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1 +0,0 @@
1
- export * from "./token_utils";
@@ -1,28 +0,0 @@
1
- /**
2
- * Helpers for dealing with the JWT stored in localStorage.
3
- */
4
- import { JwtPayload } from './../imports';
5
- /**
6
- ***Changes**:
7
- *- Updated import path for `InputProps` to `../../types/interfaces`.
8
- *
9
- *3. **Token Utilities** (`src/functions/auth/token_utils.ts`):
10
- * Copy from `/var/www/abstractendeavors/my-login-app/src/functions/auth_utils/token_utils.ts`.
11
- *
12
- */
13
- export declare function isLoggedIn(): boolean;
14
- /** Read raw JWT from LocalStorage (or null if absent) */
15
- export declare function getToken(): string | null;
16
- /**
17
- * Add a Bearer Authorization header.
18
- * A shallow copy of headers is returned so callers can keep chaining.
19
- */
20
- export declare function getAuthorizationHeader(headers?: Record<string, string> | null, token?: string | null): Record<string, string>;
21
- /** Throw + redirect if there’s no valid token; otherwise return it. */
22
- export declare function requireToken(): string;
23
- /** True if token is structurally bad or its exp ≤ now. */
24
- export declare function isTokenExpired(token: string): boolean;
25
- /** Convenience wrapper: return username from the JWT (or null). */
26
- export declare function currentUsername(): string | null;
27
- export declare function currentUsernames(): any;
28
- export declare function decodeJwt(token: string): JwtPayload;
@@ -1 +0,0 @@
1
- export type { AppConfig } from './../../types';
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1,8 +0,0 @@
1
- import type { AppConfig } from './../imports';
2
- export declare function loadConfig(filePath?: string | null): Promise<AppConfig>;
3
- /**
4
- * getConfig(): load the full AppConfig
5
- * getConfig(key): load just that key
6
- */
7
- export declare function getConfig(): Promise<AppConfig>;
8
- export declare function getConfig<K extends keyof AppConfig>(key: K): Promise<AppConfig[K]>;
@@ -1 +0,0 @@
1
- export * from './config_utils';
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1,7 +0,0 @@
1
- export declare const PROTOCOL = "https://";
2
- export declare const DOMAIN_NAME = "abstractendeavors";
3
- export declare const BASE_URL = "https://abstractendeavors.com";
4
- export declare const SUB_DIR = "secure-files";
5
- export declare const PROD_PREFIX = "/secure-files/";
6
- export declare const API_PREFIX = "/secure-files/api";
7
- export declare const DEV_PREFIX = "/secure-files-dev/";
@@ -1 +0,0 @@
1
- export * from './constants';
@@ -1 +0,0 @@
1
- export { BASE_URL, DEV_PREFIX } from './../constants_utils/index';
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1 +0,0 @@
1
- export * from './window_utils';
@@ -1,4 +0,0 @@
1
- export declare function get_window(): (Window & typeof globalThis) | null;
2
- export declare function get_window_location(): Location | "https://abstractendeavors.com" | null;
3
- export declare function get_window_pathname(): string | null;
4
- export declare function get_window_parts(): Location | "https://abstractendeavors.com" | null;
@@ -1,7 +0,0 @@
1
- export { getAuthorizationHeader } from "./../auth_utils";
2
- export { make_path } from './../path_utils';
3
- export { alertit } from './../rndm_utils';
4
- export { ensure_list } from './../type_utils';
5
- export { eatInner, stripPrefixes } from './../string_utils';
6
- export type { LogoutButtonProps, FetchVariables, UrlKey } from './../../types';
7
- export { getConfig, loadConfig } from './../config_utils';
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1,10 +0,0 @@
1
- /**
2
- * Given an “endpoint” slug like "api/list", build the full URL
3
- * from the BASE_API_URL entry in your JSON config.
4
- */
5
- export declare function get_app_config_url(endpoint: string): Promise<any>;
6
- export declare function fetchIt(endpoint: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<any>;
7
- export declare function secureFetchIt<T>(endpoint: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<T>;
8
- export declare function secureFetchIt(endpoint: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, noApi?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<Blob>;
9
- export declare function requestPatch(url: string, body?: unknown): Promise<Response>;
10
- export declare function fetchSharePatch(file: unknown, appKey?: any): Promise<void>;
@@ -1,2 +0,0 @@
1
- export * from './fetchIt_utils';
2
- export * from './utils';
@@ -1,24 +0,0 @@
1
- import { FetchVariables } from './../imports';
2
- export declare function ensureAbstractUrl(endpoint: string, slices?: string[]): string;
3
- /**
4
- * Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
5
- */
6
- export declare function getResult<T>(obj: unknown): T;
7
- export declare function api(endpoint: string): string;
8
- /**
9
- * Intercept 401/403 and force a clean redirect to login
10
- * without ever showing an alert.
11
- */
12
- export declare function checkResponse(res: Response): Response;
13
- /**
14
- * parseResult no longer needs to worry about JSON vs HTML redirect errors;
15
- * all 401/403 have already been handled above.
16
- */
17
- export declare function parseResult(res: Response): Promise<unknown>;
18
- export declare function getMethod(method?: string | null, body?: unknown): string;
19
- export declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
20
- export declare function getBody(body?: unknown, method?: string | null): string | undefined;
21
- export declare function getFetchVars(headers?: Record<string, string> | null, method?: string | null, body?: any): FetchVariables;
22
- export declare function getHtmlDirectory(directory: string, filename: string): string;
23
- export declare function fetchIndexHtml(filename: string, directory?: string, base?: string): Promise<string>;
24
- export declare function fetchIndexHtmlContainer(filename: string, doc?: Document, directory?: string): Promise<void>;
@@ -1,12 +0,0 @@
1
- export { useCallback, useRef, useState, useEffect } from "react";
2
- export * from './auth_utils';
3
- export * from './constants_utils';
4
- export * from './env_utils';
5
- export * from './fetch_utils';
6
- export * from './path_utils';
7
- export * from './rndm_utils';
8
- export * from './string_utils';
9
- export * from './type_utils';
10
- export * from './ui_utils';
11
- export * from './config_utils';
12
- export * from './read_utils';
@@ -1,21 +0,0 @@
1
- /**
2
- * In the browser we already have a WHATWG URL constructor on window.
3
- * Here we re-export it as “url” so other modules can import it.
4
- */
5
- declare const _url: {
6
- new (url: string | URL, base?: string | URL): URL;
7
- prototype: URL;
8
- canParse(url: string | URL, base?: string | URL): boolean;
9
- createObjectURL(obj: Blob | MediaSource): string;
10
- parse(url: string | URL, base?: string | URL): URL | null;
11
- revokeObjectURL(url: string): void;
12
- } | undefined;
13
- export { _url as url };
14
- /**
15
- * Minimal fileURLToPath implementation for browser-side code.
16
- * If you only ever need to strip off “file://” in development, this is enough.
17
- */
18
- export declare function fileURLToPath(fileUrl: string): string;
19
- export { eatOuter, eatInner } from './../string_utils';
20
- export { ensure_list } from './../type_utils';
21
- export declare function getAbsolutePath(): string;
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1,4 +0,0 @@
1
- export declare function getBaseDir(): string;
2
- export declare function getPublicDir(): string;
3
- export declare function getDistDir(): string;
4
- export declare function getEnvDir(): string;
@@ -1,10 +0,0 @@
1
- export declare function getFunctionsDir(): string;
2
- export declare function geAuthsUtilsDirectory(): string;
3
- export declare function geBackupsUtilsDirectory(): string;
4
- export declare function geConstantsUtilsDirectory(): string;
5
- export declare function geEnvUtilsDirectory(): string;
6
- export declare function geFetchUtilsDirectory(): string;
7
- export declare function geFileUtilsDirectory(): string;
8
- export declare function gePathUtilsDirectory(): string;
9
- export declare function geStringUtilsDirectory(): string;
10
- export declare function geTypeUtilsDirectory(): string;
@@ -1,6 +0,0 @@
1
- export * from './path_utils';
2
- export * from './paths';
3
- export * from './function_dirs';
4
- export * from './src_dirs';
5
- export * from './base_dirs';
6
- export * from './misc_dirs';
@@ -1,4 +0,0 @@
1
- export declare function getEnvPath(string?: string): string;
2
- export declare function getDbConfigsPath(): string;
3
- export declare function getSchemasPath(): string;
4
- export declare function getSchemasDirPath(subPath: string): string;
@@ -1,17 +0,0 @@
1
- export declare function get_dirname(filePath: string | null): string;
2
- export declare function get_basename(filePath: string | null): string;
3
- export declare function get_filename(file_path: string): string;
4
- export declare function get_extname(filePath: string | null): string;
5
- export declare function get_splitext(filePath: string | null): {
6
- filename: string;
7
- extname: string;
8
- ext?: undefined;
9
- } | {
10
- filename: string;
11
- ext: string;
12
- extname?: undefined;
13
- };
14
- export declare function make_path(...segments: string[]): string;
15
- export declare function sanitizeFilename(filename: string): string;
16
- export declare function make_sanitized_path(...paths: string[]): string;
17
- export declare function normalizeUrl(base: string, p?: string): string;
@@ -1,5 +0,0 @@
1
- /**
2
- * Returns the absolute path of the current file.
3
- */
4
- export declare function getAbsDir(): string;
5
- export declare function getAbsPath(subPath: string): string;
@@ -1,6 +0,0 @@
1
- export declare function getSrcDir(): string;
2
- export declare function geStaticDirectory(): string;
3
- export declare function getLibUtilsDirectory(): string;
4
- export declare function getHooksUtilsDirectory(): string;
5
- export declare function getFunctionsUtilsDirectory(): string;
6
- export declare function getComponentsUtilsDirectory(): string;
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1 +0,0 @@
1
- export * from './read_utils';
@@ -1,9 +0,0 @@
1
- /**
2
- * Reads a file at `relativeOrAbsolutePath` and returns its contents as a string.
3
- * In a browser this will reject immediately.
4
- */
5
- export declare function readFileContents(relativeOrAbsolutePath: string): Promise<string>;
6
- /**
7
- * Reads a JSON file and returns the parsed object.
8
- */
9
- export declare function readJsonFile<T = any>(relativeOrAbsolutePath: string): Promise<T>;
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1 +0,0 @@
1
- export * from './utils';
@@ -1 +0,0 @@
1
- export declare function alertit(obj?: any): void;
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1 +0,0 @@
1
- export * from './string_utils';
@@ -1,31 +0,0 @@
1
- export declare function getSubstring(obj: string, maxLength?: number | null, minLength?: number | null): string;
2
- export declare function truncateString(obj: string, maxLength?: number): string;
3
- export declare function stripPrefixes(str: string, bases?: string | string[]): string;
4
- /**
5
- * Removes characters from the beginning of the string
6
- * if they are found in the list of characters.
7
- *
8
- * @param str - The input string.
9
- * @param listObjects - A string or an array of characters to remove.
10
- * @returns The modified string.
11
- */
12
- export declare function eatInner(str: string, listObjects: string | string[]): string;
13
- /**
14
- * Removes characters from the end of the string
15
- * if they are found in the list of characters.
16
- *
17
- * @param str - The input string.
18
- * @param listObjects - A string or an array of characters to remove.
19
- * @returns The modified string.
20
- */
21
- export declare function eatOuter(str: string, listObjects: string | string[]): string;
22
- /**
23
- * Removes characters from both the beginning and the end of the string
24
- * if they are found in the list of characters.
25
- *
26
- * @param str - The input string.
27
- * @param listObjects - A string or an array of characters to remove.
28
- * @returns The modified string.
29
- */
30
- export declare function eatAll(str: string, listObjects: string | string[]): string;
31
- export declare function eatEnd(obj: string, endings?: string[]): string;
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1 +0,0 @@
1
- export * from './type_utils';
@@ -1 +0,0 @@
1
- export declare function ensure_list<T>(obj: T | T[]): T[];
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare const useState: typeof React.useState, useEffect: typeof React.useEffect, useCallback: typeof React.useCallback;
3
- export { fetchIt } from './../fetch_utils';
4
- export { currentUsername, isTokenExpired, getToken } from './../auth_utils';
@@ -1 +0,0 @@
1
- export * from './src';
@@ -1,5 +0,0 @@
1
- export declare function Button({ children, color, variant, className, ...rest }: React.ButtonHTMLAttributes<HTMLButtonElement> & {
2
- color?: 'gray' | 'green' | 'blue';
3
- variant?: 'default' | 'icon' | 'primary' | 'secondary';
4
- className?: string;
5
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- export declare function Checkbox({ label, ...rest }: React.InputHTMLAttributes<HTMLInputElement> & {
3
- label: string;
4
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +0,0 @@
1
- export * from './button';
2
- export * from './checkbox';
3
- export * from './input';
4
- export * from './spinner';
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare function Input({ label, trailing, ...rest }: React.InputHTMLAttributes<HTMLInputElement> & {
3
- label: string;
4
- trailing?: React.ReactNode;
5
- }): import("react/jsx-runtime").JSX.Element;