0.0.5 • Published 4 years ago

bpaslib v0.0.5

Weekly downloads
16
License
-
Repository
-
Last release
4 years ago

Bpaslib

This library was generated with Angular CLI version 8.2.14.

Code scaffolding

Run ng generate component component-name --project bpaslib to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project bpaslib.

Note: Don't forget to add --project bpaslib or else it will be added to the default project in your angular.json file.

Build

Run ng build bpaslib to build the project. The build artifacts will be stored in the dist/ directory.

Publishing

After building your library with ng build bpaslib, go to the dist folder cd dist/bpaslib and run npm publish.

Running unit tests

Run ng test bpaslib to execute the unit tests via Karma.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Services

BpaslibService --> This provides a litany of methods

Date Formatting: calculateMinMaxDate(date:Date):void --> Minimum Date will be 50 years in the past. Maximum Date will be 50 years in the future. Saves dates into variables minDate / maxDate. datediff(startdate:any,enddate:any):number --> Return number of days between two dates getJSONtoDate(date:string):Date --> Convert Date from JSON format to Date Object getDatetoJSON(date:any):string --> Convert Date Object to JSON format addDays(date:string,adddays:number):Date --> Add days to a Date Object formattime(elapsedtime:number):string --> Format elapsed time to hh:mm:ss format getOEDateTime(date:string,elapsedtime:number):Date --> Convert OpenEdge Date and Time to Date Ojbect getDateString(date:Date):string --> Format Date Object to MM/DD/YYYY getjsondate(date:Date):string --> Format Date Object to yyy-mm-dd getdatetime(date:string,elapsedtime:number) --> Format Open Edge date string with elapsed time to MM/DD/YYY HH:MM:SS getdatestring(date:string) --> Format Open Edge date to MM/DD/YYYY using date pipe getYear(date:string) --> Get Year from Open Edge date add_months(date:Date,month:number):Date --> Add months to a Date Object getMonthNumber(monthname:string):number --> Using switch case return month number

String Formatting: GetBuildDateTime:string --> Creates a Build Date Time Stamp (YYMMDDHHMM) returnPositive(data:number):number --> Always return positive number maskPartNumber(partnumber:string,maskdata:boolean):string --> Environment value will indicate whether partnumber will be masked createFileName(filename:string,filextension:string):string --> Add DateTime Stamp to file name getInt(value:any):number --> Convert any object to number or return zero isIntvalue:any):boolean --> Check whether object is a number

