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