karso/front/src/back-api/api/public-key-resource.ts

47 lines
816 B
TypeScript

/**
* Interface of the server (auto-generated code)
*/
import {
HTTPMimeType,
HTTPRequestModel,
RESTConfig,
RESTRequestJson,
} from "../rest-tools";
import {
PublicKey,
isPublicKey,
} from "../model";
export namespace PublicKeyResource {
export function getKey({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<PublicKey> {
return RESTRequestJson({
restModel: {
endPoint: "/public_key/",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
}, isPublicKey);
};
export function getKeyPem({
restConfig,
}: {
restConfig: RESTConfig,
}): Promise<string> {
return RESTRequestJson({
restModel: {
endPoint: "/public_key//pem",
requestType: HTTPRequestModel.GET,
accept: HTTPMimeType.JSON,
},
restConfig,
});
};
}