@admin-layout/client 12.2.4-alpha.7 → 12.2.4-alpha.71

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.
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAgBA;;;;;GAKG;AACH,eAAO,MAAM,cAAc,kCAMzB,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,MAAM;;GAuF7F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,kBAAkB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE;;;;CAAA;;;GA8GpE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAQrE"}
1
+ {"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,eAAO,MAAM,cAAc,kCAMzB,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,MAAM;;GAoG7F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,kBAAkB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE;;;;CAAA;;;GA4HpE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAQrE"}
@@ -1,4 +1,4 @@
1
- import {createCookie}from'@remix-run/node';import {ConfigCollectionName,ConfigFragmentName,ConfigurationSchemaId}from'common';import {GetPageSettingsDocument}from'common/graphql';import {merge}from'lodash-es';import {print}from'graphql';import {parseEnvLayoutSettings}from'../../utils/parseEnvUiLayoutSettings.js';import {config}from'../../config/env-config.js';import'../../config/defaultSettings.js';import {generateCdecodeUri,DEFAULT_CONTRIBUTION_TENANT_ID}from'@adminide-stack/core';/**
1
+ import {createCookie}from'@remix-run/node';import {ConfigCollectionName,ConfigFragmentName,ConfigurationSchemaId}from'common';import {GetPageSettingsDocument}from'common/graphql';import {merge}from'lodash-es';import {print}from'graphql';import {parseEnvLayoutSettings}from'../../utils/parseEnvUiLayoutSettings.js';import {config}from'../../config/env-config.js';import {DEFAULT_SETTINGS}from'../../config/defaultSettings.js';import {generateCdecodeUri,DEFAULT_CONTRIBUTION_TENANT_ID}from'@adminide-stack/core';/**
2
2
  * Cookie configuration for storing user settings
3
3
  * - Max age: 30 days
4
4
  * - Client-side accessible for dynamic UI updates
@@ -78,20 +78,25 @@ async function fetchPageSettingsWithFetch(request, overrideIdentifier) {
78
78
  }),
79
79
  });
80
80
  if (!response.ok) {
81
- console.error('❌ GraphQL fetch failed with status:', response.status);
82
- throw new Error(`GraphQL request failed: ${response.status} ${response.statusText}`);
81
+ console.warn('⚠️ GraphQL fetch failed with status:', response.status, '- Backend may be down, using empty settings');
82
+ // Return empty data structure instead of throwing to allow layout to render
83
+ return { data: { pageSettings: { settings: null } } };
83
84
  }
84
85
  const result = await response.json();
85
86
  if (result.errors) {
86
- console.error('❌ GraphQL errors:', JSON.stringify(result.errors, null, 2));
87
- throw new Error(`GraphQL errors: ${JSON.stringify(result.errors)}`);
87
+ console.warn('⚠️ GraphQL errors:', JSON.stringify(result.errors, null, 2), '- Backend may be down, using empty settings');
88
+ // Return empty data structure instead of throwing to allow layout to render
89
+ return { data: { pageSettings: { settings: null } } };
88
90
  }
89
91
  console.log('✅ Settings fetched successfully (from Redis-cached backend)');
90
92
  return { data: result.data };
91
93
  }
92
94
  catch (error) {
93
- console.error('❌ Failed to fetch settings with fetch:', error);
94
- throw error;
95
+ // Log error but return empty data instead of throwing to allow layout to render
96
+ console.warn('⚠️ Failed to fetch settings (backend may be down):', error?.message || error);
97
+ console.warn('⚠️ Returning empty settings to allow layout to render');
98
+ // Return empty data structure instead of throwing
99
+ return { data: { pageSettings: { settings: null } } };
95
100
  }
96
101
  }
97
102
  /**
@@ -137,12 +142,20 @@ async function settingsLoaderUtil({ request, context, params }) {
137
142
  const deviceType = getDeviceType(userAgent);
138
143
  // 2. Fetch settings from GraphQL backend with device-specific overrides
139
144
  // Override identifier format: "[desktop]" or "[mobile]"
140
- const overrideIdentifier = `[${deviceType}]`;
141
- const result = await fetchPageSettingsWithFetch(request, overrideIdentifier);
142
- // console.log('ddRESULT=========>', JSON.stringify(result));
143
- const pageBackendSettings = result?.data?.pageSettings?.settings
144
- ? JSON.parse(JSON.stringify(result?.data?.pageSettings?.settings))
145
- : null;
145
+ let pageBackendSettings = null;
146
+ try {
147
+ const overrideIdentifier = `[${deviceType}]`;
148
+ const result = await fetchPageSettingsWithFetch(request, overrideIdentifier);
149
+ // console.log('ddRESULT=========>', JSON.stringify(result));
150
+ pageBackendSettings = result?.data?.pageSettings?.settings
151
+ ? JSON.parse(JSON.stringify(result?.data?.pageSettings?.settings))
152
+ : null;
153
+ }
154
+ catch (error) {
155
+ // If fetchPageSettingsWithFetch still throws (shouldn't happen now, but defensive coding)
156
+ console.warn('⚠️ Error fetching page settings, using null:', error?.message || error);
157
+ pageBackendSettings = null;
158
+ }
146
159
  // 3. Parse request payload (only available for POST/PUT requests in actions)
147
160
  let requestPayload = {};
148
161
  try {
@@ -196,7 +209,12 @@ async function settingsLoaderUtil({ request, context, params }) {
196
209
  }
197
210
  // 7. Merge all settings sources in priority order (later sources override earlier)
198
211
  // Priority: GraphQL backend → Environment → Cookie + Request payload
199
- const fullSettings = merge({}, pageBackendSettings, envLayoutSettings, cookieUpdatedSettings);
212
+ // Use DEFAULT_SETTINGS as fallback when backend is down (null, undefined, or empty object)
213
+ const effectiveBackendSettings = !pageBackendSettings ||
214
+ (typeof pageBackendSettings === 'object' && Object.keys(pageBackendSettings).length === 0)
215
+ ? DEFAULT_SETTINGS
216
+ : pageBackendSettings;
217
+ const fullSettings = merge({}, effectiveBackendSettings, envLayoutSettings, cookieUpdatedSettings);
200
218
  // 8. Validate final merged settings - detect and remove numeric key corruption
201
219
  const numericKeysAfterFinalMerge = Object.keys(fullSettings).filter((k) => /^\d+$/.test(k));
202
220
  if (numericKeysAfterFinalMerge.length > 0) {
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;AAyCG,IAAA,IAAA,EAAA,GAAA;AACH,IAAA,MAAA,EAAA,MAAA,CAAA,MAAsB,GAAA,MAAA,CAAA,UAAA,GAAA,SAA2B;;AAuFhD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG,QAAA,WAAA,EAAA,QAAA;AACH,QAAA,OAAA;;;;AAAqE;;;AA8GpE,QAAA,eAAA,EAAA,qCAAA;AAED,QAAA,MAAA,EAAA,UAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AA0CG,IAAA,QAAA,EAAA,KAAA;AACH,IAAA,IAAA,EAAA,GAAA;;AAoGC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG,IAAA,MAAA,SAAA,GAAA;AACH,QAAA,WAAA,EAAA,QAAsB;;;;AAA+C;;;AA4HpE,QAAA,cAAA,EAAA,kBAAA;AAED,QAAA,eAAA,EAAgB,qCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -76,6 +76,96 @@ export declare const SHARED_VIEW_CONFIG: {
76
76
  };
77
77
  };
78
78
  };
79
+ /**
80
+ * Comprehensive default settings to use when backend is down
81
+ * These ensure header, footer, and all UI components render properly
82
+ */
83
+ export declare const DEFAULT_SETTINGS: {
84
+ readonly header: {
85
+ readonly showHeader: true;
86
+ readonly showMenu: false;
87
+ readonly menuHeaderRender: true;
88
+ readonly showLogo: true;
89
+ readonly showSearchSlot: true;
90
+ readonly showRightContent: true;
91
+ readonly showMenuToggle: true;
92
+ readonly showBackButton: true;
93
+ readonly showPageTitle: true;
94
+ readonly showActionButtons: true;
95
+ readonly position: "fixed";
96
+ readonly height: "64px";
97
+ readonly backgroundColor: "inherit";
98
+ readonly elevation: 2;
99
+ readonly searchBarRender: true;
100
+ readonly searchBarBehavior: SearchBarBehavior.PERMANENT;
101
+ readonly searchBarOverlay: true;
102
+ readonly scrollThreshold: 50;
103
+ };
104
+ readonly footer: {
105
+ readonly showFooter: true;
106
+ };
107
+ readonly loginThemeColor: "blue";
108
+ readonly loginFormPosition: "center";
109
+ readonly loginSocials: "{\"Google\":true,\"Apple\":true,\"Facebook\":true}";
110
+ readonly loginBackgroundImage: any;
111
+ readonly verifyFormLayout: "center";
112
+ readonly verifyFormImageUrl: "";
113
+ readonly verifyFormBackgroundStyle: "color";
114
+ readonly verifyFormVisibleFields: "[\"firstName\",\"lastName\",\"username\",\"companyName\",\"workEmail\",\"phoneNumber\",\"dateOfBirth\"]";
115
+ readonly verifyFormShowSkipButton: false;
116
+ readonly organization: {
117
+ readonly members: {
118
+ readonly invitations: {
119
+ readonly showEmailInvite: true;
120
+ readonly showSmsInvite: true;
121
+ readonly showQrCodeInvite: true;
122
+ readonly showInviteLink: true;
123
+ };
124
+ };
125
+ };
126
+ readonly logo: "https://cdmbase.s3.ca-central-1.amazonaws.com/favicon-new-128.svg";
127
+ readonly themeType: "light";
128
+ readonly theme: "default";
129
+ readonly navTheme: "light";
130
+ readonly primaryColor: "#1890ff";
131
+ readonly colorPrimary: "#1677FF";
132
+ readonly secondaryColor: "#4A5568";
133
+ readonly layout: "mix";
134
+ readonly contentWidth: ContentWidth;
135
+ readonly fixedHeader: true;
136
+ readonly fixedSidebar: true;
137
+ readonly colorWeak: false;
138
+ readonly title: "CDMBase LLC";
139
+ readonly iconfontUrl: "";
140
+ readonly showSettingPanel: true;
141
+ readonly titleColor: "#2869E0";
142
+ readonly language: "en-US";
143
+ readonly fontFamily: "Poppins, sans-serif";
144
+ readonly titleFontWeight: "700";
145
+ readonly titleHeight: "30px";
146
+ readonly titleFontSize: "1.8rem";
147
+ readonly letterSpacings: "1px";
148
+ readonly navigationMode: NavigationMode;
149
+ readonly sideMenuType: SideMenuType;
150
+ readonly splitMenus: false;
151
+ readonly upperMenuDividerName: "Navigation";
152
+ readonly middleMenuDividerName: "Dashboard";
153
+ readonly lowerMenuDividerName: "Admin";
154
+ readonly background: {
155
+ readonly type: "video";
156
+ readonly color: "inherit";
157
+ readonly image: "";
158
+ readonly video: "https://d1tsi4dpgrrap2.cloudfront.net/_site/pubng-mountain-view-orig.webm";
159
+ readonly videoThumbnail: "https://d1tsi4dpgrrap2.cloudfront.net/_site/pubng-mountain-view.webp";
160
+ };
161
+ readonly components: readonly [];
162
+ readonly hiddenMenuKeys: readonly [];
163
+ readonly hiddenMenuCategories: readonly [];
164
+ readonly activeComponent: any;
165
+ readonly siderBgColor: "#000000";
166
+ readonly headerBgColor: "#000000";
167
+ readonly textColor: "#a19c9c";
168
+ };
79
169
  export type ISettings = ProSettings & {
80
170
  logo: string;
81
171
  showS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ACF,MAAM,EAAE;gBACJ,MAAM,EAAE;oBACJ,QAAQ,EAAE,OAAO,CAAC;oBAClB,cAAc,EAAE,OAAO,CAAC;oBACxB,gBAAgB,EAAE,OAAO,CAAC;oBAC1B,cAAc,EAAE,OAAO,CAAC;oBACxB,cAAc,EAAE,OAAO,CAAC;oBACxB,aAAa,EAAE,OAAO,CAAC;oBACvB,iBAAiB,EAAE,OAAO,CAAC;oBAC3B,QAAQ,EAAE,MAAM,CAAC;oBACjB,MAAM,EAAE,MAAM,CAAC;oBACf,eAAe,EAAE,MAAM,CAAC;oBACxB,SAAS,EAAE,MAAM,CAAC;oBAClB,UAAU,EAAE,OAAO,CAAC;oBACpB,QAAQ,EAAE,OAAO,CAAC;oBAClB,gBAAgB,EAAE,OAAO,CAAC;oBAC1B,eAAe,EAAE,OAAO,CAAC;oBACzB,iBAAiB,EAAE,iBAAiB,CAAC;oBACrC,gBAAgB,EAAE,OAAO,CAAC;oBAC1B,eAAe,EAAE,MAAM,CAAC;iBAC3B,CAAC;gBACF,UAAU,EAAE;oBACR,IAAI,EAAE,MAAM,CAAC;oBACb,KAAK,EAAE,MAAM,CAAC;oBACd,KAAK,EAAE,MAAM,CAAC;oBACd,KAAK,EAAE,MAAM,CAAC;iBACjB,CAAC;gBACF,MAAM,EAAE;oBACJ,UAAU,EAAE,OAAO,CAAC;iBACvB,CAAC;aACL,CAAC;SACL,CAAC;KACL,CACJ,CAAC;IACF,UAAU,EAAE,GAAG,EAAE,CAAC;IAClB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC"}
@@ -67,4 +67,94 @@ const SHARED_VIEW_CONFIG = {
67
67
  },
68
68
  footer: { showFooter: true },
69
69
  },
