This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Formatter = require("./formatter"); | |
const ApiClient = require("./api-client"); // Any API Client implementation. Can be axios | |
const Parser = require("./parser"); | |
const url = `http://www.dneonline.com/calculator.asmx`; | |
module.exports = class Remote { | |
static async multipleTwoOperands(operandA, operandB) { | |
try { | |
let payload = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Parser = require("./parser"); | |
module.exports = class Formatter { | |
static convertJsonToSoapRequest(jsonArguments) { | |
let soapBody = Parser.parseJSONBodyToXML(jsonArguments); | |
return `<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://tempuri.org/"> | |
<soap:Header/> | |
<soap:Body> | |
${soapBody} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsonxml = require("jsontoxml"); | |
const parseString = require("xml2js").parseString; | |
const { promisify } = require("util"); | |
const promisfiedParseString = promisify(parseString); | |
module.exports = class Parser { | |
static parseJSONBodyToXML(jsonArgument) { | |
return jsonxml(jsonArgument, { html: true }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const jsonxml = require("jsontoxml"); | |
const parseString = require("xml2js").parseString; | |
const { promisify } = require("util"); | |
const promisfiedParseString = promisify(parseString); | |
module.exports = class Parser { | |
static parseJSONBodyToXML(jsonArgument) { | |
return jsonxml(jsonArgument, { html: true }); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function heidiDecode(hex) { | |
var str = ''; | |
var shift = parseInt(hex.substr(-1)); | |
hex = hex.substr(0, hex.length - 1); | |
for (var i = 0; i < hex.length; i += 2) | |
str += String.fromCharCode(parseInt(hex.substr(i, 2), 16) - shift); | |
return str; | |
} | |
document.write(heidiDecode('755A5A585C3D8141786B3C385E3A393')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
validateFilterAndSort(req,res,next) | |
{ | |
let query = req.query['q']; | |
// Let destructure our query. | |
let {filter,sort} = req.query; | |
// Let's limit the possible column user can filter by. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div class="container"> | |
<div class="row mt-5"> | |
<div class="col-12"> | |
<div class="card"> | |
<div class="card-header"> | |
<h3 class="card-title">Users</h3> | |
<div class="card-tools"> |