@optifye/dashboard-core 6.0.7 → 6.0.9
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/index.d.mts +15 -11
- package/dist/index.d.ts +15 -11
- package/dist/index.js +170 -122
- package/dist/index.mjs +170 -122
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2083,19 +2083,19 @@ interface UseWorkspaceDisplayNamesReturn {
|
|
|
2083
2083
|
* loading states, error handling, and caching. It automatically fetches workspace display names
|
|
2084
2084
|
* on mount and provides utility methods for accessing individual workspace names.
|
|
2085
2085
|
*
|
|
2086
|
-
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2087
2086
|
* @param {string} [lineId] - Optional line ID to filter workspaces
|
|
2087
|
+
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2088
2088
|
* @returns {UseWorkspaceDisplayNamesReturn} An object containing display names, loading state, error, and utility functions
|
|
2089
2089
|
*
|
|
2090
2090
|
* @example
|
|
2091
|
-
* const { displayNames, loading, error
|
|
2091
|
+
* const { displayNames, loading, error } = useWorkspaceDisplayNames(lineId);
|
|
2092
2092
|
*
|
|
2093
2093
|
* if (loading) return <div>Loading...</div>;
|
|
2094
2094
|
* if (error) return <div>Error: {error.message}</div>;
|
|
2095
2095
|
*
|
|
2096
|
-
* const workspaceName =
|
|
2096
|
+
* const workspaceName = displayNames['WS01'] || 'WS01'; // Returns display name or fallback
|
|
2097
2097
|
*/
|
|
2098
|
-
declare const useWorkspaceDisplayNames: (
|
|
2098
|
+
declare const useWorkspaceDisplayNames: (lineId?: string, companyId?: string) => UseWorkspaceDisplayNamesReturn;
|
|
2099
2099
|
/**
|
|
2100
2100
|
* @hook useWorkspaceDisplayName
|
|
2101
2101
|
* @summary Hook for fetching a single workspace display name
|
|
@@ -2103,17 +2103,17 @@ declare const useWorkspaceDisplayNames: (companyId?: string, lineId?: string) =>
|
|
|
2103
2103
|
* loading state and error handling. It's useful when you only need one workspace name.
|
|
2104
2104
|
*
|
|
2105
2105
|
* @param {string} workspaceId - The workspace ID to fetch the display name for
|
|
2106
|
-
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2107
2106
|
* @param {string} [lineId] - Optional line ID to filter workspaces
|
|
2107
|
+
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2108
2108
|
* @returns {object} An object containing displayName, loading state, error, and refetch function
|
|
2109
2109
|
*
|
|
2110
2110
|
* @example
|
|
2111
|
-
* const { displayName, loading, error } = useWorkspaceDisplayName('WS01');
|
|
2111
|
+
* const { displayName, loading, error } = useWorkspaceDisplayName('WS01', lineId);
|
|
2112
2112
|
*
|
|
2113
2113
|
* if (loading) return <span>Loading...</span>;
|
|
2114
2114
|
* return <span>{displayName}</span>;
|
|
2115
2115
|
*/
|
|
2116
|
-
declare const useWorkspaceDisplayName: (workspaceId: string,
|
|
2116
|
+
declare const useWorkspaceDisplayName: (workspaceId: string, lineId?: string, companyId?: string) => {
|
|
2117
2117
|
displayName: string;
|
|
2118
2118
|
loading: boolean;
|
|
2119
2119
|
error: Error | null;
|
|
@@ -2126,20 +2126,20 @@ declare const useWorkspaceDisplayName: (workspaceId: string, companyId?: string,
|
|
|
2126
2126
|
* as a Record<string, string> for easy lookup. Useful when you need names for a specific set of workspaces.
|
|
2127
2127
|
*
|
|
2128
2128
|
* @param {string[]} workspaceIds - Array of workspace IDs to fetch display names for
|
|
2129
|
-
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2130
2129
|
* @param {string} [lineId] - Optional line ID to filter workspaces
|
|
2130
|
+
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2131
2131
|
* @returns {object} An object containing displayNamesMap, loading state, error, and refetch function
|
|
2132
2132
|
*
|
|
2133
2133
|
* @example
|
|
2134
|
-
* const {
|
|
2134
|
+
* const { displayNames, loading } = useWorkspaceDisplayNamesMap(['WS01', 'WS02', 'WS03'], lineId);
|
|
2135
2135
|
*
|
|
2136
2136
|
* if (!loading) {
|
|
2137
2137
|
* workspaceIds.forEach(id => {
|
|
2138
|
-
* console.log(`${id}: ${
|
|
2138
|
+
* console.log(`${id}: ${displayNames[id]}`);
|
|
2139
2139
|
* });
|
|
2140
2140
|
* }
|
|
2141
2141
|
*/
|
|
2142
|
-
declare const useWorkspaceDisplayNamesMap: (workspaceIds: string[],
|
|
2142
|
+
declare const useWorkspaceDisplayNamesMap: (workspaceIds: string[], lineId?: string, companyId?: string) => {
|
|
2143
2143
|
displayNames: Record<string, string>;
|
|
2144
2144
|
loading: boolean;
|
|
2145
2145
|
error: Error | null;
|
|
@@ -2957,10 +2957,14 @@ declare const forceRefreshWorkspaceDisplayNames: (lineId?: string) => Promise<vo
|
|
|
2957
2957
|
/**
|
|
2958
2958
|
* Gets workspace display name synchronously
|
|
2959
2959
|
* If not initialized, triggers lazy initialization and returns workspace ID
|
|
2960
|
+
* @param workspaceId - The workspace ID to get display name for
|
|
2961
|
+
* @param lineId - Optional line ID to filter workspaces by line
|
|
2960
2962
|
*/
|
|
2961
2963
|
declare const getWorkspaceDisplayName: (workspaceId: string, lineId?: string) => string;
|
|
2962
2964
|
/**
|
|
2963
2965
|
* Short version of workspace display name (synchronous version for backward compatibility)
|
|
2966
|
+
* @param workspaceId - The workspace ID to get display name for
|
|
2967
|
+
* @param lineId - Optional line ID to filter workspaces by line
|
|
2964
2968
|
*/
|
|
2965
2969
|
declare const getShortWorkspaceDisplayName: (workspaceId: string, lineId?: string) => string;
|
|
2966
2970
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -2083,19 +2083,19 @@ interface UseWorkspaceDisplayNamesReturn {
|
|
|
2083
2083
|
* loading states, error handling, and caching. It automatically fetches workspace display names
|
|
2084
2084
|
* on mount and provides utility methods for accessing individual workspace names.
|
|
2085
2085
|
*
|
|
2086
|
-
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2087
2086
|
* @param {string} [lineId] - Optional line ID to filter workspaces
|
|
2087
|
+
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2088
2088
|
* @returns {UseWorkspaceDisplayNamesReturn} An object containing display names, loading state, error, and utility functions
|
|
2089
2089
|
*
|
|
2090
2090
|
* @example
|
|
2091
|
-
* const { displayNames, loading, error
|
|
2091
|
+
* const { displayNames, loading, error } = useWorkspaceDisplayNames(lineId);
|
|
2092
2092
|
*
|
|
2093
2093
|
* if (loading) return <div>Loading...</div>;
|
|
2094
2094
|
* if (error) return <div>Error: {error.message}</div>;
|
|
2095
2095
|
*
|
|
2096
|
-
* const workspaceName =
|
|
2096
|
+
* const workspaceName = displayNames['WS01'] || 'WS01'; // Returns display name or fallback
|
|
2097
2097
|
*/
|
|
2098
|
-
declare const useWorkspaceDisplayNames: (
|
|
2098
|
+
declare const useWorkspaceDisplayNames: (lineId?: string, companyId?: string) => UseWorkspaceDisplayNamesReturn;
|
|
2099
2099
|
/**
|
|
2100
2100
|
* @hook useWorkspaceDisplayName
|
|
2101
2101
|
* @summary Hook for fetching a single workspace display name
|
|
@@ -2103,17 +2103,17 @@ declare const useWorkspaceDisplayNames: (companyId?: string, lineId?: string) =>
|
|
|
2103
2103
|
* loading state and error handling. It's useful when you only need one workspace name.
|
|
2104
2104
|
*
|
|
2105
2105
|
* @param {string} workspaceId - The workspace ID to fetch the display name for
|
|
2106
|
-
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2107
2106
|
* @param {string} [lineId] - Optional line ID to filter workspaces
|
|
2107
|
+
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2108
2108
|
* @returns {object} An object containing displayName, loading state, error, and refetch function
|
|
2109
2109
|
*
|
|
2110
2110
|
* @example
|
|
2111
|
-
* const { displayName, loading, error } = useWorkspaceDisplayName('WS01');
|
|
2111
|
+
* const { displayName, loading, error } = useWorkspaceDisplayName('WS01', lineId);
|
|
2112
2112
|
*
|
|
2113
2113
|
* if (loading) return <span>Loading...</span>;
|
|
2114
2114
|
* return <span>{displayName}</span>;
|
|
2115
2115
|
*/
|
|
2116
|
-
declare const useWorkspaceDisplayName: (workspaceId: string,
|
|
2116
|
+
declare const useWorkspaceDisplayName: (workspaceId: string, lineId?: string, companyId?: string) => {
|
|
2117
2117
|
displayName: string;
|
|
2118
2118
|
loading: boolean;
|
|
2119
2119
|
error: Error | null;
|
|
@@ -2126,20 +2126,20 @@ declare const useWorkspaceDisplayName: (workspaceId: string, companyId?: string,
|
|
|
2126
2126
|
* as a Record<string, string> for easy lookup. Useful when you need names for a specific set of workspaces.
|
|
2127
2127
|
*
|
|
2128
2128
|
* @param {string[]} workspaceIds - Array of workspace IDs to fetch display names for
|
|
2129
|
-
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2130
2129
|
* @param {string} [lineId] - Optional line ID to filter workspaces
|
|
2130
|
+
* @param {string} [companyId] - Optional company ID to filter workspaces
|
|
2131
2131
|
* @returns {object} An object containing displayNamesMap, loading state, error, and refetch function
|
|
2132
2132
|
*
|
|
2133
2133
|
* @example
|
|
2134
|
-
* const {
|
|
2134
|
+
* const { displayNames, loading } = useWorkspaceDisplayNamesMap(['WS01', 'WS02', 'WS03'], lineId);
|
|
2135
2135
|
*
|
|
2136
2136
|
* if (!loading) {
|
|
2137
2137
|
* workspaceIds.forEach(id => {
|
|
2138
|
-
* console.log(`${id}: ${
|
|
2138
|
+
* console.log(`${id}: ${displayNames[id]}`);
|
|
2139
2139
|
* });
|
|
2140
2140
|
* }
|
|
2141
2141
|
*/
|
|
2142
|
-
declare const useWorkspaceDisplayNamesMap: (workspaceIds: string[],
|
|
2142
|
+
declare const useWorkspaceDisplayNamesMap: (workspaceIds: string[], lineId?: string, companyId?: string) => {
|
|
2143
2143
|
displayNames: Record<string, string>;
|
|
2144
2144
|
loading: boolean;
|
|
2145
2145
|
error: Error | null;
|
|
@@ -2957,10 +2957,14 @@ declare const forceRefreshWorkspaceDisplayNames: (lineId?: string) => Promise<vo
|
|
|
2957
2957
|
/**
|
|
2958
2958
|
* Gets workspace display name synchronously
|
|
2959
2959
|
* If not initialized, triggers lazy initialization and returns workspace ID
|
|
2960
|
+
* @param workspaceId - The workspace ID to get display name for
|
|
2961
|
+
* @param lineId - Optional line ID to filter workspaces by line
|
|
2960
2962
|
*/
|
|
2961
2963
|
declare const getWorkspaceDisplayName: (workspaceId: string, lineId?: string) => string;
|
|
2962
2964
|
/**
|
|
2963
2965
|
* Short version of workspace display name (synchronous version for backward compatibility)
|
|
2966
|
+
* @param workspaceId - The workspace ID to get display name for
|
|
2967
|
+
* @param lineId - Optional line ID to filter workspaces by line
|
|
2964
2968
|
*/
|
|
2965
2969
|
declare const getShortWorkspaceDisplayName: (workspaceId: string, lineId?: string) => string;
|
|
2966
2970
|
/**
|