refactor: make schema root-level object
This commit is contained in:
@@ -1,39 +1,52 @@
|
||||
export const extractedFactSchema = {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
statement: { type: "string" },
|
||||
summary: { type: "string" },
|
||||
source: { type: "string" },
|
||||
confidence: { type: "number" },
|
||||
metadata: { type: "object", additionalProperties: false },
|
||||
topics: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
name: { type: "string" },
|
||||
category: {
|
||||
type: "string",
|
||||
enum: ["entity", "concept", "temporal", "custom"],
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
items: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
statement: { type: "string" },
|
||||
summary: { type: "string" },
|
||||
source: { type: "string" },
|
||||
confidence: { type: "number" },
|
||||
metadata: { type: "object", additionalProperties: false },
|
||||
topics: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
name: { type: "string" },
|
||||
category: {
|
||||
type: "string",
|
||||
enum: ["entity", "concept", "temporal", "custom"],
|
||||
},
|
||||
granularity: {
|
||||
type: "string",
|
||||
enum: ["abstract", "concrete", "mixed"],
|
||||
},
|
||||
role: { type: "string" },
|
||||
description: { type: "string" },
|
||||
metadata: { type: "object", additionalProperties: false },
|
||||
},
|
||||
required: [
|
||||
"name",
|
||||
"category",
|
||||
"granularity",
|
||||
"role",
|
||||
"description",
|
||||
],
|
||||
},
|
||||
granularity: {
|
||||
type: "string",
|
||||
enum: ["abstract", "concrete", "mixed"],
|
||||
},
|
||||
role: { type: "string" },
|
||||
description: { type: "string" },
|
||||
metadata: { type: "object", additionalProperties: false },
|
||||
},
|
||||
required: ["name", "category", "granularity", "role", "description"],
|
||||
},
|
||||
required: ["statement", "summary", "source", "confidence", "topics"],
|
||||
},
|
||||
},
|
||||
required: ["statement", "summary", "source", "confidence", "topics"],
|
||||
},
|
||||
required: ["items"],
|
||||
};
|
||||
|
||||
const timeString = {
|
||||
@@ -70,33 +83,50 @@ export const dailyScheduleSchema = {
|
||||
};
|
||||
|
||||
export const monthlyScheduleSchema = {
|
||||
type: "array",
|
||||
minItems: 28,
|
||||
maxItems: 31,
|
||||
items: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
day: { type: "integer", minimum: 1, maximum: 31 },
|
||||
summary: { type: "string" },
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
items: {
|
||||
type: "array",
|
||||
minItems: 28,
|
||||
maxItems: 31,
|
||||
items: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
day: { type: "integer", minimum: 1, maximum: 31 },
|
||||
summary: { type: "string" },
|
||||
},
|
||||
required: ["day", "summary"],
|
||||
},
|
||||
},
|
||||
required: ["day", "summary"],
|
||||
},
|
||||
required: ["items"],
|
||||
};
|
||||
|
||||
export const availabilitySchema = {
|
||||
type: "array",
|
||||
minItems: 1,
|
||||
items: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
start: timeString,
|
||||
end: endTimeString,
|
||||
status: { type: "string", enum: ["online", "do-not-disturb", "offline"] },
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
items: {
|
||||
type: "array",
|
||||
minItems: 1,
|
||||
items: {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
start: timeString,
|
||||
end: endTimeString,
|
||||
status: {
|
||||
type: "string",
|
||||
enum: ["online", "do-not-disturb", "offline"],
|
||||
},
|
||||
},
|
||||
required: ["start", "end", "status"],
|
||||
},
|
||||
},
|
||||
required: ["start", "end", "status"],
|
||||
},
|
||||
required: ["items"],
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user