/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 762b25305020 */ import * as z from "zod/v4"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { RegistrySharingScope, RegistrySharingScope$inboundSchema, } from "./registrysharingscope.js"; import { SkillDefinition, SkillDefinition$inboundSchema, } from "./skilldefinition.js"; export type Skill = { id?: string | undefined; /** * Stable object name. */ name?: string | undefined; /** * Versioned skill content. */ definition?: SkillDefinition | undefined; version?: number | undefined; /** * Notes for this version. */ notes?: string | undefined; /** * Aliases pointing to this version. */ aliases?: Array | undefined; sharingScope?: RegistrySharingScope | undefined; /** * RFC 3339 timestamp. */ createdAt?: Date | undefined; /** * RFC 3339 timestamp. */ updatedAt?: Date | undefined; /** * Latest version number. */ latestVersion?: number | undefined; }; /** @internal */ export const Skill$inboundSchema: z.ZodType = z.object({ id: z.string().optional(), name: z.string().optional(), definition: SkillDefinition$inboundSchema.optional(), version: z.int().optional(), notes: z.string().optional(), aliases: z.array(z.string()).optional(), sharingScope: RegistrySharingScope$inboundSchema.optional(), createdAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)) .optional(), updatedAt: z.iso.datetime({ offset: true }).transform(v => new Date(v)) .optional(), latestVersion: z.int().optional(), }); export function skillFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => Skill$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'Skill' from JSON`, ); }