@alfresco/adf-content-services
Version:
Alfresco ADF content services
160 lines (159 loc) • 6.18 kB
TypeScript
/*!
* @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.
*/
import { UserPreferencesService } from '@alfresco/adf-core';
import { ContentPagingQuery, Node, NodeAssignedHold, NodeEntry, NodePaging, NodesApi, NodesIncludeQuery, TrashcanApi, SizeDetailsEntry, JobIdBodyEntry } from '@alfresco/js-api';
import { Observable, Subject } from 'rxjs';
import { NodeMetadata } from '../models/node-metadata.model';
import { AlfrescoApiService } from '../../services/alfresco-api.service';
import * as i0 from "@angular/core";
export declare class NodesApiService {
private apiService;
private preferences;
/**
* Publish/subscribe to events related to node updates.
*/
nodeUpdated: Subject<Node>;
private _trashcanApi;
get trashcanApi(): TrashcanApi;
private _nodesApi;
get nodesApi(): NodesApi;
constructor(apiService: AlfrescoApiService, preferences: UserPreferencesService);
private getEntryFromEntity;
/**
* 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: string, options?: any): Observable<Node>;
/**
* 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: string, options?: any): Observable<NodePaging>;
/**
* 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: string, nodeBody: any, options?: any): Observable<Node>;
/**
* 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: string, nodeBody: any, options?: any): Observable<Node>;
/**
* 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: string, nodeBody: any, options?: any): Observable<Node>;
/**
* 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: string, options?: any): Observable<any>;
/**
* Restores a node previously moved to the trashcan.
*
* @param nodeId ID of the node to restore
* @returns Details of the restored node
*/
restoreNode(nodeId: string): Observable<Node>;
/**
* 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: string): Observable<NodeMetadata>;
/**
* 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: string, options?: {
includeSource?: boolean;
} & NodesIncludeQuery & ContentPagingQuery): Observable<NodeAssignedHold[]>;
/**
* Gets content for the given node.
*
* @param nodeId ID of the target node
* @returns Content data
*/
getNodeContent(nodeId: string): Observable<any>;
/**
* 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: string, nodeType: string, properties: any, path: string): Observable<NodeEntry>;
/**
* 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: string, nameSpace: any, data: any, path: string, name?: string): Observable<NodeEntry>;
/**
* 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: string): Observable<JobIdBodyEntry>;
/**
* Gets the size of a folder.
*
* @param nodeId Node Id
* @param jobId Job Id
* @returns Folder details
*/
getFolderSizeInfo(nodeId: string, jobId: string): Observable<SizeDetailsEntry>;
private randomNodeName;
private cleanMetadataFromSemicolon;
static ɵfac: i0.ɵɵFactoryDeclaration<NodesApiService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<NodesApiService>;
}