import { Ref } from "vue" import * as E from "fp-ts/Either" import { Handle, HandleRef } from "./handle" import { Workspace, WorkspaceCollection, WorkspaceDecor, WorkspaceRequest, } from "./workspace" import { RESTCollectionLevelAuthHeadersView, RESTCollectionChildrenView, RootRESTCollectionView, RESTSearchResultsView, RESTCollectionJSONView, } from "./view" import { HoppCollection, HoppRESTRequest } from "@hoppscotch/data" export interface WorkspaceProvider { providerID: string workspaceDecor?: Ref getWorkspaceHandle( workspaceID: string ): Promise>> getCollectionHandle( workspaceHandle: HandleRef, collectionID: string ): Promise>> getRequestHandle( workspaceHandle: HandleRef, requestID: string ): Promise>> getRESTRootCollectionView( workspaceHandle: HandleRef ): Promise>> getRESTCollectionChildrenView( collectionHandle: HandleRef ): Promise>> getRESTCollectionLevelAuthHeadersView( collectionHandle: HandleRef ): Promise>> getRESTSearchResultsView( workspaceHandle: HandleRef, searchQuery: Ref ): Promise>> getRESTCollectionJSONView( workspaceHandle: HandleRef ): Promise>> createRESTRootCollection( workspaceHandle: HandleRef, newCollection: Partial> & { name: string } ): Promise>> createRESTChildCollection( parentCollectionHandle: HandleRef, newChildCollection: Partial & { name: string } ): Promise>> updateRESTCollection( collectionHandle: HandleRef, updatedCollection: Partial ): Promise> removeRESTCollection( collectionHandle: HandleRef ): Promise> createRESTRequest( parentCollectionHandle: HandleRef, newRequest: HoppRESTRequest ): Promise>> updateRESTRequest( requestHandle: HandleRef, updatedRequest: Partial ): Promise> removeRESTRequest( requestHandle: HandleRef ): Promise> importRESTCollections( workspaceHandle: HandleRef, collections: HoppCollection[] ): Promise>> exportRESTCollections( workspaceHandle: HandleRef, collections: HoppCollection[] ): Promise> exportRESTCollection( collectionHandle: HandleRef, collection: HoppCollection ): Promise> reorderRESTCollection( collectionHandle: HandleRef, destinationCollectionID: string | null ): Promise> moveRESTCollection( collectionHandle: HandleRef, destinationCollectionID: string | null ): Promise> reorderRESTRequest( requestHandle: HandleRef, destinationCollectionID: string, destinationRequestID: string | null ): Promise> moveRESTRequest( requestHandle: HandleRef, destinationCollectionID: string ): Promise> }