@ldsg/schedule 0.3.31 → 0.3.33
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/dist/constants.d.ts +3 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +8 -8
- package/dist/handler.d.ts +4 -4
- package/dist/index.d.ts +5 -5
- package/dist/instantiate-resource.d.ts +3 -3
- package/dist/instantiate-resource.d.ts.map +1 -1
- package/dist/instantiate-resource.js +1 -1
- package/dist/resource.d.ts +2 -2
- package/dist/resource.js +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/specific-resource-settings.d.ts +1 -1
- package/dist/types/specific-resource-settings.d.ts.map +1 -1
- package/dist/types/specific-resource-settings.js +3 -3
- package/package.json +15 -11
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HandlerSpecificResourceSettings } from
|
|
2
|
-
import { ResourceDefinitionSpecificResourceSettings } from
|
|
3
|
-
import { GeneralResourceSettings } from
|
|
1
|
+
import { HandlerSpecificResourceSettings } from "@ldsg/handler";
|
|
2
|
+
import { ResourceDefinitionSpecificResourceSettings } from "@ldsg/resource-definition";
|
|
3
|
+
import { GeneralResourceSettings } from "@ldsg/types";
|
|
4
4
|
export declare const INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
|
|
5
5
|
export declare const INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS: HandlerSpecificResourceSettings;
|
|
6
6
|
export declare const RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,sDAAsD,EAAE,uBAGpE,CAAC;AAEF,eAAO,MAAM,uDAAuD,EAAE,+
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,sDAAsD,EAAE,uBAGpE,CAAC;AAEF,eAAO,MAAM,uDAAuD,EAAE,+BAQnE,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBAG3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAG1D,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = void 0;
|
|
4
4
|
exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
|
|
5
|
-
title:
|
|
6
|
-
description:
|
|
5
|
+
title: "定时任务实例化资源处理程序",
|
|
6
|
+
description: "",
|
|
7
7
|
};
|
|
8
8
|
exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
|
|
9
9
|
code: `export * from "@ldsg/schedule";`,
|
|
10
10
|
dependencies: [
|
|
11
11
|
{
|
|
12
|
-
name:
|
|
13
|
-
}
|
|
14
|
-
]
|
|
12
|
+
name: "@ldsg/schedule",
|
|
13
|
+
},
|
|
14
|
+
],
|
|
15
15
|
};
|
|
16
16
|
exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
|
|
17
|
-
title:
|
|
18
|
-
description:
|
|
17
|
+
title: "定时任务资源定义",
|
|
18
|
+
description: "",
|
|
19
19
|
};
|
|
20
20
|
exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
|
|
21
|
-
kind:
|
|
21
|
+
kind: "schedule",
|
|
22
22
|
};
|
package/dist/handler.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Handler } from
|
|
2
|
-
import { InstantiateResourceParams, InstantiateResourceRes } from
|
|
3
|
-
import { ScheduleResource } from
|
|
4
|
-
import { ScheduleSpecificResourceSettings } from
|
|
1
|
+
import { Handler } from "@ldsg/handler";
|
|
2
|
+
import { InstantiateResourceParams, InstantiateResourceRes } from "@ldsg/resource";
|
|
3
|
+
import { ScheduleResource } from "./resource";
|
|
4
|
+
import { ScheduleSpecificResourceSettings } from "./types";
|
|
5
5
|
export declare const handler: Handler<InstantiateResourceParams<ScheduleSpecificResourceSettings>, InstantiateResourceRes<ScheduleResource>>;
|
|
6
6
|
//# sourceMappingURL=handler.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from "./constants";
|
|
2
|
+
export * from "./handler";
|
|
3
|
+
export * from "./instantiate-resource";
|
|
4
|
+
export * from "./resource";
|
|
5
|
+
export * from "./types";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InstantiateResource } from
|
|
2
|
-
import { ScheduleResource } from
|
|
3
|
-
import { ScheduleSpecificResourceSettings } from
|
|
1
|
+
import { InstantiateResource } from "@ldsg/resource";
|
|
2
|
+
import { ScheduleResource } from "./resource";
|
|
3
|
+
import { ScheduleSpecificResourceSettings } from "./types";
|
|
4
4
|
export declare const instantiateResource: InstantiateResource<ScheduleSpecificResourceSettings, ScheduleResource>;
|
|
5
5
|
//# sourceMappingURL=instantiate-resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instantiate-resource.d.ts","sourceRoot":"","sources":["../src/instantiate-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"instantiate-resource.d.ts","sourceRoot":"","sources":["../src/instantiate-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,CACnD,gCAAgC,EAChC,gBAAgB,CAWjB,CAAC"}
|
package/dist/resource.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Resource } from
|
|
2
|
-
import { ScheduleSpecificResourceSettings } from
|
|
1
|
+
import { Resource } from "@ldsg/resource";
|
|
2
|
+
import { ScheduleSpecificResourceSettings } from "./types";
|
|
3
3
|
export declare class ScheduleResource extends Resource<ScheduleSpecificResourceSettings> {
|
|
4
4
|
getScheduleInfo: () => {
|
|
5
5
|
scheduleInfo: {
|
package/dist/resource.js
CHANGED
|
@@ -6,7 +6,7 @@ class ScheduleResource extends resource_1.Resource {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
8
|
this.getScheduleInfo = () => {
|
|
9
|
-
const { settings: { triggerType, workflowResourceId, workflowVariables, delay, scheduledAt, cron }, id } = this;
|
|
9
|
+
const { settings: { triggerType, workflowResourceId, workflowVariables, delay, scheduledAt, cron }, id, } = this;
|
|
10
10
|
const scheduleInfo = {
|
|
11
11
|
id,
|
|
12
12
|
triggerType,
|
|
@@ -14,7 +14,7 @@ class ScheduleResource extends resource_1.Resource {
|
|
|
14
14
|
workflowVariables,
|
|
15
15
|
delay,
|
|
16
16
|
scheduledAt,
|
|
17
|
-
cron
|
|
17
|
+
cron,
|
|
18
18
|
};
|
|
19
19
|
return { scheduleInfo };
|
|
20
20
|
};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./specific-resource-settings";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mCAAmC;AACnC,eAAO,MAAM,iBAAiB;;;;EAAmC,CAAC;AAElE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,sCAAsC;;;;;;;;;;;8BAe/B,CAAC;AAErB,eAAO,MAAM,8BAA8B;;;;;;;;;;;8BAAyC,CAAC;AACrF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,
|
|
1
|
+
{"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mCAAmC;AACnC,eAAO,MAAM,iBAAiB;;;;EAAmC,CAAC;AAElE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAAM,sCAAsC;;;;;;;;;;;8BAe/B,CAAC;AAErB,eAAO,MAAM,8BAA8B;;;;;;;;;;;8BAAyC,CAAC;AACrF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,sCAAsC,CAC9C,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;8BAE7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,IAAI;QAAE,YAAY,EAAE,YAAY,CAAA;KAAE,CAAC;CACpC"}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ScheduleInfoSchema = exports.SpecificResourceSettingsSchema = exports.ScheduleSpecificResourceSettingsSchema = exports.TriggerTypeSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
/** 触发类型:now-立即,once-单次,every-周期 */
|
|
6
|
-
exports.TriggerTypeSchema = zod_1.z.enum([
|
|
6
|
+
exports.TriggerTypeSchema = zod_1.z.enum(["now", "once", "every"]);
|
|
7
7
|
exports.ScheduleSpecificResourceSettingsSchema = zod_1.z
|
|
8
8
|
.object({
|
|
9
9
|
/** 触发类型 */
|
|
@@ -17,10 +17,10 @@ exports.ScheduleSpecificResourceSettingsSchema = zod_1.z
|
|
|
17
17
|
/** 计划执行时间(毫秒时间戳),优先生效 */
|
|
18
18
|
scheduledAt: zod_1.z.number().optional(),
|
|
19
19
|
/** cron 表达式,仅 every 类型下使用 */
|
|
20
|
-
cron: zod_1.z.string().optional()
|
|
20
|
+
cron: zod_1.z.string().optional(),
|
|
21
21
|
})
|
|
22
22
|
.catchall(zod_1.z.any());
|
|
23
23
|
exports.SpecificResourceSettingsSchema = exports.ScheduleSpecificResourceSettingsSchema;
|
|
24
24
|
exports.ScheduleInfoSchema = exports.ScheduleSpecificResourceSettingsSchema.extend({
|
|
25
|
-
id: zod_1.z.string()
|
|
25
|
+
id: zod_1.z.string(),
|
|
26
26
|
});
|
package/package.json
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/schedule",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.33",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "wanxger",
|
|
8
|
-
"main": "dist/index.js",
|
|
9
|
-
"types": "dist",
|
|
10
8
|
"files": [
|
|
11
9
|
"dist/"
|
|
12
10
|
],
|
|
11
|
+
"main": "dist/index.js",
|
|
12
|
+
"types": "dist",
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
13
16
|
"dependencies": {
|
|
14
17
|
"zod": "^4.1.11",
|
|
15
|
-
"@ldsg/handler": "0.3.
|
|
16
|
-
"@ldsg/resource
|
|
17
|
-
"@ldsg/resource": "0.3.
|
|
18
|
+
"@ldsg/handler": "0.3.33",
|
|
19
|
+
"@ldsg/resource": "0.3.33",
|
|
20
|
+
"@ldsg/resource-definition": "0.3.33"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
20
23
|
"@types/jest": "^29.5.2",
|
|
21
24
|
"@types/node": "^20.13.0",
|
|
22
25
|
"jest": "^29.5.0",
|
|
26
|
+
"oxfmt": "latest",
|
|
27
|
+
"oxlint": "latest",
|
|
23
28
|
"ts-jest": "^29.1.5",
|
|
24
29
|
"ts-node": "^10.9.2",
|
|
25
30
|
"typescript": "^5.8.3",
|
|
26
|
-
"@ldsg/
|
|
27
|
-
"@ldsg/
|
|
28
|
-
},
|
|
29
|
-
"publishConfig": {
|
|
30
|
-
"access": "public"
|
|
31
|
+
"@ldsg/types": "0.3.33",
|
|
32
|
+
"@ldsg/application": "0.3.33"
|
|
31
33
|
},
|
|
32
34
|
"scripts": {
|
|
33
35
|
"build": "tsc --project tsconfig.build.json",
|
|
34
36
|
"clean": "rm -rf dist",
|
|
37
|
+
"format": "oxfmt --write src/",
|
|
38
|
+
"lint": "oxlint src/",
|
|
35
39
|
"test": "jest"
|
|
36
40
|
}
|
|
37
41
|
}
|