70
- };export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,SEARCH_TYPES,SHARED_VIEW_CONFIG};//# sourceMappingURL=defaultSettings.js.map
70
+ };
71
+ /**
72
+ * Comprehensive default settings to use when backend is down
73
+ * These ensure header, footer, and all UI components render properly
74
+ */
75
+ const DEFAULT_SETTINGS = {
76
+ header: {
77
+ showHeader: true,
78
+ showMenu: false,
79
+ menuHeaderRender: true,
80
+ showLogo: true,
81
+ showSearchSlot: true,
82
+ showRightContent: true,
83
+ showMenuToggle: true,
84
+ showBackButton: true,
85
+ showPageTitle: true,
86
+ showActionButtons: true,
87
+ position: 'fixed',
88
+ height: '64px',
89
+ backgroundColor: 'inherit',
90
+ elevation: 2,
91
+ searchBarRender: true,
92
+ searchBarBehavior: SearchBarBehavior.PERMANENT,
93
+ searchBarOverlay: true,
94
+ scrollThreshold: 50,
95
+ },
96
+ footer: {
97
+ showFooter: true,
98
+ },
99
+ loginThemeColor: 'blue',
100
+ loginFormPosition: 'center',
101
+ loginSocials: '{"Google":true,"Apple":true,"Facebook":true}',
102
+ loginBackgroundImage: null,
103
+ verifyFormLayout: 'center',
104
+ verifyFormImageUrl: '',
105
+ verifyFormBackgroundStyle: 'color',
106
+ verifyFormVisibleFields: '["firstName","lastName","username","companyName","workEmail","phoneNumber","dateOfBirth"]',
107
+ verifyFormShowSkipButton: false,
108
+ organization: {
109
+ members: {
110
+ invitations: {
111
+ showEmailInvite: true,
112
+ showSmsInvite: true,
113
+ showQrCodeInvite: true,
114
+ showInviteLink: true,
115
+ },
116
+ },
117
+ },
118
+ logo: 'https://cdmbase.s3.ca-central-1.amazonaws.com/favicon-new-128.svg',
119
+ themeType: 'light',
120
+ theme: 'default',
121
+ navTheme: 'light',
122
+ primaryColor: '#1890ff',
123
+ colorPrimary: '#1677FF',
124
+ secondaryColor: '#4A5568',
125
+ layout: 'mix',
126
+ contentWidth: 'Fluid',
127
+ fixedHeader: true,
128
+ fixedSidebar: true,
129
+ colorWeak: false,
130
+ title: 'CDMBase LLC',
131
+ iconfontUrl: '',
132
+ showSettingPanel: true,
133
+ titleColor: '#2869E0',
134
+ language: 'en-US',
135
+ fontFamily: 'Poppins, sans-serif',
136
+ titleFontWeight: '700',
137
+ titleHeight: '30px',
138
+ titleFontSize: '1.8rem',
139
+ letterSpacings: '1px',
140
+ navigationMode: 'topbar',
141
+ sideMenuType: 'perplexLayout',
142
+ splitMenus: false,
143
+ upperMenuDividerName: 'Navigation',
144
+ middleMenuDividerName: 'Dashboard',
145
+ lowerMenuDividerName: 'Admin',
146
+ background: {
147
+ type: 'video',
148
+ color: 'inherit',
149
+ image: '',
150
+ video: 'https://d1tsi4dpgrrap2.cloudfront.net/_site/pubng-mountain-view-orig.webm',
151
+ videoThumbnail: 'https://d1tsi4dpgrrap2.cloudfront.net/_site/pubng-mountain-view.webp',
152
+ },
153
+ components: [],
154
+ hiddenMenuKeys: [],
155
+ hiddenMenuCategories: [],
156
+ activeComponent: null,
157
+ siderBgColor: '#000000',
158
+ headerBgColor: '#000000',
159
+ textColor: '#a19c9c',
160
+ };export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,DEFAULT_SETTINGS,SEARCH_TYPES,SHARED_VIEW_CONFIG};//# sourceMappingURL=defaultSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaultSettings.js","sources":["../../src/config/defaultSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"0DACA;AACS,MAAA,cAAc;AAGvB,IAAA,qBAAa;qBACgB;;;;AAI3B,MAAA,cAAA,GAAA;AAEF,IAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;AAiBE,MAAA,YAAA,GAAA;AAEF,IAAA,MAAA,EAAA;;;;AAIW,MAAA,SAAA,GAAA;AAEX,IAAA,MAAA;AAgBA,IAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"defaultSettings.js","sources":["../../src/config/defaultSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"0DACA;AACS,MAAA,cAAc;AAGvB,IAAA,qBAAa;qBACgB;;;;AAI3B,MAAA,cAAA,GAAA;AAEF,IAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;AAiBE,MAAA,YAAA,GAAA;AAEF,IAAA,MAAA,EAAA;;;;AAIW,MAAA,SAAA,GAAA;AAEX,IAAA,MAAA;AAgBA,IAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwBE,UAAA,EAAA,IAAA;AAEF,QAAA,QAAA,EAAA,KAAA;;;AAGG,QAAA,cAAA,EAAA,IAAA;AACH,QAAA,gBAAa,EAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{safeLocalStorage}from'./utils/storage.js';export{getStorageMode,isSpaMode,settingsStorage}from'./utils/settingsStorage.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';export{useLayoutSettings}from'./hooks/useLayoutSettings.js';export{usePermissionAutoFetch,useSetting,useSettingsLoader}from'@adminide-stack/platform-client';export{ClientOnly}from'./hooks/Client-only.js';export{blue}from'./colors/presets/blue.js';export{brinkPink}from'./colors/presets/brinkPink.js';export{cyan}from'./colors/presets/cyan.js';export{green}from'./colors/presets/green.js';export{lime}from'./colors/presets/lime.js';export{orange}from'./colors/presets/orange.js';export{pink}from'./colors/presets/pink.js';export{purple}from'./colors/presets/purple.js';export{red}from'./colors/presets/red.js';export{skyBlue}from'./colors/presets/skyBlue.js';export{turquoise}from'./colors/presets/turquoise.js';export{yellow}from'./colors/presets/yellow.js';export{white}from'./colors/presets/white.js';export{black}from'./colors/presets/black.js';export{colorList,getThemeColors}from'./colors/colorsList.js';//# sourceMappingURL=index.js.map
1
+ export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{safeLocalStorage}from'./utils/storage.js';export{getStorageMode,isSpaMode,settingsStorage}from'./utils/settingsStorage.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,DEFAULT_SETTINGS,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';export{useLayoutSettings}from'./hooks/useLayoutSettings.js';export{usePermissionAutoFetch,useSetting,useSettingsLoader}from'@adminide-stack/platform-client';export{ClientOnly}from'./hooks/Client-only.js';export{blue}from'./colors/presets/blue.js';export{brinkPink}from'./colors/presets/brinkPink.js';export{cyan}from'./colors/presets/cyan.js';export{green}from'./colors/presets/green.js';export{lime}from'./colors/presets/lime.js';export{orange}from'./colors/presets/orange.js';export{pink}from'./colors/presets/pink.js';export{purple}from'./colors/presets/purple.js';export{red}from'./colors/presets/red.js';export{skyBlue}from'./colors/presets/skyBlue.js';export{turquoise}from'./colors/presets/turquoise.js';export{yellow}from'./colors/presets/yellow.js';export{white}from'./colors/presets/white.js';export{black}from'./colors/presets/black.js';export{colorList,getThemeColors}from'./colors/colorsList.js';//# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{safeLocalStorage}from'./utils/storage.js';export{getStorageMode,isSpaMode,settingsStorage}from'./utils/settingsStorage.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';//# sourceMappingURL=index.native.js.map
1
+ export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{safeLocalStorage}from'./utils/storage.js';export{getStorageMode,isSpaMode,settingsStorage}from'./utils/settingsStorage.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,DEFAULT_SETTINGS,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';//# sourceMappingURL=index.native.js.map
@@ -57,6 +57,10 @@ export interface MenuDataItem {
57
57
  * @author @sri
58
58
  */
59
59
  modal?: boolean;
60
+ /**
61
+ * Policy paths that must all resolve to boolean true for the menu item to be visible.
62
+ */
63
+ requiredFeatures?: string[];
60
64
  [key: string]: any;
61
65
  }
