feat: add extended support for versioned entities in the CLI (#3912)

This commit is contained in:
James George
2024-03-20 20:13:22 +05:30
committed by GitHub
parent fc20b76080
commit 7621ff2961
14 changed files with 352 additions and 159 deletions

View File

@@ -8,8 +8,7 @@ import { translateToNewRequest } from "../rest"
import { translateToGQLRequest } from "../graphql"
const versionedObject = z.object({
// v is a stringified number
v: z.string().regex(/^\d+$/).transform(Number),
v: z.number(),
})
export const HoppCollection = createVersionedEntity({
@@ -26,7 +25,7 @@ export const HoppCollection = createVersionedEntity({
// For V1 we have to check the schema
const result = V1_VERSION.schema.safeParse(data)
return result.success ? 0 : null
return result.success ? 1 : null
},
})