@erpsquad/common 1.8.82 → 1.8.83

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 (47) hide show
  1. package/dist/_virtual/index/index.esm2.js +4 -2
  2. package/dist/_virtual/index/index.esm2.js.map +1 -1
  3. package/dist/_virtual/index/index.esm3.js +3 -3
  4. package/dist/_virtual/index/index.esm4.js +3 -3
  5. package/dist/_virtual/index/index.esm5.js +2 -4
  6. package/dist/_virtual/index/index.esm5.js.map +1 -1
  7. package/dist/_virtual/index/index2.js +1 -1
  8. package/dist/_virtual/index/index3.js +1 -1
  9. package/dist/_virtual/index/index4.js +1 -1
  10. package/dist/_virtual/index/index5.js +1 -1
  11. package/dist/components/providers/ERPUIProvider/index.esm.js +15 -1
  12. package/dist/components/providers/ERPUIProvider/index.esm.js.map +1 -1
  13. package/dist/components/providers/ERPUIProvider/index.js +1 -1
  14. package/dist/components/providers/ERPUIProvider/index.js.map +1 -1
  15. package/dist/components/providers/ERPUIProvider.d.ts +2 -0
  16. package/dist/index.esm.js +7 -1
  17. package/dist/index.esm.js.map +1 -1
  18. package/dist/index.js +1 -1
  19. package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.esm.js +1 -1
  20. package/dist/node_modules/@asseinfo/react-kanban/dist/index/index.js +1 -1
  21. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.esm.js +1 -1
  22. package/dist/node_modules/@mui/icons-material/utils/createSvgIcon/index.js +1 -1
  23. package/dist/node_modules/@mui/system/colorManipulator/index.esm.js +2 -2
  24. package/dist/node_modules/@mui/system/colorManipulator/index.js +1 -1
  25. package/dist/src/components/providers/ERPUIProvider.d.ts +2 -0
  26. package/dist/src/utils/api-config.d.ts +48 -0
  27. package/dist/src/utils/api.d.ts +1 -0
  28. package/dist/src/utils/index.d.ts +1 -0
  29. package/dist/style.css +71 -71
  30. package/dist/utils/api/index.esm.js +20 -7
  31. package/dist/utils/api/index.esm.js.map +1 -1
  32. package/dist/utils/api/index.js +1 -1
  33. package/dist/utils/api/index.js.map +1 -1
  34. package/dist/utils/api-config/index.esm.js +36 -0
  35. package/dist/utils/api-config/index.esm.js.map +1 -0
  36. package/dist/utils/api-config/index.js +2 -0
  37. package/dist/utils/api-config/index.js.map +1 -0
  38. package/dist/utils/api-config.d.ts +48 -0
  39. package/dist/utils/api.d.ts +1 -0
  40. package/dist/utils/common/index.esm.js +6 -5
  41. package/dist/utils/common/index.esm.js.map +1 -1
  42. package/dist/utils/common/index.js +1 -1
  43. package/dist/utils/common/index.js.map +1 -1
  44. package/dist/utils/index.esm.js +7 -1
  45. package/dist/utils/index.esm.js.map +1 -1
  46. package/dist/utils/index.js +1 -1
  47. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import { default as React, ReactNode } from 'react';
2
2
  import { ApiClientConfig } from '../../redux';
3
3
  import { Color } from '../../theme';
4
+ import { ApiConfig } from '../../utils/api-config';
4
5
 
5
6
  interface ERPUIContextValue {
6
7
  useRedux: boolean;
@@ -36,6 +37,7 @@ interface ERPUIProviderProps {
36
37
  };
37
38
  autoHideDuration?: number;
38
39
  };
40
+ apiConfig?: ApiConfig;
39
41
  }
40
42
  export declare const ERPUIProvider: React.FC<ERPUIProviderProps>;
41
43
  export default ERPUIProvider;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * API Configuration Module
3
+ *
4
+ * This module provides runtime configuration for API base URLs and other environment-specific settings.
5
+ * The configuration must be initialized by the consuming application before using any API-related features.
6
+ */
7
+ export interface ApiConfig {
8
+ backendBaseUrl: string;
9
+ s3BucketUrl: string;
10
+ socketBaseUrl: string;
11
+ }
12
+ /**
13
+ * Initialize the API configuration.
14
+ * This function must be called by the consuming application during startup.
15
+ *
16
+ * @param config - The API configuration object
17
+ * @throws Error if configuration is already initialized
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * import { initializeApiConfig } from '@erpsquad/common/utils';
22
+ *
23
+ * initializeApiConfig({
24
+ * backendBaseUrl: import.meta.env.VITE_BACKEND_BASE_URL,
25
+ * s3BucketUrl: import.meta.env.VITE_S3_BUCKET_URL,
26
+ * socketBaseUrl: import.meta.env.VITE_SOCKET_BASE_URL,
27
+ * });
28
+ * ```
29
+ */
30
+ export declare function initializeApiConfig(config: ApiConfig): void;
31
+ /**
32
+ * Get the current API configuration.
33
+ *
34
+ * @returns The current API configuration
35
+ * @throws Error if configuration has not been initialized
36
+ */
37
+ export declare function getApiConfig(): ApiConfig;
38
+ /**
39
+ * Check if API configuration has been initialized.
40
+ *
41
+ * @returns True if configuration is initialized, false otherwise
42
+ */
43
+ export declare function isApiConfigInitialized(): boolean;
44
+ /**
45
+ * Reset the API configuration (useful for testing).
46
+ * This should not be used in production code.
47
+ */
48
+ export declare function resetApiConfig(): void;
@@ -1,5 +1,6 @@
1
1
  import { getPartyName } from './common';
2
2
 
3
+ export declare function initializeApiBaseUrls(): void;
3
4
  export declare const getOptions: (apiFunc: (params: any) => Promise<any>, filters: Record<string, any>, dataKey: string, labelKey: string, defaultColumn: string[], defaultFilter?: string, valueKey?: string) => Promise<{
4
5
  data: any;
5
6
  pagination: any;
@@ -1,4 +1,5 @@
1
1
  export * from './api';
2
+ export * from './api-config';
2
3
  export * from './calculation';
3
4
  export * from './color';
4
5
  export * from './common-utility';