chore: update types
This commit is contained in:
@@ -8,7 +8,7 @@ export const getDefaultRESTRequest = (): HoppRESTRequest => ({
|
||||
headers: [],
|
||||
method: "GET",
|
||||
auth: {
|
||||
authType: "none",
|
||||
authType: "inherit",
|
||||
authActive: true,
|
||||
},
|
||||
preRequestScript: "",
|
||||
|
||||
@@ -2,6 +2,7 @@ import { HoppRESTRequest } from "@hoppscotch/data"
|
||||
import { HoppRESTResponse } from "../types/HoppRESTResponse"
|
||||
import { HoppTestResult } from "../types/HoppTestResult"
|
||||
import { RESTOptionTabs } from "~/components/http/RequestOptions.vue"
|
||||
import { HoppInheritedProperty } from "../types/HoppInheritedProperties"
|
||||
|
||||
export type HoppRESTSaveContext =
|
||||
| {
|
||||
@@ -80,4 +81,10 @@ export type HoppRESTDocument = {
|
||||
* Options tab preference for the current tab's document
|
||||
*/
|
||||
optionTabPreference?: RESTOptionTabs
|
||||
|
||||
/**
|
||||
* The inherited properties from the parent collection
|
||||
* (if any)
|
||||
*/
|
||||
inheritedProperties?: HoppInheritedProperty
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { HoppRESTRequest } from "@hoppscotch/data"
|
||||
|
||||
export type HoppInheritedProperty = {
|
||||
parentId: string
|
||||
parentName: string
|
||||
auth?: HoppRESTRequest["auth"]
|
||||
headers?: HoppRESTRequest["headers"]
|
||||
}
|
||||
@@ -17,6 +17,11 @@ const defaultRESTCollectionState = {
|
||||
name: "My Collection",
|
||||
folders: [],
|
||||
requests: [],
|
||||
auth: {
|
||||
authType: "inherit",
|
||||
authActive: false,
|
||||
},
|
||||
headers: [],
|
||||
}),
|
||||
],
|
||||
}
|
||||
@@ -27,6 +32,11 @@ const defaultGraphqlCollectionState = {
|
||||
name: "My GraphQL Collection",
|
||||
folders: [],
|
||||
requests: [],
|
||||
auth: {
|
||||
authType: "inherit",
|
||||
authActive: false,
|
||||
},
|
||||
headers: [],
|
||||
}),
|
||||
],
|
||||
}
|
||||
@@ -132,6 +142,15 @@ const restCollectionDispatchers = defineDispatchers({
|
||||
name,
|
||||
folders: [],
|
||||
requests: [],
|
||||
auth: {
|
||||
authType: "inherit",
|
||||
authActive: false,
|
||||
auth: {
|
||||
authType: "inherit",
|
||||
authActive: false,
|
||||
},
|
||||
},
|
||||
headers: [],
|
||||
})
|
||||
|
||||
const newState = state
|
||||
@@ -690,8 +709,12 @@ const gqlCollectionDispatchers = defineDispatchers({
|
||||
name,
|
||||
folders: [],
|
||||
requests: [],
|
||||
auth: {
|
||||
authType: "inherit",
|
||||
authActive: false,
|
||||
},
|
||||
headers: [],
|
||||
})
|
||||
|
||||
const newState = state
|
||||
const indexPaths = path.split("/").map((x) => parseInt(x))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user