1var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 2 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 3 return new (P || (P = Promise))(function (resolve, reject) { 4 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 5 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 6 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 7 step((generator = generator.apply(thisArg, _arguments || [])).next()); 8 }); 9}; 10import { AjaxTransaction } from "../ajax/AjaxTransaction.js"; 11/** 12 * @category Workflow 13 * @class Portfolio 14 * Class for handling portfolios of the Workflow platform. 15 */ 16export class Portfolio extends AjaxTransaction { 17 constructor(ajaxCfg) { 18 super(ajaxCfg); 19 } 20 /** 21 * Get portfolio information from the Workflow. 22 * 23 * ```ts 24 * const portfolio = new SDK.Workflow.Portfolio(ajaxConfig); 25 * portfolio.getPortfolios({employeeId: 1, language: 'EN'}) 26 * .then(res => console.log(res)) 27 * .catch(error => console.log(error)); 28 * ``` 29 * 30 * @param payload 31 * @return List of portfolios 32 */ 33 getPortfolios(payload) { 34 return __awaiter(this, void 0, void 0, function* () { 35 if (!payload) { 36 throw new Error("Payload not informed"); 37 } 38 return this.ajax.post("/webmvc/servicerequestportfolio/listportfolios", payload); 39 }); 40 } 41 /** 42 * Get portfolio information from the Workflow. 43 * 44 * ```ts 45 * const portfolio = new SDK.Workflow.Portfolio(ajaxConfig); 46 * portfolio.getPortfoliosByEmployeeIdAndLanguage(1, 'EN') 47 * .then(res => console.log(res)) 48 * .catch(error => console.log(error)); 49 * ``` 50 * 51 * @param employeeId 52 * @param language 53 * @return List of portfolios 54 */ 55 getPortfoliosByEmployeeIdAndLanguage(employeeId, language) { 56 return __awaiter(this, void 0, void 0, function* () { 57 if (!employeeId) { 58 throw new Error("employeeId not informed"); 59 } 60 if (!language) { 61 throw new Error("language not informed"); 62 } 63 const payload = { employeeId: employeeId, language: language }; 64 return this.getPortfolios(payload); 65 }); 66 } 67}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.