feat: support import collections between workspaces (#4377)
Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
import { runGQLQuery } from "../backend/GQLClient"
|
||||
import {
|
||||
GetCollectionChildrenDocument,
|
||||
GetSingleCollectionDocument,
|
||||
} from "../backend/graphql"
|
||||
import { TeamRequest } from "./TeamRequest"
|
||||
|
||||
/**
|
||||
@@ -10,3 +15,19 @@ export interface TeamCollection {
|
||||
requests: TeamRequest[] | null
|
||||
data: string | null
|
||||
}
|
||||
|
||||
export const getSingleCollection = (collectionID: string) =>
|
||||
runGQLQuery({
|
||||
query: GetSingleCollectionDocument,
|
||||
variables: {
|
||||
collectionID,
|
||||
},
|
||||
})
|
||||
|
||||
export const getCollectionChildCollections = (collectionID: string) =>
|
||||
runGQLQuery({
|
||||
query: GetCollectionChildrenDocument,
|
||||
variables: {
|
||||
collectionID,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
} from "~/helpers/backend/graphql"
|
||||
import { HoppInheritedProperty } from "../types/HoppInheritedProperties"
|
||||
|
||||
const TEAMS_BACKEND_PAGE_SIZE = 10
|
||||
export const TEAMS_BACKEND_PAGE_SIZE = 10
|
||||
|
||||
/**
|
||||
* Finds the parent of a collection and returns the REFERENCE (or null)
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
import { HoppRESTRequest } from "@hoppscotch/data"
|
||||
import { runGQLQuery } from "../backend/GQLClient"
|
||||
import {
|
||||
GetCollectionRequestsDocument,
|
||||
GetSingleRequestDocument,
|
||||
} from "../backend/graphql"
|
||||
|
||||
/**
|
||||
* Defines how a Teams request is represented in TeamCollectionAdapter
|
||||
@@ -9,3 +14,19 @@ export interface TeamRequest {
|
||||
title: string
|
||||
request: HoppRESTRequest
|
||||
}
|
||||
|
||||
export const getCollectionChildRequests = (collectionID: string) =>
|
||||
runGQLQuery({
|
||||
query: GetCollectionRequestsDocument,
|
||||
variables: {
|
||||
collectionID,
|
||||
},
|
||||
})
|
||||
|
||||
export const getSingleRequest = (requestID: string) =>
|
||||
runGQLQuery({
|
||||
query: GetSingleRequestDocument,
|
||||
variables: {
|
||||
requestID,
|
||||
},
|
||||
})
|
||||
|
||||
@@ -8,19 +8,15 @@ import axios from "axios"
|
||||
import { Service } from "dioc"
|
||||
import * as E from "fp-ts/Either"
|
||||
import { Ref, ref } from "vue"
|
||||
|
||||
import { runGQLQuery } from "../backend/GQLClient"
|
||||
import {
|
||||
GetCollectionChildrenDocument,
|
||||
GetCollectionRequestsDocument,
|
||||
GetSingleCollectionDocument,
|
||||
GetSingleRequestDocument,
|
||||
} from "../backend/graphql"
|
||||
import { TeamCollection } from "./TeamCollection"
|
||||
import { getSingleCollection, TeamCollection } from "./TeamCollection"
|
||||
|
||||
import { platform } from "~/platform"
|
||||
import { HoppInheritedProperty } from "../types/HoppInheritedProperties"
|
||||
import { TeamRequest } from "./TeamRequest"
|
||||
import {
|
||||
getSingleRequest,
|
||||
getCollectionChildRequests,
|
||||
TeamRequest,
|
||||
} from "./TeamRequest"
|
||||
|
||||
type CollectionSearchMeta = {
|
||||
isSearchResult?: boolean
|
||||
@@ -552,38 +548,6 @@ export class TeamSearchService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
const getSingleCollection = (collectionID: string) =>
|
||||
runGQLQuery({
|
||||
query: GetSingleCollectionDocument,
|
||||
variables: {
|
||||
collectionID,
|
||||
},
|
||||
})
|
||||
|
||||
const getSingleRequest = (requestID: string) =>
|
||||
runGQLQuery({
|
||||
query: GetSingleRequestDocument,
|
||||
variables: {
|
||||
requestID,
|
||||
},
|
||||
})
|
||||
|
||||
const getCollectionChildCollections = (collectionID: string) =>
|
||||
runGQLQuery({
|
||||
query: GetCollectionChildrenDocument,
|
||||
variables: {
|
||||
collectionID,
|
||||
},
|
||||
})
|
||||
|
||||
const getCollectionChildRequests = (collectionID: string) =>
|
||||
runGQLQuery({
|
||||
query: GetCollectionRequestsDocument,
|
||||
variables: {
|
||||
collectionID,
|
||||
},
|
||||
})
|
||||
|
||||
const formatTeamsSearchResultsForSpotlight = (
|
||||
request: {
|
||||
collectionID: string
|
||||
|
||||
Reference in New Issue
Block a user