@alfresco/adf-content-services
Version:
Alfresco ADF content services
897 lines (888 loc) • 1.93 MB
JavaScript
import * as i0 from '@angular/core';
import { Component, InjectionToken, Optional, Inject, Injectable, inject, ViewEncapsulation, HostListener, Input, Directive, DestroyRef, EventEmitter, Output, ViewChild, ElementRef, ContentChildren, ViewContainerRef, ContentChild, NgZone, forwardRef, TemplateRef, Pipe, HostBinding, ChangeDetectionStrategy, Host, NgModule, ViewChildren, Injector, runInInjectionContext, APP_INITIALIZER } from '@angular/core';
import * as i4$1 from '@alfresco/js-api';
import { AlfrescoApiConfig, AlfrescoApi, ContentApi, TrashcanApi, NodesApi, PeopleApi, SitesApi, SearchApi, SharedlinksApi, FavoritesApi, SEARCH_LANGUAGE, SiteMemberPaging, DiscoveryApi, AboutApi, SystemPropertiesApi, UploadApi, VersionsApi, RenditionsApi, PreferencesApi, DownloadsApi, FileDownloadStatus, TagsApi, TagBody, CategoriesApi, QueriesApi, Pagination, SiteEntry, Site, NodePagingList, Node, UserInfo, ContentInfo, Category, ClassesApi, TypesApi, CategoryLinkBody, AspectsApi, GroupsApi, NodeEntry, CommentsApi, SecurityGroupsApi, SecurityMarksApi, AuthorityClearanceApi, PredictionsApi, LegalHoldApi, AgentsApi, SearchAiApi, PathInfo, ResultSetRowEntry, ResultNode, ResultSetPaging, SitePaging, SitePagingList } from '@alfresco/js-api';
import { ReplaySubject, Subject, from, throwError, Observable, of, forkJoin, BehaviorSubject, timer, EMPTY, merge, Subscription, defer, zip, iif } from 'rxjs';
import * as i1 from '@alfresco/adf-core';
import { AppConfigValues, BpmProductVersionModel, AppConfigService, ObjectUtils, DataSorting, BaseEvent, DateFnsUtils, ADF_DATE_FORMATS, ADF_DATETIME_FORMATS, AdfDateFnsAdapter, AdfDateTimeFnsAdapter, UserPreferenceValues, IconComponent, HeaderFilterTemplateDirective, DataTableSchema, ShowHeaderMode, DataTableComponent, NoContentTemplateDirective, EmptyListComponent, NoPermissionTemplateDirective, LoadingContentTemplateDirective, MainMenuDataTableTemplateDirective, ColumnsSelectorComponent, DataColumnListComponent, CustomLoadingContentTemplateDirective, CustomNoPermissionTemplateDirective, CustomEmptyContentTemplateDirective, DataTableService, TranslationService, FileUtils, NotificationService, EXTENDIBLE_COMPONENT, FileSizePipe, InfiniteSelectScrollDirective, ToolbarTitleComponent, ToolbarComponent, HighlightDirective, DataColumnComponent, InfinitePaginationComponent, DynamicChipListComponent, SortingPickerComponent, SearchTextInputComponent, HighlightPipe, ConfirmDialogComponent, FileTypePipe, ContextMenuDirective, CardViewTextItemModel, CardViewDateItemModel, CardViewItemMatchValidator, UserPreferencesService, LogService, CardViewSelectItemModel, MultiValuePipe, CardViewBoolItemModel, CardViewDatetimeItemModel, CardViewFloatItemModel, CardViewLongItemModel, CardViewIntItemModel, DecimalNumberPipe, CardViewComponent, User, InitialUsernamePipe, DateColumnHeaderComponent, EmptyContentComponent, ClipboardDirective, CommentModel, CommentsComponent, ADF_COMMENTS_SERVICE, CloseButtonPosition, ViewerToolbarComponent, ViewerSidebarComponent, ViewerToolbarActionsComponent, ViewerMoreActionsComponent, ViewerOpenWithComponent, ViewUtilService, VIEWER_DIRECTIVES, provideTranslations, CoreModule, NoopAuthModule, NoopTranslateModule } from '@alfresco/adf-core';
import * as i1$1 from '@angular/material/dialog';
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
import { map, catchError, filter, take, switchMap, tap, concatMap, first, startWith, debounce, delay, debounceTime, retry, mergeMap, distinctUntilChanged, takeUntil, finalize, toArray } from 'rxjs/operators';
import { Minimatch } from 'minimatch';
import * as i5$2 from '@angular/cdk/overlay';
import { ConnectionPositionPair } from '@angular/cdk/overlay';
import * as i1$2 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i7$3 from '@angular/material/tabs';
import { MatTabsModule, MatTabGroup } from '@angular/material/tabs';
import * as i4 from '@ngx-translate/core';
import { TranslateModule } from '@ngx-translate/core';
import * as i7$2 from '@angular/material/select';
import { MatSelectModule } from '@angular/material/select';
import { isAfter, parseISO, startOfMinute, endOfMinute, isValid, isBefore, endOfDay, parse, startOfMonth, subMonths, startOfWeek, subWeeks, startOfDay, subDays, endOfToday, formatISO, format, differenceInSeconds, add } from 'date-fns';
import * as i5$1 from '@angular/material/button';
import { MatButtonModule } from '@angular/material/button';
import * as i5 from '@angular/material/progress-bar';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { Buffer } from 'buffer';
import { Router, ActivatedRoute } from '@angular/router';
import * as i1$4 from '@angular/cdk/a11y';
import { A11yModule } from '@angular/cdk/a11y';
import * as i7 from '@angular/material/form-field';
import { MatFormFieldModule } from '@angular/material/form-field';
import * as i4$2 from '@angular/material/input';
import { MatInputModule } from '@angular/material/input';
import * as i1$3 from '@angular/forms';
import { FormsModule, Validators, UntypedFormControl, UntypedFormGroup, ReactiveFormsModule, FormControl, FormGroup } from '@angular/forms';
import * as i6 from '@angular/material/icon';
import { MatIconModule } from '@angular/material/icon';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import * as i2 from '@angular/material/radio';
import { MatRadioModule } from '@angular/material/radio';
import * as i2$1 from '@angular/material/slider';
import { MatSliderModule } from '@angular/material/slider';
import * as i8 from '@angular/material/checkbox';
import { MatCheckboxModule, MatCheckbox } from '@angular/material/checkbox';
import * as i2$2 from '@mat-datetimepicker/core';
import { MatDatetimepickerModule, MAT_DATETIME_FORMATS, DatetimeAdapter, MatNativeDatetimeModule } from '@mat-datetimepicker/core';
import * as i3 from '@angular/material/core';
import { MAT_DATE_FORMATS, DateAdapter, MAT_DATE_LOCALE, MatRippleModule, MatOptionModule } from '@angular/material/core';
import { ENTER } from '@angular/cdk/keycodes';
import * as i7$1 from '@angular/material/autocomplete';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import * as i3$1 from '@angular/material/chips';
import { MatChipsModule } from '@angular/material/chips';
import { DateFnsAdapter, MAT_DATE_FNS_FORMATS } from '@angular/material-date-fns-adapter';
import * as i10 from '@angular/material/datepicker';
import { MatDatepickerModule } from '@angular/material/datepicker';
import * as i4$3 from '@angular/material/menu';
import { MatMenuModule } from '@angular/material/menu';
import * as i7$4 from '@angular/material/badge';
import { MatBadgeModule } from '@angular/material/badge';
import * as i9 from '@angular/material/progress-spinner';
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
import * as i3$2 from '@angular/material/list';
import { MatListModule, MatListItem, MatSelectionList } from '@angular/material/list';
import * as i4$5 from '@angular/material/expansion';
import { MatExpansionModule } from '@angular/material/expansion';
import * as i4$4 from '@angular/material/divider';
import { MatDividerModule } from '@angular/material/divider';
import { DataSource, SelectionModel } from '@angular/cdk/collections';
import { CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf } from '@angular/cdk/scrolling';
import { trigger, state, transition, style, animate } from '@angular/animations';
import * as i1$5 from '@angular/cdk/tree';
import { FlatTreeControl } from '@angular/cdk/tree';
import * as i3$3 from '@angular/material/tree';
import { MatTreeModule } from '@angular/material/tree';
import * as i6$1 from '@angular/material/table';
import { MatTableModule } from '@angular/material/table';
import { DynamicExtensionComponent } from '@alfresco/adf-extensions';
import * as i5$3 from '@angular/material/card';
import { MatCardModule } from '@angular/material/card';
import * as i7$5 from '@angular/material/slide-toggle';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
import { TemplatePortal } from '@angular/cdk/portal';
import * as i2$3 from '@alfresco/adf-core/api';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { MatIconTestingModule } from '@angular/material/icon/testing';
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class AlfrescoIconComponent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AlfrescoIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.1.3", type: AlfrescoIconComponent, isStandalone: true, selector: "adf-alfresco-icon", ngImport: i0, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0\" y=\"0\" viewBox=\"17.2 134.6 562 573.1\"><path fill=\"#FFF\" d=\"M298.2,421.3L219,340.4l-2.9-2.9c-45.4-46.5-119.5-46.5-164.7-0.2c-45.6,46.3-45.6,121.5,0,167.8\tc45.2,46.4,119,46.4,164.4,0L298.2,421.3z\"/><path fill=\"#FFF\" d=\"M298.2,421.2v114.3l0.2,4.2c0,65.5-52.2,119-116.5,119c-64.3,0-116.5-53.1-116.5-118.6\tc0-65.6,52.4-118.8,116.5-118.8H298.2z\"/><path fill=\"#FFF\" d=\"M298.2,421.2v114.3l0.2,4.2c0,65.5-52.2,119-116.5,119c-64.3,0-116.5-53.1-116.5-118.6\tc0-65.6,52.4-118.8,116.5-118.8H298.2z\"/><path fill=\"#FFF\" d=\"M298.2,421.2v114.3l0.2,4.2c0,65.5-52.2,119-116.5,119c-64.3,0-116.5-53.1-116.5-118.6\tc0-7.3,0.8-14.4,2-21.2c45.4,32.2,108.2,27.7,148.6-13.7l82.4-83.8V421.2z\"/><path fill=\"#8ABF42\" d=\"M181.9,436.1c-56.1,0-101.6,46.5-101.6,103.8c0,57.1,45.6,103.5,101.6,103.5c56.2,0,101.7-46.4,101.7-103.5\tv-4.5v-99.3H182.1H181.9z\"/><path fill=\"#FFF\" d=\"M298.2,421.2l79.2,80.8l3.3,2.9c45.2,46.4,45.5,121.8,0,168.1c-45.6,46.3-119.2,46.3-164.8,0\tc-45.4-46.3-45.4-121.5,0-168L298.2,421.2z\"/><path fill=\"#8ABF42\" d=\"M226.5,515.6c-39.8,40.5-39.8,106.2,0,146.6c39.6,40.5,104,40.5,143.8,0c39.6-40.4,39.6-106.1,0-146.6\tl-3.3-3l-68.7-70.2l-71.7,73.1V515.6z\"/><path fill=\"#FFF\" d=\"M298.2,421.2h112.2l4.1-0.2c64.4,0,116.5,53.2,116.5,118.8c0,65.6-52,118.6-116.3,118.6\tc-64.3,0-116.5-53.1-116.5-118.6V421.2z\"/><path fill=\"#8ABF42\" d=\"M313.1,539.8c0,57.3,45.4,103.7,101.6,103.7c56,0,101.4-46.4,101.4-103.7c0-57.3-45.4-103.6-101.4-103.6\th-4.3h-97.4v103.3V539.8z\"/><path fill=\"#FFF\" d=\"M298.2,421.2l79.2-80.9l3.1-3.1c45.4-46.3,119.2-46.5,164.6-0.2c45.4,46.4,45.4,121.5,0,167.9\tc-45.4,46.4-119.2,46.4-164.6,0L298.2,421.2z\"/><path fill=\"#8ABF42\" d=\"M391.1,494.3c39.4,40.6,103.8,40.6,143.6,0c39.8-40.4,39.8-106,0-146.5c-39.8-40.5-104.1-40.5-143.6,0\tl-3.3,3.2l-68.6,70.3l71.5,73L391.1,494.3z\"/><path fill=\"#FFF\" d=\"M298.2,421.2V306.8v-4.3c0-65.5,51.9-118.8,116.5-118.8c64.2,0,116.1,52.9,116.1,118.6\tc0,65.6-52,118.8-116.1,118.8H298.2z\"/><path fill=\"#F89F31\" d=\"M414.7,406.1c56,0,101.4-46.4,101.4-103.7c0-57.1-45.4-103.6-101.4-103.6c-56.3,0-101.8,46.5-101.8,103.6\tl0.2,4.4v99.3h101.1H414.7z\"/><path fill=\"#FFF\" d=\"M298.2,421.2L219,340.3l-3.1-2.9c-45.4-46.5-45.4-121.8,0-168.1c45.2-46.4,119.1-46.4,164.6,0\tc45.4,46.3,45.4,121.6,0,167.9L298.2,421.2z\"/><path fill=\"#0080C5\" d=\"M370.1,327.6c39.6-40.5,39.6-106.2,0-146.6c-39.8-40.5-104-40.5-143.7,0c-39.8,40.4-39.8,106.1,0,146.6\tl2.9,3.1l69,70.1l71.6-73L370.1,327.6z\"/><path fill=\"#FFF\" d=\"M298.2,422.1H186.1l-4.2,0.1c-64.1,0-116.5-53.2-116.5-118.8c0-65.5,52.2-118.7,116.3-118.7\tc64.3,0,116.6,53.2,116.6,118.8V422.1z\"/><path fill=\"#0080C5\" d=\"M283.5,303.5c0-57.3-45.4-103.6-101.8-103.6c-56,0-101.6,46.3-101.6,103.5c0,57.2,45.6,103.7,101.6,103.7\tl4.4-0.1h97.4V303.8V303.5z\"/><path fill=\"#FFF\" d=\"M298.2,422.1l-281,0.1c0-30.4,11.2-60.8,34.2-84c45.2-46.3,119-46.3,164.4,0L298.2,422.1z\"/><path fill=\"#0080C5\" d=\"M205.4,348.9l71.9,73.3h-95.5c-51.6,0-95.5,34.3-110.7,81.9c-3.1-2.7-6.4-5.5-9.3-8.7\tc-39.8-40.5-39.8-106,0-146.5C101.3,308.4,165.8,308.4,205.4,348.9\"/><path fill=\"#005DA9\" d=\"M205.6,349l56.9,58l-80.9,0.2c-46.6,0-85.8-31.9-97.8-75.5c38.6-22.1,89.2-16.8,121.6,17.1L205.6,349z\"/><path fill=\"#005DA9\" d=\"M283.5,303.7l-0.1,82.1l-57.1-58.2c-32.9-33.6-38.7-84.4-17-123.8c42.7,12.2,74.2,52.2,74.2,99.8V303.7z\"/><path fill=\"#005DA9\" d=\"M312.6,386v-82.4c0-47.5,31.5-87.5,74.2-99.8c21.6,39.5,17.6,89-16.4,123.3L312.6,386z\"/><path fill=\"#FFDE4F\" d=\"M333.9,406.1l57.1-58.3c32.9-33.6,82.8-39.3,121.4-17.2c-12.2,43.5-49.4,74.8-95.3,75.6L333.9,406.1z\"/><path fill=\"#48A64A\" d=\"M333.8,436.1h80.8c46.6,0,85.8,31.7,97.8,75.4c-38.9,22.2-88.7,16.3-121.8-17.2L333.8,436.1z\"/><path fill=\"#48A64A\" d=\"M313.1,539.2v-82l57.2,58.2c32.9,33.7,38.5,84.7,16.8,124.1c-42.7-12.2-74-52.4-74-99.9V539.2z\"/><path fill=\"#48A64A\" d=\"M226.6,515.4l56.9-58l0.1,82.4c0,47.5-31.3,87.4-74,99.7c-21.6-39.5-15.8-90.4,17-123.9V515.4z\"/><path fill=\"#48A64A\" d=\"M182.4,436.1h80.4l-57,58.2c-32.8,33.5-83.1,39.3-121.7,17.3c12.1-43.7,51.4-75.5,98-75.5H182.4z\"/></svg>\n" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AlfrescoIconComponent, decorators: [{
type: Component,
args: [{ selector: 'adf-alfresco-icon', standalone: true, template: "<svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0\" y=\"0\" viewBox=\"17.2 134.6 562 573.1\"><path fill=\"#FFF\" d=\"M298.2,421.3L219,340.4l-2.9-2.9c-45.4-46.5-119.5-46.5-164.7-0.2c-45.6,46.3-45.6,121.5,0,167.8\tc45.2,46.4,119,46.4,164.4,0L298.2,421.3z\"/><path fill=\"#FFF\" d=\"M298.2,421.2v114.3l0.2,4.2c0,65.5-52.2,119-116.5,119c-64.3,0-116.5-53.1-116.5-118.6\tc0-65.6,52.4-118.8,116.5-118.8H298.2z\"/><path fill=\"#FFF\" d=\"M298.2,421.2v114.3l0.2,4.2c0,65.5-52.2,119-116.5,119c-64.3,0-116.5-53.1-116.5-118.6\tc0-65.6,52.4-118.8,116.5-118.8H298.2z\"/><path fill=\"#FFF\" d=\"M298.2,421.2v114.3l0.2,4.2c0,65.5-52.2,119-116.5,119c-64.3,0-116.5-53.1-116.5-118.6\tc0-7.3,0.8-14.4,2-21.2c45.4,32.2,108.2,27.7,148.6-13.7l82.4-83.8V421.2z\"/><path fill=\"#8ABF42\" d=\"M181.9,436.1c-56.1,0-101.6,46.5-101.6,103.8c0,57.1,45.6,103.5,101.6,103.5c56.2,0,101.7-46.4,101.7-103.5\tv-4.5v-99.3H182.1H181.9z\"/><path fill=\"#FFF\" d=\"M298.2,421.2l79.2,80.8l3.3,2.9c45.2,46.4,45.5,121.8,0,168.1c-45.6,46.3-119.2,46.3-164.8,0\tc-45.4-46.3-45.4-121.5,0-168L298.2,421.2z\"/><path fill=\"#8ABF42\" d=\"M226.5,515.6c-39.8,40.5-39.8,106.2,0,146.6c39.6,40.5,104,40.5,143.8,0c39.6-40.4,39.6-106.1,0-146.6\tl-3.3-3l-68.7-70.2l-71.7,73.1V515.6z\"/><path fill=\"#FFF\" d=\"M298.2,421.2h112.2l4.1-0.2c64.4,0,116.5,53.2,116.5,118.8c0,65.6-52,118.6-116.3,118.6\tc-64.3,0-116.5-53.1-116.5-118.6V421.2z\"/><path fill=\"#8ABF42\" d=\"M313.1,539.8c0,57.3,45.4,103.7,101.6,103.7c56,0,101.4-46.4,101.4-103.7c0-57.3-45.4-103.6-101.4-103.6\th-4.3h-97.4v103.3V539.8z\"/><path fill=\"#FFF\" d=\"M298.2,421.2l79.2-80.9l3.1-3.1c45.4-46.3,119.2-46.5,164.6-0.2c45.4,46.4,45.4,121.5,0,167.9\tc-45.4,46.4-119.2,46.4-164.6,0L298.2,421.2z\"/><path fill=\"#8ABF42\" d=\"M391.1,494.3c39.4,40.6,103.8,40.6,143.6,0c39.8-40.4,39.8-106,0-146.5c-39.8-40.5-104.1-40.5-143.6,0\tl-3.3,3.2l-68.6,70.3l71.5,73L391.1,494.3z\"/><path fill=\"#FFF\" d=\"M298.2,421.2V306.8v-4.3c0-65.5,51.9-118.8,116.5-118.8c64.2,0,116.1,52.9,116.1,118.6\tc0,65.6-52,118.8-116.1,118.8H298.2z\"/><path fill=\"#F89F31\" d=\"M414.7,406.1c56,0,101.4-46.4,101.4-103.7c0-57.1-45.4-103.6-101.4-103.6c-56.3,0-101.8,46.5-101.8,103.6\tl0.2,4.4v99.3h101.1H414.7z\"/><path fill=\"#FFF\" d=\"M298.2,421.2L219,340.3l-3.1-2.9c-45.4-46.5-45.4-121.8,0-168.1c45.2-46.4,119.1-46.4,164.6,0\tc45.4,46.3,45.4,121.6,0,167.9L298.2,421.2z\"/><path fill=\"#0080C5\" d=\"M370.1,327.6c39.6-40.5,39.6-106.2,0-146.6c-39.8-40.5-104-40.5-143.7,0c-39.8,40.4-39.8,106.1,0,146.6\tl2.9,3.1l69,70.1l71.6-73L370.1,327.6z\"/><path fill=\"#FFF\" d=\"M298.2,422.1H186.1l-4.2,0.1c-64.1,0-116.5-53.2-116.5-118.8c0-65.5,52.2-118.7,116.3-118.7\tc64.3,0,116.6,53.2,116.6,118.8V422.1z\"/><path fill=\"#0080C5\" d=\"M283.5,303.5c0-57.3-45.4-103.6-101.8-103.6c-56,0-101.6,46.3-101.6,103.5c0,57.2,45.6,103.7,101.6,103.7\tl4.4-0.1h97.4V303.8V303.5z\"/><path fill=\"#FFF\" d=\"M298.2,422.1l-281,0.1c0-30.4,11.2-60.8,34.2-84c45.2-46.3,119-46.3,164.4,0L298.2,422.1z\"/><path fill=\"#0080C5\" d=\"M205.4,348.9l71.9,73.3h-95.5c-51.6,0-95.5,34.3-110.7,81.9c-3.1-2.7-6.4-5.5-9.3-8.7\tc-39.8-40.5-39.8-106,0-146.5C101.3,308.4,165.8,308.4,205.4,348.9\"/><path fill=\"#005DA9\" d=\"M205.6,349l56.9,58l-80.9,0.2c-46.6,0-85.8-31.9-97.8-75.5c38.6-22.1,89.2-16.8,121.6,17.1L205.6,349z\"/><path fill=\"#005DA9\" d=\"M283.5,303.7l-0.1,82.1l-57.1-58.2c-32.9-33.6-38.7-84.4-17-123.8c42.7,12.2,74.2,52.2,74.2,99.8V303.7z\"/><path fill=\"#005DA9\" d=\"M312.6,386v-82.4c0-47.5,31.5-87.5,74.2-99.8c21.6,39.5,17.6,89-16.4,123.3L312.6,386z\"/><path fill=\"#FFDE4F\" d=\"M333.9,406.1l57.1-58.3c32.9-33.6,82.8-39.3,121.4-17.2c-12.2,43.5-49.4,74.8-95.3,75.6L333.9,406.1z\"/><path fill=\"#48A64A\" d=\"M333.8,436.1h80.8c46.6,0,85.8,31.7,97.8,75.4c-38.9,22.2-88.7,16.3-121.8-17.2L333.8,436.1z\"/><path fill=\"#48A64A\" d=\"M313.1,539.2v-82l57.2,58.2c32.9,33.7,38.5,84.7,16.8,124.1c-42.7-12.2-74-52.4-74-99.9V539.2z\"/><path fill=\"#48A64A\" d=\"M226.6,515.4l56.9-58l0.1,82.4c0,47.5-31.3,87.4-74,99.7c-21.6-39.5-15.8-90.4,17-123.9V515.4z\"/><path fill=\"#48A64A\" d=\"M182.4,436.1h80.4l-57,58.2c-32.8,33.5-83.1,39.3-121.7,17.3c12.1-43.7,51.4-75.5,98-75.5H182.4z\"/></svg>\n" }]
}] });
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* spellchecker: disable */
class PermissionsEnum extends String {
static { this.CONTRIBUTOR = 'Contributor'; }
static { this.CONSUMER = 'Consumer'; }
static { this.COLLABORATOR = 'Collaborator'; }
static { this.MANAGER = 'Manager'; }
static { this.EDITOR = 'Editor'; }
static { this.COORDINATOR = 'Coordinator'; }
static { this.NOT_CONTRIBUTOR = '!Contributor'; }
static { this.NOT_CONSUMER = '!Consumer'; }
static { this.NOT_COLLABORATOR = '!Collaborator'; }
static { this.NOT_MANAGER = '!Manager'; }
static { this.NOT_EDITOR = '!Editor'; }
static { this.NOT_COORDINATOR = '!Coordinator'; }
}
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* spellchecker: disable */
class AllowableOperationsEnum extends String {
static { this.DELETE = 'delete'; }
static { this.UPDATE = 'update'; }
static { this.CREATE = 'create'; }
static { this.COPY = 'copy'; }
static { this.LOCK = 'lock'; }
static { this.UPDATEPERMISSIONS = 'updatePermissions'; }
static { this.NOT_DELETE = '!delete'; }
static { this.NOT_UPDATE = '!update'; }
static { this.NOT_CREATE = '!create'; }
static { this.NOT_UPDATEPERMISSIONS = '!updatePermissions'; }
}
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const ALFRESCO_API_FACTORY = new InjectionToken('ALFRESCO_API_FACTORY');
class AlfrescoApiService {
getInstance() {
return this.alfrescoApi;
}
constructor(appConfig, storageService, alfrescoApiFactory) {
this.appConfig = appConfig;
this.storageService = storageService;
this.alfrescoApiFactory = alfrescoApiFactory;
this.alfrescoApiInitialized = new ReplaySubject(1);
this.excludedErrorUrl = ['api/enterprise/system/properties'];
}
async load(config) {
this.currentAppConfig = config;
if (config.authType === 'OAUTH') {
await this.mapAlfrescoApiOpenIdConfig();
}
this.initAlfrescoApi();
this.alfrescoApiInitialized.next(true);
}
async reset() {
this.getCurrentAppConfig();
if (this.currentAppConfig.authType === 'OAUTH') {
await this.mapAlfrescoApiOpenIdConfig();
}
this.initAlfrescoApiWithConfig();
}
getAuthWithFixedOriginLocation() {
const oauth = this.appConfig.oauth2;
if (oauth) {
oauth.redirectUri = window.location.origin + window.location.pathname;
oauth.redirectUriLogout = window.location.origin + window.location.pathname;
}
return oauth;
}
async mapAlfrescoApiOpenIdConfig() {
this.idpConfig = await this.appConfig.loadWellKnown(this.currentAppConfig.oauth2.host);
this.currentAppConfig.oauth2.tokenUrl = this.idpConfig.token_endpoint;
this.currentAppConfig.oauth2.authorizationUrl = this.idpConfig.authorization_endpoint;
this.currentAppConfig.oauth2.logoutUrl = this.idpConfig.end_session_endpoint;
this.currentAppConfig.oauth2.userinfoEndpoint = this.idpConfig.userinfo_endpoint;
}
getCurrentAppConfig() {
const oauth = this.getAuthWithFixedOriginLocation();
this.currentAppConfig = new AlfrescoApiConfig({
provider: this.appConfig.get(AppConfigValues.PROVIDERS),
hostEcm: this.appConfig.get(AppConfigValues.ECMHOST),
hostBpm: this.appConfig.get(AppConfigValues.BPMHOST),
authType: this.appConfig.get(AppConfigValues.AUTHTYPE, 'BASIC'),
contextRootBpm: this.appConfig.get(AppConfigValues.CONTEXTROOTBPM),
contextRoot: this.appConfig.get(AppConfigValues.CONTEXTROOTECM),
disableCsrf: this.appConfig.get(AppConfigValues.DISABLECSRF),
withCredentials: this.appConfig.get(AppConfigValues.AUTH_WITH_CREDENTIALS, false),
domainPrefix: this.appConfig.get(AppConfigValues.STORAGE_PREFIX),
oauth2: oauth
});
}
initAlfrescoApi() {
this.getCurrentAppConfig();
this.initAlfrescoApiWithConfig();
}
initAlfrescoApiWithConfig() {
if (this.alfrescoApi && this.isDifferentConfig(this.lastConfig, this.currentAppConfig)) {
this.alfrescoApi.setConfig(this.currentAppConfig);
}
else {
this.alfrescoApi = this.createInstance(this.currentAppConfig);
}
this.lastConfig = this.currentAppConfig;
}
createInstance(config) {
if (this.alfrescoApiFactory) {
return this.alfrescoApiFactory.createAlfrescoApi(config);
}
return new AlfrescoApi(config);
}
isDifferentConfig(lastConfig, newConfig) {
return JSON.stringify(lastConfig) !== JSON.stringify(newConfig);
}
isExcludedErrorListener(currentFullPath) {
const formattedPath = currentFullPath.replace(this.lastConfig.hostBpm + '/' + this.lastConfig.contextRootBpm, '');
return this.excludedErrorUrl.includes(formattedPath);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AlfrescoApiService, deps: [{ token: i1.AppConfigService }, { token: i1.StorageService }, { token: ALFRESCO_API_FACTORY, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AlfrescoApiService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: AlfrescoApiService, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}], ctorParameters: () => [{ type: i1.AppConfigService }, { type: i1.StorageService }, { type: undefined, decorators: [{
type: Optional
}, {
type: Inject,
args: [ALFRESCO_API_FACTORY]
}] }] });
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class ContentService {
get contentApi() {
this._contentApi = this._contentApi ?? new ContentApi(this.apiService.getInstance());
return this._contentApi;
}
constructor(authService, apiService, thumbnailService) {
this.authService = authService;
this.apiService = apiService;
this.thumbnailService = thumbnailService;
this.folderCreated = new Subject();
this.folderCreate = new Subject();
this.folderEdit = new Subject();
}
/**
* Gets a content URL for the given node.
*
* @param node Node or Node ID to get URL for.
* @param attachment Toggles whether to retrieve content as an attachment for download
* @param ticket Custom ticket to use for authentication
* @returns URL string or `null`
*/
getContentUrl(node, attachment, ticket) {
if (node) {
let nodeId;
if (typeof node === 'string') {
nodeId = node;
}
else if (node.entry) {
nodeId = node.entry.id;
}
return this.contentApi.getContentUrl(nodeId, attachment, ticket);
}
return null;
}
getDocumentThumbnailUrl(nodeId, attachment, ticket) {
return this.contentApi.getDocumentThumbnailUrl(nodeId, attachment, ticket);
}
/**
* Checks if the user has permission on that node
*
* @param node Node to check permissions
* @param permission Required permission type
* @param userId Optional current user id will be taken by default
* @returns True if the user has the required permissions, false otherwise
*/
hasPermissions(node, permission, userId) {
let hasPermissions = false;
userId = userId ?? this.authService.getEcmUsername();
const permissions = [...(node.permissions?.locallySet || []), ...(node.permissions?.inherited || [])].filter((currentPermission) => currentPermission.authorityId === userId);
if (permissions.length) {
if (permission?.startsWith('!')) {
hasPermissions = !permissions.find((currentPermission) => currentPermission.name === permission.replace('!', ''));
}
else {
hasPermissions = !!permissions.find((currentPermission) => currentPermission.name === permission);
}
}
else {
if (permission === PermissionsEnum.CONSUMER) {
hasPermissions = true;
}
else if (permission === PermissionsEnum.NOT_CONSUMER) {
hasPermissions = false;
}
else if (permission?.startsWith('!')) {
hasPermissions = true;
}
}
return hasPermissions;
}
/**
* Checks if the user has permissions on that node
*
* @param node Node to check allowableOperations
* @param allowableOperation Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions
* @returns True if the user has the required permissions, false otherwise
*/
hasAllowableOperations(node, allowableOperation) {
let hasAllowableOperations = false;
if (node?.allowableOperations) {
if (allowableOperation?.startsWith('!')) {
hasAllowableOperations = !node.allowableOperations.find((currentOperation) => currentOperation === allowableOperation.replace('!', ''));
}
else {
hasAllowableOperations = !!node.allowableOperations.find((currentOperation) => currentOperation === allowableOperation);
}
}
else {
if (allowableOperation?.startsWith('!')) {
hasAllowableOperations = true;
}
}
if (allowableOperation === AllowableOperationsEnum.COPY) {
hasAllowableOperations = true;
}
if (allowableOperation === AllowableOperationsEnum.LOCK) {
hasAllowableOperations = node.isFile;
if (node.isLocked && node.allowableOperations) {
hasAllowableOperations = !!~node.allowableOperations.indexOf('updatePermissions');
}
}
return hasAllowableOperations;
}
getNodeIcon(node) {
if (node?.isFolder) {
return this.getFolderIcon(node);
}
if (node?.isFile) {
return this.thumbnailService.getMimeTypeIcon(node?.content?.mimeType);
}
return this.thumbnailService.getDefaultMimeTypeIcon();
}
getFolderIcon(node) {
if (this.isSmartFolder(node)) {
return this.thumbnailService.getMimeTypeIcon('smartFolder');
}
else if (this.isRuleFolder(node)) {
return this.thumbnailService.getMimeTypeIcon('ruleFolder');
}
else if (this.isLinkFolder(node)) {
return this.thumbnailService.getMimeTypeIcon('linkFolder');
}
else {
return this.thumbnailService.getMimeTypeIcon('folder');
}
}
isSmartFolder(node) {
if (node) {
return this.hasAspect(node, 'smf:customConfigSmartFolder') || this.hasAspect(node, 'smf:systemConfigSmartFolder');
}
return false;
}
isRuleFolder(node) {
if (node) {
return this.hasAspect(node, 'rule:rules');
}
return false;
}
isLinkFolder(node) {
return node?.nodeType === 'app:folderlink';
}
hasAspect(node, aspectName) {
return node?.aspectNames?.includes(aspectName);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ContentService, deps: [{ token: i1.AuthenticationService }, { token: AlfrescoApiService }, { token: i1.ThumbnailService }], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ContentService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: ContentService, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}], ctorParameters: () => [{ type: i1.AuthenticationService }, { type: AlfrescoApiService }, { type: i1.ThumbnailService }] });
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class NodeMetadata {
constructor(metadata, nodeType) {
this.metadata = metadata;
this.nodeType = nodeType;
}
}
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class NodesApiService {
get trashcanApi() {
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
return this._trashcanApi;
}
get nodesApi() {
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
return this._nodesApi;
}
constructor(apiService, preferences) {
this.apiService = apiService;
this.preferences = preferences;
/**
* Publish/subscribe to events related to node updates.
*/
this.nodeUpdated = new Subject();
}
getEntryFromEntity(entity) {
return entity.entry;
}
/**
* Gets the stored information about a node.
*
* @param nodeId ID of the target node
* @param options Optional parameters supported by JS-API
* @returns Node information
*/
getNode(nodeId, options = {}) {
const defaults = {
include: ['path', 'properties', 'allowableOperations', 'permissions']
};
const queryOptions = Object.assign(defaults, options);
return from(this.nodesApi.getNode(nodeId, queryOptions)).pipe(map(this.getEntryFromEntity), catchError((err) => throwError(err)));
}
/**
* Gets the items contained in a folder node.
*
* @param nodeId ID of the target node
* @param options Optional parameters supported by JS-API
* @returns List of child items from the folder
*/
getNodeChildren(nodeId, options = {}) {
const defaults = {
maxItems: this.preferences.paginationSize,
skipCount: 0,
include: ['path', 'properties', 'allowableOperations', 'permissions']
};
const queryOptions = Object.assign(defaults, options);
return from(this.nodesApi.listNodeChildren(nodeId, queryOptions)).pipe(catchError((err) => throwError(err)));
}
/**
* Creates a new document node inside a folder.
*
* @param parentNodeId ID of the parent folder node
* @param nodeBody Data for the new node
* @param options Optional parameters supported by JS-API
* @returns Details of the new node
*/
createNode(parentNodeId, nodeBody, options = {}) {
return from(this.nodesApi.createNode(parentNodeId, nodeBody, options)).pipe(map(this.getEntryFromEntity), catchError((err) => throwError(err)));
}
/**
* Creates a new folder node inside a parent folder.
*
* @param parentNodeId ID of the parent folder node
* @param nodeBody Data for the new folder
* @param options Optional parameters supported by JS-API
* @returns Details of the new folder
*/
createFolder(parentNodeId, nodeBody, options = {}) {
const body = Object.assign({ nodeType: 'cm:folder' }, nodeBody);
return this.createNode(parentNodeId, body, options);
}
/**
* Updates the information about a node.
*
* @param nodeId ID of the target node
* @param nodeBody New data for the node
* @param options Optional parameters supported by JS-API
* @returns Updated node information
*/
updateNode(nodeId, nodeBody, options = {}) {
const defaults = {
include: ['path', 'properties', 'allowableOperations', 'permissions', 'definition']
};
const queryOptions = Object.assign(defaults, options);
return from(this.nodesApi.updateNode(nodeId, nodeBody, queryOptions)).pipe(map(this.getEntryFromEntity), catchError((err) => throwError(err)));
}
/**
* Moves a node to the trashcan.
*
* @param nodeId ID of the target node
* @param options Optional parameters supported by JS-API
* @returns Empty result that notifies when the deletion is complete
*/
deleteNode(nodeId, options = {}) {
return from(this.nodesApi.deleteNode(nodeId, options)).pipe(catchError((err) => throwError(err)));
}
/**
* Restores a node previously moved to the trashcan.
*
* @param nodeId ID of the node to restore
* @returns Details of the restored node
*/
restoreNode(nodeId) {
return from(this.trashcanApi.restoreDeletedNode(nodeId)).pipe(map(this.getEntryFromEntity), catchError((err) => throwError(err)));
}
/**
* Get the metadata and the nodeType for a nodeId cleaned by the prefix.
*
* @param nodeId ID of the target node
* @returns Node metadata
*/
getNodeMetadata(nodeId) {
return from(this.nodesApi.getNode(nodeId)).pipe(map(this.cleanMetadataFromSemicolon));
}
/**
* Gets the list of holds assigned to the node.
*
* @param nodeId ID of the target node
* @param options Optional parameters supported by JS-API
* @param options.includeSource Also include **source** (in addition to **entries**) with folder information on **nodeId**
* @returns List of assigned holds Observable<Hold[]>
*/
getNodeAssignedHolds(nodeId, options) {
const queryOptions = Object.assign({ where: `(assocType='rma:frozenContent')` }, options);
return from(this.nodesApi.listParents(nodeId, queryOptions)).pipe(map(({ list }) => list.entries?.map(({ entry }) => ({
id: entry.id,
name: entry.name
}))));
}
/**
* Gets content for the given node.
*
* @param nodeId ID of the target node
* @returns Content data
*/
getNodeContent(nodeId) {
return from(this.nodesApi.getNodeContent(nodeId)).pipe(catchError((err) => throwError(err)));
}
/**
* Create a new Node inside `-root-` folder
*
* @param name Node name
* @param nodeType Node type
* @param properties Node body properties
* @param path Path to the node
* @returns The created node
*/
createNodeInsideRoot(name, nodeType, properties, path) {
const body = {
name,
nodeType,
properties,
relativePath: path
};
return from(this.nodesApi.createNode('-root-', body, {}));
}
/**
* Create a new Node from form metadata.
*
* @param nodeType Node type
* @param nameSpace Namespace for properties
* @param data Property data to store in the node under namespace
* @param path Path to the node
* @param name Node name
* @returns The created node
*/
createNodeMetadata(nodeType, nameSpace, data, path, name) {
const properties = {};
for (const key in data) {
if (data[key]) {
properties[nameSpace + ':' + key] = data[key];
}
}
return this.createNodeInsideRoot(name || this.randomNodeName(), nodeType, properties, path);
}
/**
* Initiate a new request to calculate folder size.
*
* @param nodeId Node Id
* @returns The job id which can be used to track request status
*/
initiateFolderSizeCalculation(nodeId) {
return from(this.nodesApi.initiateFolderSizeCalculation(nodeId));
}
/**
* Gets the size of a folder.
*
* @param nodeId Node Id
* @param jobId Job Id
* @returns Folder details
*/
getFolderSizeInfo(nodeId, jobId) {
return from(this.nodesApi.getFolderSizeInfo(nodeId, jobId));
}
randomNodeName() {
return `node_${Date.now()}`;
}
cleanMetadataFromSemicolon(nodeEntry) {
const metadata = {};
if (nodeEntry?.entry.properties) {
for (const key in nodeEntry.entry.properties) {
if (key) {
if (key.indexOf(':') !== -1) {
metadata[key.split(':')[1]] = nodeEntry.entry.properties[key];
}
else {
metadata[key] = nodeEntry.entry.properties[key];
}
}
}
}
return new NodeMetadata(metadata, nodeEntry.entry.nodeType);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: NodesApiService, deps: [{ token: AlfrescoApiService }, { token: i1.UserPreferencesService }], target: i0.ɵɵFactoryTarget.Injectable }); }
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: NodesApiService, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.3", ngImport: i0, type: NodesApiService, decorators: [{
type: Injectable,
args: [{
providedIn: 'root'
}]
}], ctorParameters: () => [{ type: AlfrescoApiService }, { type: i1.UserPreferencesService }] });
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
class DocumentLoaderNode {
constructor(currentNode, children) {
this.currentNode = currentNode;
this.children = children;
}
}
const CREATE_PERMISSION = 'create';
class CustomResourcesService {
get peopleApi() {
this._peopleApi = this._peopleApi ?? new PeopleApi(this.apiService.getInstance());
return this._peopleApi;
}
get sitesApi() {
this._sitesApi = this._sitesApi ?? new SitesApi(this.apiService.getInstance());
return this._sitesApi;
}
get trashcanApi() {
this._trashcanApi = this._trashcanApi ?? new TrashcanApi(this.apiService.getInstance());
return this._trashcanApi;
}
get searchApi() {
this._searchApi = this._searchApi ?? new SearchApi(this.apiService.getInstance());
return this._searchApi;
}
get sharedLinksApi() {
this._sharedLinksApi = this._sharedLinksApi ?? new SharedlinksApi(this.apiService.getInstance());
return this._sharedLinksApi;
}
get favoritesApi() {
this._favoritesApi = this._favoritesApi ?? new FavoritesApi(this.apiService.getInstance());
return this._favoritesApi;
}
get nodesApi() {
this._nodesApi = this._nodesApi ?? new NodesApi(this.apiService.getInstance());
return this._nodesApi;
}
constructor(apiService) {
this.apiService = apiService;
}
/**
* Gets files recently accessed by a user.
*
* @param personId ID of the user
* @param pagination Specifies how to paginate the results
* @param filters Specifies additional filters to apply (joined with **AND**)
* @returns List of nodes for the recently used files
*/
getRecentFiles(personId, pagination, filters) {
const defaultFilter = [
'TYPE:"content"',
'-PATH:"//cm:wiki/*"',
'-TYPE:"app:filelink"',
'-TYPE:"cm:thumbnail"',
'-TYPE:"cm:failedThumbnail"',
'-TYPE:"cm:rating"',
'-TYPE:"dl:dataList"',
'-TYPE:"dl:todoList"',
'-TYPE:"dl:issue"',
'-TYPE:"dl:contact"',
'-TYPE:"dl:eventAgenda"',
'-TYPE:"dl:event"',
'-TYPE:"dl:task"',
'-TYPE:"dl:simpletask"',
'-TYPE:"dl:meetingAgenda"',
'-TYPE:"dl:location"',
'-TYPE:"fm:topic"',
'-TYPE:"fm:post"',
'-TYPE:"ia:calendarEvent"',
'-TYPE:"lnk:link"'
];
return new Observable((observer) => {
this.peopleApi.getPerson(personId).then((person) => {
const username = person.entry.id;
const filterQueries = [
{ query: `cm:modified:[NOW/DAY-30DAYS TO NOW/DAY+1DAY]` },
{ query: `cm:modifier:'${username}' OR cm:creator:'${username}'` },
{ query: defaultFilter.join(' AND ') }
];
if (filters && filters.length > 0) {
filterQueries.push({
query: filters.join()
});
}
const query = {
query: {
query: '*',
language: SEARCH_LANGUAGE.AFTS
},
filterQueries,
include: ['path', 'properties', 'allowableOperations', 'aspectNames'],
sort: [
{
type: 'FIELD',
field: 'cm:modified',
ascending: false
}
],
paging: {
maxItems: pagination.maxItems,
skipCount: pagination.skipCount
}
};
return this.searchApi.search(query).then((searchResult) => {
observer.next(searchResult);
observer.complete();
}, (err) => {
observer.error(err);
observer.complete();
});
}, (err) => {
observer.error(err);
observer.complete();
});
});
}
/**
* Gets favorite files for the current user.
*
* @param pagination Specifies how to paginate the results
* @param includeFields List of data field names to include in the results
* @param where A string to restrict the returned objects by using a predicate
* @returns List of favorite files
*/
loadFavorites(pagination, includeFields = [], where) {
const includeFieldsRequest = this.getIncludesFields(includeFields);
const defaultPredicate = '(EXISTS(target/file) OR EXISTS(target/folder))';
const options = {
maxItems: pagination.maxItems,
skipCount: pagination.skipCount,
where: where ? `${where} AND ${defaultPredicate}` : defaultPredicate,
include: includeFieldsRequest
};
return new Observable((observer) => {
this.favoritesApi.listFavorites('-me-', options).then((result) => {
const page = {
list: {
entries: result.list.entries.map(({ entry }) => {
const target = entry.target.file || entry.target.folder;
target.properties = {
...(target.properties || {
'cm:title': entry.title || target.title,
'cm:description': entry.description || target.description
}),
...(entry.properties || {})
};
target.aspectNames = entry?.aspectNames ?? [];
target.allowableOperations = entry?.allowableOperations ?? [];
return {
entry: target
};
}),
pagination: result.list.pagination
}
};
observer.next(page);
observer.complete();
},