62
66
  export interface Route extends MenuDataItem {
@@ -1 +1 @@
1
- {"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../src/interfaces/typings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAC;AAE7B,OAAO,EAAE,mBAAmB,IAAI,eAAe,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAElF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC5E,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;CAC3C;AAED,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACxB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,KAAM,SAAQ,Y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
- import {LOG_APPLICATION_ERROR,DISMISS_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'../../constants/error.js';const setApplicationError = (payload) => {
1
+ import {DISMISS_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS,LOG_APPLICATION_ERROR}from'../../constants/error.js';const setApplicationError = (payload) => {
2
2
  return ({
3
3
  type: LOG_APPLICATION_ERROR,
4
4
  payload,
@@ -1,4 +1,4 @@
1
- import {useDispatch,useSelector}from'react-redux';/* eslint-disable @typescript-eslint/no-restricted-imports */
1
+ import {useSelector,useDispatch}from'react-redux';/* eslint-disable @typescript-eslint/no-restricted-imports */
2
2
  // Use throughout app instead of plain `useDispatch` and `useSelector`
3
3
  // export const useAppDispatch = () => useDispatch<AppDispatch>();
4
4
  const useAppDispatch = () => useDispatch();
@@ -10,7 +10,7 @@ import { type IMenuData } from '@common-stack/client-react/lib/interfaces/menu';
10
10
  * @param authorities
11
11
  * @param isTopLevel - Internal flag to prevent logging during recursion
12
12
  */
13
- export declare const menuDataRender: (menuList: IMenuData[], authorities: any, isTopLevel?: boolean) => IMenuData[];
13
+ export declare const menuDataRender: (menuList: IMenuData[], authorities: any, policiesOrIsTopLevel?: Record<string, unknown> | null | boolean, isTopLevel?: boolean) => IMenuData[];
14
14
  export declare function transformData(data: any): any;
15
15
  export declare function setLocale(obj: any, parentName?: string): void;
16
16
  export declare const addProLayoutParentKeys: (menuData?: any[], parentKeys?: string[]) => any[];
@@ -1 +1 @@
1
- {"version":3,"file":"menuUtils.d.ts","sourceRoot":"","sources":["../../src/utils/menuUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAChF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,SAAS,EAAE,EAAE,gBAAW,EAAE,oBAAiB,KAAG,SAAS,EAuB/F,CAAC;AAMF,wBAAgB,aAAa,CAAC,IAAI,KAAA,OAcjC;AACD,wBAAgB,SAAS,CAAC,GAAG,KAAA,EAAE,UAAU,SAAK,QAO7C;AAED,eAAO,MAAM,sBAAsB,GAAI,WAAW,GAAG,EAAE,EAAE,aAAY,MAAM,EAAO,UASjF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,WAAM,UAgB5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,KAAA,QAY9C"}
1
+ {"version":3,"file":"menuUtils.d.ts","sourceRoot":"","sources":["../../src/utils/menuUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAChF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GACvB,UAAU,SAAS,EAAE,EACrB,gBAAW,EACX,uBAAuB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,OAAO,EAC/D,oBAAiB,KAClB,SAAS,EAgCX,CAAC;AAMF,wBAAgB,aAAa,CAAC,IAAI,KAAA,OAcjC;AACD,wBAAgB,SAAS,CAAC,GAAG,KAAA,EAAE,UAAU,SAAK,QAO7C;AAED,eAAO,MAAM,sBAAsB,GAAI,WAAW,GAAG,EAAE,EAAE,aAAY,MAAM,EAAO,UASjF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,WAAM,UAgB5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,KAAA,QAY9C"}
@@ -9,8 +9,10 @@ import {get,cloneDeep,sortBy}from'lodash-es';import {PermissionType}from'common'
9
9
  * @param authorities
10
10
  * @param isTopLevel - Internal flag to prevent logging during recursion
11
11
  */
12
- const menuDataRender = (menuList, authorities, isTopLevel = true) => {
13
- if (isTopLevel) {
12
+ const menuDataRender = (menuList, authorities, policiesOrIsTopLevel, isTopLevel = true) => {
13
+ const policies = typeof policiesOrIsTopLevel === 'boolean' ? undefined : policiesOrIsTopLevel;
14
+ const shouldLog = typeof policiesOrIsTopLevel === 'boolean' ? policiesOrIsTopLevel : isTopLevel;
15
+ if (shouldLog) {
14
16
  logger.trace('menuDataRender execution started');
15
17
  }
16
18
  const sortedMenuList = sortMenusByPriority(menuList);
@@ -22,12 +24,19 @@ const menuDataRender = (menuList, authorities, isTopLevel = true) => {
22
24
  return authority.some((key) => PermissionType.Allow === get(authorities, key));
23
25
  }
24
26
  return true;
27
+ })
28
+ .filter((item) => {
29
+ const requiredFeatures = item.requiredFeatures;
30
+ if (Array.isArray(requiredFeatures) && requiredFeatures.length) {
31
+ return requiredFeatures.every((key) => get(policies, key) === true);
32
+ }
33
+ return true;
25
34
  })
26
35
  .map((item) => {
27
36
  // return Authorized.check(item.authority, localItem, null) as MenuDataItem;
28
37
  return {
29
38
  ...item,
30
- children: item.children ? menuDataRender(item.children, authorities, false) : undefined,
39
+ children: item.children ? menuDataRender(item.children, authorities, policies, false) : undefined,
31
40
  };
32
41
  }));
33
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"menuUtils.js","sources":["../../src/utils/menuUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAcG;AACH;AA6BA;AAeA,MAAA,uCAA+B,EAAU,UAAK,GAAA,IAO7C,KAAA;AAED,IAAA,IAAA,UAAO,EAAA;AAWP,QAAA,MAAA,CAAO,KAAA,CAAM,kCAA0B,CAAA;AAkBvC,IAAA;;;AAGG;AACH,SAAA,MAAA,CAAA,CAAA,IAAA,KAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"menuUtils.js","sources":["../../src/utils/menuUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAcG;AACH;AA2CA;AAeA,MAAA,uCAA+B,EAAU,oBAOxC,EAAA,UAAA,GAAA,IAAA,KAAA;AAED,IAAA,MAAA,QAAO,GAAM,OAAA,oBAA0B,KAAA,SAAgB,GAAE,SAAA,GAAY,oBASnE;AAEF,IAAA,MAAA,SAAO,GAAM,OAAA,oBAA0B,KAAA,gCAgBrC,GAAA,UAAA;AAEF,IAAA,IAAA,SAAA,EAAA;;;AAGG,IAAA,MAAA,cAAA,GAAA,mBAAA,CAAA,QAAA,CAAA;AACH,IAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=menuUtils.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menuUtils.test.d.ts","sourceRoot":"","sources":["../../src/utils/menuUtils.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=seperatedMenus.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"seperatedMenus.test.d.ts","sourceRoot":"","sources":["../../src/utils/seperatedMenus.test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/client",
3
- "version": "12.2.4-alpha.7",
3
+ "version": "12.2.4-alpha.71",
4
4
  "description": "Sample client for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -26,7 +26,7 @@
26
26
  "serialize-error": "^8.0.0"
27
27
  },
28
28
  "devDependencies": {
29
- "common": "12.2.4-alpha.7",
29
+ "common": "12.2.4-alpha.67",
30
30
  "rc-menu": "^9.16.1"
31
31
  },
32
32
  "peerDependencies": {
@@ -41,8 +41,8 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
+ "gitHead": "850c24caa93c81b18c540cc1552f69ad69d137d7",
44
45
  "typescript": {
45
46
  "definition": "lib/index.d.ts"
46
- },
47
- "gitHead": "4abb9cf29404c9ad8f6dac81875cd202ea7898dc"
47
+ }
48
48
  }