@webiny/api-headless-cms-scheduler 0.0.0-unstable.e53eceafb5 → 0.0.0-unstable.e6f0dc8ca7
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/README.md +11 -15
- package/context.d.ts +2 -7
- package/context.js +15 -59
- 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 +20 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnEntryDeleteEventHandler.js +54 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnEntryDeleteEventHandler.js.map +1 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnPublishEventHandler.d.ts +19 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnPublishEventHandler.js +49 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnPublishEventHandler.js.map +1 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnRevisionDeleteEventHandler.d.ts +19 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnRevisionDeleteEventHandler.js +48 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnRevisionDeleteEventHandler.js.map +1 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnUnpublishEventHandler.d.ts +19 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnUnpublishEventHandler.js +49 -0
- package/features/CancelScheduledActionOnEntryChange/CancelScheduledActionOnUnpublishEventHandler.js.map +1 -0
- package/features/CancelScheduledActionOnEntryChange/feature.d.ts +11 -0
- package/features/CancelScheduledActionOnEntryChange/feature.js +24 -0
- package/features/CancelScheduledActionOnEntryChange/feature.js.map +1 -0
- 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/PublishActionHandler/PublishEntryActionHandler.d.ts +35 -0
- package/features/PublishActionHandler/PublishEntryActionHandler.js +114 -0
- 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/UnpublishActionHandler/UnpublishEntryActionHandler.d.ts +30 -0
- package/features/UnpublishActionHandler/UnpublishEntryActionHandler.js +97 -0
- package/features/UnpublishActionHandler/UnpublishEntryActionHandler.js.map +1 -0
- package/index.d.ts +2 -10
- package/index.js +3 -26
- package/index.js.map +1 -1
- package/package.json +22 -23
- package/types.d.ts +3 -10
- package/types.js +1 -5
- package/types.js.map +1 -1
- package/utils/namespace.d.ts +4 -0
- package/utils/namespace.js +12 -0
- package/utils/namespace.js.map +1 -0
- package/constants.d.ts +0 -11
- package/constants.js +0 -19
- package/constants.js.map +0 -1
- package/graphql/index.d.ts +0 -3
- package/graphql/index.js +0 -204
- package/graphql/index.js.map +0 -1
- package/graphql/schema.d.ts +0 -217
- package/graphql/schema.js +0 -87
- package/graphql/schema.js.map +0 -1
- package/handler/Handler.d.ts +0 -23
- package/handler/Handler.js +0 -74
- package/handler/Handler.js.map +0 -1
- package/handler/actions/PublishHandlerAction.d.ts +0 -13
- package/handler/actions/PublishHandlerAction.js +0 -64
- package/handler/actions/PublishHandlerAction.js.map +0 -1
- package/handler/actions/UnpublishHandlerAction.d.ts +0 -13
- package/handler/actions/UnpublishHandlerAction.js +0 -53
- package/handler/actions/UnpublishHandlerAction.js.map +0 -1
- package/handler/index.d.ts +0 -7
- package/handler/index.js +0 -64
- package/handler/index.js.map +0 -1
- package/handler/types.d.ts +0 -5
- package/handler/types.js +0 -7
- package/handler/types.js.map +0 -1
- package/manifest.d.ts +0 -17
- package/manifest.js +0 -47
- package/manifest.js.map +0 -1
- package/scheduler/ScheduleExecutor.d.ts +0 -16
- package/scheduler/ScheduleExecutor.js +0 -55
- package/scheduler/ScheduleExecutor.js.map +0 -1
- package/scheduler/ScheduleFetcher.d.ts +0 -16
- package/scheduler/ScheduleFetcher.js +0 -51
- package/scheduler/ScheduleFetcher.js.map +0 -1
- package/scheduler/ScheduleRecord.d.ts +0 -33
- package/scheduler/ScheduleRecord.js +0 -56
- package/scheduler/ScheduleRecord.js.map +0 -1
- package/scheduler/Scheduler.d.ts +0 -14
- package/scheduler/Scheduler.js +0 -27
- package/scheduler/Scheduler.js.map +0 -1
- package/scheduler/actions/PublishScheduleAction.d.ts +0 -26
- package/scheduler/actions/PublishScheduleAction.js +0 -209
- package/scheduler/actions/PublishScheduleAction.js.map +0 -1
- package/scheduler/actions/UnpublishScheduleAction.d.ts +0 -26
- package/scheduler/actions/UnpublishScheduleAction.js +0 -199
- package/scheduler/actions/UnpublishScheduleAction.js.map +0 -1
- package/scheduler/createScheduleRecordId.d.ts +0 -2
- package/scheduler/createScheduleRecordId.js +0 -33
- package/scheduler/createScheduleRecordId.js.map +0 -1
- package/scheduler/createScheduler.d.ts +0 -12
- package/scheduler/createScheduler.js +0 -59
- package/scheduler/createScheduler.js.map +0 -1
- package/scheduler/dates.d.ts +0 -7
- package/scheduler/dates.js +0 -27
- package/scheduler/dates.js.map +0 -1
- package/scheduler/model.d.ts +0 -1
- package/scheduler/model.js +0 -88
- package/scheduler/model.js.map +0 -1
- package/scheduler/types.d.ts +0 -92
- package/scheduler/types.js +0 -19
- package/scheduler/types.js.map +0 -1
- package/service/SchedulerService.d.ts +0 -23
- package/service/SchedulerService.js +0 -151
- package/service/SchedulerService.js.map +0 -1
- package/service/types.d.ts +0 -19
- package/service/types.js +0 -7
- package/service/types.js.map +0 -1
- package/utils/dateInTheFuture.d.ts +0 -6
- package/utils/dateInTheFuture.js +0 -19
- package/utils/dateInTheFuture.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-scheduler",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.0.0-unstable.e6f0dc8ca7",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
5
9
|
"description": "Schedule for Webiny Headless CMS",
|
|
6
10
|
"keywords": [
|
|
7
11
|
"api-headless-cms-scheduler:base"
|
|
@@ -13,33 +17,28 @@
|
|
|
13
17
|
},
|
|
14
18
|
"license": "MIT",
|
|
15
19
|
"dependencies": {
|
|
16
|
-
"@webiny/api": "0.0.0-unstable.
|
|
17
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
18
|
-
"@webiny/
|
|
19
|
-
"@webiny/
|
|
20
|
-
"@webiny/handler-graphql": "0.0.0-unstable.
|
|
21
|
-
"@webiny/utils": "0.0.0-unstable.e53eceafb5",
|
|
22
|
-
"zod": "3.23.8"
|
|
20
|
+
"@webiny/api": "0.0.0-unstable.e6f0dc8ca7",
|
|
21
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.e6f0dc8ca7",
|
|
22
|
+
"@webiny/api-scheduler": "0.0.0-unstable.e6f0dc8ca7",
|
|
23
|
+
"@webiny/feature": "0.0.0-unstable.e6f0dc8ca7",
|
|
24
|
+
"@webiny/handler-graphql": "0.0.0-unstable.e6f0dc8ca7"
|
|
23
25
|
},
|
|
24
26
|
"devDependencies": {
|
|
25
|
-
"@webiny/api-
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
30
|
-
"@webiny/
|
|
31
|
-
"@webiny/
|
|
32
|
-
"@webiny/
|
|
27
|
+
"@webiny/api-core": "0.0.0-unstable.e6f0dc8ca7",
|
|
28
|
+
"@webiny/aws-sdk": "0.0.0-unstable.e6f0dc8ca7",
|
|
29
|
+
"@webiny/build-tools": "0.0.0-unstable.e6f0dc8ca7",
|
|
30
|
+
"@webiny/handler": "0.0.0-unstable.e6f0dc8ca7",
|
|
31
|
+
"@webiny/handler-aws": "0.0.0-unstable.e6f0dc8ca7",
|
|
32
|
+
"@webiny/plugins": "0.0.0-unstable.e6f0dc8ca7",
|
|
33
|
+
"@webiny/project-utils": "0.0.0-unstable.e6f0dc8ca7",
|
|
34
|
+
"@webiny/wcp": "0.0.0-unstable.e6f0dc8ca7",
|
|
33
35
|
"aws-sdk-client-mock": "4.1.0",
|
|
34
|
-
"typescript": "
|
|
35
|
-
|
|
36
|
-
"scripts": {
|
|
37
|
-
"build": "node ../cli/bin.js run build",
|
|
38
|
-
"watch": "node ../cli/bin.js run watch"
|
|
36
|
+
"typescript": "6.0.3",
|
|
37
|
+
"vitest": "4.1.5"
|
|
39
38
|
},
|
|
40
39
|
"publishConfig": {
|
|
41
40
|
"access": "public",
|
|
42
41
|
"directory": "dist"
|
|
43
42
|
},
|
|
44
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "e6f0dc8ca741c1fcc3fec9a5b9e86fdd49544641"
|
|
45
44
|
}
|
package/types.d.ts
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
(model: CmsModel): IScheduler;
|
|
5
|
-
}
|
|
6
|
-
export interface CmsSchedule {
|
|
7
|
-
scheduler: CmsScheduleCallable;
|
|
8
|
-
}
|
|
9
|
-
export interface ScheduleContext extends CmsContext {
|
|
10
|
-
cms: HeadlessCms & CmsSchedule;
|
|
1
|
+
import type { INamespaceHandlerResult } from "@webiny/api-scheduler/features/NamespaceHandler/abstractions.js";
|
|
2
|
+
export interface IScheduledActionPayload extends INamespaceHandlerResult {
|
|
3
|
+
modelId: string;
|
|
11
4
|
}
|
package/types.js
CHANGED
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { INamespaceHandlerResult } from \"@webiny/api-scheduler/features/NamespaceHandler/abstractions.js\";\n\nexport interface IScheduledActionPayload extends INamespaceHandlerResult {\n modelId: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
export declare const CMS_NAMESPACE = "Cms/Entry/";
|
|
3
|
+
export declare const createNamespace: (model: Pick<CmsModel, "modelId">) => string;
|
|
4
|
+
export declare const extractModelIdFromNamespace: (namespace: string) => string | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const CMS_NAMESPACE = "Cms/Entry/";
|
|
2
|
+
export const createNamespace = model => {
|
|
3
|
+
return `${CMS_NAMESPACE}${model.modelId}`;
|
|
4
|
+
};
|
|
5
|
+
export const extractModelIdFromNamespace = namespace => {
|
|
6
|
+
if (!namespace.startsWith(CMS_NAMESPACE)) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return namespace.substring(CMS_NAMESPACE.length) || null;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=namespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CMS_NAMESPACE","createNamespace","model","modelId","extractModelIdFromNamespace","namespace","startsWith","substring","length"],"sources":["namespace.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport const CMS_NAMESPACE = \"Cms/Entry/\";\n\nexport const createNamespace = (model: Pick<CmsModel, \"modelId\">) => {\n return `${CMS_NAMESPACE}${model.modelId}`;\n};\n\nexport const extractModelIdFromNamespace = (namespace: string): string | null => {\n if (!namespace.startsWith(CMS_NAMESPACE)) {\n return null;\n }\n return namespace.substring(CMS_NAMESPACE.length) || null;\n};\n"],"mappings":"AAEA,OAAO,MAAMA,aAAa,GAAG,YAAY;AAEzC,OAAO,MAAMC,eAAe,GAAIC,KAAgC,IAAK;EACjE,OAAO,GAAGF,aAAa,GAAGE,KAAK,CAACC,OAAO,EAAE;AAC7C,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAIC,SAAiB,IAAoB;EAC7E,IAAI,CAACA,SAAS,CAACC,UAAU,CAACN,aAAa,CAAC,EAAE;IACtC,OAAO,IAAI;EACf;EACA,OAAOK,SAAS,CAACE,SAAS,CAACP,aAAa,CAACQ,MAAM,CAAC,IAAI,IAAI;AAC5D,CAAC","ignoreList":[]}
|
package/constants.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const SCHEDULE_MODEL_ID = "webinyCmsSchedule";
|
|
2
|
-
export declare const SCHEDULE_ID_PREFIX = "wby-schedule-";
|
|
3
|
-
/**
|
|
4
|
-
* Minimum number of seconds in the future that a schedule can be set.
|
|
5
|
-
* Everything else will result in immediately running the action.
|
|
6
|
-
*/
|
|
7
|
-
export declare const SCHEDULE_MIN_FUTURE_SECONDS = 65;
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
export declare const SCHEDULED_CMS_ACTION_EVENT_IDENTIFIER = "WebinyScheduledCmsAction";
|
package/constants.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.SCHEDULE_MODEL_ID = exports.SCHEDULE_MIN_FUTURE_SECONDS = exports.SCHEDULE_ID_PREFIX = exports.SCHEDULED_CMS_ACTION_EVENT_IDENTIFIER = void 0;
|
|
7
|
-
const SCHEDULE_MODEL_ID = exports.SCHEDULE_MODEL_ID = "webinyCmsSchedule";
|
|
8
|
-
const SCHEDULE_ID_PREFIX = exports.SCHEDULE_ID_PREFIX = "wby-schedule-";
|
|
9
|
-
/**
|
|
10
|
-
* Minimum number of seconds in the future that a schedule can be set.
|
|
11
|
-
* Everything else will result in immediately running the action.
|
|
12
|
-
*/
|
|
13
|
-
const SCHEDULE_MIN_FUTURE_SECONDS = exports.SCHEDULE_MIN_FUTURE_SECONDS = 65;
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
const SCHEDULED_CMS_ACTION_EVENT_IDENTIFIER = exports.SCHEDULED_CMS_ACTION_EVENT_IDENTIFIER = "WebinyScheduledCmsAction";
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=constants.js.map
|
package/constants.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["SCHEDULE_MODEL_ID","exports","SCHEDULE_ID_PREFIX","SCHEDULE_MIN_FUTURE_SECONDS","SCHEDULED_CMS_ACTION_EVENT_IDENTIFIER"],"sources":["constants.ts"],"sourcesContent":["export const SCHEDULE_MODEL_ID = \"webinyCmsSchedule\";\nexport const SCHEDULE_ID_PREFIX = \"wby-schedule-\";\n/**\n * Minimum number of seconds in the future that a schedule can be set.\n * Everything else will result in immediately running the action.\n */\nexport const SCHEDULE_MIN_FUTURE_SECONDS = 65;\n/**\n *\n */\nexport const SCHEDULED_CMS_ACTION_EVENT_IDENTIFIER = \"WebinyScheduledCmsAction\";\n"],"mappings":";;;;;;AAAO,MAAMA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,mBAAmB;AAC7C,MAAME,kBAAkB,GAAAD,OAAA,CAAAC,kBAAA,GAAG,eAAe;AACjD;AACA;AACA;AACA;AACO,MAAMC,2BAA2B,GAAAF,OAAA,CAAAE,2BAAA,GAAG,EAAE;AAC7C;AACA;AACA;AACO,MAAMC,qCAAqC,GAAAH,OAAA,CAAAG,qCAAA,GAAG,0BAA0B","ignoreList":[]}
|
package/graphql/index.d.ts
DELETED
package/graphql/index.js
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createSchedulerGraphQL = void 0;
|
|
7
|
-
var _index = require("@webiny/api-headless-cms/plugins/index.js");
|
|
8
|
-
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
9
|
-
var _schema = require("./schema.js");
|
|
10
|
-
var _utils = require("@webiny/utils");
|
|
11
|
-
const resolve = async cb => {
|
|
12
|
-
try {
|
|
13
|
-
const result = await cb();
|
|
14
|
-
return new _handlerGraphql.Response(result);
|
|
15
|
-
} catch (ex) {
|
|
16
|
-
return new _handlerGraphql.ErrorResponse(ex);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
const resolveList = async cb => {
|
|
20
|
-
try {
|
|
21
|
-
const result = await cb();
|
|
22
|
-
return new _handlerGraphql.ListResponse(result.data, result.meta);
|
|
23
|
-
} catch (ex) {
|
|
24
|
-
return new _handlerGraphql.ListErrorResponse(ex);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const createSchedulerGraphQL = () => {
|
|
28
|
-
return new _index.CmsGraphQLSchemaPlugin({
|
|
29
|
-
/**
|
|
30
|
-
* Make sure scheduler is available. No point in adding GraphQL if scheduler is unavailable for any reason.
|
|
31
|
-
*/
|
|
32
|
-
isApplicable: context => {
|
|
33
|
-
return !!context.cms?.scheduler;
|
|
34
|
-
},
|
|
35
|
-
typeDefs: /* GraphQL */`
|
|
36
|
-
enum CmsScheduleRecordType {
|
|
37
|
-
publish
|
|
38
|
-
unpublish
|
|
39
|
-
}
|
|
40
|
-
type CmsScheduleRecord {
|
|
41
|
-
id: String!
|
|
42
|
-
targetId: String!
|
|
43
|
-
model: CmsContentModel!
|
|
44
|
-
scheduledBy: CmsIdentity!
|
|
45
|
-
publishOn: DateTime
|
|
46
|
-
unpublishOn: DateTime
|
|
47
|
-
type: CmsScheduleRecordType!
|
|
48
|
-
title: String!
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
type CmsGetScheduleResponse {
|
|
52
|
-
data: CmsScheduleRecord
|
|
53
|
-
error: CmsError
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
type CmsListSchedulesResponse {
|
|
57
|
-
data: [CmsScheduleRecord!]
|
|
58
|
-
error: CmsError
|
|
59
|
-
meta: CmsListMeta
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
input CmsCreateScheduleInput {
|
|
63
|
-
immediately: Boolean
|
|
64
|
-
scheduleOn: DateTime
|
|
65
|
-
type: CmsScheduleRecordType!
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
type CmsCreateScheduleResponse {
|
|
69
|
-
data: CmsScheduleRecord
|
|
70
|
-
error: CmsError
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
input CmsUpdateScheduleInput {
|
|
74
|
-
immediately: Boolean
|
|
75
|
-
scheduleOn: DateTime
|
|
76
|
-
type: CmsScheduleRecordType!
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
type CmsUpdateScheduleResponse {
|
|
80
|
-
data: CmsScheduleRecord
|
|
81
|
-
error: CmsError
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type CmsCancelScheduleResponse {
|
|
85
|
-
data: Boolean
|
|
86
|
-
error: CmsError
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
input CmsListSchedulesWhereInput {
|
|
90
|
-
targetId: ID
|
|
91
|
-
title_contains: String
|
|
92
|
-
title_not_contains: String
|
|
93
|
-
targetEntryId: ID
|
|
94
|
-
type: CmsScheduleRecordType
|
|
95
|
-
scheduledBy: ID
|
|
96
|
-
scheduledOn: DateTime
|
|
97
|
-
scheduledOn_gte: DateTime
|
|
98
|
-
scheduledOn_lte: DateTime
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
enum CmsListSchedulesSorter {
|
|
102
|
-
title_ASC
|
|
103
|
-
title_DESC
|
|
104
|
-
scheduledOn_ASC
|
|
105
|
-
scheduledOn_DESC
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
extend type Query {
|
|
109
|
-
getCmsSchedule(modelId: String!, id: ID!): CmsGetScheduleResponse!
|
|
110
|
-
listCmsSchedules(
|
|
111
|
-
modelId: String!
|
|
112
|
-
where: CmsListSchedulesWhereInput
|
|
113
|
-
sort: [CmsListSchedulesSorter!]
|
|
114
|
-
limit: Int
|
|
115
|
-
after: String
|
|
116
|
-
): CmsListSchedulesResponse!
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
extend type Mutation {
|
|
120
|
-
createCmsSchedule(
|
|
121
|
-
modelId: String!
|
|
122
|
-
id: ID!
|
|
123
|
-
input: CmsCreateScheduleInput!
|
|
124
|
-
): CmsCreateScheduleResponse!
|
|
125
|
-
updateCmsSchedule(
|
|
126
|
-
modelId: String!
|
|
127
|
-
id: ID!
|
|
128
|
-
input: CmsUpdateScheduleInput!
|
|
129
|
-
): CmsUpdateScheduleResponse!
|
|
130
|
-
cancelCmsSchedule(modelId: String!, id: ID!): CmsCancelScheduleResponse!
|
|
131
|
-
}
|
|
132
|
-
`,
|
|
133
|
-
resolvers: {
|
|
134
|
-
Query: {
|
|
135
|
-
async getCmsSchedule(_, args, context) {
|
|
136
|
-
return resolve(async () => {
|
|
137
|
-
const validated = await _schema.getScheduleSchema.safeParseAsync(args);
|
|
138
|
-
if (validated.error) {
|
|
139
|
-
throw (0, _utils.createZodError)(validated.error);
|
|
140
|
-
}
|
|
141
|
-
const model = await context.cms.getModel(validated.data.modelId);
|
|
142
|
-
const scheduler = context.cms.scheduler(model);
|
|
143
|
-
return scheduler.getScheduled(validated.data.id);
|
|
144
|
-
});
|
|
145
|
-
},
|
|
146
|
-
async listCmsSchedules(_, args, context) {
|
|
147
|
-
return resolveList(async () => {
|
|
148
|
-
const validated = await _schema.listScheduleSchema.safeParseAsync(args);
|
|
149
|
-
if (validated.error) {
|
|
150
|
-
throw (0, _utils.createZodError)(validated.error);
|
|
151
|
-
}
|
|
152
|
-
const model = await context.cms.getModel(validated.data.modelId);
|
|
153
|
-
const scheduler = context.cms.scheduler(model);
|
|
154
|
-
return scheduler.listScheduled({
|
|
155
|
-
where: validated.data.where || {},
|
|
156
|
-
sort: validated.data.sort,
|
|
157
|
-
limit: validated.data.limit,
|
|
158
|
-
after: validated.data.after
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
Mutation: {
|
|
164
|
-
async createCmsSchedule(_, args, context) {
|
|
165
|
-
return resolve(async () => {
|
|
166
|
-
const validated = await _schema.createScheduleSchema.safeParseAsync(args);
|
|
167
|
-
if (validated.error) {
|
|
168
|
-
throw (0, _utils.createZodError)(validated.error);
|
|
169
|
-
}
|
|
170
|
-
const model = await context.cms.getModel(validated.data.modelId);
|
|
171
|
-
const scheduler = context.cms.scheduler(model);
|
|
172
|
-
return await scheduler.schedule(validated.data.id, validated.data.input);
|
|
173
|
-
});
|
|
174
|
-
},
|
|
175
|
-
async updateCmsSchedule(_, args, context) {
|
|
176
|
-
return resolve(async () => {
|
|
177
|
-
const validated = await _schema.updateScheduleSchema.safeParseAsync(args);
|
|
178
|
-
if (validated.error) {
|
|
179
|
-
throw (0, _utils.createZodError)(validated.error);
|
|
180
|
-
}
|
|
181
|
-
const model = await context.cms.getModel(validated.data.modelId);
|
|
182
|
-
const scheduler = context.cms.scheduler(model);
|
|
183
|
-
return scheduler.schedule(validated.data.id, validated.data.input);
|
|
184
|
-
});
|
|
185
|
-
},
|
|
186
|
-
async cancelCmsSchedule(_, args, context) {
|
|
187
|
-
return resolve(async () => {
|
|
188
|
-
const validated = await _schema.cancelScheduleSchema.safeParseAsync(args);
|
|
189
|
-
if (validated.error) {
|
|
190
|
-
throw (0, _utils.createZodError)(validated.error);
|
|
191
|
-
}
|
|
192
|
-
const model = await context.cms.getModel(validated.data.modelId);
|
|
193
|
-
const scheduler = context.cms.scheduler(model);
|
|
194
|
-
await scheduler.cancel(validated.data.id);
|
|
195
|
-
return true;
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
};
|
|
202
|
-
exports.createSchedulerGraphQL = createSchedulerGraphQL;
|
|
203
|
-
|
|
204
|
-
//# sourceMappingURL=index.js.map
|
package/graphql/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_index","require","_handlerGraphql","_schema","_utils","resolve","cb","result","Response","ex","ErrorResponse","resolveList","ListResponse","data","meta","ListErrorResponse","createSchedulerGraphQL","CmsGraphQLSchemaPlugin","isApplicable","context","cms","scheduler","typeDefs","resolvers","Query","getCmsSchedule","_","args","validated","getScheduleSchema","safeParseAsync","error","createZodError","model","getModel","modelId","getScheduled","id","listCmsSchedules","listScheduleSchema","listScheduled","where","sort","limit","after","Mutation","createCmsSchedule","createScheduleSchema","schedule","input","updateCmsSchedule","updateScheduleSchema","cancelCmsSchedule","cancelScheduleSchema","cancel","exports"],"sources":["index.ts"],"sourcesContent":["import { CmsGraphQLSchemaPlugin } from \"@webiny/api-headless-cms/plugins/index.js\";\nimport type { ScheduleContext } from \"~/types.js\";\nimport { ErrorResponse, ListErrorResponse, ListResponse, Response } from \"@webiny/handler-graphql\";\nimport type { CmsEntryMeta } from \"@webiny/api-headless-cms/types/index.js\";\nimport {\n cancelScheduleSchema,\n createScheduleSchema,\n getScheduleSchema,\n listScheduleSchema,\n updateScheduleSchema\n} from \"~/graphql/schema.js\";\nimport { createZodError } from \"@webiny/utils\";\n\nconst resolve = async (cb: () => Promise<unknown>) => {\n try {\n const result = await cb();\n\n return new Response(result);\n } catch (ex) {\n return new ErrorResponse(ex);\n }\n};\n\ninterface IResolveListCallableResponse {\n data: unknown[];\n meta: CmsEntryMeta;\n}\n\nconst resolveList = async (cb: () => Promise<IResolveListCallableResponse>) => {\n try {\n const result = await cb();\n\n return new ListResponse(result.data, result.meta);\n } catch (ex) {\n return new ListErrorResponse(ex);\n }\n};\n\nexport const createSchedulerGraphQL = () => {\n return new CmsGraphQLSchemaPlugin<ScheduleContext>({\n /**\n * Make sure scheduler is available. No point in adding GraphQL if scheduler is unavailable for any reason.\n */\n isApplicable: context => {\n return !!context.cms?.scheduler;\n },\n typeDefs: /* GraphQL */ `\n enum CmsScheduleRecordType {\n publish\n unpublish\n }\n type CmsScheduleRecord {\n id: String!\n targetId: String!\n model: CmsContentModel!\n scheduledBy: CmsIdentity!\n publishOn: DateTime\n unpublishOn: DateTime\n type: CmsScheduleRecordType!\n title: String!\n }\n\n type CmsGetScheduleResponse {\n data: CmsScheduleRecord\n error: CmsError\n }\n\n type CmsListSchedulesResponse {\n data: [CmsScheduleRecord!]\n error: CmsError\n meta: CmsListMeta\n }\n\n input CmsCreateScheduleInput {\n immediately: Boolean\n scheduleOn: DateTime\n type: CmsScheduleRecordType!\n }\n\n type CmsCreateScheduleResponse {\n data: CmsScheduleRecord\n error: CmsError\n }\n\n input CmsUpdateScheduleInput {\n immediately: Boolean\n scheduleOn: DateTime\n type: CmsScheduleRecordType!\n }\n\n type CmsUpdateScheduleResponse {\n data: CmsScheduleRecord\n error: CmsError\n }\n\n type CmsCancelScheduleResponse {\n data: Boolean\n error: CmsError\n }\n\n input CmsListSchedulesWhereInput {\n targetId: ID\n title_contains: String\n title_not_contains: String\n targetEntryId: ID\n type: CmsScheduleRecordType\n scheduledBy: ID\n scheduledOn: DateTime\n scheduledOn_gte: DateTime\n scheduledOn_lte: DateTime\n }\n\n enum CmsListSchedulesSorter {\n title_ASC\n title_DESC\n scheduledOn_ASC\n scheduledOn_DESC\n }\n\n extend type Query {\n getCmsSchedule(modelId: String!, id: ID!): CmsGetScheduleResponse!\n listCmsSchedules(\n modelId: String!\n where: CmsListSchedulesWhereInput\n sort: [CmsListSchedulesSorter!]\n limit: Int\n after: String\n ): CmsListSchedulesResponse!\n }\n\n extend type Mutation {\n createCmsSchedule(\n modelId: String!\n id: ID!\n input: CmsCreateScheduleInput!\n ): CmsCreateScheduleResponse!\n updateCmsSchedule(\n modelId: String!\n id: ID!\n input: CmsUpdateScheduleInput!\n ): CmsUpdateScheduleResponse!\n cancelCmsSchedule(modelId: String!, id: ID!): CmsCancelScheduleResponse!\n }\n `,\n resolvers: {\n Query: {\n async getCmsSchedule(_, args, context) {\n return resolve(async () => {\n const validated = await getScheduleSchema.safeParseAsync(args);\n if (validated.error) {\n throw createZodError(validated.error);\n }\n const model = await context.cms.getModel(validated.data.modelId);\n const scheduler = context.cms.scheduler(model);\n\n return scheduler.getScheduled(validated.data.id);\n });\n },\n async listCmsSchedules(_, args, context) {\n return resolveList(async () => {\n const validated = await listScheduleSchema.safeParseAsync(args);\n if (validated.error) {\n throw createZodError(validated.error);\n }\n const model = await context.cms.getModel(validated.data.modelId);\n const scheduler = context.cms.scheduler(model);\n\n return scheduler.listScheduled({\n where: validated.data.where || {},\n sort: validated.data.sort,\n limit: validated.data.limit,\n after: validated.data.after\n });\n });\n }\n },\n Mutation: {\n async createCmsSchedule(_, args, context) {\n return resolve(async () => {\n const validated = await createScheduleSchema.safeParseAsync(args);\n if (validated.error) {\n throw createZodError(validated.error);\n }\n\n const model = await context.cms.getModel(validated.data.modelId);\n const scheduler = context.cms.scheduler(model);\n\n return await scheduler.schedule(validated.data.id, validated.data.input);\n });\n },\n async updateCmsSchedule(_, args, context) {\n return resolve(async () => {\n const validated = await updateScheduleSchema.safeParseAsync(args);\n if (validated.error) {\n throw createZodError(validated.error);\n }\n const model = await context.cms.getModel(validated.data.modelId);\n const scheduler = context.cms.scheduler(model);\n\n return scheduler.schedule(validated.data.id, validated.data.input);\n });\n },\n async cancelCmsSchedule(_, args, context) {\n return resolve(async () => {\n const validated = await cancelScheduleSchema.safeParseAsync(args);\n if (validated.error) {\n throw createZodError(validated.error);\n }\n const model = await context.cms.getModel(validated.data.modelId);\n const scheduler = context.cms.scheduler(model);\n\n await scheduler.cancel(validated.data.id);\n return true;\n });\n }\n }\n }\n });\n};\n"],"mappings":"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","ignoreList":[]}
|
package/graphql/schema.d.ts
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import zod from "zod";
|
|
2
|
-
import { ScheduleType } from "../scheduler/types.js";
|
|
3
|
-
export declare const getScheduleSchema: zod.ZodObject<{
|
|
4
|
-
modelId: zod.ZodString;
|
|
5
|
-
id: zod.ZodString;
|
|
6
|
-
}, "strip", zod.ZodTypeAny, {
|
|
7
|
-
id: string;
|
|
8
|
-
modelId: string;
|
|
9
|
-
}, {
|
|
10
|
-
id: string;
|
|
11
|
-
modelId: string;
|
|
12
|
-
}>;
|
|
13
|
-
export declare const listScheduleSchema: zod.ZodObject<{
|
|
14
|
-
modelId: zod.ZodString;
|
|
15
|
-
where: zod.ZodOptional<zod.ZodObject<{
|
|
16
|
-
targetId: zod.ZodOptional<zod.ZodString>;
|
|
17
|
-
targetEntryId: zod.ZodOptional<zod.ZodString>;
|
|
18
|
-
title_contains: zod.ZodOptional<zod.ZodString>;
|
|
19
|
-
title_not_contains: zod.ZodOptional<zod.ZodString>;
|
|
20
|
-
type: zod.ZodOptional<zod.ZodNativeEnum<typeof ScheduleType>>;
|
|
21
|
-
scheduledBy: zod.ZodOptional<zod.ZodString>;
|
|
22
|
-
scheduledOn: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined, Date | undefined>;
|
|
23
|
-
scheduledOn_gte: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined, Date | undefined>;
|
|
24
|
-
scheduledOn_lte: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined, Date | undefined>;
|
|
25
|
-
}, "strip", zod.ZodTypeAny, {
|
|
26
|
-
type?: ScheduleType | undefined;
|
|
27
|
-
targetId?: string | undefined;
|
|
28
|
-
targetEntryId?: string | undefined;
|
|
29
|
-
scheduledBy?: string | undefined;
|
|
30
|
-
scheduledOn?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
31
|
-
scheduledOn_gte?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
32
|
-
scheduledOn_lte?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
33
|
-
title_contains?: string | undefined;
|
|
34
|
-
title_not_contains?: string | undefined;
|
|
35
|
-
}, {
|
|
36
|
-
type?: ScheduleType | undefined;
|
|
37
|
-
targetId?: string | undefined;
|
|
38
|
-
targetEntryId?: string | undefined;
|
|
39
|
-
scheduledBy?: string | undefined;
|
|
40
|
-
scheduledOn?: Date | undefined;
|
|
41
|
-
scheduledOn_gte?: Date | undefined;
|
|
42
|
-
scheduledOn_lte?: Date | undefined;
|
|
43
|
-
title_contains?: string | undefined;
|
|
44
|
-
title_not_contains?: string | undefined;
|
|
45
|
-
}>>;
|
|
46
|
-
sort: zod.ZodOptional<zod.ZodArray<zod.ZodEffects<zod.ZodString, `${string}_ASC` | `${string}_DESC`, string>, "many">>;
|
|
47
|
-
limit: zod.ZodOptional<zod.ZodNumber>;
|
|
48
|
-
after: zod.ZodOptional<zod.ZodString>;
|
|
49
|
-
}, "strip", zod.ZodTypeAny, {
|
|
50
|
-
modelId: string;
|
|
51
|
-
sort?: (`${string}_ASC` | `${string}_DESC`)[] | undefined;
|
|
52
|
-
after?: string | undefined;
|
|
53
|
-
where?: {
|
|
54
|
-
type?: ScheduleType | undefined;
|
|
55
|
-
targetId?: string | undefined;
|
|
56
|
-
targetEntryId?: string | undefined;
|
|
57
|
-
scheduledBy?: string | undefined;
|
|
58
|
-
scheduledOn?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
59
|
-
scheduledOn_gte?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
60
|
-
scheduledOn_lte?: `${number}-${number}-${number}T${number}:${number}:${number}.${number}Z` | undefined;
|
|
61
|
-
title_contains?: string | undefined;
|
|
62
|
-
title_not_contains?: string | undefined;
|
|
63
|
-
} | undefined;
|
|
64
|
-
limit?: number | undefined;
|
|
65
|
-
}, {
|
|
66
|
-
modelId: string;
|
|
67
|
-
sort?: string[] | undefined;
|
|
68
|
-
after?: string | undefined;
|
|
69
|
-
where?: {
|
|
70
|
-
type?: ScheduleType | undefined;
|
|
71
|
-
targetId?: string | undefined;
|
|
72
|
-
targetEntryId?: string | undefined;
|
|
73
|
-
scheduledBy?: string | undefined;
|
|
74
|
-
scheduledOn?: Date | undefined;
|
|
75
|
-
scheduledOn_gte?: Date | undefined;
|
|
76
|
-
scheduledOn_lte?: Date | undefined;
|
|
77
|
-
title_contains?: string | undefined;
|
|
78
|
-
title_not_contains?: string | undefined;
|
|
79
|
-
} | undefined;
|
|
80
|
-
limit?: number | undefined;
|
|
81
|
-
}>;
|
|
82
|
-
export declare const createScheduleSchema: zod.ZodObject<{
|
|
83
|
-
modelId: zod.ZodString;
|
|
84
|
-
id: zod.ZodString;
|
|
85
|
-
input: zod.ZodDiscriminatedUnion<"immediately", [zod.ZodObject<{
|
|
86
|
-
immediately: zod.ZodLiteral<true>;
|
|
87
|
-
scheduleOn: zod.ZodOptional<zod.ZodNever>;
|
|
88
|
-
dateOn: zod.ZodOptional<zod.ZodDate>;
|
|
89
|
-
type: zod.ZodNativeEnum<typeof ScheduleType>;
|
|
90
|
-
}, "strip", zod.ZodTypeAny, {
|
|
91
|
-
type: ScheduleType;
|
|
92
|
-
immediately: true;
|
|
93
|
-
scheduleOn?: undefined;
|
|
94
|
-
dateOn?: Date | undefined;
|
|
95
|
-
}, {
|
|
96
|
-
type: ScheduleType;
|
|
97
|
-
immediately: true;
|
|
98
|
-
scheduleOn?: undefined;
|
|
99
|
-
dateOn?: Date | undefined;
|
|
100
|
-
}>, zod.ZodObject<{
|
|
101
|
-
immediately: zod.ZodOptional<zod.ZodLiteral<false>>;
|
|
102
|
-
scheduleOn: zod.ZodUnion<[zod.ZodDate, zod.ZodEffects<zod.ZodString, Date, string>]>;
|
|
103
|
-
dateOn: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, Date | undefined, Date | undefined>;
|
|
104
|
-
type: zod.ZodNativeEnum<typeof ScheduleType>;
|
|
105
|
-
}, "strip", zod.ZodTypeAny, {
|
|
106
|
-
type: ScheduleType;
|
|
107
|
-
scheduleOn: Date;
|
|
108
|
-
immediately?: false | undefined;
|
|
109
|
-
dateOn?: Date | undefined;
|
|
110
|
-
}, {
|
|
111
|
-
type: ScheduleType;
|
|
112
|
-
scheduleOn: string | Date;
|
|
113
|
-
immediately?: false | undefined;
|
|
114
|
-
dateOn?: Date | undefined;
|
|
115
|
-
}>]>;
|
|
116
|
-
}, "strip", zod.ZodTypeAny, {
|
|
117
|
-
input: {
|
|
118
|
-
type: ScheduleType;
|
|
119
|
-
immediately: true;
|
|
120
|
-
scheduleOn?: undefined;
|
|
121
|
-
dateOn?: Date | undefined;
|
|
122
|
-
} | {
|
|
123
|
-
type: ScheduleType;
|
|
124
|
-
scheduleOn: Date;
|
|
125
|
-
immediately?: false | undefined;
|
|
126
|
-
dateOn?: Date | undefined;
|
|
127
|
-
};
|
|
128
|
-
id: string;
|
|
129
|
-
modelId: string;
|
|
130
|
-
}, {
|
|
131
|
-
input: {
|
|
132
|
-
type: ScheduleType;
|
|
133
|
-
immediately: true;
|
|
134
|
-
scheduleOn?: undefined;
|
|
135
|
-
dateOn?: Date | undefined;
|
|
136
|
-
} | {
|
|
137
|
-
type: ScheduleType;
|
|
138
|
-
scheduleOn: string | Date;
|
|
139
|
-
immediately?: false | undefined;
|
|
140
|
-
dateOn?: Date | undefined;
|
|
141
|
-
};
|
|
142
|
-
id: string;
|
|
143
|
-
modelId: string;
|
|
144
|
-
}>;
|
|
145
|
-
export declare const updateScheduleSchema: zod.ZodObject<{
|
|
146
|
-
modelId: zod.ZodString;
|
|
147
|
-
id: zod.ZodString;
|
|
148
|
-
input: zod.ZodDiscriminatedUnion<"immediately", [zod.ZodObject<{
|
|
149
|
-
immediately: zod.ZodLiteral<true>;
|
|
150
|
-
scheduleOn: zod.ZodOptional<zod.ZodNever>;
|
|
151
|
-
dateOn: zod.ZodOptional<zod.ZodDate>;
|
|
152
|
-
type: zod.ZodNativeEnum<typeof ScheduleType>;
|
|
153
|
-
}, "strip", zod.ZodTypeAny, {
|
|
154
|
-
type: ScheduleType;
|
|
155
|
-
immediately: true;
|
|
156
|
-
scheduleOn?: undefined;
|
|
157
|
-
dateOn?: Date | undefined;
|
|
158
|
-
}, {
|
|
159
|
-
type: ScheduleType;
|
|
160
|
-
immediately: true;
|
|
161
|
-
scheduleOn?: undefined;
|
|
162
|
-
dateOn?: Date | undefined;
|
|
163
|
-
}>, zod.ZodObject<{
|
|
164
|
-
immediately: zod.ZodOptional<zod.ZodLiteral<false>>;
|
|
165
|
-
scheduleOn: zod.ZodUnion<[zod.ZodDate, zod.ZodEffects<zod.ZodString, Date, string>]>;
|
|
166
|
-
dateOn: zod.ZodEffects<zod.ZodOptional<zod.ZodDate>, Date | undefined, Date | undefined>;
|
|
167
|
-
type: zod.ZodNativeEnum<typeof ScheduleType>;
|
|
168
|
-
}, "strip", zod.ZodTypeAny, {
|
|
169
|
-
type: ScheduleType;
|
|
170
|
-
scheduleOn: Date;
|
|
171
|
-
immediately?: false | undefined;
|
|
172
|
-
dateOn?: Date | undefined;
|
|
173
|
-
}, {
|
|
174
|
-
type: ScheduleType;
|
|
175
|
-
scheduleOn: string | Date;
|
|
176
|
-
immediately?: false | undefined;
|
|
177
|
-
dateOn?: Date | undefined;
|
|
178
|
-
}>]>;
|
|
179
|
-
}, "strip", zod.ZodTypeAny, {
|
|
180
|
-
input: {
|
|
181
|
-
type: ScheduleType;
|
|
182
|
-
immediately: true;
|
|
183
|
-
scheduleOn?: undefined;
|
|
184
|
-
dateOn?: Date | undefined;
|
|
185
|
-
} | {
|
|
186
|
-
type: ScheduleType;
|
|
187
|
-
scheduleOn: Date;
|
|
188
|
-
immediately?: false | undefined;
|
|
189
|
-
dateOn?: Date | undefined;
|
|
190
|
-
};
|
|
191
|
-
id: string;
|
|
192
|
-
modelId: string;
|
|
193
|
-
}, {
|
|
194
|
-
input: {
|
|
195
|
-
type: ScheduleType;
|
|
196
|
-
immediately: true;
|
|
197
|
-
scheduleOn?: undefined;
|
|
198
|
-
dateOn?: Date | undefined;
|
|
199
|
-
} | {
|
|
200
|
-
type: ScheduleType;
|
|
201
|
-
scheduleOn: string | Date;
|
|
202
|
-
immediately?: false | undefined;
|
|
203
|
-
dateOn?: Date | undefined;
|
|
204
|
-
};
|
|
205
|
-
id: string;
|
|
206
|
-
modelId: string;
|
|
207
|
-
}>;
|
|
208
|
-
export declare const cancelScheduleSchema: zod.ZodObject<{
|
|
209
|
-
modelId: zod.ZodString;
|
|
210
|
-
id: zod.ZodString;
|
|
211
|
-
}, "strip", zod.ZodTypeAny, {
|
|
212
|
-
id: string;
|
|
213
|
-
modelId: string;
|
|
214
|
-
}, {
|
|
215
|
-
id: string;
|
|
216
|
-
modelId: string;
|
|
217
|
-
}>;
|