@hokuto/jam-node
Version:
JAM Node TS, guardians and utils
24 lines (23 loc) • 1.18 kB
JavaScript
import { CoreApi, BlobContentType, IdKeyType, } from "@hokuto/jam-core";
import { SearchViewBoxApi, fetchAtlasImage, fetchAtlasSvg, fetchBlob, fetchJSON, fetchUpload, } from "./fetch.js";
import { ApiMethod } from "../types.js";
import { getAtlasImageUrl } from "./url.js";
export const AtlasApi = {
Search: new SearchViewBoxApi(CoreApi.Atlas.Search),
Create: fetchJSON(CoreApi.Atlas.Create, ApiMethod.Post),
Read: fetchJSON(CoreApi.Atlas.Read),
Update: fetchJSON(CoreApi.Atlas.Update, ApiMethod.Put),
Delete: fetchJSON(CoreApi.Atlas.Delete, ApiMethod.Delete),
Clone: fetchJSON(CoreApi.Atlas.Clone, ApiMethod.Post),
Export: fetchBlob(CoreApi.Atlas.Export, BlobContentType.Json),
Import: fetchUpload(CoreApi.Atlas.Import),
Centroid: fetchJSON(CoreApi.Atlas.Centroid),
Image: fetchAtlasImage(CoreApi.Atlas.Image),
ImageUrl: getAtlasImageUrl(CoreApi.Atlas.Image),
Label: fetchAtlasImage(CoreApi.Atlas.Label),
LabelUrl: getAtlasImageUrl(CoreApi.Atlas.Label),
Pin: fetchJSON(CoreApi.Atlas.Pin),
ViewBox: fetchJSON(CoreApi.Atlas.ViewBox),
Shape: fetchJSON(CoreApi.Atlas.Shape),
Svg: fetchAtlasSvg(CoreApi.Atlas.Svg),
};