UNPKG

@bunq-community/bunq-js-client

Version:

[![NPM Version](https://img.shields.io/npm/v/@bunq-community/bunq-js-client.svg) ](https://www.npmjs.com/package/@bunq-community/bunq-js-client) [![NPM Downloads](https://img.shields.io/npm/dt/@bunq-community/bunq-js-client.svg) ](https://www.npmjs.com/p

24 lines (23 loc) 844 B
"use strict"; 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;