@things-factory/integration-base 6.2.177 → 6.2.178

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 (253) hide show
  1. package/dist-server/controllers/index.d.ts +1 -0
  2. package/dist-server/controllers/scenario-controller.d.ts +4 -0
  3. package/dist-server/controllers/scenario-controller.js +3 -4
  4. package/dist-server/controllers/scenario-controller.js.map +1 -1
  5. package/dist-server/engine/analyzer/analyze-integration.d.ts +5 -0
  6. package/dist-server/engine/analyzer/analyze-integration.js +1 -2
  7. package/dist-server/engine/analyzer/analyze-integration.js.map +1 -1
  8. package/dist-server/engine/connection-manager.d.ts +24 -0
  9. package/dist-server/engine/connection-manager.js.map +1 -1
  10. package/dist-server/engine/connector/echo-back-connector.d.ts +9 -0
  11. package/dist-server/engine/connector/echo-back-connector.js.map +1 -1
  12. package/dist-server/engine/connector/echo-back-server.d.ts +8 -0
  13. package/dist-server/engine/connector/echo-back-server.js.map +1 -1
  14. package/dist-server/engine/connector/graphql-connector.d.ts +19 -0
  15. package/dist-server/engine/connector/graphql-connector.js +1 -1
  16. package/dist-server/engine/connector/graphql-connector.js.map +1 -1
  17. package/dist-server/engine/connector/http-connector.d.ts +25 -0
  18. package/dist-server/engine/connector/http-connector.js.map +1 -1
  19. package/dist-server/engine/connector/index.d.ts +12 -0
  20. package/dist-server/engine/connector/mqtt-connector.d.ts +14 -0
  21. package/dist-server/engine/connector/mqtt-connector.js.map +1 -1
  22. package/dist-server/engine/connector/mssql-connector.d.ts +30 -0
  23. package/dist-server/engine/connector/mssql-connector.js.map +1 -1
  24. package/dist-server/engine/connector/mysql-connector.d.ts +13 -0
  25. package/dist-server/engine/connector/mysql-connector.js.map +1 -1
  26. package/dist-server/engine/connector/operato-connector.d.ts +27 -0
  27. package/dist-server/engine/connector/operato-connector.js +1 -1
  28. package/dist-server/engine/connector/operato-connector.js.map +1 -1
  29. package/dist-server/engine/connector/oracle-connector.d.ts +29 -0
  30. package/dist-server/engine/connector/oracle-connector.js.map +1 -1
  31. package/dist-server/engine/connector/postgresql-connector.d.ts +14 -0
  32. package/dist-server/engine/connector/postgresql-connector.js.map +1 -1
  33. package/dist-server/engine/connector/socket-server.d.ts +9 -0
  34. package/dist-server/engine/connector/socket-server.js.map +1 -1
  35. package/dist-server/engine/connector/sqlite-connector.d.ts +10 -0
  36. package/dist-server/engine/connector/sqlite-connector.js.map +1 -1
  37. package/dist-server/engine/index.d.ts +7 -0
  38. package/dist-server/engine/index.js.map +1 -1
  39. package/dist-server/engine/pending-queue.d.ts +24 -0
  40. package/dist-server/engine/pending-queue.js.map +1 -1
  41. package/dist-server/engine/scenario-engine.d.ts +11 -0
  42. package/dist-server/engine/scenario-engine.js.map +1 -1
  43. package/dist-server/engine/task/book-up-scenario.d.ts +1 -0
  44. package/dist-server/engine/task/csv-readline.d.ts +1 -0
  45. package/dist-server/engine/task/csv-readline.js.map +1 -1
  46. package/dist-server/engine/task/data-accessor.d.ts +1 -0
  47. package/dist-server/engine/task/data-mapper.d.ts +1 -0
  48. package/dist-server/engine/task/data-mapper.js.map +1 -1
  49. package/dist-server/engine/task/database-query.d.ts +1 -0
  50. package/dist-server/engine/task/echo-receive.d.ts +1 -0
  51. package/dist-server/engine/task/echo-send.d.ts +1 -0
  52. package/dist-server/engine/task/echo-send.js.map +1 -1
  53. package/dist-server/engine/task/empty-check.d.ts +1 -0
  54. package/dist-server/engine/task/empty-check.js.map +1 -1
  55. package/dist-server/engine/task/end.d.ts +1 -0
  56. package/dist-server/engine/task/floating-point.d.ts +1 -0
  57. package/dist-server/engine/task/floating-point.js.map +1 -1
  58. package/dist-server/engine/task/goto.d.ts +1 -0
  59. package/dist-server/engine/task/graphql-mutate.d.ts +1 -0
  60. package/dist-server/engine/task/graphql-query.d.ts +1 -0
  61. package/dist-server/engine/task/headless-post.d.ts +1 -0
  62. package/dist-server/engine/task/headless-post.js.map +1 -1
  63. package/dist-server/engine/task/headless-scrap.d.ts +1 -0
  64. package/dist-server/engine/task/headless-scrap.js.map +1 -1
  65. package/dist-server/engine/task/http-get.d.ts +1 -0
  66. package/dist-server/engine/task/http-get.js.map +1 -1
  67. package/dist-server/engine/task/http-post.d.ts +1 -0
  68. package/dist-server/engine/task/http-post.js.map +1 -1
  69. package/dist-server/engine/task/index.d.ts +43 -0
  70. package/dist-server/engine/task/jsonata.d.ts +1 -0
  71. package/dist-server/engine/task/local-graphql-mutate.d.ts +1 -0
  72. package/dist-server/engine/task/local-graphql-mutate.js.map +1 -1
  73. package/dist-server/engine/task/local-graphql-query.d.ts +1 -0
  74. package/dist-server/engine/task/local-graphql-query.js.map +1 -1
  75. package/dist-server/engine/task/log.d.ts +1 -0
  76. package/dist-server/engine/task/log.js.map +1 -1
  77. package/dist-server/engine/task/mqtt-publish.d.ts +1 -0
  78. package/dist-server/engine/task/mqtt-publish.js.map +1 -1
  79. package/dist-server/engine/task/mqtt-subscribe.d.ts +1 -0
  80. package/dist-server/engine/task/mqtt-subscribe.js.map +1 -1
  81. package/dist-server/engine/task/oracle-procedure.d.ts +1 -0
  82. package/dist-server/engine/task/oracle-procedure.js.map +1 -1
  83. package/dist-server/engine/task/pick-pending-scenario.d.ts +1 -0
  84. package/dist-server/engine/task/pick-pending-scenario.js.map +1 -1
  85. package/dist-server/engine/task/publish.d.ts +1 -0
  86. package/dist-server/engine/task/publish.js.map +1 -1
  87. package/dist-server/engine/task/random.d.ts +1 -0
  88. package/dist-server/engine/task/reset-pending-queue.d.ts +1 -0
  89. package/dist-server/engine/task/script.d.ts +1 -0
  90. package/dist-server/engine/task/set-domain.d.ts +1 -0
  91. package/dist-server/engine/task/set-domain.js.map +1 -1
  92. package/dist-server/engine/task/sleep.d.ts +1 -0
  93. package/dist-server/engine/task/sleep.js.map +1 -1
  94. package/dist-server/engine/task/socket-listener.d.ts +1 -0
  95. package/dist-server/engine/task/socket-listener.js.map +1 -1
  96. package/dist-server/engine/task/state-read.d.ts +1 -0
  97. package/dist-server/engine/task/state-read.js.map +1 -1
  98. package/dist-server/engine/task/state-write.d.ts +1 -0
  99. package/dist-server/engine/task/state-write.js.map +1 -1
  100. package/dist-server/engine/task/stop-scenario.d.ts +1 -0
  101. package/dist-server/engine/task/sub-scenario.d.ts +1 -0
  102. package/dist-server/engine/task/switch-goto.d.ts +1 -0
  103. package/dist-server/engine/task/switch-range-goto.d.ts +1 -0
  104. package/dist-server/engine/task/switch-range-goto.js.map +1 -1
  105. package/dist-server/engine/task/switch-range-scenario.d.ts +1 -0
  106. package/dist-server/engine/task/switch-range-scenario.js.map +1 -1
  107. package/dist-server/engine/task/switch-range-set.d.ts +1 -0
  108. package/dist-server/engine/task/switch-range-set.js.map +1 -1
  109. package/dist-server/engine/task/switch-scenario.d.ts +1 -0
  110. package/dist-server/engine/task/switch-set.d.ts +1 -0
  111. package/dist-server/engine/task/throw.d.ts +1 -0
  112. package/dist-server/engine/task/utils/headless-pool-for-scenario.d.ts +1 -0
  113. package/dist-server/engine/task/utils/headless-pool-for-scenario.js +1 -2
  114. package/dist-server/engine/task/utils/headless-pool-for-scenario.js.map +1 -1
  115. package/dist-server/engine/task/utils/substitute.d.ts +1 -0
  116. package/dist-server/engine/task/utils/substitute.js +1 -2
  117. package/dist-server/engine/task/utils/substitute.js.map +1 -1
  118. package/dist-server/engine/task/variables.d.ts +1 -0
  119. package/dist-server/engine/task-registry.d.ts +12 -0
  120. package/dist-server/engine/types.d.ts +94 -0
  121. package/dist-server/index.d.ts +6 -0
  122. package/dist-server/index.js.map +1 -1
  123. package/dist-server/migrations/index.d.ts +1 -0
  124. package/dist-server/restful/index.d.ts +1 -0
  125. package/dist-server/restful/unstable/index.d.ts +7 -0
  126. package/dist-server/restful/unstable/run-scenario.d.ts +1 -0
  127. package/dist-server/restful/unstable/run-scenario.js.map +1 -1
  128. package/dist-server/restful/unstable/scenario-instance.d.ts +1 -0
  129. package/dist-server/restful/unstable/scenario-instances.d.ts +1 -0
  130. package/dist-server/restful/unstable/scenario.d.ts +1 -0
  131. package/dist-server/restful/unstable/scenarios.d.ts +1 -0
  132. package/dist-server/restful/unstable/start-scenario.d.ts +1 -0
  133. package/dist-server/restful/unstable/stop-scenario.d.ts +1 -0
  134. package/dist-server/routers/scenario-schedule-callback-router.d.ts +1 -0
  135. package/dist-server/routers/scenario-schedule-callback-router.js +1 -2
  136. package/dist-server/routers/scenario-schedule-callback-router.js.map +1 -1
  137. package/dist-server/routers/scenario-view-router.d.ts +1 -0
  138. package/dist-server/routers/scenario-view-router.js.map +1 -1
  139. package/dist-server/routes.d.ts +1 -0
  140. package/dist-server/routes.js.map +1 -1
  141. package/dist-server/service/analysis/analysis-query.d.ts +3 -0
  142. package/dist-server/service/analysis/analysis-query.js +2 -2
  143. package/dist-server/service/analysis/analysis-query.js.map +1 -1
  144. package/dist-server/service/analysis/index.d.ts +2 -0
  145. package/dist-server/service/connection/connection-mutation.d.ts +28 -0
  146. package/dist-server/service/connection/connection-mutation.js +2 -2
  147. package/dist-server/service/connection/connection-mutation.js.map +1 -1
  148. package/dist-server/service/connection/connection-query.d.ts +11 -0
  149. package/dist-server/service/connection/connection-query.js +2 -2
  150. package/dist-server/service/connection/connection-query.js.map +1 -1
  151. package/dist-server/service/connection/connection-subscription.d.ts +10 -0
  152. package/dist-server/service/connection/connection-subscription.js +2 -2
  153. package/dist-server/service/connection/connection-subscription.js.map +1 -1
  154. package/dist-server/service/connection/connection-type.d.ts +122 -0
  155. package/dist-server/service/connection/connection-type.js +11 -11
  156. package/dist-server/service/connection/connection-type.js.map +1 -1
  157. package/dist-server/service/connection/index.d.ts +6 -0
  158. package/dist-server/service/connector/connector-query.d.ts +6 -0
  159. package/dist-server/service/connector/connector-query.js +2 -2
  160. package/dist-server/service/connector/connector-query.js.map +1 -1
  161. package/dist-server/service/connector/connector-type.d.ts +12 -0
  162. package/dist-server/service/connector/connector-type.js +4 -4
  163. package/dist-server/service/connector/connector-type.js.map +1 -1
  164. package/dist-server/service/connector/index.d.ts +3 -0
  165. package/dist-server/service/index.d.ts +17 -0
  166. package/dist-server/service/payload-log/index.d.ts +5 -0
  167. package/dist-server/service/payload-log/payload-log-mutation.d.ts +10 -0
  168. package/dist-server/service/payload-log/payload-log-mutation.js +4 -4
  169. package/dist-server/service/payload-log/payload-log-mutation.js.map +1 -1
  170. package/dist-server/service/payload-log/payload-log-query.d.ts +11 -0
  171. package/dist-server/service/payload-log/payload-log-query.js +2 -2
  172. package/dist-server/service/payload-log/payload-log-query.js.map +1 -1
  173. package/dist-server/service/payload-log/payload-log-type.d.ts +15 -0
  174. package/dist-server/service/payload-log/payload-log-type.js +6 -6
  175. package/dist-server/service/payload-log/payload-log-type.js.map +1 -1
  176. package/dist-server/service/payload-log/payload-log.d.ts +23 -0
  177. package/dist-server/service/payload-log/payload-log.js +3 -3
  178. package/dist-server/service/payload-log/payload-log.js.map +1 -1
  179. package/dist-server/service/property-spec.d.ts +9 -0
  180. package/dist-server/service/property-spec.js +2 -2
  181. package/dist-server/service/property-spec.js.map +1 -1
  182. package/dist-server/service/scenario/index.d.ts +5 -0
  183. package/dist-server/service/scenario/scenario-mutation.d.ts +13 -0
  184. package/dist-server/service/scenario/scenario-mutation.js +3 -3
  185. package/dist-server/service/scenario/scenario-mutation.js.map +1 -1
  186. package/dist-server/service/scenario/scenario-query.d.ts +18 -0
  187. package/dist-server/service/scenario/scenario-query.js +2 -2
  188. package/dist-server/service/scenario/scenario-query.js.map +1 -1
  189. package/dist-server/service/scenario/scenario-type.d.ts +28 -0
  190. package/dist-server/service/scenario/scenario-type.js +6 -6
  191. package/dist-server/service/scenario/scenario-type.js.map +1 -1
  192. package/dist-server/service/scenario/scenario.d.ts +35 -0
  193. package/dist-server/service/scenario/scenario.js +2 -2
  194. package/dist-server/service/scenario/scenario.js.map +1 -1
  195. package/dist-server/service/scenario-flow/scenario-flow.d.ts +6 -0
  196. package/dist-server/service/scenario-flow/scenario-flow.js +2 -2
  197. package/dist-server/service/scenario-flow/scenario-flow.js.map +1 -1
  198. package/dist-server/service/scenario-instance/index.d.ts +5 -0
  199. package/dist-server/service/scenario-instance/scenario-instance-mutation.d.ts +6 -0
  200. package/dist-server/service/scenario-instance/scenario-instance-mutation.js +2 -2
  201. package/dist-server/service/scenario-instance/scenario-instance-mutation.js.map +1 -1
  202. package/dist-server/service/scenario-instance/scenario-instance-query.d.ts +12 -0
  203. package/dist-server/service/scenario-instance/scenario-instance-query.js +2 -2
  204. package/dist-server/service/scenario-instance/scenario-instance-query.js.map +1 -1
  205. package/dist-server/service/scenario-instance/scenario-instance-subscription.d.ts +10 -0
  206. package/dist-server/service/scenario-instance/scenario-instance-subscription.js +2 -2
  207. package/dist-server/service/scenario-instance/scenario-instance-subscription.js.map +1 -1
  208. package/dist-server/service/scenario-instance/scenario-instance-type.d.ts +78 -0
  209. package/dist-server/service/scenario-instance/scenario-instance-type.js +9 -9
  210. package/dist-server/service/scenario-instance/scenario-instance-type.js.map +1 -1
  211. package/dist-server/service/scenario-queue/index.d.ts +3 -0
  212. package/dist-server/service/scenario-queue/scenario-queue-subscription.d.ts +6 -0
  213. package/dist-server/service/scenario-queue/scenario-queue-subscription.js +2 -2
  214. package/dist-server/service/scenario-queue/scenario-queue-subscription.js.map +1 -1
  215. package/dist-server/service/scenario-queue/scenario-queue-type.d.ts +11 -0
  216. package/dist-server/service/scenario-queue/scenario-queue-type.js +4 -4
  217. package/dist-server/service/scenario-queue/scenario-queue-type.js.map +1 -1
  218. package/dist-server/service/state-register/index.d.ts +6 -0
  219. package/dist-server/service/state-register/state-register-mutation.d.ts +11 -0
  220. package/dist-server/service/state-register/state-register-mutation.js +2 -2
  221. package/dist-server/service/state-register/state-register-mutation.js.map +1 -1
  222. package/dist-server/service/state-register/state-register-query.d.ts +14 -0
  223. package/dist-server/service/state-register/state-register-query.js +2 -2
  224. package/dist-server/service/state-register/state-register-query.js.map +1 -1
  225. package/dist-server/service/state-register/state-register-type.d.ts +23 -0
  226. package/dist-server/service/state-register/state-register-type.js +6 -6
  227. package/dist-server/service/state-register/state-register-type.js.map +1 -1
  228. package/dist-server/service/state-register/state-register.d.ts +22 -0
  229. package/dist-server/service/state-register/state-register.js +2 -2
  230. package/dist-server/service/state-register/state-register.js.map +1 -1
  231. package/dist-server/service/step/index.d.ts +5 -0
  232. package/dist-server/service/step/step-mutation.d.ts +5 -0
  233. package/dist-server/service/step/step-mutation.js +2 -2
  234. package/dist-server/service/step/step-mutation.js.map +1 -1
  235. package/dist-server/service/step/step-query.d.ts +12 -0
  236. package/dist-server/service/step/step-query.js +2 -2
  237. package/dist-server/service/step/step-query.js.map +1 -1
  238. package/dist-server/service/step/step-type.d.ts +111 -0
  239. package/dist-server/service/step/step-type.js +6 -6
  240. package/dist-server/service/step/step-type.js.map +1 -1
  241. package/dist-server/service/task-type/index.d.ts +3 -0
  242. package/dist-server/service/task-type/task-type-query.d.ts +6 -0
  243. package/dist-server/service/task-type/task-type-query.js +2 -2
  244. package/dist-server/service/task-type/task-type-query.js.map +1 -1
  245. package/dist-server/service/task-type/task-type-type.d.ts +12 -0
  246. package/dist-server/service/task-type/task-type-type.js +4 -4
  247. package/dist-server/service/task-type/task-type-type.js.map +1 -1
  248. package/dist-server/tsconfig.tsbuildinfo +1 -1
  249. package/package.json +7 -7
  250. package/server/engine/connection-manager.ts +1 -1
  251. package/server/engine/index.ts +1 -1
  252. package/server/routers/scenario-schedule-callback-router.ts +2 -2
  253. package/server/service/scenario-instance/scenario-instance-type.ts +1 -1
