@tachybase/module-cron 1.3.20 → 1.3.22
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/client/index.js +1 -1
- package/dist/collections/cronJobs.d.ts +1 -1
- package/dist/externalVersion.js +5 -7
- package/dist/node_modules/cron-parser/package.json +1 -1
- package/dist/server/actions/cron-jobs-controller.d.ts +1 -1
- package/dist/server/actions/cron-jobs-controller.js +2 -2
- package/dist/server/model/CronJobModel.d.ts +1 -1
- package/dist/server/model/CronJobModel.js +2 -2
- package/dist/server/plugin.d.ts +1 -1
- package/dist/server/plugin.js +1 -1
- package/dist/server/service/StaticScheduleTrigger.js +5 -5
- package/package.json +9 -15
package/dist/client/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(v,d){typeof exports=="object"&&typeof module!="undefined"?d(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("@tachybase/module-workflow/client"),require("@
|
|
1
|
+
(function(v,d){typeof exports=="object"&&typeof module!="undefined"?d(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("@tachybase/module-workflow/client"),require("@tego/client"),require("antd"),require("react"),require("@tachybase/schema")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","@tachybase/module-workflow/client","@tego/client","antd","react","@tachybase/schema"],d):(v=typeof globalThis!="undefined"?globalThis:v||self,d(v["@tachybase/module-cron"]={},v["@tachybase/client"],v.jsxRuntime,v["@tachybase/module-workflow"],v["@tego/client"],v.antd,v.react,v["@tachybase/schema"]))})(this,function(v,d,a,T,me,U,m,R){"use strict";var Zo=Object.defineProperty,qo=Object.defineProperties;var Uo=Object.getOwnPropertyDescriptors;var Me=Object.getOwnPropertySymbols;var mo=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable;var po=(v,d,a)=>d in v?Zo(v,d,{enumerable:!0,configurable:!0,writable:!0,value:a}):v[d]=a,L=(v,d)=>{for(var a in d||(d={}))mo.call(d,a)&&po(v,a,d[a]);if(Me)for(var a of Me(d))yo.call(d,a)&&po(v,a,d[a]);return v},G=(v,d)=>qo(v,Uo(d));var Pe=(v,d)=>{var a={};for(var T in v)mo.call(v,T)&&d.indexOf(T)<0&&(a[T]=v[T]);if(v!=null&&Me)for(var T of Me(v))d.indexOf(T)<0&&yo.call(v,T)&&(a[T]=v[T]);return a};var de=(v,d,a)=>new Promise((T,me)=>{var U=O=>{try{R(a.next(O))}catch(ie){me(ie)}},m=O=>{try{R(a.throw(O))}catch(ie){me(ie)}},R=O=>O.done?T(O.value):Promise.resolve(O.value).then(U,m);R((a=a.apply(v,d)).next())});const O="cron",ie="cronJobs";var Ee=(e=>(e[e.STATIC=0]="STATIC",e[e.DATE_FIELD=1]="DATE_FIELD",e))(Ee||{});const fo={dumpRules:{group:"required"},name:ie,shared:!0,createdAt:!0,updatedAt:!0,createdBy:!0,updatedBy:!0,model:"CronJobModel",fields:[{type:"bigInt",name:"id",primaryKey:!0,autoIncrement:!0},{type:"string",name:"name",required:!0,uiSchema:{title:'{{ t("Name") }}',type:"string","x-component":"Input",required:!0}},{type:"string",name:"description",uiSchema:{title:'{{ t("Description") }}',type:"string","x-component":"Input.TextArea"}},{type:"date",name:"startsOn",required:!0,uiSchema:{title:`{{t("Starts on", { ns: "${O}" })}}`,type:"datetime","x-component":"DatePicker","x-component-props":{showTime:!0},required:!0}},{type:"integer",name:"mode",required:!0,defaultValue:Ee.STATIC},{type:"date",name:"endsOn",uiSchema:{title:`{{t("Ends on", { ns: "${O}" })}}`,type:"datetime","x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"date",name:"lastTime",uiSchema:{title:`{{t("Last time", { ns: "${O}" })}}`,type:"datetime","x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"virtual",name:"nextTime",uiSchema:{title:`{{t("Next time", { ns: "${O}" })}}`,type:"datetime","x-component":"DatePicker","x-component-props":{showTime:!0}}},{type:"string",name:"repeat",required:!0,uiSchema:{title:`{{t("Repeat mode", { ns: "${O}" })}}`,type:"string","x-component":"RepeatField"}},{type:"integer",name:"limit",uiSchema:{title:`{{t("Current limit", { ns: "${O}" })}}`,type:"number","x-component":"InputNumber"}},{type:"integer",name:"allExecuted",uiSchema:{title:`{{t("Executed", { ns: "${O}" })}}`,type:"string"},defaultValue:0},{type:"integer",name:"successExecuted",defaultValue:0,uiSchema:{title:`{{t("Success executed", { ns: "${O}" })}}`,type:"string","x-component":"InputNumber"}},{type:"integer",name:"limitExecuted",defaultValue:0,uiSchema:{title:`{{t("Current times", { ns: "${O}" })}}`,type:"string","x-component":"InputNumber"}},{type:"boolean",name:"enabled",uiSchema:{title:'{{ t("Enabled") }}',type:"boolean","x-component":"Radio.Group",enum:[{label:'{{ t("On") }}',value:!0,color:"#52c41a"},{label:'{{ t("Off") }}',value:!1}]},defaultValue:!1},{name:"workflowKey",type:"string",interface:"select",uiSchema:{title:'{{ t("Workflow") }}',type:"string","x-component":"WorkflowSelect","x-component-props":{buttonAction:"customize:triggerWorkflows",noCollection:!0,label:"title",value:"key"}}}]},ye=()=>{const{i18n:e}=d.useApp();return{t:(r,o={})=>e.t(r,L({ns:O},o))}},ho=e=>d.tval(e,{ns:O});function ee(e){return d.i18n.t(e,{ns:O})}function xo(){return!0}const vo=R.observer(e=>{const s=e,{filter:t=xo}=s,r=Pe(s,["filter"]),o=d.useCompile(),{getCollectionFields:n}=d.useCollectionManager_deprecated(),{values:u}=R.useForm(),[i,c]=d.parseCollectionName(u==null?void 0:u.collection),l=n(c,i);return a.jsx(d.Select,G(L({popupMatchSelectWidth:!1},r),{options:l.filter(t).map(y=>{var b;return{label:o((b=y.uiSchema)==null?void 0:b.title),value:y.name}})}))},{displayName:"FieldsSelect"});function bo(e){return!e.hidden&&(e.uiSchema?e.type==="date":!1)}function je({value:e,onChange:t}){const r=e!=null?e:{},{t:o}=ye(),[n,u]=m.useState(r.offset?r.offset/Math.abs(r.offset):0);return a.jsxs("fieldset",{className:d.css`
|
|
2
2
|
display: flex;
|
|
3
3
|
gap: 0.5em;
|
|
4
4
|
`,children:[a.jsx(vo,{value:r.field,onChange:i=>t(G(L({},r),{field:i})),filter:bo,placeholder:o("Select field"),className:"auto-width"}),r.field?a.jsx(d.Select,{value:n,onChange:i=>{u(i),t(G(L({},r),{offset:Math.abs(r.offset)*i}))},options:[{value:0,label:ee("Exactly at")},{value:-1,label:o("Before")},{value:1,label:o("After")}],className:"auto-width"}):null,n?a.jsxs(a.Fragment,{children:[a.jsx(d.InputNumber,{value:Math.abs(r.offset),onChange:i=>t(G(L({},r),{offset:(i!=null?i:0)*n}))}),a.jsx(d.Select,{value:r.unit||864e5,onChange:i=>t(G(L({},r),{unit:i})),options:[{value:864e5,label:ee("Days")},{value:36e5,label:ee("Hours")},{value:6e4,label:ee("Minutes")},{value:1e3,label:ee("Seconds")}],className:"auto-width"})]}):null]})}function go({value:e,onChange:t}){const{t:r}=ye(),o=e!=null?typeof e=="object"&&!(e instanceof Date)?"field":"date":null;return a.jsxs("fieldset",{className:d.css`
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@tachybase/client": "1.3.
|
|
3
|
-
"@
|
|
4
|
-
"@tachybase/server": "1.3.20",
|
|
2
|
+
"@tachybase/client": "1.3.22",
|
|
3
|
+
"@tego/server": "1.3.39",
|
|
5
4
|
"react": "18.3.1",
|
|
6
|
-
"@
|
|
5
|
+
"@tego/client": "1.3.39",
|
|
7
6
|
"antd": "5.22.5",
|
|
8
|
-
"@tachybase/schema": "1.3.
|
|
9
|
-
"@tachybase/module-workflow": "1.3.
|
|
10
|
-
"@tachybase/actions": "1.3.20"
|
|
7
|
+
"@tachybase/schema": "1.3.39",
|
|
8
|
+
"@tachybase/module-workflow": "1.3.22"
|
|
11
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron-parser","version":"4.9.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"types/index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^3.2.1"},"devDependencies":{"eslint":"^8.27.0","sinon":"^15.0.1","tap":"^16.3.3","tsd":"^0.26.0"},"engines":{"node":">=12.0.0"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"files":["lib","types","LICENSE","README.md"],"_lastModified":"2025-07-
|
|
1
|
+
{"name":"cron-parser","version":"4.9.0","description":"Node.js library for parsing crontab instructions","main":"lib/parser.js","types":"types/index.d.ts","typesVersions":{"<4.1":{"*":["types/ts3/*"]}},"directories":{"test":"test"},"scripts":{"test:tsd":"tsd","test:unit":"TZ=UTC tap ./test/*.js","test:cover":"TZ=UTC tap --coverage-report=html ./test/*.js","lint":"eslint .","lint:fix":"eslint --fix .","test":"npm run lint && npm run test:unit && npm run test:tsd"},"repository":{"type":"git","url":"https://github.com/harrisiirak/cron-parser.git"},"keywords":["cron","crontab","parser"],"author":"Harri Siirak","contributors":["Nicholas Clawson","Daniel Prentis <daniel@salsitasoft.com>","Renault John Lecoultre","Richard Astbury <richard.astbury@gmail.com>","Meaglin Wasabi <Meaglin.wasabi@gmail.com>","Mike Kusold <hello@mikekusold.com>","Alex Kit <alex.kit@atmajs.com>","Santiago Gimeno <santiago.gimeno@gmail.com>","Daniel <darc.tec@gmail.com>","Christian Steininger <christian.steininger.cs@gmail.com>","Mykola Piskovyi <m.piskovyi@gmail.com>","Brian Vaughn <brian.david.vaughn@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Yasuhiroki <yasuhiroki.duck@gmail.com>","Nicholas Clawson <nickclaw@gmail.com>","Brendan Warkentin <faazshift@gmail.com>","Charlie Fish <fishcharlie.code@gmail.com>","Ian Graves <ian+diskimage@iangrav.es>","Andy Thompson <me@andytson.com>","Regev Brody <regevbr@gmail.com>"],"license":"MIT","dependencies":{"luxon":"^3.2.1"},"devDependencies":{"eslint":"^8.27.0","sinon":"^15.0.1","tap":"^16.3.3","tsd":"^0.26.0"},"engines":{"node":">=12.0.0"},"browser":{"fs":false},"tap":{"check-coverage":false},"tsd":{"directory":"test","compilerOptions":{"lib":["es2017","dom"]}},"files":["lib","types","LICENSE","README.md"],"_lastModified":"2025-07-29T06:21:52.977Z"}
|
|
@@ -65,9 +65,9 @@ __export(cron_jobs_controller_exports, {
|
|
|
65
65
|
CronJobsController: () => CronJobsController
|
|
66
66
|
});
|
|
67
67
|
module.exports = __toCommonJS(cron_jobs_controller_exports);
|
|
68
|
-
var
|
|
68
|
+
var import_server = require("@tego/server");
|
|
69
69
|
var _clearLimitExecuted_dec, _CronJobsController_decorators, _init;
|
|
70
|
-
_CronJobsController_decorators = [(0,
|
|
70
|
+
_CronJobsController_decorators = [(0, import_server.Controller)("cronJobs")], _clearLimitExecuted_dec = [(0, import_server.Action)("clearLimitExecuted")];
|
|
71
71
|
class CronJobsController {
|
|
72
72
|
constructor() {
|
|
73
73
|
__runInitializers(_init, 5, this);
|
|
@@ -20,8 +20,8 @@ __export(CronJobModel_exports, {
|
|
|
20
20
|
CronJobModel: () => CronJobModel
|
|
21
21
|
});
|
|
22
22
|
module.exports = __toCommonJS(CronJobModel_exports);
|
|
23
|
-
var
|
|
24
|
-
class CronJobModel extends
|
|
23
|
+
var import_server = require("@tego/server");
|
|
24
|
+
class CronJobModel extends import_server.Model {
|
|
25
25
|
}
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
package/dist/server/plugin.d.ts
CHANGED
package/dist/server/plugin.js
CHANGED
|
@@ -66,7 +66,7 @@ __export(plugin_exports, {
|
|
|
66
66
|
default: () => plugin_default
|
|
67
67
|
});
|
|
68
68
|
module.exports = __toCommonJS(plugin_exports);
|
|
69
|
-
var import_server = require("@
|
|
69
|
+
var import_server = require("@tego/server");
|
|
70
70
|
var import_cron_jobs_controller = require("./actions/cron-jobs-controller");
|
|
71
71
|
var import_CronJobModel = require("./model/CronJobModel");
|
|
72
72
|
var import_StaticScheduleTrigger = require("./service/StaticScheduleTrigger");
|
|
@@ -75,13 +75,13 @@ __export(StaticScheduleTrigger_exports, {
|
|
|
75
75
|
});
|
|
76
76
|
module.exports = __toCommonJS(StaticScheduleTrigger_exports);
|
|
77
77
|
var import_module_workflow = require("@tachybase/module-workflow");
|
|
78
|
-
var
|
|
78
|
+
var import_server = require("@tego/server");
|
|
79
79
|
var import_cron_parser = __toESM(require("cron-parser"));
|
|
80
80
|
var import_constants = require("../../constants");
|
|
81
|
-
var
|
|
81
|
+
var import_utils = require("../utils");
|
|
82
82
|
var _logger_dec, _db_dec, _app_dec, _StaticScheduleTrigger_decorators, _init;
|
|
83
83
|
const MAX_SAFE_INTERVAL = 2147483647;
|
|
84
|
-
_StaticScheduleTrigger_decorators = [(0,
|
|
84
|
+
_StaticScheduleTrigger_decorators = [(0, import_server.Service)()], _app_dec = [(0, import_server.App)()], _db_dec = [(0, import_server.Db)()], _logger_dec = [(0, import_server.InjectLog)()];
|
|
85
85
|
let _StaticScheduleTrigger = class _StaticScheduleTrigger {
|
|
86
86
|
constructor() {
|
|
87
87
|
this.app = __runInitializers(_init, 8, this), __runInitializers(_init, 11, this);
|
|
@@ -175,12 +175,12 @@ let _StaticScheduleTrigger = class _StaticScheduleTrigger {
|
|
|
175
175
|
}
|
|
176
176
|
currentDate.setMilliseconds(nextSecond ? 1e3 : 0);
|
|
177
177
|
const timestamp = currentDate.getTime();
|
|
178
|
-
const startTime = (0,
|
|
178
|
+
const startTime = (0, import_utils.parseDateWithoutMs)(cronJob.startsOn);
|
|
179
179
|
if (startTime > timestamp) {
|
|
180
180
|
return startTime;
|
|
181
181
|
}
|
|
182
182
|
if (cronJob.repeat) {
|
|
183
|
-
const endTime = cronJob.endsOn ? (0,
|
|
183
|
+
const endTime = cronJob.endsOn ? (0, import_utils.parseDateWithoutMs)(cronJob.endsOn) : null;
|
|
184
184
|
if (endTime && endTime < timestamp) {
|
|
185
185
|
return null;
|
|
186
186
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/module-cron",
|
|
3
3
|
"displayName": "Cron job",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.22",
|
|
5
5
|
"description": "Schedule tasks to run at specific times, using a workflow approach",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"System management"
|
|
@@ -9,23 +9,17 @@
|
|
|
9
9
|
"main": "dist/server/index.js",
|
|
10
10
|
"dependencies": {},
|
|
11
11
|
"devDependencies": {
|
|
12
|
+
"@tachybase/schema": "^1.3.39",
|
|
13
|
+
"@tachybase/test": "^1.3.39",
|
|
14
|
+
"@tego/client": "^1.3.39",
|
|
15
|
+
"@tego/server": "^1.3.39",
|
|
12
16
|
"antd": "5.22.5",
|
|
13
17
|
"cron-parser": "4.9.0",
|
|
14
|
-
"react-js-cron": "^3.2.0"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"@tachybase/actions": "1.3.20",
|
|
18
|
-
"@tachybase/client": "1.3.20",
|
|
19
|
-
"@tachybase/database": "1.3.20",
|
|
20
|
-
"@tachybase/schema": "1.3.20",
|
|
21
|
-
"@tachybase/module-workflow": "1.3.20",
|
|
22
|
-
"@tachybase/server": "1.3.20",
|
|
23
|
-
"@tachybase/utils": "1.3.20",
|
|
24
|
-
"@tachybase/test": "1.3.20"
|
|
18
|
+
"react-js-cron": "^3.2.0",
|
|
19
|
+
"@tachybase/client": "1.3.22",
|
|
20
|
+
"@tachybase/module-workflow": "1.3.22"
|
|
25
21
|
},
|
|
26
22
|
"description.zh-CN": "安排任务在特定时间运行,采用工作流的方式",
|
|
27
23
|
"displayName.zh-CN": "定时任务",
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "tachybase-build --no-dts @tachybase/module-cron"
|
|
30
|
-
}
|
|
24
|
+
"scripts": {}
|
|
31
25
|
}
|