@things-factory/scheduler 7.1.34

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.
Files changed (81) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/client/bootstrap.ts +1 -0
  3. package/client/index.ts +0 -0
  4. package/client/pages/scheduler/popup-crontab-input.ts +75 -0
  5. package/client/pages/scheduler/schedule-list-page.ts +326 -0
  6. package/client/pages/scheduler/schedule-popup.ts +484 -0
  7. package/client/route.ts +7 -0
  8. package/client/tsconfig.json +11 -0
  9. package/client/types.ts +34 -0
  10. package/dist-client/bootstrap.d.ts +1 -0
  11. package/dist-client/bootstrap.js +2 -0
  12. package/dist-client/bootstrap.js.map +1 -0
  13. package/dist-client/index.d.ts +0 -0
  14. package/dist-client/index.js +2 -0
  15. package/dist-client/index.js.map +1 -0
  16. package/dist-client/pages/scheduler/popup-crontab-input.d.ts +12 -0
  17. package/dist-client/pages/scheduler/popup-crontab-input.js +77 -0
  18. package/dist-client/pages/scheduler/popup-crontab-input.js.map +1 -0
  19. package/dist-client/pages/scheduler/schedule-list-page.d.ts +42 -0
  20. package/dist-client/pages/scheduler/schedule-list-page.js +326 -0
  21. package/dist-client/pages/scheduler/schedule-list-page.js.map +1 -0
  22. package/dist-client/pages/scheduler/schedule-popup.d.ts +25 -0
  23. package/dist-client/pages/scheduler/schedule-popup.js +457 -0
  24. package/dist-client/pages/scheduler/schedule-popup.js.map +1 -0
  25. package/dist-client/route.d.ts +1 -0
  26. package/dist-client/route.js +8 -0
  27. package/dist-client/route.js.map +1 -0
  28. package/dist-client/tsconfig.tsbuildinfo +1 -0
  29. package/dist-client/types.d.ts +33 -0
  30. package/dist-client/types.js +2 -0
  31. package/dist-client/types.js.map +1 -0
  32. package/dist-server/controllers/index.d.ts +0 -0
  33. package/dist-server/controllers/index.js +1 -0
  34. package/dist-server/controllers/index.js.map +1 -0
  35. package/dist-server/index.d.ts +2 -0
  36. package/dist-server/index.js +6 -0
  37. package/dist-server/index.js.map +1 -0
  38. package/dist-server/routes.d.ts +1 -0
  39. package/dist-server/routes.js +25 -0
  40. package/dist-server/routes.js.map +1 -0
  41. package/dist-server/service/index.d.ts +5 -0
  42. package/dist-server/service/index.js +21 -0
  43. package/dist-server/service/index.js.map +1 -0
  44. package/dist-server/service/schedule/index.d.ts +6 -0
  45. package/dist-server/service/schedule/index.js +10 -0
  46. package/dist-server/service/schedule/index.js.map +1 -0
  47. package/dist-server/service/schedule/schedule-mutation.d.ts +6 -0
  48. package/dist-server/service/schedule/schedule-mutation.js +55 -0
  49. package/dist-server/service/schedule/schedule-mutation.js.map +1 -0
  50. package/dist-server/service/schedule/schedule-query.d.ts +6 -0
  51. package/dist-server/service/schedule/schedule-query.js +70 -0
  52. package/dist-server/service/schedule/schedule-query.js.map +1 -0
  53. package/dist-server/service/schedule/schedule-type.d.ts +75 -0
  54. package/dist-server/service/schedule/schedule-type.js +281 -0
  55. package/dist-server/service/schedule/schedule-type.js.map +1 -0
  56. package/dist-server/tsconfig.tsbuildinfo +1 -0
  57. package/helps/scheduler/assets/scheduler-explains.png +0 -0
  58. package/helps/scheduler/assets/scheduler-service-msa.png +0 -0
  59. package/helps/scheduler/assets/scheduler-service-openapi.png +0 -0
  60. package/helps/scheduler/assets/scheduler-service-scalable.png +0 -0
  61. package/helps/scheduler/assets/updated-scheduler-diagram-periodic.png +0 -0
  62. package/helps/scheduler/assets/updated-scheduler-diagram-pubsub.png +0 -0
  63. package/helps/scheduler/scheduler.ko.md +185 -0
  64. package/helps/scheduler/scheduler.md +186 -0
  65. package/helps/scheduler/scheduler.zh.md +185 -0
  66. package/package.json +38 -0
  67. package/server/controllers/index.ts +0 -0
  68. package/server/index.ts +3 -0
  69. package/server/routes.ts +28 -0
  70. package/server/service/index.ts +25 -0
  71. package/server/service/schedule/index.ts +7 -0
  72. package/server/service/schedule/schedule-mutation.ts +34 -0
  73. package/server/service/schedule/schedule-query.ts +64 -0
  74. package/server/service/schedule/schedule-type.ts +194 -0
  75. package/server/tsconfig.json +10 -0
  76. package/things-factory.config.js +8 -0
  77. package/translations/en.json +9 -0
  78. package/translations/ja.json +9 -0
  79. package/translations/ko.json +9 -0
  80. package/translations/ms.json +9 -0
  81. package/translations/zh.json +9 -0
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScheduleMutation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const scheduler_client_1 = require("@things-factory/scheduler-client");
7
+ const schedule_type_1 = require("./schedule-type");
8
+ let ScheduleMutation = class ScheduleMutation {
9
+ async registerSchedule(schedule) {
10
+ var handle = await (0, scheduler_client_1.registerSchedule)(schedule);
11
+ return handle;
12
+ }
13
+ async updateSchedule(schedule) {
14
+ return await (0, scheduler_client_1.updateSchedule)(schedule);
15
+ }
16
+ async unregisterSchedule(handle) {
17
+ try {
18
+ await (0, scheduler_client_1.unregisterSchedule)(handle);
19
+ }
20
+ catch (error) {
21
+ console.error(error);
22
+ return false;
23
+ }
24
+ return true;
25
+ }
26
+ };
27
+ exports.ScheduleMutation = ScheduleMutation;
28
+ tslib_1.__decorate([
29
+ (0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
30
+ (0, type_graphql_1.Mutation)(() => type_graphql_1.ID),
31
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('schedule')),
32
+ tslib_1.__metadata("design:type", Function),
33
+ tslib_1.__metadata("design:paramtypes", [schedule_type_1.NewSchedule]),
34
+ tslib_1.__metadata("design:returntype", Promise)
35
+ ], ScheduleMutation.prototype, "registerSchedule", null);
36
+ tslib_1.__decorate([
37
+ (0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
38
+ (0, type_graphql_1.Mutation)(() => type_graphql_1.ID),
39
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('schedule')),
40
+ tslib_1.__metadata("design:type", Function),
41
+ tslib_1.__metadata("design:paramtypes", [schedule_type_1.SchedulePatch]),
42
+ tslib_1.__metadata("design:returntype", Promise)
43
+ ], ScheduleMutation.prototype, "updateSchedule", null);
44
+ tslib_1.__decorate([
45
+ (0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
46
+ (0, type_graphql_1.Mutation)(() => Boolean),
47
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('handle', () => type_graphql_1.ID)),
48
+ tslib_1.__metadata("design:type", Function),
49
+ tslib_1.__metadata("design:paramtypes", [String]),
50
+ tslib_1.__metadata("design:returntype", Promise)
51
+ ], ScheduleMutation.prototype, "unregisterSchedule", null);
52
+ exports.ScheduleMutation = ScheduleMutation = tslib_1.__decorate([
53
+ (0, type_graphql_1.Resolver)(schedule_type_1.Schedule)
54
+ ], ScheduleMutation);
55
+ //# sourceMappingURL=schedule-mutation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-mutation.js","sourceRoot":"","sources":["../../../server/service/schedule/schedule-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAqE;AAErE,uEAAuG;AACvG,mDAAsE;AAG/D,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAGrB,AAAN,KAAK,CAAC,gBAAgB,CAAkB,QAAqB;QAC3D,IAAI,MAAM,GAAG,MAAM,IAAA,mCAAgB,EAAC,QAAQ,CAAC,CAAA;QAE7C,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,cAAc,CAAkB,QAAuB;QAC3D,OAAO,MAAM,IAAA,iCAAc,EAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;IAIK,AAAN,KAAK,CAAC,kBAAkB,CAA0B,MAAc;QAC9D,IAAI,CAAC;YACH,MAAM,IAAA,qCAAkB,EAAC,MAAM,CAAC,CAAA;QAClC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;YACpB,OAAO,KAAK,CAAA;QACd,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AA3BY,4CAAgB;AAGrB;IAFL,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,uBAAQ,EAAC,GAAG,EAAE,CAAC,iBAAE,CAAC;IACK,mBAAA,IAAA,kBAAG,EAAC,UAAU,CAAC,CAAA;;6CAAW,2BAAW;;wDAI5D;AAIK;IAFL,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,uBAAQ,EAAC,GAAG,EAAE,CAAC,iBAAE,CAAC;IACG,mBAAA,IAAA,kBAAG,EAAC,UAAU,CAAC,CAAA;;6CAAW,6BAAa;;sDAE5D;AAIK;IAFL,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,uBAAQ,EAAC,GAAG,EAAE,CAAC,OAAO,CAAC;IACE,mBAAA,IAAA,kBAAG,EAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,iBAAE,CAAC,CAAA;;;;0DAShD;2BA1BU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,wBAAQ,CAAC;GACN,gBAAgB,CA2B5B","sourcesContent":["import { Resolver, Directive, Mutation, Arg, ID } from 'type-graphql'\n\nimport { registerSchedule, updateSchedule, unregisterSchedule } from '@things-factory/scheduler-client'\nimport { Schedule, NewSchedule, SchedulePatch } from './schedule-type'\n\n@Resolver(Schedule)\nexport class ScheduleMutation {\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(() => ID)\n async registerSchedule(@Arg('schedule') schedule: NewSchedule): Promise<string> {\n var handle = await registerSchedule(schedule)\n\n return handle\n }\n\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(() => ID)\n async updateSchedule(@Arg('schedule') schedule: SchedulePatch): Promise<string> {\n return await updateSchedule(schedule)\n }\n\n @Directive('@privilege(superUserGranted: true)')\n @Mutation(() => Boolean)\n async unregisterSchedule(@Arg('handle', () => ID) handle: string): Promise<boolean> {\n try {\n await unregisterSchedule(handle)\n } catch (error) {\n console.error(error)\n return false\n }\n\n return true\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { ListParam } from '@things-factory/shell';
2
+ import { Schedule, ScheduleList } from './schedule-type';
3
+ export declare class ScheduleQuery {
4
+ schedule(id: string): Promise<Schedule | null>;
5
+ schedules(params: ListParam, context: ResolverContext): Promise<ScheduleList>;
6
+ }
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScheduleQuery = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const shell_1 = require("@things-factory/shell");
7
+ const scheduler_client_1 = require("@things-factory/scheduler-client");
8
+ const schedule_type_1 = require("./schedule-type");
9
+ let ScheduleQuery = class ScheduleQuery {
10
+ async schedule(id) {
11
+ return await (0, scheduler_client_1.getSchedule)(id);
12
+ }
13
+ async schedules(params, context) {
14
+ var _a, _b, _c, _d, _e, _f;
15
+ const filters = params.filters || [];
16
+ const name = (_a = filters.find(filter => filter.name == 'name')) === null || _a === void 0 ? void 0 : _a.value;
17
+ const application = (_b = filters.find(filter => filter.name == 'application')) === null || _b === void 0 ? void 0 : _b.value;
18
+ const group = (_c = filters.find(filter => filter.name == 'group')) === null || _c === void 0 ? void 0 : _c.value;
19
+ const type = (_d = filters.find(filter => filter.name == 'type')) === null || _d === void 0 ? void 0 : _d.value;
20
+ const key = (_e = filters.find(filter => filter.name == 'key')) === null || _e === void 0 ? void 0 : _e.value;
21
+ const operation = (_f = filters.find(filter => filter.name == 'operation')) === null || _f === void 0 ? void 0 : _f.value;
22
+ var schedules = await (0, scheduler_client_1.getSchedules)({});
23
+ if (name) {
24
+ schedules = schedules.filter(schedule => (schedule.name || '').toLowerCase().includes(name.toLowerCase()));
25
+ }
26
+ if (application) {
27
+ schedules = schedules.filter(schedule => { var _a; return (((_a = schedule.client) === null || _a === void 0 ? void 0 : _a.application) || '').toLowerCase().includes(application.toLowerCase()); });
28
+ }
29
+ if (group) {
30
+ schedules = schedules.filter(schedule => { var _a; return (((_a = schedule.client) === null || _a === void 0 ? void 0 : _a.group) || '').toLowerCase().includes(group.toLowerCase()); });
31
+ }
32
+ if (type) {
33
+ schedules = schedules.filter(schedule => { var _a; return (((_a = schedule.client) === null || _a === void 0 ? void 0 : _a.type) || '').toLowerCase().includes(type.toLowerCase()); });
34
+ }
35
+ if (key) {
36
+ schedules = schedules.filter(schedule => { var _a; return (((_a = schedule.client) === null || _a === void 0 ? void 0 : _a.key) || '').toLowerCase().includes(key.toLowerCase()); });
37
+ }
38
+ if (operation) {
39
+ schedules = schedules.filter(schedule => { var _a; return (((_a = schedule.client) === null || _a === void 0 ? void 0 : _a.operation) || '').toLowerCase().includes(operation.toLowerCase()); });
40
+ }
41
+ const { page = 1, limit = 20 } = params.pagination || {};
42
+ const start = (page - 1) * limit;
43
+ const end = start + limit;
44
+ const items = schedules.slice(start, end);
45
+ const total = schedules.length;
46
+ return { items, total };
47
+ }
48
+ };
49
+ exports.ScheduleQuery = ScheduleQuery;
50
+ tslib_1.__decorate([
51
+ (0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
52
+ (0, type_graphql_1.Query)(() => schedule_type_1.Schedule, { nullable: true }),
53
+ tslib_1.__param(0, (0, type_graphql_1.Arg)('id', () => type_graphql_1.ID)),
54
+ tslib_1.__metadata("design:type", Function),
55
+ tslib_1.__metadata("design:paramtypes", [String]),
56
+ tslib_1.__metadata("design:returntype", Promise)
57
+ ], ScheduleQuery.prototype, "schedule", null);
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.Directive)('@privilege(superUserGranted: true)'),
60
+ (0, type_graphql_1.Query)(returns => schedule_type_1.ScheduleList, { description: 'To fetch multiple Schedules' }),
61
+ tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
62
+ tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
63
+ tslib_1.__metadata("design:type", Function),
64
+ tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
65
+ tslib_1.__metadata("design:returntype", Promise)
66
+ ], ScheduleQuery.prototype, "schedules", null);
67
+ exports.ScheduleQuery = ScheduleQuery = tslib_1.__decorate([
68
+ (0, type_graphql_1.Resolver)(schedule_type_1.Schedule)
69
+ ], ScheduleQuery);
70
+ //# sourceMappingURL=schedule-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-query.js","sourceRoot":"","sources":["../../../server/service/schedule/schedule-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA6E;AAC7E,iDAAiD;AAEjD,uEAA4E;AAC5E,mDAAwD;AAGjD,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGlB,AAAN,KAAK,CAAC,QAAQ,CAAsB,EAAU;QAC5C,OAAO,MAAM,IAAA,8BAAW,EAAC,EAAE,CAAC,CAAA;IAC9B,CAAC;IAIK,AAAN,KAAK,CAAC,SAAS,CAA0B,MAAiB,EAAS,OAAwB;;QACzF,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAA;QAEpC,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,0CAAE,KAAK,CAAA;QAEjE,MAAM,WAAW,GAAG,MAAA,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,aAAa,CAAC,0CAAE,KAAK,CAAA;QAC/E,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,0CAAE,KAAK,CAAA;QACnE,MAAM,IAAI,GAAG,MAAA,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,0CAAE,KAAK,CAAA;QACjE,MAAM,GAAG,GAAG,MAAA,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,M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G,EAAC,IAAI,EAAE,GAAG,EAAE,CAAC,iBAAE,CAAC,CAAA;;;;6CAElC;AAIK;IAFL,IAAA,wBAAS,EAAC,oCAAoC,CAAC;IAC/C,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,4BAAY,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAC9D,mBAAA,IAAA,mBAAI,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;8CA8CzD;wBAvDU,aAAa;IADzB,IAAA,uBAAQ,EAAC,wBAAQ,CAAC;GACN,aAAa,CAwDzB","sourcesContent":["import { Resolver, Query, Args, Arg, Ctx, Directive, ID } from 'type-graphql'\nimport { ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { getSchedules, getSchedule } from '@things-factory/scheduler-client'\nimport { Schedule, ScheduleList } from './schedule-type'\n\n@Resolver(Schedule)\nexport class ScheduleQuery {\n @Directive('@privilege(superUserGranted: true)')\n @Query(() => Schedule, { nullable: true })\n async schedule(@Arg('id', () => ID) id: string): Promise<Schedule | null> {\n return await getSchedule(id)\n }\n\n @Directive('@privilege(superUserGranted: true)')\n @Query(returns => ScheduleList, { description: 'To fetch multiple Schedules' })\n async schedules(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<ScheduleList> {\n const filters = params.filters || []\n\n const name = filters.find(filter => filter.name == 'name')?.value\n\n const application = filters.find(filter => filter.name == 'application')?.value\n const group = filters.find(filter => filter.name == 'group')?.value\n const type = filters.find(filter => filter.name == 'type')?.value\n const key = filters.find(filter => filter.name == 'key')?.value\n const operation = filters.find(filter => filter.name == 'operation')?.value\n\n var schedules = await getSchedules({})\n\n if (name) {\n schedules = schedules.filter(schedule => (schedule.name || '').toLowerCase().includes(name.toLowerCase()))\n }\n if (application) {\n schedules = schedules.filter(schedule =>\n (schedule.client?.application || '').toLowerCase().includes(application.toLowerCase())\n )\n }\n if (group) {\n schedules = schedules.filter(schedule =>\n (schedule.client?.group || '').toLowerCase().includes(group.toLowerCase())\n )\n }\n if (type) {\n schedules = schedules.filter(schedule => (schedule.client?.type || '').toLowerCase().includes(type.toLowerCase()))\n }\n if (key) {\n schedules = schedules.filter(schedule => (schedule.client?.key || '').toLowerCase().includes(key.toLowerCase()))\n }\n if (operation) {\n schedules = schedules.filter(schedule =>\n (schedule.client?.operation || '').toLowerCase().includes(operation.toLowerCase())\n )\n }\n\n const { page = 1, limit = 20 } = params.pagination || {}\n\n const start = (page - 1) * limit\n const end = start + limit\n const items = schedules.slice(start, end)\n const total = schedules.length\n\n return { items, total }\n }\n}\n"]}
@@ -0,0 +1,75 @@
1
+ export declare class ScheduleClient {
2
+ application: string;
3
+ group: string;
4
+ type: string;
5
+ key: string;
6
+ operation: string;
7
+ }
8
+ export declare class ScheduleTaskConnection {
9
+ host?: string;
10
+ headers?: Record<string, string>;
11
+ topic?: string;
12
+ }
13
+ export declare class ScheduleTask {
14
+ type: string;
15
+ connection: ScheduleTaskConnection;
16
+ data: Record<string, any>;
17
+ history_check: boolean;
18
+ failed_policy: 'ignore' | 'retry' | 'retry_dlq';
19
+ retry_wait: number;
20
+ retry_count: number;
21
+ max_retry_count: number;
22
+ }
23
+ export declare class Schedule {
24
+ id: string;
25
+ name?: string;
26
+ client: ScheduleClient;
27
+ type: 'now' | 'delay' | 'date' | 'cron' | 'delay-recur';
28
+ schedule?: string;
29
+ timezone?: string;
30
+ task: ScheduleTask;
31
+ }
32
+ declare class ScheduleClientInput {
33
+ application: string;
34
+ group: string;
35
+ type: string;
36
+ key: string;
37
+ operation: string;
38
+ }
39
+ export declare class ScheduleTaskConnectionInput {
40
+ host?: string;
41
+ headers?: Record<string, string>;
42
+ topic?: string;
43
+ }
44
+ declare class ScheduleTaskInput {
45
+ type: 'rest' | 'kafka' | 'redis';
46
+ connection: ScheduleTaskConnectionInput;
47
+ data: Record<string, any>;
48
+ history_check: boolean;
49
+ failed_policy: 'ignore' | 'retry' | 'retry_dlq';
50
+ retry_wait: number;
51
+ retry_count: number;
52
+ max_retry_count: number;
53
+ }
54
+ export declare class NewSchedule {
55
+ name: string;
56
+ client: ScheduleClientInput;
57
+ type: 'now' | 'delay' | 'date' | 'cron' | 'delay-recur';
58
+ schedule: string;
59
+ timezone: string;
60
+ task: ScheduleTaskInput;
61
+ }
62
+ export declare class SchedulePatch {
63
+ id: string;
64
+ name?: string;
65
+ client: ScheduleClientInput;
66
+ type: 'now' | 'delay' | 'date' | 'cron' | 'delay-recur';
67
+ schedule: string;
68
+ timezone: string;
69
+ task: ScheduleTaskInput;
70
+ }
71
+ export declare class ScheduleList {
72
+ items: Schedule[];
73
+ total: number;
74
+ }
75
+ export {};
@@ -0,0 +1,281 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ScheduleList = exports.SchedulePatch = exports.NewSchedule = exports.ScheduleTaskConnectionInput = exports.Schedule = exports.ScheduleTask = exports.ScheduleTaskConnection = exports.ScheduleClient = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const type_graphql_1 = require("type-graphql");
6
+ const shell_1 = require("@things-factory/shell");
7
+ let ScheduleClient = class ScheduleClient {
8
+ };
9
+ exports.ScheduleClient = ScheduleClient;
10
+ tslib_1.__decorate([
11
+ (0, type_graphql_1.Field)(),
12
+ tslib_1.__metadata("design:type", String)
13
+ ], ScheduleClient.prototype, "application", void 0);
14
+ tslib_1.__decorate([
15
+ (0, type_graphql_1.Field)(),
16
+ tslib_1.__metadata("design:type", String)
17
+ ], ScheduleClient.prototype, "group", void 0);
18
+ tslib_1.__decorate([
19
+ (0, type_graphql_1.Field)(),
20
+ tslib_1.__metadata("design:type", String)
21
+ ], ScheduleClient.prototype, "type", void 0);
22
+ tslib_1.__decorate([
23
+ (0, type_graphql_1.Field)(),
24
+ tslib_1.__metadata("design:type", String)
25
+ ], ScheduleClient.prototype, "key", void 0);
26
+ tslib_1.__decorate([
27
+ (0, type_graphql_1.Field)(),
28
+ tslib_1.__metadata("design:type", String)
29
+ ], ScheduleClient.prototype, "operation", void 0);
30
+ exports.ScheduleClient = ScheduleClient = tslib_1.__decorate([
31
+ (0, type_graphql_1.ObjectType)()
32
+ ], ScheduleClient);
33
+ let ScheduleTaskConnection = class ScheduleTaskConnection {
34
+ };
35
+ exports.ScheduleTaskConnection = ScheduleTaskConnection;
36
+ tslib_1.__decorate([
37
+ (0, type_graphql_1.Field)({ nullable: true }),
38
+ tslib_1.__metadata("design:type", String)
39
+ ], ScheduleTaskConnection.prototype, "host", void 0);
40
+ tslib_1.__decorate([
41
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
42
+ tslib_1.__metadata("design:type", Object)
43
+ ], ScheduleTaskConnection.prototype, "headers", void 0);
44
+ tslib_1.__decorate([
45
+ (0, type_graphql_1.Field)({ nullable: true }),
46
+ tslib_1.__metadata("design:type", String)
47
+ ], ScheduleTaskConnection.prototype, "topic", void 0);
48
+ exports.ScheduleTaskConnection = ScheduleTaskConnection = tslib_1.__decorate([
49
+ (0, type_graphql_1.ObjectType)()
50
+ ], ScheduleTaskConnection);
51
+ let ScheduleTask = class ScheduleTask {
52
+ };
53
+ exports.ScheduleTask = ScheduleTask;
54
+ tslib_1.__decorate([
55
+ (0, type_graphql_1.Field)(),
56
+ tslib_1.__metadata("design:type", String)
57
+ ], ScheduleTask.prototype, "type", void 0);
58
+ tslib_1.__decorate([
59
+ (0, type_graphql_1.Field)(type => ScheduleTaskConnection),
60
+ tslib_1.__metadata("design:type", ScheduleTaskConnection)
61
+ ], ScheduleTask.prototype, "connection", void 0);
62
+ tslib_1.__decorate([
63
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject),
64
+ tslib_1.__metadata("design:type", Object)
65
+ ], ScheduleTask.prototype, "data", void 0);
66
+ tslib_1.__decorate([
67
+ (0, type_graphql_1.Field)(),
68
+ tslib_1.__metadata("design:type", Boolean)
69
+ ], ScheduleTask.prototype, "history_check", void 0);
70
+ tslib_1.__decorate([
71
+ (0, type_graphql_1.Field)(),
72
+ tslib_1.__metadata("design:type", String)
73
+ ], ScheduleTask.prototype, "failed_policy", void 0);
74
+ tslib_1.__decorate([
75
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
76
+ tslib_1.__metadata("design:type", Number)
77
+ ], ScheduleTask.prototype, "retry_wait", void 0);
78
+ tslib_1.__decorate([
79
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
80
+ tslib_1.__metadata("design:type", Number)
81
+ ], ScheduleTask.prototype, "retry_count", void 0);
82
+ tslib_1.__decorate([
83
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
84
+ tslib_1.__metadata("design:type", Number)
85
+ ], ScheduleTask.prototype, "max_retry_count", void 0);
86
+ exports.ScheduleTask = ScheduleTask = tslib_1.__decorate([
87
+ (0, type_graphql_1.ObjectType)()
88
+ ], ScheduleTask);
89
+ let Schedule = class Schedule {
90
+ };
91
+ exports.Schedule = Schedule;
92
+ tslib_1.__decorate([
93
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID),
94
+ tslib_1.__metadata("design:type", String)
95
+ ], Schedule.prototype, "id", void 0);
96
+ tslib_1.__decorate([
97
+ (0, type_graphql_1.Field)({ nullable: true }),
98
+ tslib_1.__metadata("design:type", String)
99
+ ], Schedule.prototype, "name", void 0);
100
+ tslib_1.__decorate([
101
+ (0, type_graphql_1.Field)(type => ScheduleClient),
102
+ tslib_1.__metadata("design:type", ScheduleClient)
103
+ ], Schedule.prototype, "client", void 0);
104
+ tslib_1.__decorate([
105
+ (0, type_graphql_1.Field)(),
106
+ tslib_1.__metadata("design:type", String)
107
+ ], Schedule.prototype, "type", void 0);
108
+ tslib_1.__decorate([
109
+ (0, type_graphql_1.Field)({ nullable: true }),
110
+ tslib_1.__metadata("design:type", String)
111
+ ], Schedule.prototype, "schedule", void 0);
112
+ tslib_1.__decorate([
113
+ (0, type_graphql_1.Field)({ nullable: true }),
114
+ tslib_1.__metadata("design:type", String)
115
+ ], Schedule.prototype, "timezone", void 0);
116
+ tslib_1.__decorate([
117
+ (0, type_graphql_1.Field)(type => ScheduleTask),
118
+ tslib_1.__metadata("design:type", ScheduleTask)
119
+ ], Schedule.prototype, "task", void 0);
120
+ exports.Schedule = Schedule = tslib_1.__decorate([
121
+ (0, type_graphql_1.ObjectType)()
122
+ ], Schedule);
123
+ let ScheduleClientInput = class ScheduleClientInput {
124
+ };
125
+ tslib_1.__decorate([
126
+ (0, type_graphql_1.Field)(),
127
+ tslib_1.__metadata("design:type", String)
128
+ ], ScheduleClientInput.prototype, "application", void 0);
129
+ tslib_1.__decorate([
130
+ (0, type_graphql_1.Field)(),
131
+ tslib_1.__metadata("design:type", String)
132
+ ], ScheduleClientInput.prototype, "group", void 0);
133
+ tslib_1.__decorate([
134
+ (0, type_graphql_1.Field)(),
135
+ tslib_1.__metadata("design:type", String)
136
+ ], ScheduleClientInput.prototype, "type", void 0);
137
+ tslib_1.__decorate([
138
+ (0, type_graphql_1.Field)(),
139
+ tslib_1.__metadata("design:type", String)
140
+ ], ScheduleClientInput.prototype, "key", void 0);
141
+ tslib_1.__decorate([
142
+ (0, type_graphql_1.Field)(),
143
+ tslib_1.__metadata("design:type", String)
144
+ ], ScheduleClientInput.prototype, "operation", void 0);
145
+ ScheduleClientInput = tslib_1.__decorate([
146
+ (0, type_graphql_1.InputType)()
147
+ ], ScheduleClientInput);
148
+ let ScheduleTaskConnectionInput = class ScheduleTaskConnectionInput {
149
+ };
150
+ exports.ScheduleTaskConnectionInput = ScheduleTaskConnectionInput;
151
+ tslib_1.__decorate([
152
+ (0, type_graphql_1.Field)({ nullable: true }),
153
+ tslib_1.__metadata("design:type", String)
154
+ ], ScheduleTaskConnectionInput.prototype, "host", void 0);
155
+ tslib_1.__decorate([
156
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true }),
157
+ tslib_1.__metadata("design:type", Object)
158
+ ], ScheduleTaskConnectionInput.prototype, "headers", void 0);
159
+ tslib_1.__decorate([
160
+ (0, type_graphql_1.Field)({ nullable: true }),
161
+ tslib_1.__metadata("design:type", String)
162
+ ], ScheduleTaskConnectionInput.prototype, "topic", void 0);
163
+ exports.ScheduleTaskConnectionInput = ScheduleTaskConnectionInput = tslib_1.__decorate([
164
+ (0, type_graphql_1.InputType)()
165
+ ], ScheduleTaskConnectionInput);
166
+ let ScheduleTaskInput = class ScheduleTaskInput {
167
+ };
168
+ tslib_1.__decorate([
169
+ (0, type_graphql_1.Field)(),
170
+ tslib_1.__metadata("design:type", String)
171
+ ], ScheduleTaskInput.prototype, "type", void 0);
172
+ tslib_1.__decorate([
173
+ (0, type_graphql_1.Field)(type => ScheduleTaskConnectionInput),
174
+ tslib_1.__metadata("design:type", ScheduleTaskConnectionInput)
175
+ ], ScheduleTaskInput.prototype, "connection", void 0);
176
+ tslib_1.__decorate([
177
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject),
178
+ tslib_1.__metadata("design:type", Object)
179
+ ], ScheduleTaskInput.prototype, "data", void 0);
180
+ tslib_1.__decorate([
181
+ (0, type_graphql_1.Field)(),
182
+ tslib_1.__metadata("design:type", Boolean)
183
+ ], ScheduleTaskInput.prototype, "history_check", void 0);
184
+ tslib_1.__decorate([
185
+ (0, type_graphql_1.Field)(),
186
+ tslib_1.__metadata("design:type", String)
187
+ ], ScheduleTaskInput.prototype, "failed_policy", void 0);
188
+ tslib_1.__decorate([
189
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
190
+ tslib_1.__metadata("design:type", Number)
191
+ ], ScheduleTaskInput.prototype, "retry_wait", void 0);
192
+ tslib_1.__decorate([
193
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
194
+ tslib_1.__metadata("design:type", Number)
195
+ ], ScheduleTaskInput.prototype, "retry_count", void 0);
196
+ tslib_1.__decorate([
197
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
198
+ tslib_1.__metadata("design:type", Number)
199
+ ], ScheduleTaskInput.prototype, "max_retry_count", void 0);
200
+ ScheduleTaskInput = tslib_1.__decorate([
201
+ (0, type_graphql_1.InputType)()
202
+ ], ScheduleTaskInput);
203
+ let NewSchedule = class NewSchedule {
204
+ };
205
+ exports.NewSchedule = NewSchedule;
206
+ tslib_1.__decorate([
207
+ (0, type_graphql_1.Field)(),
208
+ tslib_1.__metadata("design:type", String)
209
+ ], NewSchedule.prototype, "name", void 0);
210
+ tslib_1.__decorate([
211
+ (0, type_graphql_1.Field)(type => ScheduleClientInput),
212
+ tslib_1.__metadata("design:type", ScheduleClientInput)
213
+ ], NewSchedule.prototype, "client", void 0);
214
+ tslib_1.__decorate([
215
+ (0, type_graphql_1.Field)(),
216
+ tslib_1.__metadata("design:type", String)
217
+ ], NewSchedule.prototype, "type", void 0);
218
+ tslib_1.__decorate([
219
+ (0, type_graphql_1.Field)({ nullable: true }),
220
+ tslib_1.__metadata("design:type", String)
221
+ ], NewSchedule.prototype, "schedule", void 0);
222
+ tslib_1.__decorate([
223
+ (0, type_graphql_1.Field)({ nullable: true }),
224
+ tslib_1.__metadata("design:type", String)
225
+ ], NewSchedule.prototype, "timezone", void 0);
226
+ tslib_1.__decorate([
227
+ (0, type_graphql_1.Field)(type => ScheduleTaskInput),
228
+ tslib_1.__metadata("design:type", ScheduleTaskInput)
229
+ ], NewSchedule.prototype, "task", void 0);
230
+ exports.NewSchedule = NewSchedule = tslib_1.__decorate([
231
+ (0, type_graphql_1.InputType)()
232
+ ], NewSchedule);
233
+ let SchedulePatch = class SchedulePatch {
234
+ };
235
+ exports.SchedulePatch = SchedulePatch;
236
+ tslib_1.__decorate([
237
+ (0, type_graphql_1.Field)({ nullable: true }),
238
+ tslib_1.__metadata("design:type", String)
239
+ ], SchedulePatch.prototype, "id", void 0);
240
+ tslib_1.__decorate([
241
+ (0, type_graphql_1.Field)({ nullable: true }),
242
+ tslib_1.__metadata("design:type", String)
243
+ ], SchedulePatch.prototype, "name", void 0);
244
+ tslib_1.__decorate([
245
+ (0, type_graphql_1.Field)(type => ScheduleClientInput),
246
+ tslib_1.__metadata("design:type", ScheduleClientInput)
247
+ ], SchedulePatch.prototype, "client", void 0);
248
+ tslib_1.__decorate([
249
+ (0, type_graphql_1.Field)(),
250
+ tslib_1.__metadata("design:type", String)
251
+ ], SchedulePatch.prototype, "type", void 0);
252
+ tslib_1.__decorate([
253
+ (0, type_graphql_1.Field)({ nullable: true }),
254
+ tslib_1.__metadata("design:type", String)
255
+ ], SchedulePatch.prototype, "schedule", void 0);
256
+ tslib_1.__decorate([
257
+ (0, type_graphql_1.Field)({ nullable: true }),
258
+ tslib_1.__metadata("design:type", String)
259
+ ], SchedulePatch.prototype, "timezone", void 0);
260
+ tslib_1.__decorate([
261
+ (0, type_graphql_1.Field)(type => ScheduleTaskInput),
262
+ tslib_1.__metadata("design:type", ScheduleTaskInput)
263
+ ], SchedulePatch.prototype, "task", void 0);
264
+ exports.SchedulePatch = SchedulePatch = tslib_1.__decorate([
265
+ (0, type_graphql_1.InputType)()
266
+ ], SchedulePatch);
267
+ let ScheduleList = class ScheduleList {
268
+ };
269
+ exports.ScheduleList = ScheduleList;
270
+ tslib_1.__decorate([
271
+ (0, type_graphql_1.Field)(type => [Schedule]),
272
+ tslib_1.__metadata("design:type", Array)
273
+ ], ScheduleList.prototype, "items", void 0);
274
+ tslib_1.__decorate([
275
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int),
276
+ tslib_1.__metadata("design:type", Number)
277
+ ], ScheduleList.prototype, "total", void 0);
278
+ exports.ScheduleList = ScheduleList = tslib_1.__decorate([
279
+ (0, type_graphql_1.ObjectType)()
280
+ ], ScheduleList);
281
+ //# sourceMappingURL=schedule-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schedule-type.js","sourceRoot":"","sources":["../../../server/service/schedule/schedule-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,iDAAoD;AAG7C,IAAM,cAAc,GAApB,MAAM,cAAc;CAe1B,CAAA;A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AAC,EAAE,CAAC,iBAAiB,CAAC;sCAC3B,iBAAiB;yCAAA;sBAjBZ,WAAW;IADvB,IAAA,wBAAS,GAAE;GACC,WAAW,CAkBvB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAqBzB,CAAA;AArBY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCAChB;AAGV;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAmB,CAAC;sCAC3B,mBAAmB;6CAAA;AAG3B;IADC,IAAA,oBAAK,GAAE;;2CAC+C;AAGvD;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAiB,CAAC;sCAC3B,iBAAiB;2CAAA;wBApBZ,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAqBzB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC;;2CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;2CACN;uBALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\nimport { ScalarObject } from '@things-factory/shell'\n\n@ObjectType()\nexport class ScheduleClient {\n @Field()\n application: string\n\n @Field()\n group: string\n\n @Field()\n type: string\n\n @Field()\n key: string\n\n @Field()\n operation: string\n}\n\n@ObjectType()\nexport class ScheduleTaskConnection {\n @Field({ nullable: true })\n host?: string\n\n @Field(type => ScalarObject, { nullable: true })\n headers?: Record<string, string>\n\n @Field({ nullable: true })\n topic?: string\n}\n\n@ObjectType()\nexport class ScheduleTask {\n @Field()\n type: string\n\n @Field(type => ScheduleTaskConnection)\n connection: ScheduleTaskConnection\n\n @Field(type => ScalarObject)\n data: Record<string, any>\n\n @Field()\n history_check: boolean\n\n @Field()\n failed_policy: 'ignore' | 'retry' | 'retry_dlq'\n\n @Field(type => Int)\n retry_wait: number\n\n @Field(type => Int)\n retry_count: number\n\n @Field(type => Int)\n max_retry_count: number\n}\n\n@ObjectType()\nexport class Schedule {\n @Field(type => ID)\n id: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field(type => ScheduleClient)\n client: ScheduleClient\n\n @Field()\n type: 'now' | 'delay' | 'date' | 'cron' | 'delay-recur'\n\n @Field({ nullable: true })\n schedule?: string\n\n @Field({ nullable: true })\n timezone?: string\n\n @Field(type => ScheduleTask)\n task: ScheduleTask\n}\n\n@InputType()\nclass ScheduleClientInput {\n @Field()\n application: string\n\n @Field()\n group: string\n\n @Field()\n type: string\n\n @Field()\n key: string\n\n @Field()\n operation: string\n}\n\n@InputType()\nexport class ScheduleTaskConnectionInput {\n @Field({ nullable: true })\n host?: string\n\n @Field(type => ScalarObject, { nullable: true })\n headers?: Record<string, string>\n\n @Field({ nullable: true })\n topic?: string\n}\n\n@InputType()\nclass ScheduleTaskInput {\n @Field()\n type: 'rest' | 'kafka' | 'redis'\n\n @Field(type => ScheduleTaskConnectionInput)\n connection: ScheduleTaskConnectionInput\n\n @Field(type => ScalarObject)\n data: Record<string, any>\n\n @Field()\n history_check: boolean\n\n @Field()\n failed_policy: 'ignore' | 'retry' | 'retry_dlq'\n\n @Field(type => Int)\n retry_wait: number\n\n @Field(type => Int)\n retry_count: number\n\n @Field(type => Int)\n max_retry_count: number\n}\n\n@InputType()\nexport class NewSchedule {\n @Field()\n name: string\n\n @Field(type => ScheduleClientInput)\n client: ScheduleClientInput\n\n @Field()\n type: 'now' | 'delay' | 'date' | 'cron' | 'delay-recur'\n\n @Field({ nullable: true })\n schedule: string\n\n @Field({ nullable: true })\n timezone: string\n\n @Field(type => ScheduleTaskInput)\n task: ScheduleTaskInput\n}\n\n@InputType()\nexport class SchedulePatch {\n @Field({ nullable: true })\n id: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field(type => ScheduleClientInput)\n client: ScheduleClientInput\n\n @Field()\n type: 'now' | 'delay' | 'date' | 'cron' | 'delay-recur'\n\n @Field({ nullable: true })\n schedule: string\n\n @Field({ nullable: true })\n timezone: string\n\n @Field(type => ScheduleTaskInput)\n task: ScheduleTaskInput\n}\n\n@ObjectType()\nexport class ScheduleList {\n @Field(type => [Schedule])\n items: Schedule[]\n\n @Field(type => Int)\n total: number\n}\n"]}