UNPKG

nmkr-studio-api

Version:

Typesafe API Client to work with the NMKR Studio V2 API

59 lines 2.57 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.IpfsService = void 0; class IpfsService { constructor(httpRequest) { this.httpRequest = httpRequest; } /** * Returns a list with all uploaded files to IPFS. The files/NFTs that are in a project are not returned * @returns GetAllUploadedFilesResultClass Returns the GetAllUploadedFilesResult Class * @throws ApiError */ getV2GetAllUploadedFiles({ customerid, maxCount = 100, page = 1, }) { return this.httpRequest.request({ method: 'GET', url: '/v2/GetAllUploadedFiles/{customerid}', path: { customerid: customerid, }, query: { maxCount: maxCount, page: page, }, errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `No Image Content was provided. Send a file either as Base64 or as Link or IPFS Hash`, 406: `See the errormessage in the resultset for further information`, 409: `There is a conflict with the provided images. Send a file either as Base64 or as Link or IPFS Hash`, 500: `Internal server error - see the errormessage in the resultset`, }, }); } /** * Upload a File pin it to IPFS * With this API you can upload a file to IPFS. You can upload the file as BASE64 Content or as URL Link. * @returns string Returns the UploadToIpfsResult Class * @throws ApiError */ postV2UploadToIpfs({ customerid, requestBody, }) { return this.httpRequest.request({ method: 'POST', url: '/v2/UploadToIpfs/{customerid}', path: { customerid: customerid, }, body: requestBody, mediaType: 'application/json', errors: { 401: `The access was denied. (Wrong or expired APIKEY, wrong projectid etc.)`, 404: `No Image Content was provided. Send a file either as Base64 or as Link or IPFS Hash`, 406: `See the errormessage in the resultset for further information`, 409: `There is a conflict with the provided images. Send a file either as Base64 or as Link or IPFS Hash`, 500: `Internal server error - see the errormessage in the resultset`, }, }); } } exports.IpfsService = IpfsService; //# sourceMappingURL=IpfsService.js.map