feat(cron): require job name
This commit is contained in:
@@ -412,7 +412,8 @@ export const CronJobStateSchema = Type.Object(
|
||||
export const CronJobSchema = Type.Object(
|
||||
{
|
||||
id: NonEmptyString,
|
||||
name: Type.Optional(Type.String()),
|
||||
name: NonEmptyString,
|
||||
description: Type.Optional(Type.String()),
|
||||
enabled: Type.Boolean(),
|
||||
createdAtMs: Type.Integer({ minimum: 0 }),
|
||||
updatedAtMs: Type.Integer({ minimum: 0 }),
|
||||
@@ -440,7 +441,8 @@ export const CronStatusParamsSchema = Type.Object(
|
||||
|
||||
export const CronAddParamsSchema = Type.Object(
|
||||
{
|
||||
name: Type.Optional(Type.String()),
|
||||
name: NonEmptyString,
|
||||
description: Type.Optional(Type.String()),
|
||||
enabled: Type.Optional(Type.Boolean()),
|
||||
schedule: CronScheduleSchema,
|
||||
sessionTarget: Type.Union([Type.Literal("main"), Type.Literal("isolated")]),
|
||||
|
||||
@@ -968,6 +968,7 @@ describe("gateway server", () => {
|
||||
id: "cron-add-log-1",
|
||||
method: "cron.add",
|
||||
params: {
|
||||
name: "log test",
|
||||
enabled: true,
|
||||
schedule: { kind: "at", atMs },
|
||||
sessionTarget: "main",
|
||||
@@ -1077,6 +1078,7 @@ describe("gateway server", () => {
|
||||
id: "cron-add-log-2",
|
||||
method: "cron.add",
|
||||
params: {
|
||||
name: "log test (jobs.json)",
|
||||
enabled: true,
|
||||
schedule: { kind: "at", atMs },
|
||||
sessionTarget: "main",
|
||||
@@ -1207,6 +1209,7 @@ describe("gateway server", () => {
|
||||
id: "cron-add-auto-1",
|
||||
method: "cron.add",
|
||||
params: {
|
||||
name: "auto run test",
|
||||
enabled: true,
|
||||
schedule: { kind: "at", atMs },
|
||||
sessionTarget: "main",
|
||||
|
||||
Reference in New Issue
Block a user