@cafecafe/afip.ts
Version:
Afip typescript SDK
35 lines • 1.69 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.SoapClientFacade = void 0;
const path_1 = require("path");
const soap_1 = require("soap");
class SoapClientFacade {
// eslint-disable-next-line @typescript-eslint/no-empty-function
construct() { }
/**
* Geth the path for the WSDL file stored on the WSDL folder.
*
* @param wsdlFile
* @param forceFolderPath
* @returns Path of wsdl file
*/
static getWsdlPath(wsdlFile, forceFolderPath) {
return (0, path_1.resolve)(forceFolderPath !== null && forceFolderPath !== void 0 ? forceFolderPath : (0, path_1.resolve)(__dirname, "wsdl/"), wsdlFile);
}
static create(_a) {
return __awaiter(this, arguments, void 0, function* ({ wsdl, options, }) {
return (yield (0, soap_1.createClientAsync)(SoapClientFacade.getWsdlPath(wsdl), options));
});
}
}
exports.SoapClientFacade = SoapClientFacade;
//# sourceMappingURL=soap-client-facade.js.map