feat: description field for request parameters and headers (#4187)
* feat: key-value component added for reuse * chore: inspection result added * chore: add `HoppRESTRequest` schema `v7` * feat: add `description` for field for REST request headers * feat: add `description` for field for GraphQL request headers * fix: synchronization logic b/w bulk edit context and the default view - Add `HoppGQLRequest` schema `v6`. - Fix pre-existing issue with changes in bulk edit context not immediately reflecting in the default GQL request headers view. * feat: support importing `description` fields from external sources * test: fix failing tests * chore: include description field for computed headers Headers computed based on authorization info & inherited entries. * feat: add `description` field for headers at the collection level Add `HoppCollection` schema `v3`. * test: fix failing tests * ci: update tests workflow target branch trigger * chore: cleanup * chore: cleanup * chore: rely on type inference --------- Co-authored-by: jamesgeorge007 <25279263+jamesgeorge007@users.noreply.github.com> Co-authored-by: nivedin <nivedinp@gmail.com>
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import { defineVersion, entityReference } from "verzod"
|
||||
import { z } from "zod"
|
||||
import { HoppRESTRequest, HoppRESTAuth } from "../../rest"
|
||||
import { HoppGQLRequest, HoppGQLAuth, GQLHeader } from "../../graphql"
|
||||
import { V1_SCHEMA } from "./1"
|
||||
import { HoppRESTHeaders } from "../../rest/v/1"
|
||||
|
||||
const baseCollectionSchema = z.object({
|
||||
import { HoppGQLRequest } from "../../graphql"
|
||||
import { GQLHeader } from "../../graphql/v/1"
|
||||
import { HoppGQLAuth } from "../../graphql/v/5"
|
||||
import { HoppRESTRequest } from "../../rest"
|
||||
import { HoppRESTHeaders } from "../../rest/v/1"
|
||||
import { HoppRESTAuth } from "../../rest/v/5"
|
||||
import { V1_SCHEMA } from "./1"
|
||||
|
||||
export const v2_baseCollectionSchema = z.object({
|
||||
v: z.literal(2),
|
||||
id: z.optional(z.string()), // For Firestore ID data
|
||||
|
||||
@@ -23,17 +27,18 @@ const baseCollectionSchema = z.object({
|
||||
headers: z.union([HoppRESTHeaders, z.array(GQLHeader)]),
|
||||
})
|
||||
|
||||
type Input = z.input<typeof baseCollectionSchema> & {
|
||||
type Input = z.input<typeof v2_baseCollectionSchema> & {
|
||||
folders: Input[]
|
||||
}
|
||||
|
||||
type Output = z.output<typeof baseCollectionSchema> & {
|
||||
type Output = z.output<typeof v2_baseCollectionSchema> & {
|
||||
folders: Output[]
|
||||
}
|
||||
|
||||
export const V2_SCHEMA: z.ZodType<Output, z.ZodTypeDef, Input> = baseCollectionSchema.extend({
|
||||
folders: z.lazy(() => z.array(V2_SCHEMA)),
|
||||
})
|
||||
export const V2_SCHEMA: z.ZodType<Output, z.ZodTypeDef, Input> =
|
||||
v2_baseCollectionSchema.extend({
|
||||
folders: z.lazy(() => z.array(V2_SCHEMA)),
|
||||
})
|
||||
|
||||
export default defineVersion({
|
||||
initial: false,
|
||||
|
||||
Reference in New Issue
Block a user