New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

e5core-angular-services

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

e5core-angular-services

e5 Anywhere Angular Services

latest
npmnpm
Version
1.2.2
Version published
Weekly downloads
18
-14.29%
Maintainers
4
Weekly downloads
 
Created
Source

e5core-angular-services (1.2.1)

Copyright 2018 e5 Workflow Inc

This library implements a group of Angular Services that can be used to access the e5 Workflow e5 Anywhere REST API web services from an Angular Application and componment.

Quick Start

The following is a simple guide for adding a e5 Anywhere angular services to an existing Angular CLI application. Note that to access the API you will need to authenticate to the REST web service. The authentication method uses which will depend on your environment (see Authentication).

  • Install the Library
    npm install e5core-angular-services --save
    
  • Register the default API endpoints in the application module e.g. "app.module.ts".
    import { E5coreAngularServicesModule } from 'e5core-angular-services' ;
    ...
    @NgModule({
        imports: [ E5coreAngularServicesModule, ... ]
    
  • Add the Authentication method for your environment.
  • Add the e5 Anywhere API endpoint provider to you 'app.module.ts'.
    import { environment as Environment } from '../environments/environment'
    import { E5ConfigurationService } from 'e5core-angular-services';
    export class EnvConfigurationService extends E5ConfigurationService {
        constructor() {
            super() ;
            this.settings = Environment.e5Configuration
        }
    }
    ...
    @NgModule({
        providers: [
            {
                provide: E5ConfigurationService,
                useClass: EnvConfigurationService
            },
        ...
    
  • Add the environment settings to the "environment.ts".
    export const environment = {
        production: false,
        e5Configuration : {
            env : {
                name : "Simple Configuration"
            },
            apiServer: {
                baseUrl: "http://demo.e5workflow.com:84",
                scope: "test"
            }
        }
    };
    
  • Inject the service into your component.
    import { WorkGetNextService } from 'e5core-angular-services';
    export class GetNextComponent implements OnInit {
        constructor(private service:WorkGetNextService) { }
    
    
  • Call the service in a click handler (for example)
    getNext() {
        this.service.getNextId().subscribe(
            res => {
                this.id = res.id ;
            }
        )
    }
    

Authentication

The e5 Anywhere API REST services can be configured in a number of ways to authenticate a user, and this is depended on what your application and environment are using. For example it could be using Windows Authentication or JWT Tokens.

Adding Windows Authentication

  • Create a "winAuthInterceptor.ts" class file.
    import { Injectable } from '@angular/core';
    import { HttpRequest, HttpHandler, HttpInterceptor, HttpEvent } from '@angular/common/http';
    import { Observable } from 'rxjs';
    
    @Injectable()
    export class WinAuthInterceptor implements HttpInterceptor{
        constructor(){}
    
        intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
            req = req.clone({
                withCredentials: true
            });
            return next.handle(req);
        }
    }
    
  • Add the interceptor to you 'app.module.ts'
    import { HTTP_INTERCEPTORS } from '@angular/common/http';
    import { WinAuthInterceptor } from './WinAuthInterceptor';
    @NgModule({
        providers: [
            {
            provide: HTTP_INTERCEPTORS,
            useClass: WinAuthInterceptor,
            multi: true
            },
            ...
    })
    

Change Log

VersionChanges
1.2.2Work Task APIs : Fixed CSOM Work Task Apis
1.2.1Added Work Task APIs : PrescribeTask, UnprescribeTask, CompleteTask,GetPrescribableTasks, GetPrescribedTasks
1.2.0Upgrade to Angular 7.0
1.1.13Added AddEvent function to WorkItem
1.1.12Added UiDocument service
1.1.11Changed "WorkWork*" models to jusr "Work*"
1.1.10Added getWorkRelatedItems and models to WotkItemService
1.1.9Moved UiListService to ListSearchService and added a prefix "Taxonomy" to the Taxonomy Services.
1.1.8Added SLA Monitor, Attachment and updated workitem and search definition services.
1.1.7Inproved type completion on functions and models, added UI WorkItem and and UI SearchDefinition services.
1.1.4Changed services method optional function parameters into an options typed object. e.g. you can now use getFindWorkItem(1, {}, { select: 'Id,Reference' }) instead of getFindWorkItem(1, {}, null, null, null, null, null, null, null, 'Id,Reference' ).
1.1.6Fixed a couple of NPM deployment issues.

Keywords

e5

FAQs

Package last updated on 07 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts