ipfs-http-client
Version:
A client library for the IPFS HTTP API
28 lines (23 loc) • 704 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var configure = require('../../lib/configure.js');
var toUrlSearchParams = require('../../lib/to-url-search-params.js');
const createApply = configure.configure(api => {
async function apply(profile, options = {}) {
const res = await api.post('config/profile/apply', {
signal: options.signal,
searchParams: toUrlSearchParams.toUrlSearchParams({
arg: profile,
...options
}),
headers: options.headers
});
const data = await res.json();
return {
original: data.OldCfg,
updated: data.NewCfg
};
}
return apply;
});
exports.createApply = createApply;