Function Calls: getrouterUrl:string --> Returns current Route URL getDownLoadLink(urllinktype:string,userrole:string):string --> Transaction pages have download links which we can be different based of user role and transaction type getUser:LoginUser --> Return object with currently logged user details isLoggedIn:boolean --> Check whether user is currently logged in a valid session getEnvironment:string --> Get Environment Name base64ToUint8Array(object):ArrayObject --> Convert any object into Base 64 Unit Array base64(object):any --> Convert object to Base 64 object getExcelTemplate:strin --> Return Excel Template for file download downloadfile(data:any,header:string,filename:string,filextension:string) --> Convert data object to a blob and using file saver make file available for download irrespective of browser exportToExcel(tableid:string,worksheetname:string,filename:string):boolean --> Pass htmlid of a html table which will be converted to an excel and available for download exportToCSV(event:any,tableid:string,filename:strong):boolean --> Pass htmlid of a html table which will be converted to an csv and available for download isEmpty(object:any):boolean --> Check whether object is undefined or null isNumberNullOrZero(object:number):boolean --> Check whether number is zero or null isStringEmpty(object:string):boolean --> Check whether string is empty isStringBlank(object:string):boolean --> Check whether string is empty isBiggerThanZero(object:number):boolean --> Check whether number is greater than zero findIndexInArray(data:any,value:any):number --> Search value in data and return Array Index number findinArray(data:any,searchvalue:string):boolean --> Recursive search to check whether search value exists in data array findIndexInData(data:any,propertyname:string,searchvalue:string,operator?:string):any --> Search array recursively for propertyname and if operator is provided (first / last) stop search after operator has been applied openPDF(data:any,filename:string,showdata:boolean):boolean --> For Safari browsers open PDF content in new browser or tab, for IE browsers make pdf available for download, other browser return true for the browser to open pdf as embedded object getEmptyRequest:any --> Build PUT Request parameters initRequest(user:LoginUser,Page?string):any --> Build PUT Request parameters and add logged user details. If Page is not undefined pass SponsorReport LoginID buildInputData(parametername:string,parametervalue:string,recordnumber?:number):any --> Build PUT Request parameters addPutRequest(request:any,parametername:string,parametervalue:string,recordnumber?:number):request --> Add PUT Request Parameters to array received which will be returned back updatePropValue(request[]:any,searchvalue:string,updatevalue:string):request[] --> Update Parameter value with update value on finding searchvalue cleanUpNull(object[]:any):any[] --> Recursive process to make all null string values blank getPropertyTotal(data:any,propertyname:string):any --> Sum up value where array property name matches provided propertyname cloneObject(object:T)T --> Generic cloning of passed object interface array cloneArray(object:any[])any[] --> Clone object using slice transferData(object1:any,object2:any):any[] --> Create clone of object2 and transfer data from object1 to cloned object2 announceMission(message:string) --> Using Subject publish message to all subscribing components announceData(data:any) --> Using Subject publish object to all subscribing components announceSwitchPlan(PlanDetail:Interface) --> Using Subject publish PlanDetail object to all subscribing components announceNotifications(data:any) --> Using Subject publish Notification object to all subscribing components setMessage(data:any) --> Save Environment Data Array to collection for the current session getMessage(messageName:string):any --> Search message name in Environment data array and return corresponding name value pair object getkey(messageText:string):any --> Search message text in Environment data array and return corresponding message name setOption(key:string,data:any) --> Save data to a collection for the current session removeOption(key:string) --> Remove data from collection based of key getConfig(key:string) --> Return data from collection based of key checkObjectinCollection(data:any[],found:boolean,searchvalue:string):boolean --> Recursive search of an array for search value and return whether found or not getDataSetFromCollection(datain:any[],dataout:any[],searchvalue:string):any[] --> Recursive search and extractions of data on finding key of data collection searchParamProperty(datain:any[],dataout:any[],searchvalue:string) --> Recursive search of Name Value pair object and apply searchvalue updateParamProperty(data:any[],searchvalue:string,updatevalue:string) --> Recursive search of Name Value pair object and update value on successfull search initializePoller(callback:any) --> Initialize Polling callback method by binding it to a split button for page refresh startPoller(delayperiod:number,callback:any) --> Start Polling using delay period stopPoller --> Stop Polling getPlanOptionValue(data:any,searchvalue:string):boolean --> Apply rule search in data and return whether it's allowed or not getPlanOptionDefaultValue(data:any,searchvalue,default:boolean):boolean --> Apply rule search in data and return default value if rule is not found else return whether it's allowed or not cleanupEmptyArray(data:any):any --> Initialize array if values are null getLogJobID(data:any):string --> Parse LogJobID from data getErrorMessages(data:any,checkErrorStatus?:boolean):any --> Parse all Error Messages and return it as an array getAccountGrouping(data:any) --> Check Plan Options for Account Grouping Rules and set appropriates Option Rules

Web Requests: getHTMLdata(url:string):Observable --> make http call for url and pipe result back as observable array buildMessageRequest(url:string,data:any,logjobid:string,msgType?:string):any --> Build Web Logger Request for all Web Calls (msgType: Request / Response) buildHeaders:HttpHeaders --> Build HTTP Header for REST API Calls buildHeadersXml:HttpHeaders --> Build HTTP Header for SOAP Calls responseLogger(url:string,data:any,logjobid:string,msgType?:string)Observable<any[]> --> Log Web Response to Logger Services (msgType: Request / Response) postlogger(url:string,data:any,checkErrorStatus?:boolean):any --> Parse Errors from Web Response and Log Response to Logger Services postErrorLogger(url:string,data:any,ErrorMessage:string) --> Post Errors for Web Request to Logger Service postJSONdata(url:string,data:any,callback:string):Observable --> POST REST API Calls putJSONdata(url:string,data:any,callback:string):Observable --> PUT REST API Calls getJSONdata(url:string,data:any,callback:string):Observable --> GET REST API Calls saveMessageErrorHandler(HttpErrorResponse,url:string,data:any) --> Log Error Messages and then make REST API Call handleError(HttpErrorResponse) --> Parse Error Messages and Log it

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago