UNPKG

ngx-drupal7-services

Version:

# Angular 2+/Ionic 2+ Drupal 7 Services #### Typescript angular module for [Drupal Services 3.x](https://www.drupal.org/project/services)

64 lines (63 loc) 2.13 kB
import { Observable } from 'rxjs'; import { MainService } from '../main/main.service'; import { FileEntity, CommentEntity, NodeEntity, CreatedNode, FileAttach } from '../models'; import * as i0 from "@angular/core"; /** * node service for drupal * @see BACK_END/admin/structure/services/list/END_POINT/resources for more details */ export declare class NodeService extends MainService { entityType: string; /** * impelement index resource * @return array of nodes */ getAllNodes(): Observable<NodeEntity[]>; /** * implement retrive resource * @param nid node id to retrive * @return object of the node entity */ getNodeById(nid: number): Observable<NodeEntity>; /** * implement create resource * @param node node entity to create * @return created node details */ createNode(node: NodeEntity): Observable<CreatedNode>; /** * implement create resource * @param node node to create * @return created node details */ updateNode(node: { nid: number; }): Observable<CreatedNode>; /** * implement delete resource * @param nid node id to delete * @return array true if node deleted, otherwise return false array */ deleteNode(nid: number): Observable<boolean[]>; /** * implement files resource * @param nid node id * @return array of files that attached to that node */ files(nid: number): Observable<FileEntity[]>; /** * implement comments resource * @param nid node id * @return array of comments that attached to that node */ comments(nid: number): Observable<CommentEntity[]>; /** * implement attach_files resource * @param nid node id * @file object contains the field details and the file to upload * @return attached file */ attachFilesToNode(nid: number, file: FileAttach): Observable<FileEntity>; static ɵfac: i0.ɵɵFactoryDeclaration<NodeService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<NodeService>; }