@things-factory/integration-base 9.0.0-beta.8 → 9.0.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.
Files changed (157) hide show
  1. package/dist-server/controllers/publish-data.js +7 -2
  2. package/dist-server/controllers/publish-data.js.map +1 -1
  3. package/dist-server/engine/analyzer/analyze-integration.js +1 -1
  4. package/dist-server/engine/analyzer/analyze-integration.js.map +1 -1
  5. package/dist-server/engine/connection-manager.js +41 -40
  6. package/dist-server/engine/connection-manager.js.map +1 -1
  7. package/dist-server/engine/connector/graphql-connector.js +4 -1
  8. package/dist-server/engine/connector/graphql-connector.js.map +1 -1
  9. package/dist-server/engine/connector/headless-connector.js +1 -2
  10. package/dist-server/engine/connector/headless-connector.js.map +1 -1
  11. package/dist-server/engine/connector/http-connector.js +5 -1
  12. package/dist-server/engine/connector/http-connector.js.map +1 -1
  13. package/dist-server/engine/connector/operato-connector.js +10 -8
  14. package/dist-server/engine/connector/operato-connector.js.map +1 -1
  15. package/dist-server/engine/connector/oracle-connector.js +2 -2
  16. package/dist-server/engine/connector/oracle-connector.js.map +1 -1
  17. package/dist-server/engine/connector/postgresql-connector.js +3 -3
  18. package/dist-server/engine/connector/postgresql-connector.js.map +1 -1
  19. package/dist-server/engine/connector/proxy-connector.js +1 -1
  20. package/dist-server/engine/connector/proxy-connector.js.map +1 -1
  21. package/dist-server/engine/index.d.ts +2 -2
  22. package/dist-server/engine/index.js +2 -2
  23. package/dist-server/engine/index.js.map +1 -1
  24. package/dist-server/engine/scenario-engine.js +10 -7
  25. package/dist-server/engine/scenario-engine.js.map +1 -1
  26. package/dist-server/engine/task/headless-post.js +3 -1
  27. package/dist-server/engine/task/headless-post.js.map +1 -1
  28. package/dist-server/engine/task/headless-scrap.js +36 -4
  29. package/dist-server/engine/task/headless-scrap.js.map +1 -1
  30. package/dist-server/engine/task/http-get.js +4 -1
  31. package/dist-server/engine/task/http-get.js.map +1 -1
  32. package/dist-server/engine/task/http-post.js +4 -1
  33. package/dist-server/engine/task/http-post.js.map +1 -1
  34. package/dist-server/engine/task/mqtt-publish.js +29 -6
  35. package/dist-server/engine/task/mqtt-publish.js.map +1 -1
  36. package/dist-server/engine/task/mqtt-subscribe.d.ts +84 -0
  37. package/dist-server/engine/task/mqtt-subscribe.js +197 -79
  38. package/dist-server/engine/task/mqtt-subscribe.js.map +1 -1
  39. package/dist-server/engine/task/mssql-procedure.js +1 -1
  40. package/dist-server/engine/task/mssql-procedure.js.map +1 -1
  41. package/dist-server/engine/task/oracle-procedure.js +10 -10
  42. package/dist-server/engine/task/oracle-procedure.js.map +1 -1
  43. package/dist-server/engine/task/pick-pending-scenario.js +5 -1
  44. package/dist-server/engine/task/pick-pending-scenario.js.map +1 -1
  45. package/dist-server/engine/task/state-group-read.js +1 -2
  46. package/dist-server/engine/task/state-group-read.js.map +1 -1
  47. package/dist-server/engine/task/state-read.js +1 -2
  48. package/dist-server/engine/task/state-read.js.map +1 -1
  49. package/dist-server/engine/task/state-write.js +1 -2
  50. package/dist-server/engine/task/state-write.js.map +1 -1
  51. package/dist-server/engine/task/stop-scenario.js +3 -3
  52. package/dist-server/engine/task/stop-scenario.js.map +1 -1
  53. package/dist-server/engine/task/sub-scenario.js +5 -2
  54. package/dist-server/engine/task/sub-scenario.js.map +1 -1
  55. package/dist-server/engine/task/switch-range-scenario.js +5 -2
  56. package/dist-server/engine/task/switch-range-scenario.js.map +1 -1
  57. package/dist-server/engine/task/switch-scenario.js +5 -2
  58. package/dist-server/engine/task/switch-scenario.js.map +1 -1
  59. package/dist-server/engine/task/variables.js +1 -1
  60. package/dist-server/engine/task/variables.js.map +1 -1
  61. package/dist-server/engine/task-registry.js +4 -2
  62. package/dist-server/engine/task-registry.js.map +1 -1
  63. package/dist-server/index.d.ts +6 -6
  64. package/dist-server/index.js +10 -10
  65. package/dist-server/index.js.map +1 -1
  66. package/dist-server/routers/scenario-schedule-callback-router.js +2 -2
  67. package/dist-server/routers/scenario-schedule-callback-router.js.map +1 -1
  68. package/dist-server/routes.js +8 -7
  69. package/dist-server/routes.js.map +1 -1
  70. package/dist-server/service/analysis/analysis-query.d.ts +3 -0
  71. package/dist-server/service/analysis/analysis-query.js +6 -1
  72. package/dist-server/service/analysis/analysis-query.js.map +1 -1
  73. package/dist-server/service/connection/connection-mutation.d.ts +3 -1
  74. package/dist-server/service/connection/connection-mutation.js +69 -21
  75. package/dist-server/service/connection/connection-mutation.js.map +1 -1
  76. package/dist-server/service/connection/connection-query.d.ts +3 -0
  77. package/dist-server/service/connection/connection-query.js +22 -6
  78. package/dist-server/service/connection/connection-query.js.map +1 -1
  79. package/dist-server/service/connection/connection-subscription.js +14 -8
  80. package/dist-server/service/connection/connection-subscription.js.map +1 -1
  81. package/dist-server/service/connection/connection-type.d.ts +15 -4
  82. package/dist-server/service/connection/connection-type.js +78 -58
  83. package/dist-server/service/connection/connection-type.js.map +1 -1
  84. package/dist-server/service/connector/connector-query.d.ts +4 -1
  85. package/dist-server/service/connector/connector-query.js +8 -5
  86. package/dist-server/service/connector/connector-query.js.map +1 -1
  87. package/dist-server/service/connector/connector-type.js +12 -9
  88. package/dist-server/service/connector/connector-type.js.map +1 -1
  89. package/dist-server/service/payload-log/payload-log-mutation.js +30 -12
  90. package/dist-server/service/payload-log/payload-log-mutation.js.map +1 -1
  91. package/dist-server/service/payload-log/payload-log-query.d.ts +3 -0
  92. package/dist-server/service/payload-log/payload-log-query.js +5 -2
  93. package/dist-server/service/payload-log/payload-log-query.js.map +1 -1
  94. package/dist-server/service/payload-log/payload-log-type.js +11 -11
  95. package/dist-server/service/payload-log/payload-log-type.js.map +1 -1
  96. package/dist-server/service/payload-log/payload-log.d.ts +1 -1
  97. package/dist-server/service/payload-log/payload-log.js +18 -14
  98. package/dist-server/service/payload-log/payload-log.js.map +1 -1
  99. package/dist-server/service/property-spec.js +12 -7
  100. package/dist-server/service/property-spec.js.map +1 -1
  101. package/dist-server/service/scenario/scenario-mutation.js +71 -26
  102. package/dist-server/service/scenario/scenario-mutation.js.map +1 -1
  103. package/dist-server/service/scenario/scenario-query.d.ts +3 -0
  104. package/dist-server/service/scenario/scenario-query.js +7 -5
  105. package/dist-server/service/scenario/scenario-query.js.map +1 -1
  106. package/dist-server/service/scenario/scenario-type.js +27 -24
  107. package/dist-server/service/scenario/scenario-type.js.map +1 -1
  108. package/dist-server/service/scenario/scenario.js +27 -24
  109. package/dist-server/service/scenario/scenario.js.map +1 -1
  110. package/dist-server/service/scenario-instance/scenario-instance-mutation.js +8 -3
  111. package/dist-server/service/scenario-instance/scenario-instance-mutation.js.map +1 -1
  112. package/dist-server/service/scenario-instance/scenario-instance-query.d.ts +3 -0
  113. package/dist-server/service/scenario-instance/scenario-instance-query.js +5 -2
  114. package/dist-server/service/scenario-instance/scenario-instance-query.js.map +1 -1
  115. package/dist-server/service/scenario-instance/scenario-instance-subscription.js +10 -9
  116. package/dist-server/service/scenario-instance/scenario-instance-subscription.js.map +1 -1
  117. package/dist-server/service/scenario-instance/scenario-instance-type.js +76 -71
  118. package/dist-server/service/scenario-instance/scenario-instance-type.js.map +1 -1
  119. package/dist-server/service/scenario-queue/scenario-queue-subscription.js +4 -4
  120. package/dist-server/service/scenario-queue/scenario-queue-subscription.js.map +1 -1
  121. package/dist-server/service/scenario-queue/scenario-queue-type.js +8 -8
  122. package/dist-server/service/scenario-queue/scenario-queue-type.js.map +1 -1
  123. package/dist-server/service/state-register/data-resolver.js +3 -4
  124. package/dist-server/service/state-register/data-resolver.js.map +1 -1
  125. package/dist-server/service/state-register/state-register-mutation.js +41 -16
  126. package/dist-server/service/state-register/state-register-mutation.js.map +1 -1
  127. package/dist-server/service/state-register/state-register-query.d.ts +3 -0
  128. package/dist-server/service/state-register/state-register-query.js +7 -4
  129. package/dist-server/service/state-register/state-register-query.js.map +1 -1
  130. package/dist-server/service/state-register/state-register-type.js +3 -3
  131. package/dist-server/service/state-register/state-register-type.js.map +1 -1
  132. package/dist-server/service/state-register/state-register.js +4 -2
  133. package/dist-server/service/state-register/state-register.js.map +1 -1
  134. package/dist-server/service/step/step-mutation.js +13 -5
  135. package/dist-server/service/step/step-mutation.js.map +1 -1
  136. package/dist-server/service/step/step-query.d.ts +3 -0
  137. package/dist-server/service/step/step-query.js +5 -2
  138. package/dist-server/service/step/step-query.js.map +1 -1
  139. package/dist-server/service/step/step-type.d.ts +11 -3
  140. package/dist-server/service/step/step-type.js +54 -35
  141. package/dist-server/service/step/step-type.js.map +1 -1
  142. package/dist-server/service/task-type/task-type-query.js +5 -3
  143. package/dist-server/service/task-type/task-type-query.js.map +1 -1
  144. package/dist-server/service/task-type/task-type-type.js +12 -9
  145. package/dist-server/service/task-type/task-type-type.js.map +1 -1
  146. package/dist-server/tsconfig.tsbuildinfo +1 -1
  147. package/helps/integration/task/headless-scrap.ja.md +11 -4
  148. package/helps/integration/task/headless-scrap.ko.md +12 -5
  149. package/helps/integration/task/headless-scrap.md +10 -3
  150. package/helps/integration/task/headless-scrap.ms.md +9 -2
  151. package/helps/integration/task/headless-scrap.zh.md +9 -2
  152. package/package.json +12 -12
  153. package/translations/en.json +6 -1
  154. package/translations/ja.json +6 -1
  155. package/translations/ko.json +6 -1
  156. package/translations/ms.json +6 -1
  157. package/translations/zh.json +6 -1
