@eintrek/erp-shell 0.1.59 → 0.1.61

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.
@@ -18,5 +18,10 @@ export interface UseOrganizationIdStateResult {
18
18
  *
19
19
  * On set, writes through to localStorage + cookie before flipping React state
20
20
  * so all readers see a consistent value across navigations.
21
+ *
22
+ * The tab's own organisation (organization/active-organization.ts) follows
23
+ * this state, and it is written synchronously — in the initialiser and at the
24
+ * start of every set — because requests read it: an effect would run after
25
+ * the children's effects, which is where their queries start.
21
26
  */
22
27
  export declare function useOrganizationIdState(initialOrganizationId: string | null | undefined, actions: OrganizationCookieActions): UseOrganizationIdStateResult;
@@ -1,3 +1,11 @@
1
1
  import { AxiosInstance } from "axios";
2
+ declare module "axios" {
3
+ interface AxiosRequestConfig {
4
+ /** Send this request without X-Organization-ID. */
5
+ erpWithoutOrganization?: boolean;
6
+ /** Send this request for this organisation, whatever the tab has active. */
7
+ erpOrganizationId?: string;
8
+ }
9
+ }
2
10
  declare const instance: AxiosInstance;
3
11
  export default instance;
@@ -0,0 +1 @@
1
+ export declare function retryWithStoredOrganizations<T>(config: Record<string, unknown> | undefined, status: number | undefined, send: (config: Record<string, unknown>) => Promise<T>): Promise<T | undefined>;
package/dist/index.d.ts CHANGED
@@ -23,6 +23,7 @@ export { OrganizationSwitcher, type OrganizationSwitcherProps, type Organization
23
23
  export { SidebarHeader } from "./navigation/sidebar-header";
24
24
  export { AppSidebar, type AppSidebarProps } from "./navigation/app-sidebar";
25
25
  export { AppLayoutShell, type AppLayoutShellProps, type AppLayoutShellOrganization, } from "./navigation/app-layout-shell";
26
+ export { resolveUrlOrgGate, findOrganizationForCode, resolveStaleOrganization, type StaleOrganizationRecovery, type UrlOrgGate, type UrlOrgGateInput, type OrganizationsStatus, } from "./navigation/url-org-gate";
26
27
  export { type ShellChrome, type WorkspaceHeaderTone, WORKSPACE_HEADER_VARS, WORKSPACE_LIGHT_HEADER_VARS, } from "./navigation/chrome";
27
28
  export { WorkspaceBrand, type WorkspaceBrandProps } from "./navigation/workspace-brand";
28
29
  export { SidebarHelpCard, SidebarHelpLink, type SidebarHelpCardProps, type SidebarHelpLinkProps, } from "./navigation/sidebar-help-card";
@@ -43,6 +44,7 @@ export { ThemeProvider } from "./providers/theme-provider";
43
44
  export { FeatureFlagsProvider, useFeatureFlags, useFeatureFlag, type FeatureFlags, } from "./providers/feature-flags-provider";
44
45
  export { ReactQueryProvider } from "./providers/react-query-provider";
45
46
  export { getQueryClientConfig } from "./providers/react-query-config";
47
+ export { organizationScopedQueryHash, shouldRetryQuery, } from "./providers/query-scope";
46
48
  export { PermissionRulesProvider, usePermissionRules, type PermissionRulesData, type PermissionRulesMap, type ApiPoliciesMap, type PolicyRule, type PermissionRulesProviderProps, } from "./providers/permission-rules-context";
47
49
  export { SessionBackedProfileCacheSeeder, type SessionBackedProfileCacheSeederProps, } from "./providers/session-backed-profile-cache-seeder";
48
50
  export { default as axiosInstance } from "./http/axios";
@@ -52,5 +54,7 @@ export { unwrapApiResponse } from "./http/unwrap";
52
54
  export { getAccessToken, clearAccessTokenCache, } from "./http/auth-token-manager";
53
55
  export { runGlobalRequestPrecheck } from "./http/request-precheck";
54
56
  export { getOrganizationId, setOrganizationId, clearOrganizationId, } from "./organization/organization-id";
57
+ export { getRequestOrganizationId, getTabOrganizationId, setTabOrganizationId, setKnownOrganizationIds, isKnownStaleOrganizationId, withoutOrganization, WITHOUT_ORGANIZATION_FLAG, FOR_ORGANIZATION_FIELD, getStoredOrganizationIds, clearStoredOrganization, } from "./organization/active-organization";
58
+ export { retryWithStoredOrganizations } from "./http/organization-fallback";
55
59
  export declare const updateOrganizationId: (organizationId: string | null) => void;
56
60
  export declare const getAxiosErrorMessage: (error: unknown) => string;