@@ -0,0 +1,122 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain } from '@things-factory/shell';
3
+ export declare enum ConnectionStatus {
4
+ CONNECTED = "CONNECTED",
5
+ DISCONNECTED = "DISCONNECTED"
6
+ }
7
+ export declare class Connection {
8
+ /**
9
+ * Unique identifier for the connection, generated in UUID format.
10
+ */
11
+ readonly id: string;
12
+ /**
13
+ * Many-to-One relationship with the Domain entity.
14
+ */
15
+ domain: Domain;
16
+ /**
17
+ * Stores the ID of the associated Domain.
18
+ */
19
+ domainId: string;
20
+ /**
21
+ * The name of the connection.
22
+ */
23
+ name: string;
24
+ /**
25
+ * Optional description for the connection.
26
+ */
27
+ description: string;
28
+ /**
29
+ * The type of the connection.
30
+ */
31
+ type: string;
32
+ /**
33
+ * The endpoint for the connection.
34
+ */
35
+ endpoint: string;
36
+ /**
37
+ * Indicates the active status of the connection.
38
+ */
39
+ active: boolean;
40
+ /**
41
+ * The status of the connection, using the ConnectionStatus type.
42
+ */
43
+ state: ConnectionStatus;
44
+ /**
45
+ * Additional parameters for the connection, stored as a JSON string.
46
+ */
47
+ params: string;
48
+ /**
49
+ * The date and time when the connection was created.
50
+ */
51
+ createdAt: Date;
52
+ /**
53
+ * The date and time when the connection was last updated.
54
+ */
55
+ updatedAt: Date;
56
+ /**
57
+ * Many-to-One relationship with the User entity who created the connection. Optional field.
58
+ */
59
+ creator: User;
60
+ /**
61
+ * Stores the ID of the User who created the connection.
62
+ */
63
+ creatorId: string;
64
+ /**
65
+ * Many-to-One relationship with the User entity who last updated the connection.
66
+ * Optional field.
67
+ */
68
+ updater: User;
69
+ /**
70
+ * Stores the ID of the User who last updated the connection.
71
+ *
72
+ */
73
+ updaterId: string;
74
+ /**
75
+ * Asynchronous method to establish the connection.
76
+ *
77
+ */
78
+ connect(): Promise<void>;
79
+ /**
80
+ * @brief Asynchronous method to disconnect the connection.
81
+ *
82
+ */
83
+ disconnect(): Promise<void>;
84
+ }
85
+ /**
86
+ * Connection의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로
87
+ * 추후, 타입 일치를 통해서 제거할 예정임.
88
+ *
89
+ */
90
+ export interface InputConnection extends Connection {
91
+ params: any;
92
+ }
93
+ export declare class ConnectionState {
94
+ domain?: Domain;
95
+ id?: string;
96
+ name?: string;
97
+ description?: string;
98
+ type?: string;
99
+ state?: ConnectionStatus;
100
+ timestamp?: Date;
101
+ }
102
+ export declare class NewConnection {
103
+ name: string;
104
+ description?: string;
105
+ type?: string;
106
+ endpoint?: string;
107
+ params?: string;
108
+ }
109
+ export declare class ConnectionPatch {
110
+ id: string;
111
+ name?: string;
112
+ description?: string;
113
+ type?: string;
114
+ endpoint?: string;
115
+ active?: boolean;
116
+ params?: string;
117
+ cuFlag?: string;
118
+ }
119
+ export declare class ConnectionList {
120
+ items: Connection[];
121
+ total: number;
122
+ }
@@ -12,7 +12,7 @@ var ConnectionStatus;
12
12
  (function (ConnectionStatus) {
13
13
  ConnectionStatus["CONNECTED"] = "CONNECTED";
14
14
  ConnectionStatus["DISCONNECTED"] = "DISCONNECTED";
15
- })(ConnectionStatus = exports.ConnectionStatus || (exports.ConnectionStatus = {}));
15
+ })(ConnectionStatus || (exports.ConnectionStatus = ConnectionStatus = {}));
16
16
  (0, type_graphql_1.registerEnumType)(ConnectionStatus, {
17
17
  name: 'ConnectionStatus',
18
18
  description: 'state enumeration of a connection'
@@ -46,6 +46,7 @@ let Connection = class Connection {
46
46
  }
47
47
  }
48
48
  };
