@alfresco/aca-shared 8.1.0-39393175653 → 8.1.0-39437794237

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.
@@ -3576,6 +3576,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
3576
3576
  }]
3577
3577
  }] });
3578
3578
 
3579
+ /*!
3580
+ * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
3581
+ *
3582
+ * Alfresco Example Content Application
3583
+ *
3584
+ * This file is part of the Alfresco Example Content Application.
3585
+ * If the software was purchased under a paid Alfresco license, the terms of
3586
+ * the paid license agreement will prevail. Otherwise, the software is
3587
+ * provided under the following open source license terms:
3588
+ *
3589
+ * The Alfresco Example Content Application is free software: you can redistribute it and/or modify
3590
+ * it under the terms of the GNU Lesser General Public License as published by
3591
+ * the Free Software Foundation, either version 3 of the License, or
3592
+ * (at your option) any later version.
3593
+ *
3594
+ * The Alfresco Example Content Application is distributed in the hope that it will be useful,
3595
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3596
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3597
+ * GNU Lesser General Public License for more details.
3598
+ *
3599
+ * You should have received a copy of the GNU Lesser General Public License
3600
+ * from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
3601
+ */
3602
+ function toPayload(value) {
3603
+ if (typeof value === 'object') {
3604
+ return value?.error ? value : null;
3605
+ }
3606
+ if (typeof value === 'string') {
3607
+ try {
3608
+ const parsed = JSON.parse(value);
3609
+ return parsed?.error ? parsed : null;
3610
+ }
3611
+ catch {
3612
+ return null;
3613
+ }
3614
+ }
3615
+ return null;
3616
+ }
3617
+ function parsePayload(error) {
3618
+ return toPayload(error?.response?.body) ?? toPayload(error?.message);
3619
+ }
3620
+ /**
3621
+ * Extracts the human readable message the backend sent with a failed API call.
3622
+ *
3623
+ * @param error failed call error
3624
+ * @param fallback translation key to use when the response carried no message
3625
+ * @returns the backend message, or `fallback`
3626
+ */
3627
+ function getApiErrorMessage(error, fallback = 'CORE.MESSAGES.ERRORS.GENERIC') {
3628
+ const briefSummary = parsePayload(error)?.error?.briefSummary;
3629
+ return briefSummary?.trim() ? briefSummary : fallback;
3630
+ }
3631
+
3579
3632
  /*!
3580
3633
  * Copyright © 2005-2026 Hyland Software, Inc. and its affiliates. All rights reserved.
3581
3634
  *
@@ -3604,5 +3657,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.22", ngImpo
3604
3657
  * Generated bundle index. Do not edit.
3605
3658
  */
3606
3659
 
3607
- export { AppExtensionService, AppHookService, AppService, AppSettingsService, AppSharedRuleGuard, AutoDownloadService, ContentApiService, ContextActionsDirective, DefaultExtensionLoaderFactory, DefaultMimeTypes, DocumentBasePageService, DocumentBasePageServiceMock, EXTENSION_DATA_LOADERS, ExtensionsDataLoaderGuard, GenericErrorComponent, InfoDrawerComponent, LibTestingModule, LockedByComponent, NavigationHistoryService, NodePermissionService, OpenInAppComponent, PageComponent, PageLayoutComponent, PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutModule, PaginationDirective, PaginationStateBaseService, PaginationStateService, PluginEnabledGuard, RouterExtensionService, ToolbarActionComponent, ToolbarButtonComponent, ToolbarButtonType, ToolbarComponent, ToolbarMenuComponent, ToolbarMenuItemComponent, UserProfileService, discoveryApiServiceMockValue, initialState, isLibrary, isLocked, isWorkingCopy, provideContentAppExtensions, resetInvoked };
3660
+ export { AppExtensionService, AppHookService, AppService, AppSettingsService, AppSharedRuleGuard, AutoDownloadService, ContentApiService, ContextActionsDirective, DefaultExtensionLoaderFactory, DefaultMimeTypes, DocumentBasePageService, DocumentBasePageServiceMock, EXTENSION_DATA_LOADERS, ExtensionsDataLoaderGuard, GenericErrorComponent, InfoDrawerComponent, LibTestingModule, LockedByComponent, NavigationHistoryService, NodePermissionService, OpenInAppComponent, PageComponent, PageLayoutComponent, PageLayoutContentComponent, PageLayoutErrorComponent, PageLayoutHeaderComponent, PageLayoutModule, PaginationDirective, PaginationStateBaseService, PaginationStateService, PluginEnabledGuard, RouterExtensionService, ToolbarActionComponent, ToolbarButtonComponent, ToolbarButtonType, ToolbarComponent, ToolbarMenuComponent, ToolbarMenuItemComponent, UserProfileService, discoveryApiServiceMockValue, getApiErrorMessage, initialState, isLibrary, isLocked, isWorkingCopy, provideContentAppExtensions, resetInvoked };
3608
3661
  //# sourceMappingURL=alfresco-aca-shared.mjs.map