import {Extension, HttpMethod, IServiceCall, SessionRequirement} from "@chaosinsight/portalclient" import type {IEndpointResult, IIdentifier, IPortalResponse} from "../index" export default class EZFile extends Extension { protected readonly extensionName = "EZFile" public createPost(assetId: string, fileName: string, originalFileName: string, folderPath: string, formatId: string, parentId: string): IServiceCall> { return this.call("Create", {assetId, fileName, originalFileName, folderPath, formatId, parentId}, HttpMethod.Post, SessionRequirement.authenticated) } public setPost(id: string, name: string): IServiceCall> { return this.call("Set", {id, name}, HttpMethod.Post, SessionRequirement.authenticated) } public deletePost(id: string): IServiceCall> { return this.call("Delete", {id}, HttpMethod.Post, SessionRequirement.authenticated) } public uploadPost(assetId: string, file: File): IServiceCall> { return this.call("Upload", {assetId, file}, HttpMethod.Post, SessionRequirement.authenticated) } } Extension.add(EZFile, "ezFile") declare module "@chaosinsight/portalclient" { interface ExtensionHandler { ezFile: EZFile } }