@things-factory/integration-base 5.0.7 → 6.0.0-alpha.0
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-server/engine/connection-manager.js +3 -6
- package/dist-server/engine/connection-manager.js.map +1 -1
- package/dist-server/engine/connector/echo-back-connector.js +3 -5
- package/dist-server/engine/connector/echo-back-connector.js.map +1 -1
- package/dist-server/engine/connector/echo-back-server.js +3 -5
- package/dist-server/engine/connector/echo-back-server.js.map +1 -1
- package/dist-server/engine/connector/graphql-connector.js +4 -4
- package/dist-server/engine/connector/graphql-connector.js.map +1 -1
- package/dist-server/engine/connector/http-connector.js +3 -3
- package/dist-server/engine/connector/http-connector.js.map +1 -1
- package/dist-server/engine/connector/index.js.map +1 -1
- package/dist-server/engine/connector/mqtt-connector.js +2 -4
- package/dist-server/engine/connector/mqtt-connector.js.map +1 -1
- package/dist-server/engine/connector/mssql-connector.js.map +1 -1
- package/dist-server/engine/connector/mysql-connector.js +2 -4
- package/dist-server/engine/connector/mysql-connector.js.map +1 -1
- package/dist-server/engine/connector/oracle-connector.js.map +1 -1
- package/dist-server/engine/connector/postgresql-connector.js.map +1 -1
- package/dist-server/engine/connector/socket-server.js +2 -4
- package/dist-server/engine/connector/socket-server.js.map +1 -1
- package/dist-server/engine/connector/sqlite-connector.js.map +1 -1
- package/dist-server/engine/index.js +4 -17
- package/dist-server/engine/index.js.map +1 -1
- package/dist-server/engine/pending-queue.js.map +1 -1
- package/dist-server/engine/scenario-engine.js +1 -2
- package/dist-server/engine/scenario-engine.js.map +1 -1
- package/dist-server/engine/task/book-up-scenario.js.map +1 -1
- package/dist-server/engine/task/database-query.js.map +1 -1
- package/dist-server/engine/task/echo-receive.js.map +1 -1
- package/dist-server/engine/task/echo-send.js.map +1 -1
- package/dist-server/engine/task/empty-check.js.map +1 -1
- package/dist-server/engine/task/end.js.map +1 -1
- package/dist-server/engine/task/floating-point.js +2 -4
- package/dist-server/engine/task/floating-point.js.map +1 -1
- package/dist-server/engine/task/goto.js.map +1 -1
- package/dist-server/engine/task/graphql-mutate.js +2 -4
- package/dist-server/engine/task/graphql-mutate.js.map +1 -1
- package/dist-server/engine/task/graphql-query.js +2 -4
- package/dist-server/engine/task/graphql-query.js.map +1 -1
- package/dist-server/engine/task/http-get.js +3 -5
- package/dist-server/engine/task/http-get.js.map +1 -1
- package/dist-server/engine/task/http-post.js +3 -5
- package/dist-server/engine/task/http-post.js.map +1 -1
- package/dist-server/engine/task/index.js.map +1 -1
- package/dist-server/engine/task/local-graphql-mutate.js +5 -6
- package/dist-server/engine/task/local-graphql-mutate.js.map +1 -1
- package/dist-server/engine/task/local-graphql-query.js +5 -6
- package/dist-server/engine/task/local-graphql-query.js.map +1 -1
- package/dist-server/engine/task/log.js.map +1 -1
- package/dist-server/engine/task/mqtt-publish.js.map +1 -1
- package/dist-server/engine/task/mqtt-subscribe.js +2 -4
- package/dist-server/engine/task/mqtt-subscribe.js.map +1 -1
- package/dist-server/engine/task/pick-pending-scenario.js +4 -4
- package/dist-server/engine/task/pick-pending-scenario.js.map +1 -1
- package/dist-server/engine/task/publish.js.map +1 -1
- package/dist-server/engine/task/reset-pending-queue.js.map +1 -1
- package/dist-server/engine/task/script.js.map +1 -1
- package/dist-server/engine/task/sleep.js.map +1 -1
- package/dist-server/engine/task/socket-listener.js.map +1 -1
- package/dist-server/engine/task/sub-scenario.js +3 -3
- package/dist-server/engine/task/sub-scenario.js.map +1 -1
- package/dist-server/engine/task/switch-goto.js.map +1 -1
- package/dist-server/engine/task/switch-range-goto.js.map +1 -1
- package/dist-server/engine/task/switch-range-scenario.js +2 -2
- package/dist-server/engine/task/switch-range-scenario.js.map +1 -1
- package/dist-server/engine/task/switch-range-set.js.map +1 -1
- package/dist-server/engine/task/switch-scenario.js +2 -2
- package/dist-server/engine/task/switch-scenario.js.map +1 -1
- package/dist-server/engine/task/switch-set.js.map +1 -1
- package/dist-server/engine/task/throw.js.map +1 -1
- package/dist-server/engine/task/utils/substitute.js.map +1 -1
- package/dist-server/engine/task/variables.js.map +1 -1
- package/dist-server/engine/task-registry.js.map +1 -1
- package/dist-server/engine/types.js.map +1 -1
- package/dist-server/index.js +4 -17
- package/dist-server/index.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/restful/index.js.map +1 -1
- package/dist-server/restful/unstable/index.js.map +1 -1
- package/dist-server/restful/unstable/run-scenario.js +2 -4
- package/dist-server/restful/unstable/run-scenario.js.map +1 -1
- package/dist-server/restful/unstable/scenario-instance.js +2 -4
- package/dist-server/restful/unstable/scenario-instance.js.map +1 -1
- package/dist-server/restful/unstable/scenario-instances.js +2 -4
- package/dist-server/restful/unstable/scenario-instances.js.map +1 -1
- package/dist-server/restful/unstable/scenario.js +2 -4
- package/dist-server/restful/unstable/scenario.js.map +1 -1
- package/dist-server/restful/unstable/scenarios.js +2 -4
- package/dist-server/restful/unstable/scenarios.js.map +1 -1
- package/dist-server/restful/unstable/start-scenario.js +2 -4
- package/dist-server/restful/unstable/start-scenario.js.map +1 -1
- package/dist-server/restful/unstable/stop-scenario.js +2 -4
- package/dist-server/restful/unstable/stop-scenario.js.map +1 -1
- package/dist-server/routers/scenario-view-router.js +8 -9
- package/dist-server/routers/scenario-view-router.js.map +1 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/connection/connection-mutation.js +53 -63
- package/dist-server/service/connection/connection-mutation.js.map +1 -1
- package/dist-server/service/connection/connection-query.js +41 -54
- package/dist-server/service/connection/connection-query.js.map +1 -1
- package/dist-server/service/connection/connection-subscription.js +17 -30
- package/dist-server/service/connection/connection-subscription.js.map +1 -1
- package/dist-server/service/connection/connection-type.js +82 -91
- package/dist-server/service/connection/connection-type.js.map +1 -1
- package/dist-server/service/connection/index.js.map +1 -1
- package/dist-server/service/connector/connector-query.js +22 -33
- package/dist-server/service/connector/connector-query.js.map +1 -1
- package/dist-server/service/connector/connector-type.js +17 -25
- package/dist-server/service/connector/connector-type.js.map +1 -1
- package/dist-server/service/connector/index.js.map +1 -1
- package/dist-server/service/index.js +11 -24
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/payload-log/index.js.map +1 -1
- package/dist-server/service/payload-log/payload-log-mutation.js +44 -52
- package/dist-server/service/payload-log/payload-log-mutation.js.map +1 -1
- package/dist-server/service/payload-log/payload-log-query.js +35 -48
- package/dist-server/service/payload-log/payload-log-query.js.map +1 -1
- package/dist-server/service/payload-log/payload-log-type.js +20 -28
- package/dist-server/service/payload-log/payload-log-type.js.map +1 -1
- package/dist-server/service/payload-log/payload-log.js +35 -39
- package/dist-server/service/payload-log/payload-log.js.map +1 -1
- package/dist-server/service/property-spec.js +12 -21
- package/dist-server/service/property-spec.js.map +1 -1
- package/dist-server/service/scenario/index.js.map +1 -1
- package/dist-server/service/scenario/scenario-mutation.js +58 -64
- package/dist-server/service/scenario/scenario-mutation.js.map +1 -1
- package/dist-server/service/scenario/scenario-query.js +55 -68
- package/dist-server/service/scenario/scenario-query.js.map +1 -1
- package/dist-server/service/scenario/scenario-type.js +71 -80
- package/dist-server/service/scenario/scenario-type.js.map +1 -1
- package/dist-server/service/scenario-flow/scenario-flow.js +8 -17
- package/dist-server/service/scenario-flow/scenario-flow.js.map +1 -1
- package/dist-server/service/scenario-instance/index.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-mutation.js +28 -41
- package/dist-server/service/scenario-instance/scenario-instance-mutation.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-query.js +44 -56
- package/dist-server/service/scenario-instance/scenario-instance-query.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-subscription.js +17 -29
- package/dist-server/service/scenario-instance/scenario-instance-subscription.js.map +1 -1
- package/dist-server/service/scenario-instance/scenario-instance-type.js +60 -71
- package/dist-server/service/scenario-instance/scenario-instance-type.js.map +1 -1
- package/dist-server/service/scenario-queue/index.js.map +1 -1
- package/dist-server/service/scenario-queue/scenario-queue-subscription.js +7 -18
- package/dist-server/service/scenario-queue/scenario-queue-subscription.js.map +1 -1
- package/dist-server/service/scenario-queue/scenario-queue-type.js +15 -24
- package/dist-server/service/scenario-queue/scenario-queue-type.js.map +1 -1
- package/dist-server/service/step/index.js.map +1 -1
- package/dist-server/service/step/step-mutation.js +18 -29
- package/dist-server/service/step/step-mutation.js.map +1 -1
- package/dist-server/service/step/step-query.js +41 -54
- package/dist-server/service/step/step-query.js.map +1 -1
- package/dist-server/service/step/step-type.js +66 -75
- package/dist-server/service/step/step-type.js.map +1 -1
- package/dist-server/service/task-type/index.js.map +1 -1
- package/dist-server/service/task-type/task-type-query.js +24 -35
- package/dist-server/service/task-type/task-type-query.js.map +1 -1
- package/dist-server/service/task-type/task-type-type.js +17 -25
- package/dist-server/service/task-type/task-type-type.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/package.json +8 -8
- package/server/engine/connection-manager.ts +1 -2
- package/server/engine/connector/graphql-connector.ts +5 -5
- package/server/engine/connector/http-connector.ts +5 -5
- package/server/engine/scenario-engine.ts +2 -2
- package/server/engine/task/local-graphql-mutate.ts +3 -2
- package/server/engine/task/local-graphql-query.ts +3 -2
- package/server/engine/task/pick-pending-scenario.ts +4 -3
- package/server/engine/task/sub-scenario.ts +3 -2
- package/server/engine/task/switch-range-scenario.ts +1 -2
- package/server/engine/task/switch-scenario.ts +1 -2
- package/server/engine/types.ts +1 -2
- package/server/routers/scenario-view-router.ts +8 -8
- package/server/service/connection/connection-mutation.ts +21 -13
- package/server/service/connection/connection-query.ts +8 -9
- package/server/service/connection/connection-subscription.ts +5 -4
- package/server/service/connector/connector-query.ts +9 -7
- package/server/service/payload-log/payload-log-mutation.ts +25 -21
- package/server/service/payload-log/payload-log-query.ts +7 -8
- package/server/service/payload-log/payload-log.ts +5 -2
- package/server/service/property-spec.ts +3 -2
- package/server/service/scenario/scenario-mutation.ts +26 -20
- package/server/service/scenario/scenario-query.ts +11 -12
- package/server/service/scenario-instance/scenario-instance-mutation.ts +8 -9
- package/server/service/scenario-instance/scenario-instance-query.ts +5 -2
- package/server/service/scenario-instance/scenario-instance-type.ts +4 -4
- package/server/service/scenario-queue/scenario-queue-type.ts +3 -2
- package/server/service/step/step-mutation.ts +5 -5
- package/server/service/step/step-query.ts +8 -9
- package/server/service/task-type/task-type-query.ts +10 -8
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var _a, _b, _c;
|
|
12
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
3
|
exports.StepList = exports.StepPatch = exports.Step = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
14
5
|
const type_graphql_1 = require("type-graphql");
|
|
15
6
|
const typeorm_1 = require("typeorm");
|
|
16
7
|
const auth_base_1 = require("@things-factory/auth-base");
|
|
@@ -18,114 +9,114 @@ const shell_1 = require("@things-factory/shell");
|
|
|
18
9
|
const scenario_type_1 = require("../scenario/scenario-type");
|
|
19
10
|
let Step = class Step {
|
|
20
11
|
};
|
|
21
|
-
__decorate([
|
|
12
|
+
tslib_1.__decorate([
|
|
22
13
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
23
14
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
24
|
-
__metadata("design:type", String)
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
25
16
|
], Step.prototype, "id", void 0);
|
|
26
|
-
__decorate([
|
|
17
|
+
tslib_1.__decorate([
|
|
27
18
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
28
19
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
29
|
-
__metadata("design:type",
|
|
20
|
+
tslib_1.__metadata("design:type", shell_1.Domain)
|
|
30
21
|
], Step.prototype, "domain", void 0);
|
|
31
|
-
__decorate([
|
|
22
|
+
tslib_1.__decorate([
|
|
32
23
|
(0, typeorm_1.RelationId)((step) => step.domain),
|
|
33
|
-
__metadata("design:type", String)
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
34
25
|
], Step.prototype, "domainId", void 0);
|
|
35
|
-
__decorate([
|
|
26
|
+
tslib_1.__decorate([
|
|
36
27
|
(0, typeorm_1.Column)({
|
|
37
28
|
nullable: true
|
|
38
29
|
}),
|
|
39
30
|
(0, type_graphql_1.Field)(),
|
|
40
|
-
__metadata("design:type", String)
|
|
31
|
+
tslib_1.__metadata("design:type", String)
|
|
41
32
|
], Step.prototype, "name", void 0);
|
|
42
|
-
__decorate([
|
|
33
|
+
tslib_1.__decorate([
|
|
43
34
|
(0, typeorm_1.Column)({
|
|
44
35
|
nullable: true
|
|
45
36
|
}),
|
|
46
37
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
47
|
-
__metadata("design:type", String)
|
|
38
|
+
tslib_1.__metadata("design:type", String)
|
|
48
39
|
], Step.prototype, "description", void 0);
|
|
49
|
-
__decorate([
|
|
40
|
+
tslib_1.__decorate([
|
|
50
41
|
(0, typeorm_1.ManyToOne)(type => scenario_type_1.Scenario, scenario => scenario.steps, { onDelete: 'CASCADE' }),
|
|
51
42
|
(0, type_graphql_1.Field)(type => scenario_type_1.Scenario, { nullable: true }),
|
|
52
|
-
__metadata("design:type", scenario_type_1.Scenario)
|
|
43
|
+
tslib_1.__metadata("design:type", scenario_type_1.Scenario)
|
|
53
44
|
], Step.prototype, "scenario", void 0);
|
|
54
|
-
__decorate([
|
|
45
|
+
tslib_1.__decorate([
|
|
55
46
|
(0, typeorm_1.RelationId)((step) => step.scenario),
|
|
56
|
-
__metadata("design:type", String)
|
|
47
|
+
tslib_1.__metadata("design:type", String)
|
|
57
48
|
], Step.prototype, "scenarioId", void 0);
|
|
58
|
-
__decorate([
|
|
49
|
+
tslib_1.__decorate([
|
|
59
50
|
(0, typeorm_1.Column)(),
|
|
60
51
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
61
|
-
__metadata("design:type", Number)
|
|
52
|
+
tslib_1.__metadata("design:type", Number)
|
|
62
53
|
], Step.prototype, "sequence", void 0);
|
|
63
|
-
__decorate([
|
|
54
|
+
tslib_1.__decorate([
|
|
64
55
|
(0, typeorm_1.Column)(),
|
|
65
56
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
66
|
-
__metadata("design:type", String)
|
|
57
|
+
tslib_1.__metadata("design:type", String)
|
|
67
58
|
], Step.prototype, "task", void 0);
|
|
68
|
-
__decorate([
|
|
59
|
+
tslib_1.__decorate([
|
|
69
60
|
(0, typeorm_1.Column)({
|
|
70
61
|
nullable: true
|
|
71
62
|
}),
|
|
72
63
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
73
|
-
__metadata("design:type", Boolean)
|
|
64
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
74
65
|
], Step.prototype, "skip", void 0);
|
|
75
|
-
__decorate([
|
|
66
|
+
tslib_1.__decorate([
|
|
76
67
|
(0, typeorm_1.Column)({
|
|
77
68
|
nullable: true
|
|
78
69
|
}),
|
|
79
70
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
80
|
-
__metadata("design:type", Boolean)
|
|
71
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
81
72
|
], Step.prototype, "log", void 0);
|
|
82
|
-
__decorate([
|
|
73
|
+
tslib_1.__decorate([
|
|
83
74
|
(0, typeorm_1.Column)({
|
|
84
75
|
nullable: true
|
|
85
76
|
}),
|
|
86
77
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
87
|
-
__metadata("design:type", String)
|
|
78
|
+
tslib_1.__metadata("design:type", String)
|
|
88
79
|
], Step.prototype, "connection", void 0);
|
|
89
|
-
__decorate([
|
|
80
|
+
tslib_1.__decorate([
|
|
90
81
|
(0, typeorm_1.Column)({
|
|
91
82
|
nullable: true
|
|
92
83
|
}),
|
|
93
84
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
94
|
-
__metadata("design:type", String)
|
|
85
|
+
tslib_1.__metadata("design:type", String)
|
|
95
86
|
], Step.prototype, "params", void 0);
|
|
96
|
-
__decorate([
|
|
87
|
+
tslib_1.__decorate([
|
|
97
88
|
(0, typeorm_1.CreateDateColumn)(),
|
|
98
89
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
99
|
-
__metadata("design:type", Date)
|
|
90
|
+
tslib_1.__metadata("design:type", Date)
|
|
100
91
|
], Step.prototype, "createdAt", void 0);
|
|
101
|
-
__decorate([
|
|
92
|
+
tslib_1.__decorate([
|
|
102
93
|
(0, typeorm_1.UpdateDateColumn)(),
|
|
103
94
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
104
|
-
__metadata("design:type", Date)
|
|
95
|
+
tslib_1.__metadata("design:type", Date)
|
|
105
96
|
], Step.prototype, "updatedAt", void 0);
|
|
106
|
-
__decorate([
|
|
97
|
+
tslib_1.__decorate([
|
|
107
98
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
108
99
|
nullable: true
|
|
109
100
|
}),
|
|
110
101
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
111
|
-
__metadata("design:type",
|
|
102
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
112
103
|
], Step.prototype, "creator", void 0);
|
|
113
|
-
__decorate([
|
|
104
|
+
tslib_1.__decorate([
|
|
114
105
|
(0, typeorm_1.RelationId)((step) => step.creator),
|
|
115
|
-
__metadata("design:type", String)
|
|
106
|
+
tslib_1.__metadata("design:type", String)
|
|
116
107
|
], Step.prototype, "creatorId", void 0);
|
|
117
|
-
__decorate([
|
|
108
|
+
tslib_1.__decorate([
|
|
118
109
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
|
|
119
110
|
nullable: true
|
|
120
111
|
}),
|
|
121
112
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
122
|
-
__metadata("design:type",
|
|
113
|
+
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
123
114
|
], Step.prototype, "updater", void 0);
|
|
124
|
-
__decorate([
|
|
115
|
+
tslib_1.__decorate([
|
|
125
116
|
(0, typeorm_1.RelationId)((step) => step.creator),
|
|
126
|
-
__metadata("design:type", String)
|
|
117
|
+
tslib_1.__metadata("design:type", String)
|
|
127
118
|
], Step.prototype, "updaterId", void 0);
|
|
128
|
-
Step = __decorate([
|
|
119
|
+
Step = tslib_1.__decorate([
|
|
129
120
|
(0, typeorm_1.Entity)(),
|
|
130
121
|
(0, typeorm_1.Index)('ix_step_0', (step) => [step.scenario, step.sequence], { unique: true }),
|
|
131
122
|
(0, type_graphql_1.ObjectType)()
|
|
@@ -133,61 +124,61 @@ Step = __decorate([
|
|
|
133
124
|
exports.Step = Step;
|
|
134
125
|
let StepPatch = class StepPatch {
|
|
135
126
|
};
|
|
136
|
-
__decorate([
|
|
127
|
+
tslib_1.__decorate([
|
|
137
128
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
138
|
-
__metadata("design:type", String)
|
|
129
|
+
tslib_1.__metadata("design:type", String)
|
|
139
130
|
], StepPatch.prototype, "id", void 0);
|
|
140
|
-
__decorate([
|
|
131
|
+
tslib_1.__decorate([
|
|
141
132
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
142
|
-
__metadata("design:type", String)
|
|
133
|
+
tslib_1.__metadata("design:type", String)
|
|
143
134
|
], StepPatch.prototype, "name", void 0);
|
|
144
|
-
__decorate([
|
|
135
|
+
tslib_1.__decorate([
|
|
145
136
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
146
|
-
__metadata("design:type", String)
|
|
137
|
+
tslib_1.__metadata("design:type", String)
|
|
147
138
|
], StepPatch.prototype, "description", void 0);
|
|
148
|
-
__decorate([
|
|
139
|
+
tslib_1.__decorate([
|
|
149
140
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
150
|
-
__metadata("design:type", Number)
|
|
141
|
+
tslib_1.__metadata("design:type", Number)
|
|
151
142
|
], StepPatch.prototype, "sequence", void 0);
|
|
152
|
-
__decorate([
|
|
143
|
+
tslib_1.__decorate([
|
|
153
144
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
154
|
-
__metadata("design:type", String)
|
|
145
|
+
tslib_1.__metadata("design:type", String)
|
|
155
146
|
], StepPatch.prototype, "task", void 0);
|
|
156
|
-
__decorate([
|
|
147
|
+
tslib_1.__decorate([
|
|
157
148
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
158
|
-
__metadata("design:type", Boolean)
|
|
149
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
159
150
|
], StepPatch.prototype, "skip", void 0);
|
|
160
|
-
__decorate([
|
|
151
|
+
tslib_1.__decorate([
|
|
161
152
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
162
|
-
__metadata("design:type", Boolean)
|
|
153
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
163
154
|
], StepPatch.prototype, "log", void 0);
|
|
164
|
-
__decorate([
|
|
155
|
+
tslib_1.__decorate([
|
|
165
156
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
166
|
-
__metadata("design:type", String)
|
|
157
|
+
tslib_1.__metadata("design:type", String)
|
|
167
158
|
], StepPatch.prototype, "connection", void 0);
|
|
168
|
-
__decorate([
|
|
159
|
+
tslib_1.__decorate([
|
|
169
160
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
170
|
-
__metadata("design:type", String)
|
|
161
|
+
tslib_1.__metadata("design:type", String)
|
|
171
162
|
], StepPatch.prototype, "params", void 0);
|
|
172
|
-
__decorate([
|
|
163
|
+
tslib_1.__decorate([
|
|
173
164
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
174
|
-
__metadata("design:type", String)
|
|
165
|
+
tslib_1.__metadata("design:type", String)
|
|
175
166
|
], StepPatch.prototype, "cuFlag", void 0);
|
|
176
|
-
StepPatch = __decorate([
|
|
167
|
+
StepPatch = tslib_1.__decorate([
|
|
177
168
|
(0, type_graphql_1.InputType)()
|
|
178
169
|
], StepPatch);
|
|
179
170
|
exports.StepPatch = StepPatch;
|
|
180
171
|
let StepList = class StepList {
|
|
181
172
|
};
|
|
182
|
-
__decorate([
|
|
173
|
+
tslib_1.__decorate([
|
|
183
174
|
(0, type_graphql_1.Field)(type => [Step]),
|
|
184
|
-
__metadata("design:type", Array)
|
|
175
|
+
tslib_1.__metadata("design:type", Array)
|
|
185
176
|
], StepList.prototype, "items", void 0);
|
|
186
|
-
__decorate([
|
|
177
|
+
tslib_1.__decorate([
|
|
187
178
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
188
|
-
__metadata("design:type", Number)
|
|
179
|
+
tslib_1.__metadata("design:type", Number)
|
|
189
180
|
], StepList.prototype, "total", void 0);
|
|
190
|
-
StepList = __decorate([
|
|
181
|
+
StepList = tslib_1.__decorate([
|
|
191
182
|
(0, type_graphql_1.ObjectType)()
|
|
192
183
|
], StepList);
|
|
193
184
|
exports.StepList = StepList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-type.js","sourceRoot":"","sources":["../../../server/service/step/step-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step-type.js","sourceRoot":"","sources":["../../../server/service/step/step-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,qCASgB;AAEhB,yDAAgD;AAChD,iDAA8C;AAE9C,6DAAoD;AAKpD,IAAa,IAAI,GAAjB,MA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,IAAA,wBAAS,GAAE;GACC,SAAS,CA8BrB;AA9BY,8BAAS;AAiCtB,IAAa,QAAQ,GAArB,MAAa,QAAQ;CAMpB,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;;uCACT;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;uCACN;AALF,QAAQ;IADpB,IAAA,yBAAU,GAAE;GACA,QAAQ,CAMpB;AANY,4BAAQ","sourcesContent":["import { Field, ID, InputType, Int, ObjectType } from 'type-graphql'\nimport {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToOne,\n PrimaryGeneratedColumn,\n RelationId,\n UpdateDateColumn\n} from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { Domain } from '@things-factory/shell'\n\nimport { Scenario } from '../scenario/scenario-type'\n\n@Entity()\n@Index('ix_step_0', (step: Step) => [step.scenario, step.sequence], { unique: true })\n@ObjectType()\nexport class Step {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain: Domain\n\n @RelationId((step: Step) => step.domain)\n domainId: string\n\n @Column({\n nullable: true\n })\n @Field()\n name: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n @ManyToOne(type => Scenario, scenario => scenario.steps, { onDelete: 'CASCADE' })\n @Field(type => Scenario, { nullable: true })\n scenario: Scenario\n\n @RelationId((step: Step) => step.scenario)\n scenarioId: string\n\n @Column()\n @Field({ nullable: true })\n sequence: number\n\n @Column()\n @Field({ nullable: true })\n task: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n skip: boolean\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n log: boolean\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n connection: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n params: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((step: Step) => step.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((step: Step) => step.creator)\n updaterId: string\n}\n\n@InputType()\nexport class StepPatch {\n @Field(type => ID, { nullable: true })\n id: string\n\n @Field({ nullable: true })\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field(type => Int, { nullable: true })\n sequence?: number\n\n @Field({ nullable: true })\n task?: string\n\n @Field({ nullable: true })\n skip?: boolean\n\n @Field({ nullable: true })\n log?: boolean\n\n @Field({ nullable: true })\n connection?: string\n\n @Field({ nullable: true })\n params?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class StepList {\n @Field(type => [Step])\n items: Step[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/task-type/index.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEpC,QAAA,QAAQ,GAAG,EAAE,CAAA;AACb,QAAA,SAAS,GAAG,CAAC,+BAAa,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/task-type/index.ts"],"names":[],"mappings":";;;AAAA,uDAAiD;AAEpC,QAAA,QAAQ,GAAG,EAAE,CAAA;AACb,QAAA,SAAS,GAAG,CAAC,+BAAa,CAAC,CAAA","sourcesContent":["import { TaskTypeQuery } from './task-type-query'\n\nexport const entities = []\nexport const resolvers = [TaskTypeQuery]\n"]}
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.TaskTypeQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const type_graphql_1 = require("type-graphql");
|
|
17
|
-
const
|
|
6
|
+
const shell_1 = require("@things-factory/shell");
|
|
7
|
+
const connection_manager_1 = require("../../engine/connection-manager");
|
|
8
|
+
const task_registry_1 = require("../../engine/task-registry");
|
|
18
9
|
const connection_type_1 = require("../connection/connection-type");
|
|
19
10
|
const task_type_type_1 = require("./task-type-type");
|
|
20
|
-
const task_registry_1 = require("../../engine/task-registry");
|
|
21
|
-
const connection_manager_1 = require("../../engine/connection-manager");
|
|
22
11
|
let TaskTypeQuery = class TaskTypeQuery {
|
|
23
12
|
taskType(name, context) {
|
|
24
13
|
const { description, help, parameterSpec, connectorFree } = (task_registry_1.TaskRegistry.getTaskHandler(name) || {});
|
|
@@ -54,8 +43,8 @@ let TaskTypeQuery = class TaskTypeQuery {
|
|
|
54
43
|
async taskTypesByConnection(connectionName, context) {
|
|
55
44
|
var taskPrefixes = [];
|
|
56
45
|
if (connectionName) {
|
|
57
|
-
var connection = await (0,
|
|
58
|
-
where: { domain: context.state.domain, name: connectionName }
|
|
46
|
+
var connection = await (0, shell_1.getRepository)(connection_type_1.Connection).findOne({
|
|
47
|
+
where: { domain: { id: context.state.domain.id }, name: connectionName }
|
|
59
48
|
});
|
|
60
49
|
if (connection) {
|
|
61
50
|
var connector = connection_manager_1.ConnectionManager.getConnector(connection.type);
|
|
@@ -89,30 +78,30 @@ let TaskTypeQuery = class TaskTypeQuery {
|
|
|
89
78
|
};
|
|
90
79
|
}
|
|
91
80
|
};
|
|
92
|
-
__decorate([
|
|
81
|
+
tslib_1.__decorate([
|
|
93
82
|
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskType, { description: 'To fetch a task-type' }),
|
|
94
|
-
__param(0, (0, type_graphql_1.Arg)('name')),
|
|
95
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
96
|
-
__metadata("design:type", Function),
|
|
97
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
98
|
-
__metadata("design:returntype", task_type_type_1.TaskType)
|
|
83
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
|
|
84
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
85
|
+
tslib_1.__metadata("design:type", Function),
|
|
86
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
87
|
+
tslib_1.__metadata("design:returntype", task_type_type_1.TaskType)
|
|
99
88
|
], TaskTypeQuery.prototype, "taskType", null);
|
|
100
|
-
__decorate([
|
|
89
|
+
tslib_1.__decorate([
|
|
101
90
|
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, { description: 'To fetch multiple task-type' }),
|
|
102
|
-
__param(0, (0, type_graphql_1.Ctx)()),
|
|
103
|
-
__metadata("design:type", Function),
|
|
104
|
-
__metadata("design:paramtypes", [Object]),
|
|
105
|
-
__metadata("design:returntype", task_type_type_1.TaskTypeList)
|
|
91
|
+
tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
|
|
92
|
+
tslib_1.__metadata("design:type", Function),
|
|
93
|
+
tslib_1.__metadata("design:paramtypes", [Object]),
|
|
94
|
+
tslib_1.__metadata("design:returntype", task_type_type_1.TaskTypeList)
|
|
106
95
|
], TaskTypeQuery.prototype, "taskTypes", null);
|
|
107
|
-
__decorate([
|
|
96
|
+
tslib_1.__decorate([
|
|
108
97
|
(0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, { description: 'To fetch the connector from a task-type' }),
|
|
109
|
-
__param(0, (0, type_graphql_1.Arg)('connectionName')),
|
|
110
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
111
|
-
__metadata("design:type", Function),
|
|
112
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
113
|
-
__metadata("design:returntype", Promise)
|
|
98
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('connectionName')),
|
|
99
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
100
|
+
tslib_1.__metadata("design:type", Function),
|
|
101
|
+
tslib_1.__metadata("design:paramtypes", [String, Object]),
|
|
102
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
114
103
|
], TaskTypeQuery.prototype, "taskTypesByConnection", null);
|
|
115
|
-
TaskTypeQuery = __decorate([
|
|
104
|
+
TaskTypeQuery = tslib_1.__decorate([
|
|
116
105
|
(0, type_graphql_1.Resolver)(task_type_type_1.TaskType)
|
|
117
106
|
], TaskTypeQuery);
|
|
118
107
|
exports.TaskTypeQuery = TaskTypeQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-type-query.js","sourceRoot":"","sources":["../../../server/service/task-type/task-type-query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task-type-query.js","sourceRoot":"","sources":["../../../server/service/task-type/task-type-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AAExD,iDAAqD;AAErD,wEAAmE;AACnE,8DAAyD;AACzD,mEAA0D;AAC1D,qDAAyD;AAGzD,IAAa,aAAa,GAA1B,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C,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;QAEJ,OAAO;YACL,KAAK;YACL,KAAK,EAAE,KAAK,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;CACF,CAAA;AAlFC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,yBAAQ,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IAC1D,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;4CAA4B,yBAAQ;6CAU7E;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6BAAY,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACpE,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;4CAA4B,6BAAY;8CAqBvD;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6BAAY,EAAE,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;IAExF,mBAAA,IAAA,kBAAG,EAAC,gBAAgB,CAAC,CAAA;IACrB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0DA0CP;AAnFU,aAAa;IADzB,IAAA,uBAAQ,EAAC,yBAAQ,CAAC;GACN,aAAa,CAoFzB;AApFY,sCAAa","sourcesContent":["import { Arg, Ctx, Query, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine/connection-manager'\nimport { TaskRegistry } from '../../engine/task-registry'\nimport { Connection } from '../connection/connection-type'\nimport { TaskType, TaskTypeList } from './task-type-type'\n\n@Resolver(TaskType)\nexport class TaskTypeQuery {\n @Query(returns => TaskType, { description: 'To fetch a task-type' })\n taskType(@Arg('name') name: string, @Ctx() context: ResolverContext): TaskType {\n const { description, help, parameterSpec, connectorFree } = (TaskRegistry.getTaskHandler(name) || {}) as any\n\n return {\n name,\n description,\n help,\n parameterSpec,\n connectorFree: !!connectorFree\n }\n }\n\n @Query(returns => TaskTypeList, { description: 'To fetch multiple task-type' })\n taskTypes(@Ctx() context: ResolverContext): TaskTypeList {\n var taskTypes = TaskRegistry.getTaskHandlers()\n var items = Object.keys(taskTypes)\n .map(name => {\n const taskType: any = taskTypes[name]\n return {\n name,\n description: taskType.description,\n help: taskType.help,\n parameterSpec: taskType.parameterSpec,\n connectorFree: !!taskType.connectorFree\n }\n })\n .sort((x, y) => {\n return x.name < y.name ? -1 : 1\n })\n\n return {\n items,\n total: items.length\n }\n }\n\n @Query(returns => TaskTypeList, { description: 'To fetch the connector from a task-type' })\n async taskTypesByConnection(\n @Arg('connectionName') connectionName: string,\n @Ctx() context: ResolverContext\n ): Promise<TaskTypeList> {\n var taskPrefixes = []\n\n if (connectionName) {\n var connection = await getRepository(Connection).findOne({\n where: { domain: { id: context.state.domain.id }, name: connectionName }\n })\n\n if (connection) {\n var connector = ConnectionManager.getConnector(connection.type)\n taskPrefixes = connector.taskPrefixes || []\n }\n }\n\n var taskTypes = TaskRegistry.getTaskHandlers()\n var names: string[] = Object.keys(taskTypes)\n\n if (taskPrefixes.length == 0) {\n names = names.filter(name => !!(taskTypes[name] as any).connectorFree)\n } else {\n names = names.filter(name => taskPrefixes.find(prefix => name.indexOf(prefix) == 0))\n }\n\n var items: any[] = names\n .map(name => {\n var taskType: any = taskTypes[name]\n return {\n name,\n description: '',\n parameterSpec: taskType.parameterSpec,\n connectorFree: !!taskType.connectorFree\n }\n })\n .sort((x, y) => {\n return x.name < y.name ? -1 : 1\n })\n\n return {\n items,\n total: items.length\n }\n }\n}\n"]}
|
|
@@ -1,54 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.TaskTypeList = exports.TaskType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
13
5
|
const type_graphql_1 = require("type-graphql");
|
|
14
6
|
const property_spec_1 = require("../property-spec");
|
|
15
7
|
let TaskType = class TaskType {
|
|
16
8
|
};
|
|
17
|
-
__decorate([
|
|
9
|
+
tslib_1.__decorate([
|
|
18
10
|
(0, type_graphql_1.Field)(),
|
|
19
|
-
__metadata("design:type", String)
|
|
11
|
+
tslib_1.__metadata("design:type", String)
|
|
20
12
|
], TaskType.prototype, "name", void 0);
|
|
21
|
-
__decorate([
|
|
13
|
+
tslib_1.__decorate([
|
|
22
14
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
23
|
-
__metadata("design:type", String)
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
24
16
|
], TaskType.prototype, "description", void 0);
|
|
25
|
-
__decorate([
|
|
17
|
+
tslib_1.__decorate([
|
|
26
18
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
27
|
-
__metadata("design:type", String)
|
|
19
|
+
tslib_1.__metadata("design:type", String)
|
|
28
20
|
], TaskType.prototype, "help", void 0);
|
|
29
|
-
__decorate([
|
|
21
|
+
tslib_1.__decorate([
|
|
30
22
|
(0, type_graphql_1.Field)(type => [property_spec_1.PropertySpec], { nullable: true }),
|
|
31
|
-
__metadata("design:type", Array)
|
|
23
|
+
tslib_1.__metadata("design:type", Array)
|
|
32
24
|
], TaskType.prototype, "parameterSpec", void 0);
|
|
33
|
-
__decorate([
|
|
25
|
+
tslib_1.__decorate([
|
|
34
26
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
35
|
-
__metadata("design:type", Boolean)
|
|
27
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
36
28
|
], TaskType.prototype, "connectorFree", void 0);
|
|
37
|
-
TaskType = __decorate([
|
|
29
|
+
TaskType = tslib_1.__decorate([
|
|
38
30
|
(0, type_graphql_1.ObjectType)()
|
|
39
31
|
], TaskType);
|
|
40
32
|
exports.TaskType = TaskType;
|
|
41
33
|
let TaskTypeList = class TaskTypeList {
|
|
42
34
|
};
|
|
43
|
-
__decorate([
|
|
35
|
+
tslib_1.__decorate([
|
|
44
36
|
(0, type_graphql_1.Field)(type => [TaskType]),
|
|
45
|
-
__metadata("design:type", Array)
|
|
37
|
+
tslib_1.__metadata("design:type", Array)
|
|
46
38
|
], TaskTypeList.prototype, "items", void 0);
|
|
47
|
-
__decorate([
|
|
39
|
+
tslib_1.__decorate([
|
|
48
40
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
49
|
-
__metadata("design:type", Number)
|
|
41
|
+
tslib_1.__metadata("design:type", Number)
|
|
50
42
|
], TaskTypeList.prototype, "total", void 0);
|
|
51
|
-
TaskTypeList = __decorate([
|
|
43
|
+
TaskTypeList = tslib_1.__decorate([
|
|
52
44
|
(0, type_graphql_1.ObjectType)()
|
|
53
45
|
], TaskTypeList);
|
|
54
46
|
exports.TaskTypeList = TaskTypeList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-type-type.js","sourceRoot":"","sources":["../../../server/service/task-type/task-type-type.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"task-type-type.js","sourceRoot":"","sources":["../../../server/service/task-type/task-type-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAqD;AACrD,oDAA+C;AAG/C,IAAa,QAAQ,GAArB,MAAa,QAAQ;CAepB,CAAA;AAbC;IADC,IAAA,oBAAK,GAAE;;sCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACd;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACrB;AAG7B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACJ;AAdX,QAAQ;IADpB,IAAA,yBAAU,GAAE;GACA,QAAQ,CAepB;AAfY,4BAAQ;AAkBrB,IAAa,YAAY,GAAzB,MAAa,YAAY;CAMxB,CAAA;AAJC;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;AALF,YAAY;IADxB,IAAA,yBAAU,GAAE;GACA,YAAY,CAMxB;AANY,oCAAY","sourcesContent":["import { ObjectType, Field, Int } from 'type-graphql'\nimport { PropertySpec } from '../property-spec'\n\n@ObjectType()\nexport class TaskType {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description: string\n\n @Field({ nullable: true })\n help: string\n\n @Field(type => [PropertySpec], { nullable: true })\n parameterSpec: PropertySpec[]\n\n @Field({ nullable: true })\n connectorFree: boolean\n}\n\n@ObjectType()\nexport class TaskTypeList {\n @Field(type => [TaskType])\n items: TaskType[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|