refactor: make schema root-level object
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
export const extractedFactSchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
items: {
|
||||
type: "array",
|
||||
items: {
|
||||
type: "object",
|
||||
@@ -28,12 +32,21 @@ export const extractedFactSchema = {
|
||||
description: { type: "string" },
|
||||
metadata: { type: "object", additionalProperties: false },
|
||||
},
|
||||
required: ["name", "category", "granularity", "role", "description"],
|
||||
required: [
|
||||
"name",
|
||||
"category",
|
||||
"granularity",
|
||||
"role",
|
||||
"description",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["statement", "summary", "source", "confidence", "topics"],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["items"],
|
||||
};
|
||||
|
||||
const timeString = {
|
||||
@@ -70,6 +83,10 @@ export const dailyScheduleSchema = {
|
||||
};
|
||||
|
||||
export const monthlyScheduleSchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
items: {
|
||||
type: "array",
|
||||
minItems: 28,
|
||||
maxItems: 31,
|
||||
@@ -82,9 +99,16 @@ export const monthlyScheduleSchema = {
|
||||
},
|
||||
required: ["day", "summary"],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["items"],
|
||||
};
|
||||
|
||||
export const availabilitySchema = {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
properties: {
|
||||
items: {
|
||||
type: "array",
|
||||
minItems: 1,
|
||||
items: {
|
||||
@@ -93,10 +117,16 @@ export const availabilitySchema = {
|
||||
properties: {
|
||||
start: timeString,
|
||||
end: endTimeString,
|
||||
status: { type: "string", enum: ["online", "do-not-disturb", "offline"] },
|
||||
status: {
|
||||
type: "string",
|
||||
enum: ["online", "do-not-disturb", "offline"],
|
||||
},
|
||||
},
|
||||
required: ["start", "end", "status"],
|
||||
},
|
||||
},
|
||||
},
|
||||
required: ["items"],
|
||||
};
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user