upgrade to 1.1.0

This commit is contained in:
ben committed 2026-10-23 18:49:11 +00:00
1 parent 02c95d89bb
commit f5893a107d
46 files changed
+3764 -2891

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
"use strict";
const axios = require('axios');
const { getConfig, getDefault } = require('./config.js');
function _getUrl(path) {
const cfg = getConfig();
return `${cfg.apiUrl}${path}`;
}
function _getArchiveUrl(path) {
const cfg = getConfig();
return `${cfg.archiveUrl}${path}`;
}
function _headers(token) {
return {
'Authorization': `Bearer ${token || getConfig().apiKey}`,
};
}
async function getAudits({ agreementId, eventId, meta }) {
return (await axios.post(_getArchiveUrl('/api/v1/audit/get'), { agreementId: agreementId || getDefault('agreementId'), eventId, meta }, { headers: _headers(getConfig().archiveKey) })).data;
}
async function verifyAudit({ audits, shortNames }) {
return (await axios.post(_getUrl('/api/v1/data/audit/verify'), { audits, shortNames }, { headers: _headers() })).data;
}
module.exports = { getAudits, verifyAudit };