49
+ exports.Connection = Connection;
49
50
  tslib_1.__decorate([
50
51
  (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
51
52
  (0, type_graphql_1.Field)(type => type_graphql_1.ID),
@@ -149,14 +150,14 @@ tslib_1.__decorate([
149
150
  (0, typeorm_1.RelationId)((connection) => connection.updater),
150
151
  tslib_1.__metadata("design:type", String)
151
152
  ], Connection.prototype, "updaterId", void 0);
152
- Connection = tslib_1.__decorate([
153
+ exports.Connection = Connection = tslib_1.__decorate([
153
154
  (0, typeorm_1.Entity)(),
154
155
  (0, typeorm_1.Index)('ix_connection_0', (connection) => [connection.domain, connection.name], { unique: true }),
155
156
  (0, type_graphql_1.ObjectType)()
156
157
  ], Connection);
157
- exports.Connection = Connection;
158
158
  let ConnectionState = class ConnectionState {
159
159
  };
160
+ exports.ConnectionState = ConnectionState;
160
161
  tslib_1.__decorate([
161
162
  (0, type_graphql_1.Field)({ nullable: true }),
162
163
  tslib_1.__metadata("design:type", shell_1.Domain)
@@ -185,12 +186,12 @@ tslib_1.__decorate([
185
186
  (0, type_graphql_1.Field)({ nullable: true }),
186
187
  tslib_1.__metadata("design:type", Date)
187
188
  ], ConnectionState.prototype, "timestamp", void 0);
188
- ConnectionState = tslib_1.__decorate([
189
+ exports.ConnectionState = ConnectionState = tslib_1.__decorate([
189
190
  (0, type_graphql_1.ObjectType)()
190
191
  ], ConnectionState);
191
- exports.ConnectionState = ConnectionState;
192
192
  let NewConnection = class NewConnection {
193
193
  };
194
+ exports.NewConnection = NewConnection;
194
195
  tslib_1.__decorate([
195
196
  (0, type_graphql_1.Field)(),
196
197
  tslib_1.__metadata("design:type", String)
@@ -211,12 +212,12 @@ tslib_1.__decorate([
211
212
  (0, type_graphql_1.Field)({ nullable: true }),
212
213
  tslib_1.__metadata("design:type", String)
213
214
  ], NewConnection.prototype, "params", void 0);
214
- NewConnection = tslib_1.__decorate([
215
+ exports.NewConnection = NewConnection = tslib_1.__decorate([
215
216
  (0, type_graphql_1.InputType)()
216
217
  ], NewConnection);
217
- exports.NewConnection = NewConnection;
218
218
  let ConnectionPatch = class ConnectionPatch {
219
219
  };
220
+ exports.ConnectionPatch = ConnectionPatch;
220
221
  tslib_1.__decorate([
221
222
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
222
223
  tslib_1.__metadata("design:type", String)
@@ -249,12 +250,12 @@ tslib_1.__decorate([
249
250
  (0, type_graphql_1.Field)({ nullable: true }),
250
251
  tslib_1.__metadata("design:type", String)
251
252
  ], ConnectionPatch.prototype, "cuFlag", void 0);
252
- ConnectionPatch = tslib_1.__decorate([
253
+ exports.ConnectionPatch = ConnectionPatch = tslib_1.__decorate([
253
254
  (0, type_graphql_1.InputType)()
254
255
  ], ConnectionPatch);
255
- exports.ConnectionPatch = ConnectionPatch;
256
256
  let ConnectionList = class ConnectionList {
257
257
  };
258
+ exports.ConnectionList = ConnectionList;
258
259
  tslib_1.__decorate([
259
260
  (0, type_graphql_1.Field)(type => [Connection]),
260
261
  tslib_1.__metadata("design:type", Array)
@@ -263,8 +264,7 @@ tslib_1.__decorate([
263
264
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
264
265
  tslib_1.__metadata("design:type", Number)
265
266
  ], ConnectionList.prototype, "total", void 0);
266
- ConnectionList = tslib_1.__decorate([
267
+ exports.ConnectionList = ConnectionList = tslib_1.__decorate([
267
268
  (0, type_graphql_1.ObjectType)()
268
269
  ], ConnectionList);
269
- exports.ConnectionList = ConnectionList;
270
270
  //# sourceMappingURL=connection-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connection-type.js","sourceRoot":"","sources":["../../../server/service/connection/connection-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AACtF,qCASgB;AAEhB,yDAAgD;AAChD,6CAA4C;AAC5C,iDAA8C;AAE9C,yCAAgD;AAEhD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,iDAA6B,CAAA;AAC/B,CAAC,EAHW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAG3B;AAED,IAAA,+BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,mCAAmC;CACjD,CAAC,CAAA;AAKK,IAAM,UAAU,GAAhB,MAAM,UAAU;IAqHrB;;;OAGG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,SAAS,GAAG,0BAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACzD,IAAI,MAAM,GAAG,EAAE,CAAA;QAEf,IAAI;YACF,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAA;SACzC;QAAC,OAAO,EAAE,EAAE;YACX,YAAM,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,IAAI,gCAAgC,EAAE,EAAE,CAAC,CAAA;SAC3E;QAED,MAAM,SAAS,CAAC,OAAO,iCAClB,IAAI,KACP,MAAM,IACN,CAAA;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC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,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC5B;AAEV;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAEpB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAEhB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;AAvBJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAwB3B;AAxBY,0CAAe;AA2BrB,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;;6CACT;AAEnB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;AALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc","sourcesContent":["import { Field, ID, InputType, Int, ObjectType, registerEnumType } 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 { logger } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine'\n\nexport enum ConnectionStatus {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED'\n}\n\nregisterEnumType(ConnectionStatus, {\n name: 'ConnectionStatus',\n description: 'state enumeration of a connection'\n})\n\n@Entity()\n@Index('ix_connection_0', (connection: Connection) => [connection.domain, connection.name], { unique: true })\n@ObjectType()\nexport class Connection {\n /** \n * Unique identifier for the connection, generated in UUID format.\n */\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n /** \n * Many-to-One relationship with the Domain entity.\n */\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain: Domain\n\n /** \n * Stores the ID of the associated Domain.\n */\n @RelationId((connection: Connection) => connection.domain)\n domainId: string\n\n /** \n * The name of the connection.\n */\n @Column()\n @Field()\n name: string\n\n /** \n * Optional description for the connection.\n */\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n /** \n * The type of the connection.\n */\n @Column()\n @Field({ nullable: true })\n type: string\n\n /** \n * The endpoint for the connection.\n */\n @Column()\n @Field({ nullable: true })\n endpoint: string\n\n /** \n * Indicates the active status of the connection.\n */\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n active: boolean\n\n /** \n * The status of the connection, using the ConnectionStatus type.\n */\n @Field({ nullable: true })\n state: ConnectionStatus\n\n /** \n * Additional parameters for the connection, stored as a JSON string.\n */\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n params: string\n\n /** \n * The date and time when the connection was created.\n */\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n /** \n * The date and time when the connection was last updated.\n */\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n /** \n * Many-to-One relationship with the User entity who created the connection. Optional field.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator: User\n\n /** \n * Stores the ID of the User who created the connection.\n */\n @RelationId((connection: Connection) => connection.creator)\n creatorId: string\n\n /** \n * Many-to-One relationship with the User entity who last updated the connection.\n * Optional field.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater: User\n\n /**\n * Stores the ID of the User who last updated the connection.\n * \n */\n @RelationId((connection: Connection) => connection.updater)\n updaterId: string\n\n /**\n * Asynchronous method to establish the connection.\n * \n */\n async connect() {\n var connector = ConnectionManager.getConnector(this.type)\n var params = {}\n\n try {\n params = JSON.parse(this.params || '{}')\n } catch (ex) {\n logger.error(`connection '${this.name}' params should be JSON format`, ex)\n }\n\n await connector.connect({\n ...this,\n params\n })\n }\n\n /**\n * @brief Asynchronous method to disconnect the connection.\n * \n */\n async disconnect() {\n try {\n var connector = ConnectionManager.getConnector(this.type)\n await connector.disconnect(this)\n } finally {\n }\n }\n}\n\n/**\n * Connection의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로\n * 추후, 타입 일치를 통해서 제거할 예정임.\n * \n */\nexport interface InputConnection extends Connection {\n params: any;\n}\n\n@ObjectType()\nexport class ConnectionState {\n @Field({ nullable: true })\n domain?: Domain\n\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n state?: ConnectionStatus\n\n @Field({ nullable: true })\n timestamp?: Date\n}\n\n@InputType()\nexport class NewConnection {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n endpoint?: string\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class ConnectionPatch {\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({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n endpoint?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ConnectionList {\n @Field(type => [Connection])\n items: Connection[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"connection-type.js","sourceRoot":"","sources":["../../../server/service/connection/connection-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AACtF,qCASgB;AAEhB,yDAAgD;AAChD,6CAA4C;AAC5C,iDAA8C;AAE9C,yCAAgD;AAEhD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,iDAA6B,CAAA;AAC/B,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAA,+BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,mCAAmC;CACjD,CAAC,CAAA;AAKK,IAAM,UAAU,GAAhB,MAAM,UAAU;IAqHrB;;;OAGG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,SAAS,GAAG,0BAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACzD,IAAI,MAAM,GAAG,EAAE,CAAA;QAEf,IAAI,CAAC;YACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,CAAA;QAC1C,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,YAAM,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,IAAI,gCAAgC,EAAE,EAAE,CAAC,CAAA;QAC5E,CAAC;QAED,MAAM,SAAS,CAAC,OAAO,iCAClB,IAAI,KACP,MAAM,IACN,CAAA;IACJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,UAAU;QACd,IAAI,CAAC;YACH,IAAI,SAAS,GAAG,0BAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACzD,MAAM,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QAClC,CAAC;gBAAS,CAAC;QACX,CAAC;IACH,CAAC;CACF,CAAA;AApJY,gCAAU;AAMZ;IAFR,IAA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A,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;AAGf;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACX;0BAvBJ,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAwB3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","sourcesContent":["import { Field, ID, InputType, Int, ObjectType, registerEnumType } 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 { logger } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine'\n\nexport enum ConnectionStatus {\n CONNECTED = 'CONNECTED',\n DISCONNECTED = 'DISCONNECTED'\n}\n\nregisterEnumType(ConnectionStatus, {\n name: 'ConnectionStatus',\n description: 'state enumeration of a connection'\n})\n\n@Entity()\n@Index('ix_connection_0', (connection: Connection) => [connection.domain, connection.name], { unique: true })\n@ObjectType()\nexport class Connection {\n /** \n * Unique identifier for the connection, generated in UUID format.\n */\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n /** \n * Many-to-One relationship with the Domain entity.\n */\n @ManyToOne(type => Domain)\n @Field({ nullable: true })\n domain: Domain\n\n /** \n * Stores the ID of the associated Domain.\n */\n @RelationId((connection: Connection) => connection.domain)\n domainId: string\n\n /** \n * The name of the connection.\n */\n @Column()\n @Field()\n name: string\n\n /** \n * Optional description for the connection.\n */\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n /** \n * The type of the connection.\n */\n @Column()\n @Field({ nullable: true })\n type: string\n\n /** \n * The endpoint for the connection.\n */\n @Column()\n @Field({ nullable: true })\n endpoint: string\n\n /** \n * Indicates the active status of the connection.\n */\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n active: boolean\n\n /** \n * The status of the connection, using the ConnectionStatus type.\n */\n @Field({ nullable: true })\n state: ConnectionStatus\n\n /** \n * Additional parameters for the connection, stored as a JSON string.\n */\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n params: string\n\n /** \n * The date and time when the connection was created.\n */\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n /** \n * The date and time when the connection was last updated.\n */\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n\n /** \n * Many-to-One relationship with the User entity who created the connection. Optional field.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n creator: User\n\n /** \n * Stores the ID of the User who created the connection.\n */\n @RelationId((connection: Connection) => connection.creator)\n creatorId: string\n\n /** \n * Many-to-One relationship with the User entity who last updated the connection.\n * Optional field.\n */\n @ManyToOne(type => User, { nullable: true })\n @Field({ nullable: true })\n updater: User\n\n /**\n * Stores the ID of the User who last updated the connection.\n * \n */\n @RelationId((connection: Connection) => connection.updater)\n updaterId: string\n\n /**\n * Asynchronous method to establish the connection.\n * \n */\n async connect() {\n var connector = ConnectionManager.getConnector(this.type)\n var params = {}\n\n try {\n params = JSON.parse(this.params || '{}')\n } catch (ex) {\n logger.error(`connection '${this.name}' params should be JSON format`, ex)\n }\n\n await connector.connect({\n ...this,\n params\n })\n }\n\n /**\n * @brief Asynchronous method to disconnect the connection.\n * \n */\n async disconnect() {\n try {\n var connector = ConnectionManager.getConnector(this.type)\n await connector.disconnect(this)\n } finally {\n }\n }\n}\n\n/**\n * Connection의 params의 원 타입과 사용 시에 타입 불일치로 인해 임시적으로 생성한 타입으로\n * 추후, 타입 일치를 통해서 제거할 예정임.\n * \n */\nexport interface InputConnection extends Connection {\n params: any;\n}\n\n@ObjectType()\nexport class ConnectionState {\n @Field({ nullable: true })\n domain?: Domain\n\n @Field({ nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n state?: ConnectionStatus\n\n @Field({ nullable: true })\n timestamp?: Date\n}\n\n@InputType()\nexport class NewConnection {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n endpoint?: string\n\n @Field({ nullable: true })\n params?: string\n}\n\n@InputType()\nexport class ConnectionPatch {\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({ nullable: true })\n type?: string\n\n @Field({ nullable: true })\n endpoint?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n params?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class ConnectionList {\n @Field(type => [Connection])\n items: Connection[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { Connection } from './connection-type';
2
+ import { ConnectionQuery } from './connection-query';
3
+ import { ConnectionMutation } from './connection-mutation';
4
+ import { ConnectionSubscription } from './connection-subscription';
5
+ export declare const entities: (typeof Connection)[];
6
+ export declare const resolvers: (typeof ConnectionQuery | typeof ConnectionMutation | typeof ConnectionSubscription)[];
@@ -0,0 +1,6 @@
1
+ import { ConnectorList, ConnectorType } from './connector-type';
2
+ export declare class ConnectorQuery {
3
+ connection(name: string, context: ResolverContext): Promise<ConnectorType>;
4
+ connectors(): Promise<ConnectorList>;
5
+ connectorByConnection(connectionName: string, context: ResolverContext): Promise<ConnectorType>;
6
+ }
@@ -48,6 +48,7 @@ let ConnectorQuery = class ConnectorQuery {
48
48
  return connection && connection_manager_1.ConnectionManager.getConnector(connection.type);
49
49
  }
50
50
  };
51
+ exports.ConnectorQuery = ConnectorQuery;
51
52
  tslib_1.__decorate([
52
53
  (0, type_graphql_1.Query)(returns => connector_type_1.ConnectorType, { description: 'To fetch a connector' }),
53
54
  tslib_1.__param(0, (0, type_graphql_1.Arg)('name')),
@@ -70,8 +71,7 @@ tslib_1.__decorate([
70
71
  tslib_1.__metadata("design:paramtypes", [String, Object]),
71
72
  tslib_1.__metadata("design:returntype", Promise)
72
73
  ], ConnectorQuery.prototype, "connectorByConnection", null);
73
- ConnectorQuery = tslib_1.__decorate([
74
+ exports.ConnectorQuery = ConnectorQuery = tslib_1.__decorate([
74
75
  (0, type_graphql_1.Resolver)(connector_type_1.ConnectorType)
75
76
  ], ConnectorQuery);
76
- exports.ConnectorQuery = ConnectorQuery;
77
77
  //# sourceMappingURL=connector-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connector-query.js","sourceRoot":"","sources":["../../../server/service/connector/connector-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AAExD,iDAAqD;AAErD,wEAAmE;AACnE,mEAA0D;AAC1D,qDAA+D;AAGxD,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,UAAU,CAAc,IAAY,EAAS,OAAwB;QACzE,aAAa;QACb,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,sCAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QAErG,OAAO;YACL,IAAI;YACJ,WAA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CAAA;AAlDO;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IAAgB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;gDAWjD;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;;;;gDAsB/E;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,8BAAa,EAAE,EAAE,WAAW,EAAE,0CAA0C,EAAE,CAAC;IAE1F,mBAAA,IAAA,kBAAG,EAAC,gBAAgB,CAAC,CAAA;IACrB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DASP;AAnDU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,8BAAa,CAAC;GACX,cAAc,CAoD1B;AApDY,wCAAc","sourcesContent":["import { Arg, Ctx, Query, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine/connection-manager'\nimport { Connection } from '../connection/connection-type'\nimport { ConnectorList, ConnectorType } from './connector-type'\n\n@Resolver(ConnectorType)\nexport class ConnectorQuery {\n @Query(returns => ConnectorType, { description: 'To fetch a connector' })\n async connection(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<ConnectorType> {\n // @ts-ignore\n const { description, help, parameterSpec, taskPrefixes } = ConnectionManager.getConnector(name) || {}\n\n return {\n name,\n description,\n help,\n parameterSpec,\n taskPrefixes: taskPrefixes || []\n }\n }\n\n @Query(returns => ConnectorList, { description: 'To fetch multiple connector' })\n async connectors(): Promise<ConnectorList> {\n var connectors = ConnectionManager.getConnectors()\n var items = Object.keys(connectors)\n .map(name => {\n var connector = connectors[name]\n return {\n name,\n description: connector.description,\n help: connector.help,\n parameterSpec: connector.parameterSpec,\n taskPrefixes: connector.taskPrefixes || []\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 => ConnectorType, { description: 'To fetch the connector from a connection' })\n async connectorByConnection(\n @Arg('connectionName') connectionName: string,\n @Ctx() context: ResolverContext\n ): Promise<ConnectorType> {\n const { domain } = context.state\n\n var connection = await getRepository(Connection).findOne({\n where: { domain: { id: domain.id }, name: connectionName }\n })\n\n return connection && (ConnectionManager.getConnector(connection.type) as any)\n }\n}\n"]}
1
+ {"version":3,"file":"connector-query.js","sourceRoot":"","sources":["../../../server/service/connector/connector-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAwD;AAExD,iDAAqD;AAErD,wEAAmE;AACnE,mEAA0D;AAC1D,qDAA+D;AAGxD,IAAM,cAAc,GAApB,MAAM,cAAc;IAEnB,AAAN,KAAK,CAAC,UAAU,CAAc,IAAY,EAAS,OAAwB;QACzE,aAAa;QACb,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,sCAAiB,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;QAErG,OAAO;YACL,IAAI;YACJ,WAAW;YACX,IAAI;YACJ,aAAa;YACb,YAAY,EAAE,YAAY,IAAI,EAAE;SACjC,CAAA;IACH,CAAC;IAGK,AAAN,KAAK,CAAC,UAAU;QACd,IAAI,UAAU,GAAG,sCAAiB,CAAC,aAAa,EAAE,CAAA;QAClD,IAAI,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC;aAChC,GAAG,CAAC,IAAI,CAAC,EAAE;YACV,IAAI,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;YAChC,OAAO;gBACL,IAAI;gBACJ,WAAW,EAAE,SAAS,CAAC,WAAW;gBAClC,IAAI,EAAE,SAAS,CAAC,IAAI;gBACpB,aAAa,EAAE,SAAS,CAAC,aAAa;gBACtC,YAAY,EAAE,SA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BAAG,EAAC,gBAAgB,CAAC,CAAA;IACrB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DASP;yBAnDU,cAAc;IAD1B,IAAA,uBAAQ,EAAC,8BAAa,CAAC;GACX,cAAc,CAoD1B","sourcesContent":["import { Arg, Ctx, Query, Resolver } from 'type-graphql'\n\nimport { getRepository } from '@things-factory/shell'\n\nimport { ConnectionManager } from '../../engine/connection-manager'\nimport { Connection } from '../connection/connection-type'\nimport { ConnectorList, ConnectorType } from './connector-type'\n\n@Resolver(ConnectorType)\nexport class ConnectorQuery {\n @Query(returns => ConnectorType, { description: 'To fetch a connector' })\n async connection(@Arg('name') name: string, @Ctx() context: ResolverContext): Promise<ConnectorType> {\n // @ts-ignore\n const { description, help, parameterSpec, taskPrefixes } = ConnectionManager.getConnector(name) || {}\n\n return {\n name,\n description,\n help,\n parameterSpec,\n taskPrefixes: taskPrefixes || []\n }\n }\n\n @Query(returns => ConnectorList, { description: 'To fetch multiple connector' })\n async connectors(): Promise<ConnectorList> {\n var connectors = ConnectionManager.getConnectors()\n var items = Object.keys(connectors)\n .map(name => {\n var connector = connectors[name]\n return {\n name,\n description: connector.description,\n help: connector.help,\n parameterSpec: connector.parameterSpec,\n taskPrefixes: connector.taskPrefixes || []\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 => ConnectorType, { description: 'To fetch the connector from a connection' })\n async connectorByConnection(\n @Arg('connectionName') connectionName: string,\n @Ctx() context: ResolverContext\n ): Promise<ConnectorType> {\n const { domain } = context.state\n\n var connection = await getRepository(Connection).findOne({\n where: { domain: { id: domain.id }, name: connectionName }\n })\n\n return connection && (ConnectionManager.getConnector(connection.type) as any)\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { PropertySpec } from '../property-spec';
2
+ export declare class ConnectorType {
3
+ name: string;
4
+ description: string;
5
+ help?: string;
6
+ parameterSpec: PropertySpec[];
7
+ taskPrefixes?: string[];
8
+ }
9
+ export declare class ConnectorList {
10
+ items: ConnectorType[];
11
+ total: number;
12
+ }
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
6
6
  const property_spec_1 = require("../property-spec");
7
7
  let ConnectorType = class ConnectorType {
8
8
  };
9
+ exports.ConnectorType = ConnectorType;
9
10
  tslib_1.__decorate([
10
11
  (0, type_graphql_1.Field)(),
11
12
  tslib_1.__metadata("design:type", String)
@@ -26,12 +27,12 @@ tslib_1.__decorate([
26
27
  (0, type_graphql_1.Field)(type => [String], { nullable: true }),
27
28
  tslib_1.__metadata("design:type", Array)
28
29
  ], ConnectorType.prototype, "taskPrefixes", void 0);
29
- ConnectorType = tslib_1.__decorate([
30
+ exports.ConnectorType = ConnectorType = tslib_1.__decorate([
30
31
  (0, type_graphql_1.ObjectType)()
31
32
  ], ConnectorType);
32
- exports.ConnectorType = ConnectorType;
33
33
  let ConnectorList = class ConnectorList {
34
34
  };
35
+ exports.ConnectorList = ConnectorList;
35
36
  tslib_1.__decorate([
36
37
  (0, type_graphql_1.Field)(type => [ConnectorType]),
37
38
  tslib_1.__metadata("design:type", Array)
@@ -40,8 +41,7 @@ tslib_1.__decorate([
40
41
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
41
42
  tslib_1.__metadata("design:type", Number)
42
43
  ], ConnectorList.prototype, "total", void 0);
43
- ConnectorList = tslib_1.__decorate([
44
+ exports.ConnectorList = ConnectorList = tslib_1.__decorate([
44
45
  (0, type_graphql_1.ObjectType)()
45
46
  ], ConnectorList);
46
- exports.ConnectorList = ConnectorList;
47
47
  //# sourceMappingURL=connector-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connector-type.js","sourceRoot":"","sources":["../../../server/service/connector/connector-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAqD;AACrD,oDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAdC;IAAC,IAAA,oBAAK,GAAE;;2CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACP;AAEnB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACrB;AAE7B;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACrB;AAdZ,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAezB;AAfY,sCAAa;AAkBnB,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;;4CACT;AAEtB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;AALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB;AANY,sCAAa","sourcesContent":["import { ObjectType, Field, Int } from 'type-graphql'\nimport { PropertySpec } from '../property-spec'\n\n@ObjectType()\nexport class ConnectorType {\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(type => [String], { nullable: true })\n taskPrefixes?: string[]\n}\n\n@ObjectType()\nexport class ConnectorList {\n @Field(type => [ConnectorType])\n items: ConnectorType[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"connector-type.js","sourceRoot":"","sources":["../../../server/service/connector/connector-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAqD;AACrD,oDAA+C;AAGxC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAezB,CAAA;AAfY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACP;AAGnB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CACb;AAGb;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACrB;AAG7B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACrB;wBAdZ,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAezB;AAGM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AANY,sCAAa;AAExB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC;;4CACT;AAGtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;4CACN;wBALF,aAAa;IADzB,IAAA,yBAAU,GAAE;GACA,aAAa,CAMzB","sourcesContent":["import { ObjectType, Field, Int } from 'type-graphql'\nimport { PropertySpec } from '../property-spec'\n\n@ObjectType()\nexport class ConnectorType {\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(type => [String], { nullable: true })\n taskPrefixes?: string[]\n}\n\n@ObjectType()\nexport class ConnectorList {\n @Field(type => [ConnectorType])\n items: ConnectorType[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import { ConnectorQuery } from './connector-query';
2
+ export declare const entities: any[];
3
+ export declare const resolvers: (typeof ConnectorQuery)[];
@@ -0,0 +1,17 @@
1
+ export * from './property-spec';
2
+ export * from './task-type/task-type-type';
3
+ export * from './connector/connector-type';
4
+ export * from './connection/connection-type';
5
+ export * from './scenario/scenario';
6
+ export * from './scenario-instance/scenario-instance-type';
7
+ export * from './scenario-queue/scenario-queue-type';
8
+ export * from './step/step-type';
9
+ export * from './scenario-flow/scenario-flow';
10
+ export * from './payload-log/payload-log';
11
+ export * from './state-register/state-register';
12
+ export declare const entities: any[];
13
+ export declare const schema: {
14
+ resolverClasses: (typeof import("./connection/connection-query").ConnectionQuery | typeof import("./connection/connection-mutation").ConnectionMutation | typeof import("./connection/connection-subscription").ConnectionSubscription | typeof import("./connector/connector-query").ConnectorQuery | typeof import("./scenario/scenario-query").ScenarioQuery | typeof import("./scenario/scenario-mutation").ScenarioMutation | typeof import("./scenario-instance/scenario-instance-query").ScenarioInstanceQuery | typeof import("./scenario-instance/scenario-instance-mutation").ScenarioInstanceMutation | typeof import("./scenario-instance/scenario-instance-subscription").ScenarioInstanceSubscription | typeof import("./scenario-queue/scenario-queue-subscription").ScenarioQueueSubscription | typeof import("./step/step-query").StepQuery | typeof import("./step/step-mutation").StepMutation | typeof import("./task-type/task-type-query").TaskTypeQuery | typeof import("./payload-log/payload-log-query").PayloadLogQuery | typeof import("./payload-log/payload-log-mutation").PayloadLogMutation | typeof import("./state-register/state-register-query").StateRegisterQuery | typeof import("./state-register/state-register-mutation").StateRegisterMutation | typeof import("./analysis/analysis-query").IntegrationAnalysisQuery)[];
15
+ };
16
+ export { PayloadType } from './payload-log/payload-log';
17
+ export { createPayloadLog } from './payload-log/payload-log-mutation';
@@ -0,0 +1,5 @@
1
+ import { PayloadLog } from './payload-log';
2
+ import { PayloadLogQuery } from './payload-log-query';
3
+ import { PayloadLogMutation } from './payload-log-mutation';
4
+ export declare const entities: (typeof PayloadLog)[];
5
+ export declare const resolvers: (typeof PayloadLogQuery | typeof PayloadLogMutation)[];
@@ -0,0 +1,10 @@
1
+ import { PayloadLog, PayloadType } from './payload-log';
2
+ import { NewPayloadLog, PayloadLogPatch } from './payload-log-type';
3
+ export declare class PayloadLogMutation {
4
+ createPayloadLog(payloadLog: NewPayloadLog, context: ResolverContext): Promise<PayloadLog>;
5
+ updatePayloadLog(id: string, patch: PayloadLogPatch, context: ResolverContext): Promise<PayloadLog>;
6
+ updateMultiplePayloadLog(patches: PayloadLogPatch[], context: ResolverContext): Promise<PayloadLog[]>;
7
+ deletePayloadLog(id: string, context: ResolverContext): Promise<boolean>;
8
+ deletePayloadLogs(ids: string[], context: ResolverContext): Promise<boolean>;
9
+ }
10
+ export declare function createPayloadLog(name: string, endpoint: string, request: string, response: string, context: any, type?: PayloadType, src?: string): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createPayloadLog = exports.PayloadLogMutation = void 0;
3
+ exports.PayloadLogMutation = void 0;
4
+ exports.createPayloadLog = createPayloadLog;
4
5
  const tslib_1 = require("tslib");
5
6
  const type_graphql_1 = require("type-graphql");
6
7
  const typeorm_1 = require("typeorm");
@@ -58,6 +59,7 @@ let PayloadLogMutation = class PayloadLogMutation {
58
59
  return true;
59
60
  }
60
61
  };
62
+ exports.PayloadLogMutation = PayloadLogMutation;
61
63
  tslib_1.__decorate([
62
64
  (0, type_graphql_1.Directive)('@transaction'),
63
65
  (0, type_graphql_1.Mutation)(returns => payload_log_1.PayloadLog, { description: 'To create new PayloadLog' }),
@@ -104,10 +106,9 @@ tslib_1.__decorate([
104
106
  tslib_1.__metadata("design:paramtypes", [Array, Object]),
105
107
  tslib_1.__metadata("design:returntype", Promise)
106
108
  ], PayloadLogMutation.prototype, "deletePayloadLogs", null);
107
- PayloadLogMutation = tslib_1.__decorate([
109
+ exports.PayloadLogMutation = PayloadLogMutation = tslib_1.__decorate([
108
110
  (0, type_graphql_1.Resolver)(payload_log_1.PayloadLog)
109
111
  ], PayloadLogMutation);
110
- exports.PayloadLogMutation = PayloadLogMutation;
111
112
  async function createPayloadLog(name, endpoint, request, response, context, type = payload_log_1.PayloadType.EGESTION, src = null) {
112
113
  try {
113
114
  const { domain, user } = context === null || context === void 0 ? void 0 : context.state;
@@ -130,5 +131,4 @@ async function createPayloadLog(name, endpoint, request, response, context, type
130
131
  env_1.logger.error(`PayloadLog Error: ${error}`);
131
132
  }
132
133
  }
133
- exports.createPayloadLog = createPayloadLog;
134
134
  //# sourceMappingURL=payload-log-mutation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payload-log-mutation.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAG5B,6CAA4C;AAC5C,iDAA6D;AAE7D,+CAAuD;AACvD,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CACD,UAAyB,EACrC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,IAAI,iCACzC,UAAU,KACb,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CACT,EAAU,EACP,KAAsB,EAC7B,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAA;QAC/C,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YAC1C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QA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;;;2DAUP;AA3GU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA4G9B;AA5GY,gDAAkB;AA8GxB,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,OAAY,EACZ,OAAoB,yBAAW,CAAC,QAAQ,EACxC,MAAc,IAAI;IAElB,IAAI;QACF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAmC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAA;QAEvE,uCAAuC;QACvC,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,IAAI,CAAC;YACnC,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,IAAI;YACJ,GAAG;YACH,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC,CAAA;KACH;IAAC,OAAO,KAAK,EAAE;QACd,YAAM,CAAC,KAAK,CAAC,qBAAqB,KAAK,EAAE,CAAC,CAAA;KAC3C;AACH,CAAC;AA7BD,4CA6BC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { Domain, getRepository } from '@things-factory/shell'\n\nimport { PayloadLog, PayloadType } from './payload-log'\nimport { NewPayloadLog, PayloadLogPatch } from './payload-log-type'\n\n@Resolver(PayloadLog)\nexport class PayloadLogMutation {\n @Directive('@transaction')\n @Mutation(returns => PayloadLog, { description: 'To create new PayloadLog' })\n async createPayloadLog(\n @Arg('payloadLog') payloadLog: NewPayloadLog,\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(PayloadLog).save({\n ...payloadLog,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => PayloadLog, { description: 'To modify PayloadLog information' })\n async updatePayloadLog(\n @Arg('id') id: string,\n @Arg('patch') patch: PayloadLogPatch,\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(PayloadLog)\n const payloadLog = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n return await repository.save({\n ...payloadLog,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [PayloadLog], { description: \"To modify multiple PayloadLogs' information\" })\n async updateMultiplePayloadLog(\n @Arg('patches', type => [PayloadLogPatch]) patches: PayloadLogPatch[],\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const payloadLogRepo = tx.getRepository(PayloadLog)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await payloadLogRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const payloadLog = await payloadLogRepo.findOneBy({ id: newRecord.id })\n\n const result = await payloadLogRepo.save({\n ...payloadLog,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete PayloadLog' })\n async deletePayloadLog(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(PayloadLog).delete({ domain: { id: domain.id }, id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple payloadLogs' })\n async deletePayloadLogs(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(PayloadLog).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n}\n\nexport async function createPayloadLog(\n name: string,\n endpoint: string,\n request: string,\n response: string,\n context: any,\n type: PayloadType = PayloadType.EGESTION,\n src: string = null\n): Promise<void> {\n try {\n const { domain, user }: { domain: Domain; user: User } = context?.state\n\n // disabled due to high db server usage\n await getRepository(PayloadLog).save({\n name,\n domain,\n endpoint,\n request,\n response,\n type,\n src,\n createdBy: user,\n updatedBy: user,\n createdAt: new Date(),\n updatedAt: new Date()\n })\n } catch (error) {\n logger.error(`PayloadLog Error: ${error}`)\n }\n}\n"]}
1
+ {"version":3,"file":"payload-log-mutation.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-mutation.ts"],"names":[],"mappings":";;;AAyHA,4CA6BC;;AAtJD,+CAAsE;AACtE,qCAA4B;AAG5B,6CAA4C;AAC5C,iDAA6D;AAE7D,+CAAuD;AACvD,yDAAmE;AAG5D,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAGvB,AAAN,KAAK,CAAC,gBAAgB,CACD,UAAyB,EACrC,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,OAAO,MAAM,EAAE,CAAC,aAAa,CAAC,wBAAU,CAAC,CAAC,IAAI,iCACzC,UAAU,KACb,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;IACJ,CAAC;IAIK,AAAN,KAAK,CAAC,gBAAgB,CACT,EAAU,EACP,KAAsB,EAC7B,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAA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mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;0DAKnD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,gCAAgC,EAAE,CAAC;IAE7E,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAC5B,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;2DAUP;6BA3GU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,kBAAkB,CA4G9B;AAEM,KAAK,UAAU,gBAAgB,CACpC,IAAY,EACZ,QAAgB,EAChB,OAAe,EACf,QAAgB,EAChB,OAAY,EACZ,OAAoB,yBAAW,CAAC,QAAQ,EACxC,MAAc,IAAI;IAElB,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAmC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAA;QAEvE,uCAAuC;QACvC,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,IAAI,CAAC;YACnC,IAAI;YACJ,MAAM;YACN,QAAQ;YACR,OAAO;YACP,QAAQ;YACR,IAAI;YACJ,GAAG;YACH,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,SAAS,EAAE,IAAI,IAAI,EAAE;SACtB,CAAC,CAAA;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,YAAM,CAAC,KAAK,CAAC,qBAAqB,KAAK,EAAE,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC","sourcesContent":["import { Arg, Ctx, Directive, Mutation, Resolver } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { User } from '@things-factory/auth-base'\nimport { logger } from '@things-factory/env'\nimport { Domain, getRepository } from '@things-factory/shell'\n\nimport { PayloadLog, PayloadType } from './payload-log'\nimport { NewPayloadLog, PayloadLogPatch } from './payload-log-type'\n\n@Resolver(PayloadLog)\nexport class PayloadLogMutation {\n @Directive('@transaction')\n @Mutation(returns => PayloadLog, { description: 'To create new PayloadLog' })\n async createPayloadLog(\n @Arg('payloadLog') payloadLog: NewPayloadLog,\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog> {\n const { domain, user, tx } = context.state\n\n return await tx.getRepository(PayloadLog).save({\n ...payloadLog,\n domain,\n creator: user,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => PayloadLog, { description: 'To modify PayloadLog information' })\n async updatePayloadLog(\n @Arg('id') id: string,\n @Arg('patch') patch: PayloadLogPatch,\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(PayloadLog)\n const payloadLog = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n return await repository.save({\n ...payloadLog,\n ...patch,\n updater: user\n })\n }\n\n @Directive('@transaction')\n @Mutation(returns => [PayloadLog], { description: \"To modify multiple PayloadLogs' information\" })\n async updateMultiplePayloadLog(\n @Arg('patches', type => [PayloadLogPatch]) patches: PayloadLogPatch[],\n @Ctx() context: ResolverContext\n ): Promise<PayloadLog[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const payloadLogRepo = tx.getRepository(PayloadLog)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await payloadLogRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const newRecord = _updateRecords[i]\n const payloadLog = await payloadLogRepo.findOneBy({ id: newRecord.id })\n\n const result = await payloadLogRepo.save({\n ...payloadLog,\n ...newRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete PayloadLog' })\n async deletePayloadLog(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(PayloadLog).delete({ domain: { id: domain.id }, id })\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple payloadLogs' })\n async deletePayloadLogs(\n @Arg('ids', type => [String]) ids: string[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(PayloadLog).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n return true\n }\n}\n\nexport async function createPayloadLog(\n name: string,\n endpoint: string,\n request: string,\n response: string,\n context: any,\n type: PayloadType = PayloadType.EGESTION,\n src: string = null\n): Promise<void> {\n try {\n const { domain, user }: { domain: Domain; user: User } = context?.state\n\n // disabled due to high db server usage\n await getRepository(PayloadLog).save({\n name,\n domain,\n endpoint,\n request,\n response,\n type,\n src,\n createdBy: user,\n updatedBy: user,\n createdAt: new Date(),\n updatedAt: new Date()\n })\n } catch (error) {\n logger.error(`PayloadLog Error: ${error}`)\n }\n}\n"]}
@@ -0,0 +1,11 @@
1
+ import { User } from '@things-factory/auth-base';
2
+ import { Domain, ListParam } from '@things-factory/shell';
3
+ import { PayloadLog } from './payload-log';
4
+ import { PayloadLogList } from './payload-log-type';
5
+ export declare class PayloadLogQuery {
6
+ payloadLog(id: string, context: ResolverContext): Promise<PayloadLog>;
7
+ payloadLogs(params: ListParam, context: ResolverContext): Promise<PayloadLogList>;
8
+ domain(payloadLog: PayloadLog): Promise<Domain>;
9
+ updater(payloadLog: PayloadLog): Promise<User>;
10
+ creator(payloadLog: PayloadLog): Promise<User>;
11
+ }
@@ -32,6 +32,7 @@ let PayloadLogQuery = class PayloadLogQuery {
32
32
  return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: payloadLog.creatorId });
33
33
  }
34
34
  };
35
+ exports.PayloadLogQuery = PayloadLogQuery;
35
36
  tslib_1.__decorate([
36
37
  (0, type_graphql_1.Query)(returns => payload_log_1.PayloadLog, { description: 'To fetch a PayloadLog' }),
37
38
  tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
@@ -69,8 +70,7 @@ tslib_1.__decorate([
69
70
  tslib_1.__metadata("design:paramtypes", [payload_log_1.PayloadLog]),
70
71
  tslib_1.__metadata("design:returntype", Promise)
71
72
  ], PayloadLogQuery.prototype, "creator", null);
72
- PayloadLogQuery = tslib_1.__decorate([
73
+ exports.PayloadLogQuery = PayloadLogQuery = tslib_1.__decorate([
73
74
  (0, type_graphql_1.Resolver)(payload_log_1.PayloadLog)
74
75
  ], PayloadLogQuery);
75
- exports.PayloadLogQuery = PayloadLogQuery;
76
76
  //# sourceMappingURL=payload-log-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payload-log-query.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAA2F;AAE3F,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAAS,MAAiB,EAAS,OAAwB;QA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IAAqB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;6CAAjB,iBAAS;;kDAS1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;6CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAa,wBAAU;;8CAE3C;AAnCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAoC3B;AApCY,0CAAe","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, Domain, getRepository, ListParam } from '@things-factory/shell'\n\nimport { PayloadLog } from './payload-log'\nimport { PayloadLogList } from './payload-log-type'\n\n@Resolver(PayloadLog)\nexport class PayloadLogQuery {\n @Query(returns => PayloadLog, { description: 'To fetch a PayloadLog' })\n async payloadLog(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PayloadLog> {\n const { domain } = context.state\n\n return await getRepository(PayloadLog).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => PayloadLogList, { description: 'To fetch multiple PayloadLogs' })\n async payloadLogs(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<PayloadLogList> {\n const { domain } = context.state\n\n const convertedParams = convertListParams(params, {\n domain\n })\n const [items, total] = await getRepository(PayloadLog).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() payloadLog: PayloadLog): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: payloadLog.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() payloadLog: PayloadLog): Promise<User> {\n return await getRepository(User).findOneBy({ id: payloadLog.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() payloadLog: PayloadLog): Promise<User> {\n return await getRepository(User).findOneBy({ id: payloadLog.creatorId })\n }\n}\n"]}
1
+ {"version":3,"file":"payload-log-query.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-query.ts"],"names":[],"mappings":";;;;AAAA,+CAAmF;AAEnF,yDAAgD;AAChD,iDAA2F;AAE3F,+CAA0C;AAC1C,yDAAmD;AAG5C,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAY,EAAU,EAAS,OAAwB;QACrE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAAS,MAAiB,EAAS,OAAwB;QAC1E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,MAAM,eAAe,GAAG,IAAA,yBAAiB,EAAC,MAAM,EAAE;YAChD,MAAM;SACP,CAAC,CAAA;QACF,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,qBAAa,EAAC,wBAAU,CAAC,CAAC,YAAY,CAAC,eAAe,CAAC,CAAA;QAEpF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,UAAsB;QACzC,OAAO,MAAM,IAAA,qBAAa,EAAC,cAAM,CAAC,CAAC,SAAS,CAAC,EAAE,E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CAAa,wBAAU;;8CAE3C;0BAnCU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,wBAAU,CAAC;GACR,eAAe,CAoC3B","sourcesContent":["import { Arg, Args, Ctx, FieldResolver, Query, Resolver, Root } from 'type-graphql'\n\nimport { User } from '@things-factory/auth-base'\nimport { convertListParams, Domain, getRepository, ListParam } from '@things-factory/shell'\n\nimport { PayloadLog } from './payload-log'\nimport { PayloadLogList } from './payload-log-type'\n\n@Resolver(PayloadLog)\nexport class PayloadLogQuery {\n @Query(returns => PayloadLog, { description: 'To fetch a PayloadLog' })\n async payloadLog(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<PayloadLog> {\n const { domain } = context.state\n\n return await getRepository(PayloadLog).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => PayloadLogList, { description: 'To fetch multiple PayloadLogs' })\n async payloadLogs(@Args() params: ListParam, @Ctx() context: ResolverContext): Promise<PayloadLogList> {\n const { domain } = context.state\n\n const convertedParams = convertListParams(params, {\n domain\n })\n const [items, total] = await getRepository(PayloadLog).findAndCount(convertedParams)\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() payloadLog: PayloadLog): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: payloadLog.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() payloadLog: PayloadLog): Promise<User> {\n return await getRepository(User).findOneBy({ id: payloadLog.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() payloadLog: PayloadLog): Promise<User> {\n return await getRepository(User).findOneBy({ id: payloadLog.creatorId })\n }\n}\n"]}
@@ -0,0 +1,15 @@
1
+ import { PayloadLog } from './payload-log';
2
+ export declare class NewPayloadLog {
3
+ name: string;
4
+ description?: string;
5
+ }
6
+ export declare class PayloadLogPatch {
7
+ id?: string;
8
+ name?: string;
9
+ description?: string;
10
+ cuFlag: string;
11
+ }
12
+ export declare class PayloadLogList {
13
+ items: PayloadLog[];
14
+ total: number;
15
+ }
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
6
6
  const payload_log_1 = require("./payload-log");
7
7
  let NewPayloadLog = class NewPayloadLog {
8
8
  };
9
+ exports.NewPayloadLog = NewPayloadLog;
9
10
  tslib_1.__decorate([
10
11
  (0, type_graphql_1.Field)(),
11
12
  tslib_1.__metadata("design:type", String)
@@ -14,12 +15,12 @@ tslib_1.__decorate([
14
15
  (0, type_graphql_1.Field)({ nullable: true }),
15
16
  tslib_1.__metadata("design:type", String)
16
17
  ], NewPayloadLog.prototype, "description", void 0);
17
- NewPayloadLog = tslib_1.__decorate([
18
+ exports.NewPayloadLog = NewPayloadLog = tslib_1.__decorate([
18
19
  (0, type_graphql_1.InputType)()
19
20
  ], NewPayloadLog);
20
- exports.NewPayloadLog = NewPayloadLog;
21
21
  let PayloadLogPatch = class PayloadLogPatch {
22
22
  };
23
+ exports.PayloadLogPatch = PayloadLogPatch;
23
24
  tslib_1.__decorate([
24
25
  (0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
25
26
  tslib_1.__metadata("design:type", String)
@@ -36,12 +37,12 @@ tslib_1.__decorate([
36
37
  (0, type_graphql_1.Field)(),
37
38
  tslib_1.__metadata("design:type", String)
38
39
  ], PayloadLogPatch.prototype, "cuFlag", void 0);
39
- PayloadLogPatch = tslib_1.__decorate([
40
+ exports.PayloadLogPatch = PayloadLogPatch = tslib_1.__decorate([
40
41
  (0, type_graphql_1.InputType)()
41
42
  ], PayloadLogPatch);
42
- exports.PayloadLogPatch = PayloadLogPatch;
43
43
  let PayloadLogList = class PayloadLogList {
44
44
  };
45
+ exports.PayloadLogList = PayloadLogList;
45
46
  tslib_1.__decorate([
46
47
  (0, type_graphql_1.Field)(type => [payload_log_1.PayloadLog]),
47
48
  tslib_1.__metadata("design:type", Array)
@@ -50,8 +51,7 @@ tslib_1.__decorate([
50
51
  (0, type_graphql_1.Field)(type => type_graphql_1.Int),
51
52
  tslib_1.__metadata("design:type", Number)
52
53
  ], PayloadLogList.prototype, "total", void 0);
53
- PayloadLogList = tslib_1.__decorate([
54
+ exports.PayloadLogList = PayloadLogList = tslib_1.__decorate([
54
55
  (0, type_graphql_1.ObjectType)()
55
56
  ], PayloadLogList);
56
- exports.PayloadLogList = PayloadLogList;
57
57
  //# sourceMappingURL=payload-log-type.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"payload-log-type.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,+CAA0C;AAGnC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AALC;IAAC,IAAA,oBAAK,GAAE;;2CACI;AAEZ;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;AALT,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAMzB;AANY,sCAAa;AASnB,IAAM,eAAe,GAArB,MAAM,eAAe;CAY3B,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAEX;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAEb;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAEpB;IAAC,IAAA,oBAAK,GAAE;;+CACM;AAXH,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAY3B;AAZY,0CAAe;AAerB,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAEnB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;AALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { PayloadLog } from './payload-log'\n\n@InputType()\nexport class NewPayloadLog {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class PayloadLogPatch {\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()\n cuFlag: string\n}\n\n@ObjectType()\nexport class PayloadLogList {\n @Field(type => [PayloadLog])\n items: PayloadLog[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"payload-log-type.js","sourceRoot":"","sources":["../../../server/service/payload-log/payload-log-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAoE;AAEpE,+CAA0C;AAGnC,IAAM,aAAa,GAAnB,MAAM,aAAa;CAMzB,CAAA;AANY,sCAAa;AAExB;IADC,IAAA,oBAAK,GAAE;;2CACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACN;wBALT,aAAa;IADzB,IAAA,wBAAS,GAAE;GACC,aAAa,CAMzB;AAGM,IAAM,eAAe,GAArB,MAAM,eAAe;CAY3B,CAAA;AAZY,0CAAe;AAE1B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;2CAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oDACN;AAGpB;IADC,IAAA,oBAAK,GAAE;;+CACM;0BAXH,eAAe;IAD3B,IAAA,wBAAS,GAAE;GACC,eAAe,CAY3B;AAGM,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AANY,wCAAc;AAEzB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,wBAAU,CAAC,CAAC;;6CACT;AAGnB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;6CACN;yBALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B","sourcesContent":["import { ObjectType, Field, InputType, Int, ID } from 'type-graphql'\n\nimport { PayloadLog } from './payload-log'\n\n@InputType()\nexport class NewPayloadLog {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n}\n\n@InputType()\nexport class PayloadLogPatch {\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()\n cuFlag: string\n}\n\n@ObjectType()\nexport class PayloadLogList {\n @Field(type => [PayloadLog])\n items: PayloadLog[]\n\n @Field(type => Int)\n total: number\n}\n"]}