feat: add account pins api
This commit is contained in:
parent
7cdcfe3b3e
commit
83b7d78af1
|
@ -1,10 +1,3 @@
|
||||||
import axios, {
|
|
||||||
AxiosError,
|
|
||||||
AxiosProgressEvent,
|
|
||||||
AxiosRequestConfig,
|
|
||||||
} from "axios";
|
|
||||||
import type { AxiosResponse, ResponseType, Method } from "axios";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
uploadFile,
|
uploadFile,
|
||||||
uploadLargeFile,
|
uploadLargeFile,
|
||||||
|
@ -36,6 +29,8 @@ import {
|
||||||
import { CustomClientOptions } from "#utils/options.js";
|
import { CustomClientOptions } from "#utils/options.js";
|
||||||
import { throwValidationError } from "#utils/validation.js";
|
import { throwValidationError } from "#utils/validation.js";
|
||||||
|
|
||||||
|
import { accountPins } from "./methods/account.js";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The S5 Client which can be used to access S5-net.
|
* The S5 Client which can be used to access S5-net.
|
||||||
*/
|
*/
|
||||||
|
@ -56,6 +51,7 @@ export class S5Client {
|
||||||
publishEntry = publishEntry;
|
publishEntry = publishEntry;
|
||||||
createEntry = createEntry;
|
createEntry = createEntry;
|
||||||
getEntry = getEntry;
|
getEntry = getEntry;
|
||||||
|
accountPins = accountPins;
|
||||||
// Download
|
// Download
|
||||||
protected uploadSmallFile = uploadSmallFile;
|
protected uploadSmallFile = uploadSmallFile;
|
||||||
protected uploadSmallFileRequest = uploadSmallFileRequest;
|
protected uploadSmallFileRequest = uploadSmallFileRequest;
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
import { CustomClientOptions, optionsToConfig } from "#utils/options.js";
|
||||||
|
import { S5Client } from "#client.js";
|
||||||
|
import { AccountPinsResponse, getS5AccountPins } from "#generated/index.js";
|
||||||
|
|
||||||
|
export async function accountPins(
|
||||||
|
this: S5Client,
|
||||||
|
customOptions: CustomClientOptions = {},
|
||||||
|
): Promise<AccountPinsResponse> {
|
||||||
|
const opts = {
|
||||||
|
...this.customOptions,
|
||||||
|
...customOptions,
|
||||||
|
...{
|
||||||
|
endpointPath: "/s5/account/pins",
|
||||||
|
baseUrl: await this.portalUrl,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const config = optionsToConfig(this, opts);
|
||||||
|
|
||||||
|
return await getS5AccountPins(config);
|
||||||
|
}
|
Loading…
Reference in New Issue