@webiny/api-headless-cms-scheduler 6.0.0 → 6.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/context.js +10 -4
- package/context.js.map +1 -1
- package/exports/api/cms/scheduler.d.ts +2 -0
- package/exports/api/cms/scheduler.js +4 -0
- package/exports/api/cms/scheduler.js.map +1 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnEntryDeleteEventHandler.d.ts +3 -3
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnEntryDeleteEventHandler.js +8 -5
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnEntryDeleteEventHandler.js.map +1 -1
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnPublishEventHandler.d.ts +3 -3
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnPublishEventHandler.js +7 -6
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnPublishEventHandler.js.map +1 -1
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnRevisionDeleteEventHandler.d.ts +3 -3
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnRevisionDeleteEventHandler.js +6 -5
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnRevisionDeleteEventHandler.js.map +1 -1
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnUnpublishEventHandler.d.ts +3 -3
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnUnpublishEventHandler.js +7 -6
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnUnpublishEventHandler.js.map +1 -1
- package/features/NamespaceHandler/NamespaceHandler.d.ts +15 -0
- package/features/NamespaceHandler/NamespaceHandler.js +50 -0
- package/features/NamespaceHandler/NamespaceHandler.js.map +1 -0
- package/features/{ScheduleEntryAction/actionHandlers → PublishActionHandler}/PublishEntryActionHandler.d.ts +4 -4
- package/features/{ScheduleEntryAction/actionHandlers → PublishActionHandler}/PublishEntryActionHandler.js +7 -2
- package/features/PublishActionHandler/PublishEntryActionHandler.js.map +1 -0
- package/features/SchedulePublishEntryUseCase/SchedulePublishEntryUseCase.d.ts +15 -0
- package/features/SchedulePublishEntryUseCase/SchedulePublishEntryUseCase.js +51 -0
- package/features/SchedulePublishEntryUseCase/SchedulePublishEntryUseCase.js.map +1 -0
- package/features/SchedulePublishEntryUseCase/abstractions.d.ts +23 -0
- package/features/SchedulePublishEntryUseCase/abstractions.js +5 -0
- package/features/SchedulePublishEntryUseCase/abstractions.js.map +1 -0
- package/features/ScheduleUnpublishEntryUseCase/ScheduleUnpublishEntryUseCase.d.ts +15 -0
- package/features/ScheduleUnpublishEntryUseCase/ScheduleUnpublishEntryUseCase.js +51 -0
- package/features/ScheduleUnpublishEntryUseCase/ScheduleUnpublishEntryUseCase.js.map +1 -0
- package/features/ScheduleUnpublishEntryUseCase/abstractions.d.ts +23 -0
- package/features/ScheduleUnpublishEntryUseCase/abstractions.js +5 -0
- package/features/ScheduleUnpublishEntryUseCase/abstractions.js.map +1 -0
- package/features/{ScheduleEntryAction/actionHandlers → UnpublishActionHandler}/UnpublishEntryActionHandler.d.ts +6 -5
- package/features/{ScheduleEntryAction/actionHandlers → UnpublishActionHandler}/UnpublishEntryActionHandler.js +7 -2
- package/features/UnpublishActionHandler/UnpublishEntryActionHandler.js.map +1 -0
- package/index.d.ts +2 -6
- package/index.js +1 -7
- package/index.js.map +1 -1
- package/package.json +16 -18
- package/types.d.ts +4 -0
- package/types.js +3 -0
- package/types.js.map +1 -0
- package/utils/namespace.d.ts +4 -0
- package/utils/namespace.js +12 -0
- package/utils/namespace.js.map +1 -0
- package/features/CancelScheduledEntryAction/CancelScheduledEntryActionUseCase.d.ts +0 -15
- package/features/CancelScheduledEntryAction/CancelScheduledEntryActionUseCase.js +0 -25
- package/features/CancelScheduledEntryAction/CancelScheduledEntryActionUseCase.js.map +0 -1
- package/features/CancelScheduledEntryAction/abstractions.d.ts +0 -22
- package/features/CancelScheduledEntryAction/abstractions.js +0 -11
- package/features/CancelScheduledEntryAction/abstractions.js.map +0 -1
- package/features/CancelScheduledEntryAction/feature.d.ts +0 -6
- package/features/CancelScheduledEntryAction/feature.js +0 -16
- package/features/CancelScheduledEntryAction/feature.js.map +0 -1
- package/features/CancelScheduledEntryAction/index.d.ts +0 -1
- package/features/CancelScheduledEntryAction/index.js +0 -3
- package/features/CancelScheduledEntryAction/index.js.map +0 -1
- package/features/ScheduleEntryAction/ScheduleEntryActionUseCase.d.ts +0 -27
- package/features/ScheduleEntryAction/ScheduleEntryActionUseCase.js +0 -83
- package/features/ScheduleEntryAction/ScheduleEntryActionUseCase.js.map +0 -1
- package/features/ScheduleEntryAction/abstractions.d.ts +0 -45
- package/features/ScheduleEntryAction/abstractions.js +0 -15
- package/features/ScheduleEntryAction/abstractions.js.map +0 -1
- package/features/ScheduleEntryAction/actionHandlers/PublishEntryActionHandler.js.map +0 -1
- package/features/ScheduleEntryAction/actionHandlers/UnpublishEntryActionHandler.js.map +0 -1
- package/features/ScheduleEntryAction/feature.d.ts +0 -7
- package/features/ScheduleEntryAction/feature.js +0 -21
- package/features/ScheduleEntryAction/feature.js.map +0 -1
- package/features/ScheduleEntryAction/index.d.ts +0 -1
- package/features/ScheduleEntryAction/index.js +0 -3
- package/features/ScheduleEntryAction/index.js.map +0 -1
- package/graphql/ActionMapper.d.ts +0 -15
- package/graphql/ActionMapper.js +0 -18
- package/graphql/ActionMapper.js.map +0 -1
- package/graphql/dates.d.ts +0 -6
- package/graphql/dates.js +0 -9
- package/graphql/dates.js.map +0 -1
- package/graphql/index.d.ts +0 -3
- package/graphql/index.js +0 -246
- package/graphql/index.js.map +0 -1
- package/graphql/schema.d.ts +0 -162
- package/graphql/schema.js +0 -83
- package/graphql/schema.js.map +0 -1
package/graphql/schema.d.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import zod from "zod";
|
|
2
|
-
export declare const getScheduleSchema: zod.ZodObject<{
|
|
3
|
-
modelId: zod.ZodString;
|
|
4
|
-
id: zod.ZodString;
|
|
5
|
-
}, "strip", zod.ZodTypeAny, {
|
|
6
|
-
modelId: string;
|
|
7
|
-
id: string;
|
|
8
|
-
}, {
|
|
9
|
-
modelId: string;
|
|
10
|
-
id: string;
|
|
11
|
-
}>;
|
|
12
|
-
export declare enum ScheduleType {
|
|
13
|
-
publish = "publish",
|
|
14
|
-
unpublish = "unpublish"
|
|
15
|
-
}
|
|
16
|
-
export declare const listScheduleSchema: zod.ZodObject<{
|
|
17
|
-
modelId: zod.ZodString;
|
|
18
|
-
where: zod.ZodOptional<zod.ZodObject<{
|
|
19
|
-
targetId: zod.ZodOptional<zod.ZodString>;
|
|
20
|
-
namespace: zod.ZodOptional<zod.ZodString>;
|
|
21
|
-
title_contains: zod.ZodOptional<zod.ZodString>;
|
|
22
|
-
title_not_contains: zod.ZodOptional<zod.ZodString>;
|
|
23
|
-
type: zod.ZodOptional<zod.ZodNativeEnum<typeof ScheduleType>>;
|
|
24
|
-
scheduledBy: zod.ZodOptional<zod.ZodString>;
|
|
25
|
-
scheduledFor: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined, Date | undefined>;
|
|
26
|
-
scheduledFor_gte: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined, Date | undefined>;
|
|
27
|
-
scheduledFor_lte: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined, Date | undefined>;
|
|
28
|
-
}, "strip", zod.ZodTypeAny, {
|
|
29
|
-
type?: ScheduleType | undefined;
|
|
30
|
-
targetId?: string | undefined;
|
|
31
|
-
namespace?: string | undefined;
|
|
32
|
-
title_contains?: string | undefined;
|
|
33
|
-
title_not_contains?: string | undefined;
|
|
34
|
-
scheduledBy?: string | undefined;
|
|
35
|
-
scheduledFor?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
36
|
-
scheduledFor_gte?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
37
|
-
scheduledFor_lte?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
38
|
-
}, {
|
|
39
|
-
type?: ScheduleType | undefined;
|
|
40
|
-
targetId?: string | undefined;
|
|
41
|
-
namespace?: string | undefined;
|
|
42
|
-
title_contains?: string | undefined;
|
|
43
|
-
title_not_contains?: string | undefined;
|
|
44
|
-
scheduledBy?: string | undefined;
|
|
45
|
-
scheduledFor?: Date | undefined;
|
|
46
|
-
scheduledFor_gte?: Date | undefined;
|
|
47
|
-
scheduledFor_lte?: Date | undefined;
|
|
48
|
-
}>>;
|
|
49
|
-
sort: zod.ZodOptional<zod.ZodArray<zod.ZodEffects<zod.ZodEffects<zod.ZodString, `${string}_ASC` | `${string}_DESC`, string>, `${string}_ASC` | `${string}_DESC`, string>, "many">>;
|
|
50
|
-
limit: zod.ZodOptional<zod.ZodNumber>;
|
|
51
|
-
after: zod.ZodOptional<zod.ZodString>;
|
|
52
|
-
}, "strip", zod.ZodTypeAny, {
|
|
53
|
-
modelId: string;
|
|
54
|
-
sort?: (`${string}_ASC` | `${string}_DESC`)[] | undefined;
|
|
55
|
-
where?: {
|
|
56
|
-
type?: ScheduleType | undefined;
|
|
57
|
-
targetId?: string | undefined;
|
|
58
|
-
namespace?: string | undefined;
|
|
59
|
-
title_contains?: string | undefined;
|
|
60
|
-
title_not_contains?: string | undefined;
|
|
61
|
-
scheduledBy?: string | undefined;
|
|
62
|
-
scheduledFor?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
63
|
-
scheduledFor_gte?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
64
|
-
scheduledFor_lte?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
65
|
-
} | undefined;
|
|
66
|
-
limit?: number | undefined;
|
|
67
|
-
after?: string | undefined;
|
|
68
|
-
}, {
|
|
69
|
-
modelId: string;
|
|
70
|
-
sort?: string[] | undefined;
|
|
71
|
-
where?: {
|
|
72
|
-
type?: ScheduleType | undefined;
|
|
73
|
-
targetId?: string | undefined;
|
|
74
|
-
namespace?: string | undefined;
|
|
75
|
-
title_contains?: string | undefined;
|
|
76
|
-
title_not_contains?: string | undefined;
|
|
77
|
-
scheduledBy?: string | undefined;
|
|
78
|
-
scheduledFor?: Date | undefined;
|
|
79
|
-
scheduledFor_gte?: Date | undefined;
|
|
80
|
-
scheduledFor_lte?: Date | undefined;
|
|
81
|
-
} | undefined;
|
|
82
|
-
limit?: number | undefined;
|
|
83
|
-
after?: string | undefined;
|
|
84
|
-
}>;
|
|
85
|
-
export declare const createScheduleSchema: zod.ZodIntersection<zod.ZodDiscriminatedUnion<"immediately", [zod.ZodObject<{
|
|
86
|
-
immediately: zod.ZodLiteral<true>;
|
|
87
|
-
scheduleFor: zod.ZodOptional<zod.ZodNever>;
|
|
88
|
-
type: zod.ZodNativeEnum<typeof ScheduleType>;
|
|
89
|
-
}, "strip", zod.ZodTypeAny, {
|
|
90
|
-
type: ScheduleType;
|
|
91
|
-
immediately: true;
|
|
92
|
-
scheduleFor?: undefined;
|
|
93
|
-
}, {
|
|
94
|
-
type: ScheduleType;
|
|
95
|
-
immediately: true;
|
|
96
|
-
scheduleFor?: undefined;
|
|
97
|
-
}>, zod.ZodObject<{
|
|
98
|
-
immediately: zod.ZodOptional<zod.ZodLiteral<false>>;
|
|
99
|
-
scheduleFor: zod.ZodUnion<[zod.ZodDate, zod.ZodEffects<zod.ZodString, Date, string>]>;
|
|
100
|
-
type: zod.ZodNativeEnum<typeof ScheduleType>;
|
|
101
|
-
}, "strip", zod.ZodTypeAny, {
|
|
102
|
-
type: ScheduleType;
|
|
103
|
-
scheduleFor: Date;
|
|
104
|
-
immediately?: false | undefined;
|
|
105
|
-
}, {
|
|
106
|
-
type: ScheduleType;
|
|
107
|
-
scheduleFor: string | Date;
|
|
108
|
-
immediately?: false | undefined;
|
|
109
|
-
}>]>, zod.ZodObject<{
|
|
110
|
-
modelId: zod.ZodString;
|
|
111
|
-
id: zod.ZodString;
|
|
112
|
-
}, "strip", zod.ZodTypeAny, {
|
|
113
|
-
modelId: string;
|
|
114
|
-
id: string;
|
|
115
|
-
}, {
|
|
116
|
-
modelId: string;
|
|
117
|
-
id: string;
|
|
118
|
-
}>>;
|
|
119
|
-
export declare const updateScheduleSchema: zod.ZodIntersection<zod.ZodDiscriminatedUnion<"immediately", [zod.ZodObject<{
|
|
120
|
-
immediately: zod.ZodLiteral<true>;
|
|
121
|
-
scheduleFor: zod.ZodOptional<zod.ZodNever>;
|
|
122
|
-
type: zod.ZodNativeEnum<typeof ScheduleType>;
|
|
123
|
-
}, "strip", zod.ZodTypeAny, {
|
|
124
|
-
type: ScheduleType;
|
|
125
|
-
immediately: true;
|
|
126
|
-
scheduleFor?: undefined;
|
|
127
|
-
}, {
|
|
128
|
-
type: ScheduleType;
|
|
129
|
-
immediately: true;
|
|
130
|
-
scheduleFor?: undefined;
|
|
131
|
-
}>, zod.ZodObject<{
|
|
132
|
-
immediately: zod.ZodOptional<zod.ZodLiteral<false>>;
|
|
133
|
-
scheduleFor: zod.ZodUnion<[zod.ZodDate, zod.ZodEffects<zod.ZodString, Date, string>]>;
|
|
134
|
-
type: zod.ZodNativeEnum<typeof ScheduleType>;
|
|
135
|
-
}, "strip", zod.ZodTypeAny, {
|
|
136
|
-
type: ScheduleType;
|
|
137
|
-
scheduleFor: Date;
|
|
138
|
-
immediately?: false | undefined;
|
|
139
|
-
}, {
|
|
140
|
-
type: ScheduleType;
|
|
141
|
-
scheduleFor: string | Date;
|
|
142
|
-
immediately?: false | undefined;
|
|
143
|
-
}>]>, zod.ZodObject<{
|
|
144
|
-
modelId: zod.ZodString;
|
|
145
|
-
id: zod.ZodString;
|
|
146
|
-
}, "strip", zod.ZodTypeAny, {
|
|
147
|
-
modelId: string;
|
|
148
|
-
id: string;
|
|
149
|
-
}, {
|
|
150
|
-
modelId: string;
|
|
151
|
-
id: string;
|
|
152
|
-
}>>;
|
|
153
|
-
export declare const cancelScheduleSchema: zod.ZodObject<{
|
|
154
|
-
modelId: zod.ZodString;
|
|
155
|
-
id: zod.ZodString;
|
|
156
|
-
}, "strip", zod.ZodTypeAny, {
|
|
157
|
-
modelId: string;
|
|
158
|
-
id: string;
|
|
159
|
-
}, {
|
|
160
|
-
modelId: string;
|
|
161
|
-
id: string;
|
|
162
|
-
}>;
|
package/graphql/schema.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import zod from "zod";
|
|
2
|
-
import { dateToISOString } from "./dates.js";
|
|
3
|
-
export const getScheduleSchema = zod.object({
|
|
4
|
-
modelId: zod.string(),
|
|
5
|
-
id: zod.string()
|
|
6
|
-
});
|
|
7
|
-
export let ScheduleType = /*#__PURE__*/function (ScheduleType) {
|
|
8
|
-
ScheduleType["publish"] = "publish";
|
|
9
|
-
ScheduleType["unpublish"] = "unpublish";
|
|
10
|
-
return ScheduleType;
|
|
11
|
-
}({});
|
|
12
|
-
const publishAndUnpublishSchemaType = zod.nativeEnum(ScheduleType);
|
|
13
|
-
export const listScheduleSchema = zod.object({
|
|
14
|
-
modelId: zod.string(),
|
|
15
|
-
where: zod.object({
|
|
16
|
-
targetId: zod.string().optional(),
|
|
17
|
-
namespace: zod.string().optional(),
|
|
18
|
-
title_contains: zod.string().optional(),
|
|
19
|
-
title_not_contains: zod.string().optional(),
|
|
20
|
-
type: publishAndUnpublishSchemaType.optional(),
|
|
21
|
-
scheduledBy: zod.string().optional(),
|
|
22
|
-
scheduledFor: zod.date().optional().transform(value => {
|
|
23
|
-
if (!value) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
return dateToISOString(value);
|
|
27
|
-
}),
|
|
28
|
-
scheduledFor_gte: zod.date().optional().transform(value => {
|
|
29
|
-
if (!value) {
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
return dateToISOString(value);
|
|
33
|
-
}),
|
|
34
|
-
scheduledFor_lte: zod.date().optional().transform(value => {
|
|
35
|
-
if (!value) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
return dateToISOString(value);
|
|
39
|
-
})
|
|
40
|
-
}).optional(),
|
|
41
|
-
sort: zod.array(zod.string().refine(value => {
|
|
42
|
-
const [field, direction] = value.split("_");
|
|
43
|
-
if (!field) {
|
|
44
|
-
return false;
|
|
45
|
-
} else if (direction !== "ASC" && direction !== "DESC") {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
}).transform(value => {
|
|
50
|
-
if (!value) {
|
|
51
|
-
return value;
|
|
52
|
-
}
|
|
53
|
-
return `values_${value}`;
|
|
54
|
-
})).optional(),
|
|
55
|
-
limit: zod.number().optional(),
|
|
56
|
-
after: zod.string().optional()
|
|
57
|
-
});
|
|
58
|
-
const schedulerInputSchema = zod.discriminatedUnion("immediately", [zod.object({
|
|
59
|
-
immediately: zod.literal(true),
|
|
60
|
-
scheduleFor: zod.never().optional(),
|
|
61
|
-
type: publishAndUnpublishSchemaType
|
|
62
|
-
}), zod.object({
|
|
63
|
-
immediately: zod.literal(false).optional(),
|
|
64
|
-
scheduleFor: zod.date().or(zod.string().transform(value => {
|
|
65
|
-
return new Date(value);
|
|
66
|
-
})),
|
|
67
|
-
type: publishAndUnpublishSchemaType
|
|
68
|
-
})]);
|
|
69
|
-
export const createScheduleSchema = schedulerInputSchema.and(zod.object({
|
|
70
|
-
modelId: zod.string(),
|
|
71
|
-
id: zod.string()
|
|
72
|
-
}));
|
|
73
|
-
export const updateScheduleSchema = schedulerInputSchema.and(zod.object({
|
|
74
|
-
modelId: zod.string(),
|
|
75
|
-
id: zod.string()
|
|
76
|
-
}));
|
|
77
|
-
export const cancelScheduleSchema = zod.object({
|
|
78
|
-
modelId: zod.string(),
|
|
79
|
-
// TODO: remove this; not needed as schedule ID already has model encoded
|
|
80
|
-
id: zod.string()
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
//# sourceMappingURL=schema.js.map
|
package/graphql/schema.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["zod","dateToISOString","getScheduleSchema","object","modelId","string","id","ScheduleType","publishAndUnpublishSchemaType","nativeEnum","listScheduleSchema","where","targetId","optional","namespace","title_contains","title_not_contains","type","scheduledBy","scheduledFor","date","transform","value","undefined","scheduledFor_gte","scheduledFor_lte","sort","array","refine","field","direction","split","limit","number","after","schedulerInputSchema","discriminatedUnion","immediately","literal","scheduleFor","never","or","Date","createScheduleSchema","and","updateScheduleSchema","cancelScheduleSchema"],"sources":["schema.ts"],"sourcesContent":["import zod from \"zod\";\nimport type {\n CmsEntryListSortAsc,\n CmsEntryListSortDesc\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport { dateToISOString } from \"./dates.js\";\n\nexport const getScheduleSchema = zod.object({\n modelId: zod.string(),\n id: zod.string()\n});\n\nexport enum ScheduleType {\n publish = \"publish\",\n unpublish = \"unpublish\"\n}\n\nconst publishAndUnpublishSchemaType = zod.nativeEnum(ScheduleType);\n\nexport const listScheduleSchema = zod.object({\n modelId: zod.string(),\n where: zod\n .object({\n targetId: zod.string().optional(),\n namespace: zod.string().optional(),\n title_contains: zod.string().optional(),\n title_not_contains: zod.string().optional(),\n type: publishAndUnpublishSchemaType.optional(),\n scheduledBy: zod.string().optional(),\n scheduledFor: zod\n .date()\n .optional()\n .transform(value => {\n if (!value) {\n return undefined;\n }\n return dateToISOString(value);\n }),\n scheduledFor_gte: zod\n .date()\n .optional()\n .transform(value => {\n if (!value) {\n return undefined;\n }\n return dateToISOString(value);\n }),\n scheduledFor_lte: zod\n .date()\n .optional()\n .transform(value => {\n if (!value) {\n return undefined;\n }\n return dateToISOString(value);\n })\n })\n .optional(),\n sort: zod\n .array(\n zod\n .string()\n .refine((value): value is CmsEntryListSortAsc | CmsEntryListSortDesc => {\n const [field, direction] = value.split(\"_\");\n if (!field) {\n return false;\n } else if (direction !== \"ASC\" && direction !== \"DESC\") {\n return false;\n }\n return true;\n })\n .transform(value => {\n if (!value) {\n return value;\n }\n return `values_${value}` as typeof value;\n })\n )\n .optional(),\n limit: zod.number().optional(),\n after: zod.string().optional()\n});\n\nconst schedulerInputSchema = zod.discriminatedUnion(\"immediately\", [\n zod.object({\n immediately: zod.literal(true),\n scheduleFor: zod.never().optional(),\n type: publishAndUnpublishSchemaType\n }),\n zod.object({\n immediately: zod.literal(false).optional(),\n scheduleFor: zod.date().or(\n zod.string().transform(value => {\n return new Date(value);\n })\n ),\n type: publishAndUnpublishSchemaType\n })\n]);\n\nexport const createScheduleSchema = schedulerInputSchema.and(\n zod.object({\n modelId: zod.string(),\n id: zod.string()\n })\n);\n\nexport const updateScheduleSchema = schedulerInputSchema.and(\n zod.object({\n modelId: zod.string(),\n id: zod.string()\n })\n);\n\nexport const cancelScheduleSchema = zod.object({\n modelId: zod.string(), // TODO: remove this; not needed as schedule ID already has model encoded\n id: zod.string()\n});\n"],"mappings":"AAAA,OAAOA,GAAG,MAAM,KAAK;AAKrB,SAASC,eAAe;AAExB,OAAO,MAAMC,iBAAiB,GAAGF,GAAG,CAACG,MAAM,CAAC;EACxCC,OAAO,EAAEJ,GAAG,CAACK,MAAM,CAAC,CAAC;EACrBC,EAAE,EAAEN,GAAG,CAACK,MAAM,CAAC;AACnB,CAAC,CAAC;AAEF,WAAYE,YAAY,0BAAZA,YAAY;EAAZA,YAAY;EAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA;AAKxB,MAAMC,6BAA6B,GAAGR,GAAG,CAACS,UAAU,CAACF,YAAY,CAAC;AAElE,OAAO,MAAMG,kBAAkB,GAAGV,GAAG,CAACG,MAAM,CAAC;EACzCC,OAAO,EAAEJ,GAAG,CAACK,MAAM,CAAC,CAAC;EACrBM,KAAK,EAAEX,GAAG,CACLG,MAAM,CAAC;IACJS,QA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