@putkoff/abstract-utilities 0.1.114 → 0.1.116

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 (36) hide show
  1. package/dist/cjs/functions/config_utils/imports.d.ts +1 -0
  2. package/dist/cjs/functions/config_utils/index.d.ts +1 -0
  3. package/dist/cjs/functions/config_utils/src/config_utils.d.ts +7 -0
  4. package/dist/cjs/functions/config_utils/src/index.d.ts +1 -0
  5. package/dist/cjs/functions/index.d.ts +2 -0
  6. package/dist/cjs/functions/read_utils/imports.d.ts +3 -0
  7. package/dist/cjs/functions/read_utils/index.d.ts +1 -0
  8. package/dist/cjs/functions/read_utils/src/index.d.ts +1 -0
  9. package/dist/cjs/functions/read_utils/src/read_utils.d.ts +9 -0
  10. package/dist/cjs/index.js +77 -2
  11. package/dist/cjs/index.js.map +1 -1
  12. package/dist/cjs/types/src/utils.d.ts +6 -0
  13. package/dist/esm/functions/config_utils/imports.d.ts +1 -0
  14. package/dist/esm/functions/config_utils/index.d.ts +1 -0
  15. package/dist/esm/functions/config_utils/src/config_utils.d.ts +7 -0
  16. package/dist/esm/functions/config_utils/src/index.d.ts +1 -0
  17. package/dist/esm/functions/index.d.ts +2 -0
  18. package/dist/esm/functions/read_utils/imports.d.ts +3 -0
  19. package/dist/esm/functions/read_utils/index.d.ts +1 -0
  20. package/dist/esm/functions/read_utils/src/index.d.ts +1 -0
  21. package/dist/esm/functions/read_utils/src/read_utils.d.ts +9 -0
  22. package/dist/esm/index.js +75 -3
  23. package/dist/esm/index.js.map +1 -1
  24. package/dist/esm/types/src/utils.d.ts +6 -0
  25. package/dist/functions/config_utils/imports.d.ts +1 -0
  26. package/dist/functions/config_utils/index.d.ts +1 -0
  27. package/dist/functions/config_utils/src/config_utils.d.ts +7 -0
  28. package/dist/functions/config_utils/src/index.d.ts +1 -0
  29. package/dist/functions/index.d.ts +2 -0
  30. package/dist/functions/read_utils/imports.d.ts +0 -0
  31. package/dist/functions/read_utils/index.d.ts +1 -0
  32. package/dist/functions/read_utils/src/index.d.ts +1 -0
  33. package/dist/functions/read_utils/src/read_utils.d.ts +9 -0
  34. package/dist/index.d.ts +24 -1
  35. package/dist/types/src/utils.d.ts +6 -0
  36. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -47,6 +47,12 @@ interface ChangePasswordFormProps {
47
47
  onCancel?: () => void;
48
48
  }
49
49
 
50
+ interface AppConfig {
51
+ BASE_URL: string;
52
+ BASE_API_URL: string;
53
+ FEATURE_FLAG?: boolean;
54
+ SOME_NUMBER?: number;
55
+ }
50
56
  interface InputProps {
51
57
  label?: any;
52
58
  type?: any;
@@ -262,4 +268,21 @@ declare function Input({ label, trailing, ...rest }: React$1.InputHTMLAttributes
262
268
 
263
269
  declare function Spinner(): react_jsx_runtime.JSX.Element;
264
270
 
265
- export { API_PREFIX, type ApiRow, BASE_URL, Button, type ChangePasswordFormProps, type ChangePasswordProps, Checkbox, DEV_PREFIX, DOMAIN_NAME, type FetchVariables, type FileItem, type FileListResponse, Input, type InputProps, type JwtPayload, type LoginFormProps, type LoginProps, type LogoutButtonProps, PROD_PREFIX, PROTOCOL, SUB_DIR, Spinner, alertit, currentUsername, currentUsernames, decodeJwt, eatAll, eatEnd, eatInner, eatOuter, ensure_list, fetchIt, fetchSharePatch, geAuthsUtilsDirectory, geBackupsUtilsDirectory, geConstantsUtilsDirectory, geEnvUtilsDirectory, geFetchUtilsDirectory, geFileUtilsDirectory, gePathUtilsDirectory, geStaticDirectory, geStringUtilsDirectory, geTypeUtilsDirectory, getAbsDir, getAbsPath, getAuthorizationHeader, getBaseDir, getComponentsUtilsDirectory, getDbConfigsPath, getDistDir, getEnvDir, getEnvPath, getFunctionsDir, getFunctionsUtilsDirectory, getHooksUtilsDirectory, getLibUtilsDirectory, getPublicDir, 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, make_path, make_sanitized_path, normalizeUrl, requestPatch, requireToken, sanitizeFilename, secureFetchIt, stripPrefixes, truncateString };
271
+ /**
272
+ * getConfig(): load the full AppConfig
273
+ * getConfig(key): load just that key
274
+ */
275
+ declare function getConfig(): Promise<AppConfig>;
276
+ declare function getConfig<K extends keyof AppConfig>(key: K): Promise<AppConfig[K]>;
277
+
278
+ /**
279
+ * Reads a file at `relativeOrAbsolutePath` and returns its contents as a string.
280
+ * In a browser this will reject immediately.
281
+ */
282
+ declare function readFileContents(relativeOrAbsolutePath: string): Promise<string>;
283
+ /**
284
+ * Reads a JSON file and returns the parsed object.
285
+ */
286
+ declare function readJsonFile<T = any>(relativeOrAbsolutePath: string): Promise<T>;
287
+
288
+ export { API_PREFIX, type ApiRow, type AppConfig, BASE_URL, Button, type ChangePasswordFormProps, type ChangePasswordProps, Checkbox, DEV_PREFIX, DOMAIN_NAME, type FetchVariables, type FileItem, type FileListResponse, Input, type InputProps, type JwtPayload, type LoginFormProps, type LoginProps, type LogoutButtonProps, PROD_PREFIX, PROTOCOL, SUB_DIR, Spinner, alertit, currentUsername, currentUsernames, decodeJwt, eatAll, eatEnd, eatInner, eatOuter, ensure_list, fetchIt, fetchSharePatch, geAuthsUtilsDirectory, geBackupsUtilsDirectory, geConstantsUtilsDirectory, geEnvUtilsDirectory, geFetchUtilsDirectory, geFileUtilsDirectory, gePathUtilsDirectory, geStaticDirectory, geStringUtilsDirectory, geTypeUtilsDirectory, getAbsDir, getAbsPath, getAuthorizationHeader, getBaseDir, getComponentsUtilsDirectory, getConfig, getDbConfigsPath, getDistDir, getEnvDir, getEnvPath, getFunctionsDir, getFunctionsUtilsDirectory, getHooksUtilsDirectory, getLibUtilsDirectory, getPublicDir, 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, make_path, make_sanitized_path, normalizeUrl, readFileContents, readJsonFile, requestPatch, requireToken, sanitizeFilename, secureFetchIt, stripPrefixes, truncateString };
@@ -1,3 +1,9 @@
1
+ export interface AppConfig {
2
+ BASE_URL: string;
3
+ BASE_API_URL: string;
4
+ FEATURE_FLAG?: boolean;
5
+ SOME_NUMBER?: number;
6
+ }
1
7
  export interface InputProps {
2
8
  label?: any;
3
9
  type?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putkoff/abstract-utilities",
3
- "version": "0.1.114",
3
+ "version": "0.1.116",
4
4
  "type": "module",
5
5
  "description": "A reusable React Login component with JWT authentication",
6
6
  "main": "dist/cjs/index.js",