@hokuto/jam-node
Version:
JAM Node TS, guardians and utils
15 lines (14 loc) • 723 B
JavaScript
import { CoreApi, BlobContentType, IdKeyType, } from "@hokuto/jam-core";
import { SearchFeatureApi, fetchBlob, fetchJSON, fetchUpload, } from "./fetch.js";
import { ApiMethod } from "../types.js";
export const StyleApi = {
Search: new SearchFeatureApi(CoreApi.Style.Search),
Create: fetchJSON(CoreApi.Style.Create, ApiMethod.Post),
Read: fetchJSON(CoreApi.Style.Read),
Update: fetchJSON(CoreApi.Style.Update, ApiMethod.Put),
Delete: fetchJSON(CoreApi.Style.Delete, ApiMethod.Delete),
Clone: fetchJSON(CoreApi.Style.Clone, ApiMethod.Post),
Export: fetchBlob(CoreApi.Style.Export, BlobContentType.Json),
Import: fetchUpload(CoreApi.Style.Import),
Load: fetchUpload(CoreApi.Style.Load),
};