@@ -52,8 +52,15 @@ export declare class Step {
52
52
  connection?: string;
53
53
  /**
54
54
  * The parameters for the step.
55
+ *
56
+ * [Caution]
57
+ * 이 컬럼타입은 postgres 데이터베이스에서는 varchar 타입을 유지한다.
58
+ * 이는 데이터베이스 타입을 변경하면 기존 데이터가 손실될 수 있기 때문이다.
59
+ * 'simple-json' 타입으로 변경 전에 postgres 데이타베이스에 이미 varchar 타입으로 사용한 사례가 많기 때문이다.
55
60
  */
56
- params?: string;
61
+ params?: {
62
+ [key: string]: any;
63
+ };
57
64
  /**
58
65
  * A boolean attribute indicating the inclusion status of an element in the result.
59
66
  */
@@ -93,7 +100,9 @@ export declare class StepPatch {
93
100
  skip?: boolean;
94
101
  log?: boolean;
95
102
  connection?: string;
96
- params?: string;
103
+ params?: {
104
+ [key: string]: any;
105
+ };
97
106
  result?: boolean;
98
107
  cuFlag?: string;
99
108
  }
@@ -103,7 +112,6 @@ export declare class StepPatch {
103
112
  *
104
113
  */
105
114
  export interface InputStep extends Step {
106
- params: any;
107
115
  }
108
116
  export declare class StepList {
109
117
  items: Step[];
@@ -6,7 +6,10 @@ const type_graphql_1 = require("type-graphql");
6
6
  const typeorm_1 = require("typeorm");
7
7
  const auth_base_1 = require("@things-factory/auth-base");
8
8
  const shell_1 = require("@things-factory/shell");
9
+ const env_1 = require("@things-factory/env");
9
10
  const scenario_1 = require("../scenario/scenario");
11
+ const ORMCONFIG = env_1.config.get('ormconfig', {});
12
+ const DATABASE_TYPE = ORMCONFIG.type;
10
13
  let Step = class Step {
11
14
  constructor() {
12
15
  /**
@@ -18,12 +21,12 @@ let Step = class Step {
18
21
  exports.Step = Step;
19
22
  tslib_1.__decorate([
20
23
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
21
- (0, type_graphql_1.Field)(type => type_graphql_1.ID),
24
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { description: 'The unique identifier for the step.' }),
22
25
  tslib_1.__metadata("design:type", String)
23
26
  ], Step.prototype, "id", void 0);
24
27
  tslib_1.__decorate([
25
28
  (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
26
- (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true }),
29
+ (0, type_graphql_1.Field)(type => shell_1.Domain, { nullable: true, description: 'The domain to which this step belongs.' }),
27
30
  tslib_1.__metadata("design:type", shell_1.Domain
28
31
  /**
29
32
  * The ID of the domain associated with this step.
@@ -36,17 +39,17 @@ tslib_1.__decorate([
36
39
  ], Step.prototype, "domainId", void 0);
37
40
  tslib_1.__decorate([
38
41
  (0, typeorm_1.Column)({ nullable: true }),
39
- (0, type_graphql_1.Field)(),
42
+ (0, type_graphql_1.Field)({ description: 'The name of the step.' }),
40
43
  tslib_1.__metadata("design:type", String)
41
44
  ], Step.prototype, "name", void 0);
42
45
  tslib_1.__decorate([
43
46
  (0, typeorm_1.Column)({ nullable: true }),
44
- (0, type_graphql_1.Field)({ nullable: true }),
47
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A detailed description of what the step involves.' }),
45
48
  tslib_1.__metadata("design:type", String)
46
49
  ], Step.prototype, "description", void 0);
47
50
  tslib_1.__decorate([
48
51
  (0, typeorm_1.ManyToOne)(type => scenario_1.Scenario, scenario => scenario.steps, { onDelete: 'CASCADE' }),
49
- (0, type_graphql_1.Field)(type => scenario_1.Scenario, { nullable: true }),
52
+ (0, type_graphql_1.Field)(type => scenario_1.Scenario, { nullable: true, description: 'The scenario that includes this step.' }),
50
53
  tslib_1.__metadata("design:type", scenario_1.Scenario
51
54
  /**
52
55
  * The ID of the scenario associated with this step.
@@ -59,45 +62,61 @@ tslib_1.__decorate([
59
62
  ], Step.prototype, "scenarioId", void 0);
60
63
  tslib_1.__decorate([
61
64
  (0, typeorm_1.Column)(),
62
- (0, type_graphql_1.Field)({ nullable: true }),
65
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The sequence number of the step within its scenario.' }),
63
66
  tslib_1.__metadata("design:type", Number)
64
67
  ], Step.prototype, "sequence", void 0);
65
68
  tslib_1.__decorate([
66
69
  (0, typeorm_1.Column)(),
67
- (0, type_graphql_1.Field)({ nullable: true }),
70
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The specific task type associated with this step.' }),
68
71
  tslib_1.__metadata("design:type", String)
69
72
  ], Step.prototype, "task", void 0);
70
73
  tslib_1.__decorate([
71
74
  (0, typeorm_1.Column)({ nullable: true }),
72
- (0, type_graphql_1.Field)({ nullable: true }),
75
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the step should be skipped during execution.' }),
73
76
  tslib_1.__metadata("design:type", Boolean)
74
77
  ], Step.prototype, "skip", void 0);
75
78
  tslib_1.__decorate([
76
79
  (0, typeorm_1.Column)({ nullable: true }),
77
- (0, type_graphql_1.Field)({ nullable: true }),
80
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates if the step execution should be logged.' }),
78
81
  tslib_1.__metadata("design:type", Boolean)
79
82
  ], Step.prototype, "log", void 0);
80
83
  tslib_1.__decorate([
81
84
  (0, typeorm_1.Column)({ nullable: true }),
82
- (0, type_graphql_1.Field)({ nullable: true }),
85
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The name of the connection to be used for this step.' }),
83
86
  tslib_1.__metadata("design:type", String)
84
87
  ], Step.prototype, "connection", void 0);
85
88
  tslib_1.__decorate([
86
- (0, typeorm_1.Column)({ nullable: true }),
87
- (0, type_graphql_1.Field)({ nullable: true }),
88
- tslib_1.__metadata("design:type", String)
89
+ (0, typeorm_1.Column)({
90
+ type: DATABASE_TYPE == 'postgres' ? 'varchar' : 'simple-json',
91
+ nullable: true,
92
+ transformer: DATABASE_TYPE == 'postgres'
93
+ ? {
94
+ to: (value) => JSON.stringify(value),
95
+ from: (value) => {
96
+ try {
97
+ return JSON.parse(value);
98
+ }
99
+ catch (error) {
100
+ return null;
101
+ }
102
+ }
103
+ }
104
+ : undefined
105
+ }),
106
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'A key-value map of parameters for the step task.' }),
107
+ tslib_1.__metadata("design:type", Object)
89
108
  ], Step.prototype, "params", void 0);
90
109
  tslib_1.__decorate([
91
110
  (0, typeorm_1.Column)({ nullable: true, default: true }),
92
111
  (0, type_graphql_1.Field)({
93
112
  nullable: true,
94
- description: 'A boolean attribute indicating the inclusion status of an element in the result'
113
+ description: 'A boolean attribute indicating whether the result of this step should be included in the final output.'
95
114
  }),
96
115
  tslib_1.__metadata("design:type", Boolean)
97
116
  ], Step.prototype, "result", void 0);
98
117
  tslib_1.__decorate([
99
118
  (0, typeorm_1.CreateDateColumn)(),
100
- (0, type_graphql_1.Field)({ nullable: true }),
119
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the step was created.' }),
101
120
  tslib_1.__metadata("design:type", Date
102
121
  /**
103
122
  * The timestamp when
@@ -107,7 +126,7 @@ tslib_1.__decorate([
107
126
  ], Step.prototype, "createdAt", void 0);
108
127
  tslib_1.__decorate([
109
128
  (0, typeorm_1.UpdateDateColumn)(),
110
- (0, type_graphql_1.Field)({ nullable: true }),
129
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The timestamp when the step was last updated.' }),
111
130
  tslib_1.__metadata("design:type", Date
112
131
  /**
113
132
  * The user who created this step.
@@ -116,7 +135,7 @@ tslib_1.__decorate([
116
135
  ], Step.prototype, "updatedAt", void 0);
117
136
  tslib_1.__decorate([
118
137
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
119
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
138
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who created this step.' }),
120
139
  tslib_1.__metadata("design:type", auth_base_1.User
121
140
  /**
122
141
  * The ID of the user who created this step.
@@ -129,7 +148,7 @@ tslib_1.__decorate([
129
148
  ], Step.prototype, "creatorId", void 0);
130
149
  tslib_1.__decorate([
131
150
  (0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
132
- (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
151
+ (0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true, description: 'The user who last updated this step.' }),
133
152
  tslib_1.__metadata("design:type", auth_base_1.User
134
153
  /**
135
154
  * The ID of the user who last updated this step.
@@ -143,70 +162,70 @@ tslib_1.__decorate([
143
162
  exports.Step = Step = tslib_1.__decorate([
144
163
  (0, typeorm_1.Entity)(),
145
164
  (0, typeorm_1.Index)('ix_step_0', (step) => [step.scenario, step.sequence], { unique: true }),
146
- (0, type_graphql_1.ObjectType)()
165
+ (0, type_graphql_1.ObjectType)({ description: 'Represents a single step within a scenario, defining a specific task to be executed.' })
147
166
  ], Step);
148
167
  let StepPatch = class StepPatch {
149
168
  };
150
169
  exports.StepPatch = StepPatch;
151
170
  tslib_1.__decorate([
152
- (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
171
+ (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true, description: 'The unique identifier of the step to update.' }),
153
172
  tslib_1.__metadata("design:type", String)
154
173
  ], StepPatch.prototype, "id", void 0);
155
174
  tslib_1.__decorate([
156
- (0, type_graphql_1.Field)({ nullable: true }),
175
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new name for the step.' }),
157
176
  tslib_1.__metadata("design:type", String)
158
177
  ], StepPatch.prototype, "name", void 0);
159
178
  tslib_1.__decorate([
160
- (0, type_graphql_1.Field)({ nullable: true }),
179
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new description for the step.' }),
161
180
  tslib_1.__metadata("design:type", String)
162
181
  ], StepPatch.prototype, "description", void 0);
163
182
  tslib_1.__decorate([
164
- (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
183
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true, description: 'The new sequence number for the step.' }),
165
184
  tslib_1.__metadata("design:type", Number)
166
185
  ], StepPatch.prototype, "sequence", void 0);
167
186
  tslib_1.__decorate([
168
- (0, type_graphql_1.Field)({ nullable: true }),
187
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new task type for the step.' }),
169
188
  tslib_1.__metadata("design:type", String)
170
189
  ], StepPatch.prototype, "task", void 0);
171
190
  tslib_1.__decorate([
172
- (0, type_graphql_1.Field)({ nullable: true }),
191
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new skip status for the step.' }),
173
192
  tslib_1.__metadata("design:type", Boolean)
174
193
  ], StepPatch.prototype, "skip", void 0);
175
194
  tslib_1.__decorate([
176
- (0, type_graphql_1.Field)({ nullable: true }),
195
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new log status for the step.' }),
177
196
  tslib_1.__metadata("design:type", Boolean)
178
197
  ], StepPatch.prototype, "log", void 0);
179
198
  tslib_1.__decorate([
180
- (0, type_graphql_1.Field)({ nullable: true }),
199
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new connection for the step.' }),
181
200
  tslib_1.__metadata("design:type", String)
182
201
  ], StepPatch.prototype, "connection", void 0);
183
202
  tslib_1.__decorate([
184
- (0, type_graphql_1.Field)({ nullable: true }),
185
- tslib_1.__metadata("design:type", String)
203
+ (0, type_graphql_1.Field)(type => shell_1.ScalarObject, { nullable: true, description: 'The new parameters for the step.' }),
204
+ tslib_1.__metadata("design:type", Object)
186
205
  ], StepPatch.prototype, "params", void 0);
187
206
  tslib_1.__decorate([
188
- (0, type_graphql_1.Field)({ nullable: true }),
207
+ (0, type_graphql_1.Field)({ nullable: true, description: 'The new result inclusion status for the step.' }),
189
208
  tslib_1.__metadata("design:type", Boolean)
190
209
  ], StepPatch.prototype, "result", void 0);
191
210
  tslib_1.__decorate([
192
- (0, type_graphql_1.Field)({ nullable: true }),
211
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A flag indicating whether the step is being created, updated, or deleted.' }),
193
212
  tslib_1.__metadata("design:type", String)
194
213
  ], StepPatch.prototype, "cuFlag", void 0);
195
214
  exports.StepPatch = StepPatch = tslib_1.__decorate([
196
- (0, type_graphql_1.InputType)()
215
+ (0, type_graphql_1.InputType)({ description: 'Input for updating (patching) an existing step.' })
197
216
  ], StepPatch);
198
217
  let StepList = class StepList {
199
218
  };
200
219
  exports.StepList = StepList;
201
220
  tslib_1.__decorate([
202
- (0, type_graphql_1.Field)(type => [Step]),
221
+ (0, type_graphql_1.Field)(type => [Step], { description: 'The list of step items.' }),
203
222
  tslib_1.__metadata("design:type", Array)
204
223
  ], StepList.prototype, "items", void 0);
205
224
  tslib_1.__decorate([
206
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
225
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The total number of steps.' }),
207
226
  tslib_1.__metadata("design:type", Number)
208
227
  ], StepList.prototype, "total", void 0);
209
228
  exports.StepList = StepList = tslib_1.__decorate([
210
- (0, type_graphql_1.ObjectType)()
229
+ (0, type_graphql_1.ObjectType)({ description: 'A paginated list of steps.' })
211
230
  ], StepList);
212
231
  //# sourceMappingURL=step-type.js.map
@@ -1 +1 @@
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,mDAA+C;AAKxC,IAAM,IAAI,GAAV,MAAM,IAAI;IAAV;QA0FL;;WAEG;QAMH,WAAM,GAAa,IAAI,CAAA;IA0CzB,CAAC;CAAA,CAAA;AA5IY,oBAAI;AAMN;IAFR,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;gCACE;AAOpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjC,cAAM;IAEf;;OAEG;;oCAJY;AAMf;IADC,IAAA,oBAAU,EAAC,CAAC,IAAU,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC;;sCACvB;AAOjB;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,GAAE;;kCACK;AAOb;IAFC,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACN;AAOpB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,mBAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAChF,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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'\n\n@Entity()\n@Index('ix_step_0', (step: Step) => [step.scenario, step.sequence], { unique: true })\n@ObjectType()\nexport class Step {\n /**\n * The unique identifier for each step.\n */\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id?: string\n\n /**\n * The domain to which this step belongs.\n */\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true })\n domain?: Domain\n\n /**\n * The ID of the domain associated with this step.\n */\n @RelationId((step: Step) => step.domain)\n domainId?: string\n\n /**\n * The name of the step.\n */\n @Column({ nullable: true })\n @Field()\n name?: string\n\n /**\n * A description of what the step involves.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n /**\n * The scenario that includes this step.\n */\n @ManyToOne(type => Scenario, scenario => scenario.steps, { onDelete: 'CASCADE' })\n @Field(type => Scenario, { nullable: true })\n scenario?: Scenario\n\n /**\n * The ID of the scenario associated with this step.\n */\n @RelationId((step: Step) => step.scenario)\n scenarioId?: string\n\n /**\n * The sequence number of the step within its scenario.\n */\n @Column()\n @Field({ nullable: true })\n sequence?: number\n\n /**\n * The specific task associated with this step.\n */\n @Column()\n @Field({ nullable: true })\n task?: string\n\n /**\n * Boolean value to indicate if the step should be skipped.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n skip?: boolean\n\n /**\n * Boolean value to indicate if the step should be logged.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n log?: boolean\n\n /**\n * The connection details associated with this step.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n connection?: string\n\n /**\n * The parameters for the step.\n */\n @Column({ nullable: true })\n @Field({ nullable: true })\n params?: string\n\n /**\n * A boolean attribute indicating the inclusion status of an element in the result.\n */\n @Column({ nullable: true, default: true })\n @Field({\n nullable: true,\n description: 'A boolean attribute indicating the inclusion status of an element in the result'\n })\n result?: boolean = true\n\n /**\n * The timestamp when the step was created.\n */\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt?: Date\n\n /** \n * The timestamp when\n the step was last updated.\n */\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt?: Date\n\n /**\n * The user who created this step.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n /**\n * The ID of the user who created this step.\n */\n @RelationId((step: Step) => step.creator)\n creatorId?: string\n\n /**\n * The user who last updated this step.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n /**\n * The ID of the user who last updated this step.\n */\n @RelationId((step: Step) => step.updater)\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 result?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n/**\n * Step의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로\n * 추후, 타입 일치를 통해서 제거할 예정임.\n *\n */\nexport interface InputStep extends Step {\n params: any\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
+ {"version":3,"file":"step-type.js","sourceRoot":"","sources":["../../../server/service/step/step-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AACpE,qCASgB;AAEhB,yDAAgD;AAChD,iDAA4D;AAC5D,6CAA4C;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AQ;IADpB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,4BAA4B,EAAE,CAAC;GAC7C,QAAQ,CAMpB","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, ScalarObject } from '@things-factory/shell'\nimport { config } from '@things-factory/env'\n\nimport { Scenario } from '../scenario/scenario'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index('ix_step_0', (step: Step) => [step.scenario, step.sequence], { unique: true })\n@ObjectType({ description: 'Represents a single step within a scenario, defining a specific task to be executed.' })\nexport class Step {\n /**\n * The unique identifier for each step.\n */\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'The unique identifier for the step.' })\n readonly id?: string\n\n /**\n * The domain to which this step belongs.\n */\n @ManyToOne(type => Domain)\n @Field(type => Domain, { nullable: true, description: 'The domain to which this step belongs.' })\n domain?: Domain\n\n /**\n * The ID of the domain associated with this step.\n */\n @RelationId((step: Step) => step.domain)\n domainId?: string\n\n /**\n * The name of the step.\n */\n @Column({ nullable: true })\n @Field({ description: 'The name of the step.' })\n name?: string\n\n /**\n * A description of what the step involves.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'A detailed description of what the step involves.' })\n description?: string\n\n /**\n * The scenario that includes this step.\n */\n @ManyToOne(type => Scenario, scenario => scenario.steps, { onDelete: 'CASCADE' })\n @Field(type => Scenario, { nullable: true, description: 'The scenario that includes this step.' })\n scenario?: Scenario\n\n /**\n * The ID of the scenario associated with this step.\n */\n @RelationId((step: Step) => step.scenario)\n scenarioId?: string\n\n /**\n * The sequence number of the step within its scenario.\n */\n @Column()\n @Field({ nullable: true, description: 'The sequence number of the step within its scenario.' })\n sequence?: number\n\n /**\n * The specific task associated with this step.\n */\n @Column()\n @Field({ nullable: true, description: 'The specific task type associated with this step.' })\n task?: string\n\n /**\n * Boolean value to indicate if the step should be skipped.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates if the step should be skipped during execution.' })\n skip?: boolean\n\n /**\n * Boolean value to indicate if the step should be logged.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Indicates if the step execution should be logged.' })\n log?: boolean\n\n /**\n * The connection details associated with this step.\n */\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The name of the connection to be used for this step.' })\n connection?: string\n\n /**\n * The parameters for the step.\n *\n * [Caution]\n * 이 컬럼타입은 postgres 데이터베이스에서는 varchar 타입을 유지한다.\n * 이는 데이터베이스 타입을 변경하면 기존 데이터가 손실될 수 있기 때문이다.\n * 'simple-json' 타입으로 변경 전에 postgres 데이타베이스에 이미 varchar 타입으로 사용한 사례가 많기 때문이다.\n */\n @Column({\n type: DATABASE_TYPE == 'postgres' ? 'varchar' : 'simple-json',\n nullable: true,\n transformer:\n DATABASE_TYPE == 'postgres'\n ? {\n to: (value: any) => JSON.stringify(value),\n from: (value: string) => {\n try {\n return JSON.parse(value)\n } catch (error) {\n return null\n }\n }\n }\n : undefined\n })\n @Field(type => ScalarObject, { nullable: true, description: 'A key-value map of parameters for the step task.' })\n params?: { [key: string]: any }\n\n /**\n * A boolean attribute indicating the inclusion status of an element in the result.\n */\n @Column({ nullable: true, default: true })\n @Field({\n nullable: true,\n description:\n 'A boolean attribute indicating whether the result of this step should be included in the final output.'\n })\n result?: boolean = true\n\n /**\n * The timestamp when the step was created.\n */\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the step was created.' })\n createdAt?: Date\n\n /** \n * The timestamp when\n the step was last updated.\n */\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The timestamp when the step was last updated.' })\n updatedAt?: Date\n\n /**\n * The user who created this step.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created this step.' })\n creator?: User\n\n /**\n * The ID of the user who created this step.\n */\n @RelationId((step: Step) => step.creator)\n creatorId?: string\n\n /**\n * The user who last updated this step.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated this step.' })\n updater?: User\n\n /**\n * The ID of the user who last updated this step.\n */\n @RelationId((step: Step) => step.updater)\n updaterId?: string\n}\n\n@InputType({ description: 'Input for updating (patching) an existing step.' })\nexport class StepPatch {\n @Field(type => ID, { nullable: true, description: 'The unique identifier of the step to update.' })\n id: string\n\n @Field({ nullable: true, description: 'The new name for the step.' })\n name: string\n\n @Field({ nullable: true, description: 'The new description for the step.' })\n description?: string\n\n @Field(type => Int, { nullable: true, description: 'The new sequence number for the step.' })\n sequence?: number\n\n @Field({ nullable: true, description: 'The new task type for the step.' })\n task?: string\n\n @Field({ nullable: true, description: 'The new skip status for the step.' })\n skip?: boolean\n\n @Field({ nullable: true, description: 'The new log status for the step.' })\n log?: boolean\n\n @Field({ nullable: true, description: 'The new connection for the step.' })\n connection?: string\n\n @Field(type => ScalarObject, { nullable: true, description: 'The new parameters for the step.' })\n params?: { [key: string]: any }\n\n @Field({ nullable: true, description: 'The new result inclusion status for the step.' })\n result?: boolean\n\n @Field({ nullable: true, description: 'A flag indicating whether the step is being created, updated, or deleted.' })\n cuFlag?: string\n}\n\n/**\n * Step의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로\n * 추후, 타입 일치를 통해서 제거할 예정임.\n *\n */\nexport interface InputStep extends Step {}\n\n@ObjectType({ description: 'A paginated list of steps.' })\nexport class StepList {\n @Field(type => [Step], { description: 'The list of step items.' })\n items: Step[]\n\n @Field(type => Int, { description: 'The total number of steps.' })\n total: number\n}\n"]}
@@ -80,7 +80,7 @@ let TaskTypeQuery = class TaskTypeQuery {
80
80
  };
81
81
  exports.TaskTypeQuery = TaskTypeQuery;
82
82
  tslib_1.__decorate([
83
- (0, type_graphql_1.Query)(returns => task_type_type_1.TaskType, { description: 'To fetch a task-type' }),
83
+ (0, type_graphql_1.Query)(returns => task_type_type_1.TaskType, { description: 'Fetches a single task type by its name.' }),
84
84
  tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
85
85
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
86
86
  tslib_1.__metadata("design:type", Function),
@@ -88,14 +88,16 @@ tslib_1.__decorate([
88
88
  tslib_1.__metadata("design:returntype", task_type_type_1.TaskType)
89
89
  ], TaskTypeQuery.prototype, "taskType", null);
90
90
  tslib_1.__decorate([
91
- (0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, { description: 'To fetch multiple task-type' }),
91
+ (0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, { description: 'Fetches a list of all available task types.' }),
92
92
  tslib_1.__param(0, (0, type_graphql_1.Ctx)()),
93
93
  tslib_1.__metadata("design:type", Function),
94
94
  tslib_1.__metadata("design:paramtypes", [Object]),
95
95
  tslib_1.__metadata("design:returntype", task_type_type_1.TaskTypeList)
96
96
  ], TaskTypeQuery.prototype, "taskTypes", null);
97
97
  tslib_1.__decorate([
98
- (0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, { description: 'To fetch the connector from a task-type' }),
98
+ (0, type_graphql_1.Query)(returns => task_type_type_1.TaskTypeList, {
99
+ description: 'Fetches a list of task types that are compatible with a specific connection.'
100
+ }),
99
101
  tslib_1.__param(0, (0, type_graphql_1.Arg)('connectionName')),
100
102
  tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
101
103
  tslib_1.__metadata("design:type", Function),
@@ -1 +1 @@
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;AAGlD,IAAM,aAAa,GAAnB,MAAM,aAAa;IAExB,QAAQ,CAAc,IAAY,EAA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AC,CAAC,CAAC,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;AApFY,sCAAa;AAExB;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;AAGK;IADL,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;wBAnFU,aAAa;IADzB,IAAA,uBAAQ,EAAC,yBAAQ,CAAC;GACN,aAAa,CAoFzB","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
+ {"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;AAGlD,IAAM,aAAa,GAAnB,MAA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AAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,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;AAtFY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,yBAAQ,EAAE,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;IAC7E,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,6CAA6C,EAAE,CAAC;IACpF,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;4CAA4B,6BAAY;8CAqBvD;AAKK;IAHL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,6BAAY,EAAE;QAC9B,WAAW,EAAE,8EAA8E;KAC5F,CAAC;IAEC,mBAAA,IAAA,kBAAG,EAAC,gBAAgB,CAAC,CAAA;IACrB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0DA0CP;wBArFU,aAAa;IADzB,IAAA,uBAAQ,EAAC,yBAAQ,CAAC;GACN,aAAa,CAsFzB","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: 'Fetches a single task type by its name.' })\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: 'Fetches a list of all available task types.' })\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, {\n description: 'Fetches a list of task types that are compatible with a specific connection.'\n })\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"]}
@@ -8,40 +8,43 @@ let TaskType = class TaskType {
8
8
  };
9
9
  exports.TaskType = TaskType;
10
10
  tslib_1.__decorate([
11
- (0, type_graphql_1.Field)(),
11
+ (0, type_graphql_1.Field)({ description: 'The unique name of the task type.' }),
12
12
  tslib_1.__metadata("design:type", String)
13
13
  ], TaskType.prototype, "name", void 0);
14
14
  tslib_1.__decorate([
15
- (0, type_graphql_1.Field)({ nullable: true }),
15
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A brief description of what the task does.' }),
16
16
  tslib_1.__metadata("design:type", String)
17
17
  ], TaskType.prototype, "description", void 0);
18
18
  tslib_1.__decorate([
19
- (0, type_graphql_1.Field)({ nullable: true }),
19
+ (0, type_graphql_1.Field)({ nullable: true, description: 'A URL or text providing more detailed help information.' }),
20
20
  tslib_1.__metadata("design:type", String)
21
21
  ], TaskType.prototype, "help", void 0);
22
22
  tslib_1.__decorate([
23
- (0, type_graphql_1.Field)(type => [property_spec_1.PropertySpec], { nullable: true }),
23
+ (0, type_graphql_1.Field)(type => [property_spec_1.PropertySpec], {
24
+ nullable: true,
25
+ description: 'A list of parameters that can be configured for this task type.'
26
+ }),
24
27
  tslib_1.__metadata("design:type", Array)
25
28
  ], TaskType.prototype, "parameterSpec", void 0);
26
29
  tslib_1.__decorate([
27
- (0, type_graphql_1.Field)({ nullable: true }),
30
+ (0, type_graphql_1.Field)({ nullable: true, description: 'Indicates whether this task type can be used without a connector.' }),
28
31
  tslib_1.__metadata("design:type", Boolean)
29
32
  ], TaskType.prototype, "connectorFree", void 0);
30
33
  exports.TaskType = TaskType = tslib_1.__decorate([
31
- (0, type_graphql_1.ObjectType)()
34
+ (0, type_graphql_1.ObjectType)({ description: 'Describes a type of task that can be used in a scenario.' })
32
35
  ], TaskType);
33
36
  let TaskTypeList = class TaskTypeList {
34
37
  };
35
38
  exports.TaskTypeList = TaskTypeList;
36
39
  tslib_1.__decorate([
37
- (0, type_graphql_1.Field)(type => [TaskType]),
40
+ (0, type_graphql_1.Field)(type => [TaskType], { description: 'The list of task type items.' }),
38
41
  tslib_1.__metadata("design:type", Array)
39
42
  ], TaskTypeList.prototype, "items", void 0);
40
43
  tslib_1.__decorate([
41
- (0, type_graphql_1.Field)(type => type_graphql_1.Int),
44
+ (0, type_graphql_1.Field)(type => type_graphql_1.Int, { description: 'The total number of task types.' }),
42
45
  tslib_1.__metadata("design:type", Number)
43
46
  ], TaskTypeList.prototype, "total", void 0);
44
47
  exports.TaskTypeList = TaskTypeList = tslib_1.__decorate([
45
- (0, type_graphql_1.ObjectType)()
48
+ (0, type_graphql_1.ObjectType)({ description: 'A paginated list of task types.' })
46
49
  ], TaskTypeList);
47
50
  //# sourceMappingURL=task-type-type.js.map
@@ -1 +1 @@
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;AAGxC,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAepB,CAAA;AAfY,4BAAQ;AAEnB;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;mBAdX,QAAQ;IADpB,IAAA,yBAAU,GAAE;GACA,QAAQ,CAepB;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, 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"]}
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;AAGxC,IAAM,QAAQ,GAAd,MAAM,QAAQ;CAkBpB,CAAA;AAlBY,4BAAQ;AAEnB;IADC,IAAA,oBAAK,EAAC,EAAE,WAAW,EAAE,mCAAmC,EAAE,CAAC;;sCAChD;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,4CAA4C,EAAE,CAAC;;6CAClE;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,yDAAyD,EAAE,CAAC;;sCACtF;AAMZ;IAJC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,EAAE;QAC7B,QAAQ,EAAE,IAAI;QACd,WAAW,EAAE,iEAAiE;KAC/E,CAAC;;+CAC2B;AAG7B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,mEAAmE,EAAE,CAAC;;+CACtF;mBAjBX,QAAQ;IADpB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,0DAA0D,EAAE,CAAC;GAC3E,QAAQ,CAkBpB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAMxB,CAAA;AANY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,WAAW,EAAE,8BAA8B,EAAE,CAAC;;2CAC1D;AAGjB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;;2CAC1D;uBALF,YAAY;IADxB,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,CAAC;GAClD,YAAY,CAMxB","sourcesContent":["import { ObjectType, Field, Int } from 'type-graphql'\nimport { PropertySpec } from '../property-spec'\n\n@ObjectType({ description: 'Describes a type of task that can be used in a scenario.' })\nexport class TaskType {\n @Field({ description: 'The unique name of the task type.' })\n name: string\n\n @Field({ nullable: true, description: 'A brief description of what the task does.' })\n description: string\n\n @Field({ nullable: true, description: 'A URL or text providing more detailed help information.' })\n help: string\n\n @Field(type => [PropertySpec], {\n nullable: true,\n description: 'A list of parameters that can be configured for this task type.'\n })\n parameterSpec: PropertySpec[]\n\n @Field({ nullable: true, description: 'Indicates whether this task type can be used without a connector.' })\n connectorFree: boolean\n}\n\n@ObjectType({ description: 'A paginated list of task types.' })\nexport class TaskTypeList {\n @Field(type => [TaskType], { description: 'The list of task type items.' })\n items: TaskType[]\n\n @Field(type => Int, { description: 'The total number of task types.' })\n total: number\n}\n"]}