@bunq-community/bunq-js-client
Version:
[ ](https://www.npmjs.com/package/@bunq-community/bunq-js-client) [ ](https://www.npmjs.com/p
24 lines (23 loc) • 844 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
class AttachmentPublic {
/**
* @param {ApiAdapter} ApiAdapter
*/
constructor(ApiAdapter) {
this.ApiAdapter = ApiAdapter;
this.Session = ApiAdapter.Session;
}
async post(buffer, contentType, options = {}) {
const limiter = this.ApiAdapter.RequestLimitFactory.create("/attachment-public", "POST");
// do the actual call
const response = await limiter.run(async (axiosClient) => this.ApiAdapter.post(`/v1/attachment-public`, buffer, {
"Content-Type": contentType,
"X-Bunq-Attachment-Description": "Default description"
}, {
includesFile: true
}, axiosClient));
return response.Response[0].Uuid.uuid;
}
}
exports.default = AttachmentPublic;