UNPKG

@mitre-attack/attack-data-model

Version:

A TypeScript API for the MITRE ATT&CK data model

53 lines (50 loc) 1.88 kB
import { attackBaseDomainObjectSchema } from "./chunk-ZQ5CIHH7.js"; import { objectMarkingRefsSchema } from "./chunk-Z7F5EWOT.js"; import { createStixIdValidator } from "./chunk-OM2DJ5DL.js"; import { createStixTypeValidator } from "./chunk-5JU73PGM.js"; import { IdentityClassOV, IndustrySectorOV } from "./chunk-YIPWHVL6.js"; // src/schemas/sdo/identity.schema.ts import { z } from "zod/v4"; var extensibleIdentitySchema = attackBaseDomainObjectSchema.extend({ id: createStixIdValidator("identity"), type: createStixTypeValidator("identity"), object_marking_refs: objectMarkingRefsSchema, identity_class: IdentityClassOV.meta({ description: "The type of entity that this Identity describes, e.g., an individual or organization. This is an open vocabulary and the values SHOULD come from the identity-class-ov vocabulary" }), description: z.string().meta({ description: "A description of the object" }).optional(), // Not used in ATT&CK Identity but defined in STIX roles: z.array(z.string(), { error: (issue) => issue.code === "invalid_type" ? "Roles must be an array of strings" : "Invalid roles array" }).meta({ description: "The list of roles that this Identity performs" }).optional(), // Not used in ATT&CK Identity but defined in STIX sectors: z.array(IndustrySectorOV).meta({ description: "The list of industry sectors that this Identity belongs to. This is an open vocabulary and values SHOULD come from the industry-sector-ov vocabulary" }).optional(), // Not used in ATT&CK Identity but defined in STIX contact_information: z.string().meta({ description: "The contact information (e-mail, phone number, etc.) for this Identity" }).optional() }).omit({ x_mitre_version: true }).strict(); var identitySchema = extensibleIdentitySchema; export { extensibleIdentitySchema, identitySchema };