Comparing version 1.2.6 to 1.3.0
@@ -17,3 +17,3 @@ "use strict"; | ||
const match = /<\S+Result>(.+)<\/\S+Result>/s.exec(string); | ||
assert_1.default(match && match[1], new Error('SOAP Result empty or not found in response')); | ||
(0, assert_1.default)(match && match[1], new Error('SOAP Result empty or not found in response')); | ||
return match[1]; | ||
@@ -43,11 +43,11 @@ } | ||
async login() { | ||
assert_1.default(this.key, new Error('no api key provided')); | ||
const body = await template_js_1.template('Zaloguj', { key: this.key }); | ||
(0, assert_1.default)(this.key, new Error('no api key provided')); | ||
const body = await (0, template_js_1.template)('Zaloguj', { key: this.key }); | ||
const response = await this.api({ body }); | ||
const sid = soapResult(response.body); | ||
assert_1.default(sid, new Error('login failed, no session foun in response')); | ||
(0, assert_1.default)(sid, new Error('login failed, no session foun in response')); | ||
this.sid = sid; | ||
} | ||
async value(value) { | ||
const body = await template_js_1.template('GetValue', { value }); | ||
const body = await (0, template_js_1.template)('GetValue', { value }); | ||
const response = await this.api({ body }); | ||
@@ -57,11 +57,11 @@ return soapResult(response.body); | ||
async report(query) { | ||
const body = await template_js_1.template('DanePobierzPelnyRaport', query); | ||
const body = await (0, template_js_1.template)('DanePobierzPelnyRaport', query); | ||
const response = await this.api({ headers: { sid: this.sid }, body }); | ||
const result = await xml_parser_js_1.xml2json(soapResult(response.body)); | ||
const result = await (0, xml_parser_js_1.xml2json)(soapResult(response.body)); | ||
return validate(extractData(result)); | ||
} | ||
async search(query) { | ||
const body = await template_js_1.template('DaneSzukajPodmioty', query); | ||
const body = await (0, template_js_1.template)('DaneSzukajPodmioty', query); | ||
const response = await this.api({ headers: { sid: this.sid }, body }); | ||
const result = await xml_parser_js_1.xml2json(soapResult(response.body)); | ||
const result = await (0, xml_parser_js_1.xml2json)(soapResult(response.body)); | ||
return validate(extractData(result)); | ||
@@ -68,0 +68,0 @@ } |
@@ -11,10 +11,10 @@ "use strict"; | ||
explicitArray: false, | ||
emptyTag: null, | ||
tagNameProcessors: [normalize_js_1.removePrefix('praw_'), processors_js_1.firstCharLowerCase], | ||
emptyTag: undefined, | ||
tagNameProcessors: [(0, normalize_js_1.removePrefix)('praw_'), processors_js_1.firstCharLowerCase], | ||
}; | ||
const parser = new xml2js_1.Parser(options); | ||
async function xml2json(xml) { | ||
return parser.parseStringPromise(entities_1.decodeXML(xml)); | ||
return parser.parseStringPromise((0, entities_1.decodeXML)(xml)); | ||
} | ||
exports.xml2json = xml2json; | ||
//# sourceMappingURL=xml-parser.js.map |
{ | ||
"name": "bir1", | ||
"version": "1.2.6", | ||
"version": "1.3.0", | ||
"description": "GUS REGON api client", | ||
@@ -18,6 +18,10 @@ "keywords": [ | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist", | ||
"templates" | ||
], | ||
"scripts": { | ||
"test": "tap --no-coverage", | ||
"build": "tsc", | ||
"dev": "tsc -w" | ||
"dev": "tsc -w", | ||
"test": "tap --no-coverage" | ||
}, | ||
@@ -31,7 +35,8 @@ "dependencies": { | ||
"devDependencies": { | ||
"@types/node": "^14.17.3", | ||
"@types/xml2js": "^0.4.8", | ||
"dotenv": "^9.0.0", | ||
"tap": "^15.0.9", | ||
"typescript": "^4.2.4" | ||
"@types/node": "^18.11.18", | ||
"@types/xml2js": "^0.4.11", | ||
"dotenv": "^16.0.3", | ||
"tap": "^16.3.3", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.9.4" | ||
}, | ||
@@ -38,0 +43,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unpublished package
Supply chain riskPackage version was not found on the registry. It may exist on a different registry and need to be configured to pull from that registry.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Unpopular package
QualityThis package is not very popular.
Found 1 instance in 1 package
0
17267
6
24
1