@mitre-attack/attack-data-model
Version:
A TypeScript API for the MITRE ATT&CK data model
44 lines (42 loc) • 1.91 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/schemas/common/stix-timestamp.ts
var stix_timestamp_exports = {};
__export(stix_timestamp_exports, {
stixCreatedTimestampSchema: () => stixCreatedTimestampSchema,
stixModifiedTimestampSchema: () => stixModifiedTimestampSchema,
stixTimestampSchema: () => stixTimestampSchema
});
module.exports = __toCommonJS(stix_timestamp_exports);
var import_v4 = require("zod/v4");
var stixTimestampSchema = import_v4.z.iso.datetime({
error: "Invalid STIX timestamp format: must be an RFC3339 timestamp with a timezone specification of 'Z'."
}).refine((val) => val.endsWith("Z"), {
message: "STIX timestamps must use 'Z' timezone specification"
}).meta({
description: "Represents timestamps across the CTI specifications. The format is an RFC3339 timestamp, with a required timezone specification of 'Z'."
});
var stixCreatedTimestampSchema = stixTimestampSchema.brand();
var stixModifiedTimestampSchema = stixTimestampSchema.brand();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
stixCreatedTimestampSchema,
stixModifiedTimestampSchema,
stixTimestampSchema
});