interaqt 0.1.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 (214) hide show
  1. package/README.md +53 -0
  2. package/dist/index.d.ts +4 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +4 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/runtime/ActivityCall.d.ts +68 -0
  7. package/dist/runtime/ActivityCall.d.ts.map +1 -0
  8. package/dist/runtime/ActivityCall.js +379 -0
  9. package/dist/runtime/ActivityCall.js.map +1 -0
  10. package/dist/runtime/Controller.d.ts +60 -0
  11. package/dist/runtime/Controller.d.ts.map +1 -0
  12. package/dist/runtime/Controller.js +225 -0
  13. package/dist/runtime/Controller.js.map +1 -0
  14. package/dist/runtime/InteractionCall.d.ts +102 -0
  15. package/dist/runtime/InteractionCall.d.ts.map +1 -0
  16. package/dist/runtime/InteractionCall.js +385 -0
  17. package/dist/runtime/InteractionCall.js.map +1 -0
  18. package/dist/runtime/MonoSystem.d.ts +26 -0
  19. package/dist/runtime/MonoSystem.d.ts.map +1 -0
  20. package/dist/runtime/MonoSystem.js +331 -0
  21. package/dist/runtime/MonoSystem.js.map +1 -0
  22. package/dist/runtime/Mysql.d.ts +35 -0
  23. package/dist/runtime/Mysql.d.ts.map +1 -0
  24. package/dist/runtime/Mysql.js +171 -0
  25. package/dist/runtime/Mysql.js.map +1 -0
  26. package/dist/runtime/PostgreSQL.d.ts +36 -0
  27. package/dist/runtime/PostgreSQL.d.ts.map +1 -0
  28. package/dist/runtime/PostgreSQL.js +172 -0
  29. package/dist/runtime/PostgreSQL.js.map +1 -0
  30. package/dist/runtime/SQLite.d.ts +34 -0
  31. package/dist/runtime/SQLite.d.ts.map +1 -0
  32. package/dist/runtime/SQLite.js +146 -0
  33. package/dist/runtime/SQLite.js.map +1 -0
  34. package/dist/runtime/Scheduler.d.ts +81 -0
  35. package/dist/runtime/Scheduler.d.ts.map +1 -0
  36. package/dist/runtime/Scheduler.js +457 -0
  37. package/dist/runtime/Scheduler.js.map +1 -0
  38. package/dist/runtime/System.d.ts +312 -0
  39. package/dist/runtime/System.d.ts.map +1 -0
  40. package/dist/runtime/System.js +90 -0
  41. package/dist/runtime/System.js.map +1 -0
  42. package/dist/runtime/asyncInteractionContext.d.ts +3 -0
  43. package/dist/runtime/asyncInteractionContext.d.ts.map +1 -0
  44. package/dist/runtime/asyncInteractionContext.js +3 -0
  45. package/dist/runtime/asyncInteractionContext.js.map +1 -0
  46. package/dist/runtime/boolExpression.d.ts +23 -0
  47. package/dist/runtime/boolExpression.d.ts.map +1 -0
  48. package/dist/runtime/boolExpression.js +43 -0
  49. package/dist/runtime/boolExpression.js.map +1 -0
  50. package/dist/runtime/computedDataHandles/Any.d.ts +52 -0
  51. package/dist/runtime/computedDataHandles/Any.d.ts.map +1 -0
  52. package/dist/runtime/computedDataHandles/Any.js +152 -0
  53. package/dist/runtime/computedDataHandles/Any.js.map +1 -0
  54. package/dist/runtime/computedDataHandles/Computation.d.ts +108 -0
  55. package/dist/runtime/computedDataHandles/Computation.d.ts.map +1 -0
  56. package/dist/runtime/computedDataHandles/Computation.js +49 -0
  57. package/dist/runtime/computedDataHandles/Computation.js.map +1 -0
  58. package/dist/runtime/computedDataHandles/ComputedDataHandle.d.ts +42 -0
  59. package/dist/runtime/computedDataHandles/ComputedDataHandle.d.ts.map +1 -0
  60. package/dist/runtime/computedDataHandles/ComputedDataHandle.js +4 -0
  61. package/dist/runtime/computedDataHandles/ComputedDataHandle.js.map +1 -0
  62. package/dist/runtime/computedDataHandles/Count.d.ts +45 -0
  63. package/dist/runtime/computedDataHandles/Count.d.ts.map +1 -0
  64. package/dist/runtime/computedDataHandles/Count.js +85 -0
  65. package/dist/runtime/computedDataHandles/Count.js.map +1 -0
  66. package/dist/runtime/computedDataHandles/Every.d.ts +56 -0
  67. package/dist/runtime/computedDataHandles/Every.d.ts.map +1 -0
  68. package/dist/runtime/computedDataHandles/Every.js +178 -0
  69. package/dist/runtime/computedDataHandles/Every.js.map +1 -0
  70. package/dist/runtime/computedDataHandles/StateMachine.d.ts +74 -0
  71. package/dist/runtime/computedDataHandles/StateMachine.d.ts.map +1 -0
  72. package/dist/runtime/computedDataHandles/StateMachine.js +180 -0
  73. package/dist/runtime/computedDataHandles/StateMachine.js.map +1 -0
  74. package/dist/runtime/computedDataHandles/Transform.d.ts +26 -0
  75. package/dist/runtime/computedDataHandles/Transform.d.ts.map +1 -0
  76. package/dist/runtime/computedDataHandles/Transform.js +106 -0
  77. package/dist/runtime/computedDataHandles/Transform.js.map +1 -0
  78. package/dist/runtime/computedDataHandles/TransitionFinder.d.ts +57 -0
  79. package/dist/runtime/computedDataHandles/TransitionFinder.d.ts.map +1 -0
  80. package/dist/runtime/computedDataHandles/TransitionFinder.js +40 -0
  81. package/dist/runtime/computedDataHandles/TransitionFinder.js.map +1 -0
  82. package/dist/runtime/computedDataHandles/WeightedSummation.d.ts +57 -0
  83. package/dist/runtime/computedDataHandles/WeightedSummation.d.ts.map +1 -0
  84. package/dist/runtime/computedDataHandles/WeightedSummation.js +146 -0
  85. package/dist/runtime/computedDataHandles/WeightedSummation.js.map +1 -0
  86. package/dist/runtime/computedDataHandles/index.d.ts +7 -0
  87. package/dist/runtime/computedDataHandles/index.d.ts.map +1 -0
  88. package/dist/runtime/computedDataHandles/index.js +7 -0
  89. package/dist/runtime/computedDataHandles/index.js.map +1 -0
  90. package/dist/runtime/index.d.ts +15 -0
  91. package/dist/runtime/index.d.ts.map +1 -0
  92. package/dist/runtime/index.js +15 -0
  93. package/dist/runtime/index.js.map +1 -0
  94. package/dist/runtime/server.d.ts +35 -0
  95. package/dist/runtime/server.d.ts.map +1 -0
  96. package/dist/runtime/server.js +171 -0
  97. package/dist/runtime/server.js.map +1 -0
  98. package/dist/runtime/types/boolExpression.d.ts +22 -0
  99. package/dist/runtime/types/boolExpression.d.ts.map +1 -0
  100. package/dist/runtime/types/boolExpression.js +6 -0
  101. package/dist/runtime/types/boolExpression.js.map +1 -0
  102. package/dist/runtime/util.d.ts +10 -0
  103. package/dist/runtime/util.d.ts.map +1 -0
  104. package/dist/runtime/util.js +39 -0
  105. package/dist/runtime/util.js.map +1 -0
  106. package/dist/shared/BoolExp.d.ts +97 -0
  107. package/dist/shared/BoolExp.d.ts.map +1 -0
  108. package/dist/shared/BoolExp.js +252 -0
  109. package/dist/shared/BoolExp.js.map +1 -0
  110. package/dist/shared/activity/Activity.d.ts +465 -0
  111. package/dist/shared/activity/Activity.d.ts.map +1 -0
  112. package/dist/shared/activity/Activity.js +264 -0
  113. package/dist/shared/activity/Activity.js.map +1 -0
  114. package/dist/shared/activity/Condition.d.ts +75 -0
  115. package/dist/shared/activity/Condition.d.ts.map +1 -0
  116. package/dist/shared/activity/Condition.js +51 -0
  117. package/dist/shared/activity/Condition.js.map +1 -0
  118. package/dist/shared/activity/Data.d.ts +115 -0
  119. package/dist/shared/activity/Data.d.ts.map +1 -0
  120. package/dist/shared/activity/Data.js +89 -0
  121. package/dist/shared/activity/Data.js.map +1 -0
  122. package/dist/shared/attributive.d.ts +93 -0
  123. package/dist/shared/attributive.d.ts.map +1 -0
  124. package/dist/shared/attributive.js +59 -0
  125. package/dist/shared/attributive.js.map +1 -0
  126. package/dist/shared/computed.d.ts +607 -0
  127. package/dist/shared/computed.d.ts.map +1 -0
  128. package/dist/shared/computed.js +202 -0
  129. package/dist/shared/computed.js.map +1 -0
  130. package/dist/shared/createClass.d.ts +102 -0
  131. package/dist/shared/createClass.d.ts.map +1 -0
  132. package/dist/shared/createClass.js +276 -0
  133. package/dist/shared/createClass.js.map +1 -0
  134. package/dist/shared/dictionary/Dictionary.d.ts +40 -0
  135. package/dist/shared/dictionary/Dictionary.d.ts.map +1 -0
  136. package/dist/shared/dictionary/Dictionary.js +51 -0
  137. package/dist/shared/dictionary/Dictionary.js.map +1 -0
  138. package/dist/shared/entity/Entity.d.ts +149 -0
  139. package/dist/shared/entity/Entity.d.ts.map +1 -0
  140. package/dist/shared/entity/Entity.js +226 -0
  141. package/dist/shared/entity/Entity.js.map +1 -0
  142. package/dist/shared/index.d.ts +11 -0
  143. package/dist/shared/index.d.ts.map +1 -0
  144. package/dist/shared/index.js +11 -0
  145. package/dist/shared/index.js.map +1 -0
  146. package/dist/shared/user/User.d.ts +21 -0
  147. package/dist/shared/user/User.d.ts.map +1 -0
  148. package/dist/shared/user/User.js +11 -0
  149. package/dist/shared/user/User.js.map +1 -0
  150. package/dist/shared/utils.d.ts +11 -0
  151. package/dist/shared/utils.d.ts.map +1 -0
  152. package/dist/shared/utils.js +19 -0
  153. package/dist/shared/utils.js.map +1 -0
  154. package/dist/storage/erstorage/AttributeInfo.d.ts +40 -0
  155. package/dist/storage/erstorage/AttributeInfo.d.ts.map +1 -0
  156. package/dist/storage/erstorage/AttributeInfo.js +147 -0
  157. package/dist/storage/erstorage/AttributeInfo.js.map +1 -0
  158. package/dist/storage/erstorage/AttributeQuery.d.ts +33 -0
  159. package/dist/storage/erstorage/AttributeQuery.d.ts.map +1 -0
  160. package/dist/storage/erstorage/AttributeQuery.js +190 -0
  161. package/dist/storage/erstorage/AttributeQuery.js.map +1 -0
  162. package/dist/storage/erstorage/EntityQueryHandle.d.ts +29 -0
  163. package/dist/storage/erstorage/EntityQueryHandle.d.ts.map +1 -0
  164. package/dist/storage/erstorage/EntityQueryHandle.js +78 -0
  165. package/dist/storage/erstorage/EntityQueryHandle.js.map +1 -0
  166. package/dist/storage/erstorage/EntityToTableMap.d.ts +85 -0
  167. package/dist/storage/erstorage/EntityToTableMap.d.ts.map +1 -0
  168. package/dist/storage/erstorage/EntityToTableMap.js +262 -0
  169. package/dist/storage/erstorage/EntityToTableMap.js.map +1 -0
  170. package/dist/storage/erstorage/LinkInfo.d.ts +35 -0
  171. package/dist/storage/erstorage/LinkInfo.d.ts.map +1 -0
  172. package/dist/storage/erstorage/LinkInfo.js +89 -0
  173. package/dist/storage/erstorage/LinkInfo.js.map +1 -0
  174. package/dist/storage/erstorage/MatchExp.d.ts +37 -0
  175. package/dist/storage/erstorage/MatchExp.d.ts.map +1 -0
  176. package/dist/storage/erstorage/MatchExp.js +211 -0
  177. package/dist/storage/erstorage/MatchExp.js.map +1 -0
  178. package/dist/storage/erstorage/Modifier.d.ts +23 -0
  179. package/dist/storage/erstorage/Modifier.d.ts.map +1 -0
  180. package/dist/storage/erstorage/Modifier.js +24 -0
  181. package/dist/storage/erstorage/Modifier.js.map +1 -0
  182. package/dist/storage/erstorage/NewRecordData.d.ts +42 -0
  183. package/dist/storage/erstorage/NewRecordData.d.ts.map +1 -0
  184. package/dist/storage/erstorage/NewRecordData.js +178 -0
  185. package/dist/storage/erstorage/NewRecordData.js.map +1 -0
  186. package/dist/storage/erstorage/RecordInfo.d.ts +26 -0
  187. package/dist/storage/erstorage/RecordInfo.d.ts.map +1 -0
  188. package/dist/storage/erstorage/RecordInfo.js +111 -0
  189. package/dist/storage/erstorage/RecordInfo.js.map +1 -0
  190. package/dist/storage/erstorage/RecordQuery.d.ts +73 -0
  191. package/dist/storage/erstorage/RecordQuery.d.ts.map +1 -0
  192. package/dist/storage/erstorage/RecordQuery.js +158 -0
  193. package/dist/storage/erstorage/RecordQuery.js.map +1 -0
  194. package/dist/storage/erstorage/RecordQueryAgent.d.ts +84 -0
  195. package/dist/storage/erstorage/RecordQueryAgent.d.ts.map +1 -0
  196. package/dist/storage/erstorage/RecordQueryAgent.js +1130 -0
  197. package/dist/storage/erstorage/RecordQueryAgent.js.map +1 -0
  198. package/dist/storage/erstorage/Setup.d.ts +49 -0
  199. package/dist/storage/erstorage/Setup.d.ts.map +1 -0
  200. package/dist/storage/erstorage/Setup.js +400 -0
  201. package/dist/storage/erstorage/Setup.js.map +1 -0
  202. package/dist/storage/erstorage/util.d.ts +6 -0
  203. package/dist/storage/erstorage/util.d.ts.map +1 -0
  204. package/dist/storage/erstorage/util.js +25 -0
  205. package/dist/storage/erstorage/util.js.map +1 -0
  206. package/dist/storage/index.d.ts +13 -0
  207. package/dist/storage/index.d.ts.map +1 -0
  208. package/dist/storage/index.js +13 -0
  209. package/dist/storage/index.js.map +1 -0
  210. package/dist/storage/utils.d.ts +10 -0
  211. package/dist/storage/utils.d.ts.map +1 -0
  212. package/dist/storage/utils.js +48 -0
  213. package/dist/storage/utils.js.map +1 -0
  214. package/package.json +59 -0
@@ -0,0 +1,264 @@
1
+ import { createClass } from "../createClass.js";
2
+ import { Entity, Relation } from "../entity/Entity.js";
3
+ import { Attributive, Attributives, } from "../attributive.js";
4
+ import { Condition, Conditions } from './Condition.js';
5
+ import { Computation, DataAttributive, DataAttributives, Query } from "./Data.js";
6
+ // 交互动作,因为以后可能有更多的关于交互动作的管理,所以应该是个对象,而不只是字符串名字。
7
+ // 例如获取所有的 send xxx 类型的交互动作。
8
+ export const Action = createClass({
9
+ name: 'Action',
10
+ public: {
11
+ name: {
12
+ type: 'string',
13
+ required: true
14
+ }
15
+ }
16
+ });
17
+ // CAUTION 全局唯一的 GET 交互。
18
+ export const GetAction = new Action({ name: 'get' });
19
+ export const PayloadItem = createClass({
20
+ name: 'PayloadItem',
21
+ public: {
22
+ name: {
23
+ type: 'string',
24
+ required: true
25
+ },
26
+ // 用于修饰后面的 UserAttributive 或者 Entity,类型根据 base 变化而变化
27
+ attributives: {
28
+ type: [Attributives, Attributive],
29
+ collection: false,
30
+ },
31
+ // 当前 Item 的具体概念类型
32
+ base: {
33
+ type: Entity,
34
+ required: true,
35
+ collection: false,
36
+ },
37
+ // isRef 表示这个 payload 是不是一个有 id ,系统中已经存在的。
38
+ // 例如交互"用户 删除 内容",用户执行这个交互时传的 "内容" 就应该是有 id 。
39
+ isRef: {
40
+ type: 'boolean',
41
+ collection: false,
42
+ defaultValue: () => false
43
+ },
44
+ required: {
45
+ type: 'boolean',
46
+ collection: false,
47
+ defaultValue: () => false
48
+ },
49
+ isCollection: {
50
+ type: 'boolean',
51
+ collection: false,
52
+ defaultValue: () => false
53
+ },
54
+ // payload 也可以指向前其他交互中定义的实体之类的,这用在了 activity 中。
55
+ itemRef: {
56
+ collection: false,
57
+ required: false,
58
+ type: [Attributive, Entity],
59
+ }
60
+ }
61
+ });
62
+ export const Payload = createClass({
63
+ name: 'Payload',
64
+ public: {
65
+ items: {
66
+ type: PayloadItem,
67
+ collection: true,
68
+ required: true,
69
+ defaultValue: () => []
70
+ }
71
+ }
72
+ });
73
+ // 执行的 side effect。通常需要和实现的系统进行约定。
74
+ export const SideEffect = createClass({
75
+ name: 'SideEffect',
76
+ public: {
77
+ name: {
78
+ type: 'string',
79
+ required: true,
80
+ collection: false
81
+ },
82
+ handle: {
83
+ type: 'function',
84
+ required: true,
85
+ collection: false
86
+ }
87
+ }
88
+ });
89
+ export const Interaction = createClass({
90
+ name: 'Interaction',
91
+ display: (interaction) => `${interaction.action.name}`,
92
+ public: {
93
+ name: {
94
+ type: 'string',
95
+ collection: false,
96
+ required: true
97
+ },
98
+ conditions: {
99
+ type: [Conditions, Condition],
100
+ required: false,
101
+ collection: false,
102
+ },
103
+ // 用户自定义的任何定语
104
+ userAttributives: {
105
+ type: [Attributives, Attributive],
106
+ required: false,
107
+ collection: false,
108
+ },
109
+ // 当前的用户的 alias 名字。这个地方应该改成 Alias 才更加好
110
+ userRef: {
111
+ type: Attributive,
112
+ collection: false,
113
+ },
114
+ action: {
115
+ type: Action,
116
+ collection: false,
117
+ required: true
118
+ },
119
+ payload: {
120
+ type: Payload,
121
+ collection: false,
122
+ },
123
+ // 副作用
124
+ sideEffects: {
125
+ type: SideEffect,
126
+ collection: true,
127
+ defaultValue: (...args) => []
128
+ },
129
+ dataAttributives: {
130
+ type: [DataAttributive, DataAttributives],
131
+ required: false,
132
+ collection: false,
133
+ },
134
+ data: {
135
+ type: [Entity, Relation, Computation],
136
+ required: false,
137
+ collection: false
138
+ },
139
+ query: {
140
+ type: Query,
141
+ required: false,
142
+ collection: false
143
+ }
144
+ }
145
+ });
146
+ // 分支条件判断
147
+ export const Gateway = createClass({
148
+ name: 'Gateway',
149
+ public: {
150
+ name: {
151
+ type: 'string',
152
+ required: true
153
+ }
154
+ }
155
+ });
156
+ // 用户可以定义事件
157
+ export const Event = createClass({
158
+ name: 'Event',
159
+ public: {
160
+ name: {
161
+ type: 'string',
162
+ required: true
163
+ }
164
+ }
165
+ });
166
+ const TRANSFER_PLACEHOLDER = {};
167
+ const ACTIVITY_GROUP_PLACEHOLDER = {};
168
+ export const Activity = createClass({
169
+ name: 'Activity',
170
+ public: {
171
+ name: {
172
+ type: 'string',
173
+ collection: false,
174
+ required: true
175
+ },
176
+ // 节点
177
+ interactions: {
178
+ type: Interaction,
179
+ collection: true,
180
+ defaultValue: (...args) => []
181
+ },
182
+ // 节点
183
+ gateways: {
184
+ type: Gateway,
185
+ collection: true,
186
+ defaultValue: (...args) => []
187
+ },
188
+ // 边
189
+ transfers: {
190
+ type: TRANSFER_PLACEHOLDER, // 待会要被替换掉的,因为 activity/transfer 循环引用了。所以只能待会再替换成真的
191
+ collection: true,
192
+ defaultValue: (...args) => []
193
+ },
194
+ // 节点分组
195
+ groups: {
196
+ // 待会要被替换掉的,因为 activity/activityGroup 循环引用了。所以只能待会再替换成真的
197
+ type: ACTIVITY_GROUP_PLACEHOLDER,
198
+ collection: true,
199
+ defaultValue: (...args) => []
200
+ },
201
+ // 抛出的事件groups
202
+ events: {
203
+ type: Event,
204
+ collection: true,
205
+ defaultValue: (...args) => []
206
+ },
207
+ }
208
+ });
209
+ // ActivityGroup 本质上是一个控制单元,不是 Activity。用来决定里面的 interaction 在什么情况下达到了完成状态。
210
+ export const ActivityGroup = createClass({
211
+ name: 'ActivityGroup',
212
+ public: {
213
+ type: {
214
+ type: 'string',
215
+ required: true,
216
+ collection: false
217
+ },
218
+ activities: {
219
+ // type: Activity,
220
+ instanceType: {},
221
+ collection: true,
222
+ required: false,
223
+ defaultValue: (...args) => []
224
+ }
225
+ }
226
+ });
227
+ export const Transfer = createClass({
228
+ name: 'Transfer',
229
+ public: {
230
+ name: {
231
+ type: 'string',
232
+ required: true,
233
+ collection: false
234
+ },
235
+ source: {
236
+ type: [Interaction, ActivityGroup, Gateway],
237
+ required: true,
238
+ collection: false
239
+ },
240
+ target: {
241
+ type: [Interaction, ActivityGroup, Gateway],
242
+ required: true,
243
+ collection: false
244
+ }
245
+ }
246
+ });
247
+ // 修正前面 Activity 里面为了解决循环引用问题的占位符
248
+ Activity.public.transfers.type = Transfer;
249
+ Activity.public.groups.type = ActivityGroup;
250
+ export function forEachInteraction(activity, handle, parenGroup) {
251
+ activity.interactions.forEach(i => handle(i, parenGroup));
252
+ activity.groups.forEach(group => {
253
+ group.activities.forEach(sub => forEachInteraction(sub, handle, group));
254
+ });
255
+ }
256
+ export function getInteractions(activity) {
257
+ const result = [];
258
+ forEachInteraction(activity, (i) => result.push(i));
259
+ return result;
260
+ }
261
+ export function findRootActivity(interaction) {
262
+ return null;
263
+ }
264
+ //# sourceMappingURL=Activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Activity.js","sourceRoot":"","sources":["../../../src/shared/activity/Activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAoD,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAC,WAAW,EAAE,YAAY,GAAG,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAC,SAAS,EAAE,UAAU,EAAC,MAAM,gBAAgB,CAAA;AACpD,OAAO,EAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,EAAC,MAAM,WAAW,CAAC;AAGhF,+CAA+C;AAC/C,6BAA6B;AAC7B,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC;IAC9B,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE;QACJ,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACjB;KACJ;CACJ,CAAC,CAAA;AAGF,wBAAwB;AACxB,MAAM,CAAC,MAAM,SAAS,GAA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C,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;SACpB;QACD,MAAM,EAAE;YACJ,IAAI,EAAE,CAAC,WAAW,EAAE,aAAa,EAAE,OAAO,CAAC;YAC3C,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;SACpB;KACJ;CACJ,CAAC,CAAA;AAEF,iCAAiC;AACjC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,QAAQ,CAAA;AACzC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,aAAa,CAAA;AAU3C,MAAM,UAAU,kBAAkB,CAAC,QAA8B,EAAE,MAAwE,EAAE,UAAsC;IAC/K,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAA;IACzD,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC5B,KAAK,CAAC,UAAW,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;IAC5E,CAAC,CAAC,CAAA;AACN,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,QAA8B;IAC1D,MAAM,MAAM,GAA8B,EAAE,CAAA;IAC5C,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;IACnD,OAAO,MAAM,CAAA;AACjB,CAAC;AAGD,MAAM,UAAU,gBAAgB,CAAC,WAAoC;IACjE,OAAO,IAAI,CAAA;AACf,CAAC"}
@@ -0,0 +1,75 @@
1
+ import { KlassInstance } from "../createClass.js";
2
+ import { BoolExp } from "../BoolExp.js";
3
+ export declare const Condition: import("../createClass.js").Klass<{
4
+ content: {
5
+ type: "function";
6
+ required: true;
7
+ collection: false;
8
+ };
9
+ name: {
10
+ type: "string";
11
+ };
12
+ }>;
13
+ export declare const Conditions: import("../createClass.js").Klass<{
14
+ content: {
15
+ type: (import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic> | import("../createClass.js").Klass<{
16
+ type: {
17
+ type: "string";
18
+ required: true;
19
+ collection: false;
20
+ defaultValue: () => string;
21
+ };
22
+ operator: {
23
+ type: "string";
24
+ required: true;
25
+ collection: false;
26
+ options: string[];
27
+ defaultValue: () => string;
28
+ };
29
+ left: {
30
+ instanceType: (KlassInstance<import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic>> | import("../BoolExp.js").UnwrappedBoolExpressionInstanceType<any>);
31
+ required: true;
32
+ collection: false;
33
+ };
34
+ right: {
35
+ instanceType: (KlassInstance<import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic>> | import("../BoolExp.js").UnwrappedBoolExpressionInstanceType<any>);
36
+ required: false;
37
+ collection: false;
38
+ };
39
+ }>)[];
40
+ collection: false;
41
+ required: false;
42
+ };
43
+ }>;
44
+ export declare function boolExpToConditions(obj: BoolExp<KlassInstance<typeof Condition>>): import("../createClass.js").KlassInstanceOfPublic<{
45
+ content: {
46
+ type: (import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic> | import("../createClass.js").Klass<{
47
+ type: {
48
+ type: "string";
49
+ required: true;
50
+ collection: false;
51
+ defaultValue: () => string;
52
+ };
53
+ operator: {
54
+ type: "string";
55
+ required: true;
56
+ collection: false;
57
+ options: string[];
58
+ defaultValue: () => string;
59
+ };
60
+ left: {
61
+ instanceType: (KlassInstance<import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic>> | import("../BoolExp.js").UnwrappedBoolExpressionInstanceType<any>);
62
+ required: true;
63
+ collection: false;
64
+ };
65
+ right: {
66
+ instanceType: (KlassInstance<import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic>> | import("../BoolExp.js").UnwrappedBoolExpressionInstanceType<any>);
67
+ required: false;
68
+ collection: false;
69
+ };
70
+ }>)[];
71
+ collection: false;
72
+ required: false;
73
+ };
74
+ }>;
75
+ //# sourceMappingURL=Condition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Condition.d.ts","sourceRoot":"","sources":["../../../src/shared/activity/Condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAC,OAAO,EAA0D,MAAM,eAAe,CAAC;AAG/F,eAAO,MAAM,SAAS;;;;;;;;;EAapB,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWrB,CAAA;AAsBF,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,OAAO,SAAS,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAIhF"}
@@ -0,0 +1,51 @@
1
+ import { createClass } from "../createClass.js";
2
+ import { BoolExpressionData, BoolAtomData } from "../BoolExp.js";
3
+ export const Condition = createClass({
4
+ name: 'Condition',
5
+ display: (obj) => `${obj.name}`,
6
+ public: {
7
+ content: {
8
+ type: 'function',
9
+ required: true,
10
+ collection: false
11
+ },
12
+ name: {
13
+ type: 'string'
14
+ },
15
+ }
16
+ });
17
+ export const Conditions = createClass({
18
+ name: 'Conditions',
19
+ display: (obj) => `${obj.name}`,
20
+ public: {
21
+ // CAUTION content 的类型是 BoolExpressionData<UserAttributiveAtom>
22
+ content: {
23
+ type: [BoolExpressionData, BoolAtomData],
24
+ collection: false,
25
+ required: false
26
+ },
27
+ }
28
+ });
29
+ function toConditions(obj) {
30
+ if (!obj)
31
+ return undefined;
32
+ if (obj.raw.type === 'atom') {
33
+ return BoolAtomData.create({
34
+ type: 'atom',
35
+ data: obj.raw.data
36
+ });
37
+ }
38
+ const expData = obj.raw;
39
+ return BoolExpressionData.create({
40
+ type: 'expression',
41
+ operator: expData.operator,
42
+ left: toConditions(obj.left),
43
+ right: toConditions(obj.right),
44
+ });
45
+ }
46
+ export function boolExpToConditions(obj) {
47
+ return Conditions.create({
48
+ content: toConditions(obj)
49
+ });
50
+ }
51
+ //# sourceMappingURL=Condition.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Condition.js","sourceRoot":"","sources":["../../../src/shared/activity/Condition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAiC,kBAAkB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAG/F,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;IACjC,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE;IAC/B,MAAM,EAAE;QACJ,OAAO,EAAE;YACL,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;SACpB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;SACjB;KACJ;CACJ,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,WAAW,CAAC;IAClC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE;IAC/B,MAAM,EAAE;QACJ,+DAA+D;QAC/D,OAAO,EAAE;YACL,IAAI,EAAE,CAAC,kBAAkB,EAAE,YAAY,CAAC;YACxC,UAAU,EAAE,KAAK;YACjB,QAAQ,EAAE,KAAK;SAClB;KACJ;CACJ,CAAC,CAAA;AAEF,SAAS,YAAY,CAAC,GAA8C;IAChE,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAA;IAE1B,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC1B,OAAO,YAAY,CAAC,MAAM,CAAC;YACvB,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI;SACrB,CAAC,CAAA;IACN,CAAC;IAED,MAAM,OAAO,GAAG,GAAG,CAAC,GAA6D,CAAA;IACjF,OAAO,kBAAkB,CAAC,MAAM,CAAC;QAC7B,IAAI,EAAE,YAAY;QAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,IAAI,EAAE,YAAY,CAAC,GAAG,CAAC,IAAI,CAAE;QAC7B,KAAK,EAAE,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC;KACjC,CAAC,CAAA;AACN,CAAC;AAGD,MAAM,UAAU,mBAAmB,CAAC,GAA6C;IAC7E,OAAO,UAAU,CAAC,MAAM,CAAC;QACrB,OAAO,EAAE,YAAY,CAAC,GAAG,CAA6C;KACzE,CAAC,CAAA;AACN,CAAC"}
@@ -0,0 +1,115 @@
1
+ import { KlassInstance } from "../createClass.js";
2
+ import { BoolExp } from "../BoolExp.js";
3
+ export declare const DataAttributive: import("../createClass.js").Klass<{
4
+ content: {
5
+ type: "function";
6
+ required: true;
7
+ collection: false;
8
+ };
9
+ name: {
10
+ type: "string";
11
+ };
12
+ }>;
13
+ export declare const DataAttributives: import("../createClass.js").Klass<{
14
+ content: {
15
+ type: (import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic> | import("../createClass.js").Klass<{
16
+ type: {
17
+ type: "string";
18
+ required: true;
19
+ collection: false;
20
+ defaultValue: () => string;
21
+ };
22
+ operator: {
23
+ type: "string";
24
+ required: true;
25
+ collection: false;
26
+ options: string[];
27
+ defaultValue: () => string;
28
+ };
29
+ left: {
30
+ instanceType: (KlassInstance<import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic>> | import("../BoolExp.js").UnwrappedBoolExpressionInstanceType<any>);
31
+ required: true;
32
+ collection: false;
33
+ };
34
+ right: {
35
+ instanceType: (KlassInstance<import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic>> | import("../BoolExp.js").UnwrappedBoolExpressionInstanceType<any>);
36
+ required: false;
37
+ collection: false;
38
+ };
39
+ }>)[];
40
+ collection: false;
41
+ required: false;
42
+ };
43
+ }>;
44
+ export declare const QueryItem: import("../createClass.js").Klass<{
45
+ name: {
46
+ type: "string";
47
+ required: true;
48
+ collection: false;
49
+ };
50
+ value: {
51
+ type: "string";
52
+ required: true;
53
+ collection: false;
54
+ };
55
+ }>;
56
+ export declare const Query: import("../createClass.js").Klass<{
57
+ items: {
58
+ type: import("../createClass.js").Klass<{
59
+ name: {
60
+ type: "string";
61
+ required: true;
62
+ collection: false;
63
+ };
64
+ value: {
65
+ type: "string";
66
+ required: true;
67
+ collection: false;
68
+ };
69
+ }>;
70
+ required: true;
71
+ collection: true;
72
+ };
73
+ }>;
74
+ export declare const Computation: import("../createClass.js").Klass<{
75
+ content: {
76
+ type: "function";
77
+ required: true;
78
+ collection: false;
79
+ };
80
+ name: {
81
+ type: "string";
82
+ };
83
+ }>;
84
+ export declare function boolExpToDataAttributives(obj: BoolExp<KlassInstance<typeof DataAttributive>>): import("../createClass.js").KlassInstanceOfPublic<{
85
+ content: {
86
+ type: (import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic> | import("../createClass.js").Klass<{
87
+ type: {
88
+ type: "string";
89
+ required: true;
90
+ collection: false;
91
+ defaultValue: () => string;
92
+ };
93
+ operator: {
94
+ type: "string";
95
+ required: true;
96
+ collection: false;
97
+ options: string[];
98
+ defaultValue: () => string;
99
+ };
100
+ left: {
101
+ instanceType: (KlassInstance<import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic>> | import("../BoolExp.js").UnwrappedBoolExpressionInstanceType<any>);
102
+ required: true;
103
+ collection: false;
104
+ };
105
+ right: {
106
+ instanceType: (KlassInstance<import("../createClass.js").Klass<import("../BoolExp.js").BoolAtomPublic>> | import("../BoolExp.js").UnwrappedBoolExpressionInstanceType<any>);
107
+ required: false;
108
+ collection: false;
109
+ };
110
+ }>)[];
111
+ collection: false;
112
+ required: false;
113
+ };
114
+ }>;
115
+ //# sourceMappingURL=Data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../../src/shared/activity/Data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAC,OAAO,EAA0D,MAAM,eAAe,CAAC;AAG/F,eAAO,MAAM,eAAe;;;;;;;;;EAa1B,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW3B,CAAA;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;EAcpB,CAAA;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;EAShB,CAAA;AAGF,eAAO,MAAM,WAAW;;;;;;;;;EAYtB,CAAA;AAuBF,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,CAAC,aAAa,CAAC,OAAO,eAAe,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAI5F"}
@@ -0,0 +1,89 @@
1
+ import { createClass } from "../createClass.js";
2
+ import { BoolExpressionData, BoolAtomData } from "../BoolExp.js";
3
+ export const DataAttributive = createClass({
4
+ name: 'DataAttributive',
5
+ display: (obj) => `${obj.name}`,
6
+ public: {
7
+ content: {
8
+ type: 'function',
9
+ required: true,
10
+ collection: false
11
+ },
12
+ name: {
13
+ type: 'string'
14
+ },
15
+ }
16
+ });
17
+ export const DataAttributives = createClass({
18
+ name: 'DataAttributives',
19
+ display: (obj) => `${obj.name}`,
20
+ public: {
21
+ // CAUTION content 的类型是 BoolExpressionData<UserAttributiveAtom>
22
+ content: {
23
+ type: [BoolExpressionData, BoolAtomData],
24
+ collection: false,
25
+ required: false
26
+ },
27
+ }
28
+ });
29
+ export const QueryItem = createClass({
30
+ name: 'QueryItem',
31
+ public: {
32
+ name: {
33
+ type: 'string',
34
+ required: true,
35
+ collection: false,
36
+ },
37
+ value: {
38
+ type: 'string',
39
+ required: true,
40
+ collection: false,
41
+ },
42
+ }
43
+ });
44
+ export const Query = createClass({
45
+ name: 'Query',
46
+ public: {
47
+ items: {
48
+ type: QueryItem,
49
+ required: true,
50
+ collection: true,
51
+ }
52
+ }
53
+ });
54
+ export const Computation = createClass({
55
+ name: 'Computation',
56
+ public: {
57
+ content: {
58
+ type: 'function',
59
+ required: true,
60
+ collection: false
61
+ },
62
+ name: {
63
+ type: 'string'
64
+ },
65
+ }
66
+ });
67
+ function toDataAttributives(obj) {
68
+ if (!obj)
69
+ return undefined;
70
+ if (obj.raw.type === 'atom') {
71
+ return BoolAtomData.create({
72
+ type: 'atom',
73
+ data: obj.raw.data
74
+ });
75
+ }
76
+ const expData = obj.raw;
77
+ return BoolExpressionData.create({
78
+ type: 'expression',
79
+ operator: expData.operator,
80
+ left: toDataAttributives(obj.left),
81
+ right: toDataAttributives(obj.right),
82
+ });
83
+ }
84
+ export function boolExpToDataAttributives(obj) {
85
+ return DataAttributives.create({
86
+ content: toDataAttributives(obj)
87
+ });
88
+ }
89
+ //# sourceMappingURL=Data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Data.js","sourceRoot":"","sources":["../../../src/shared/activity/Data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAgB,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAiC,kBAAkB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AAG/F,MAAM,CAAC,MAAM,eAAe,GAAG,WAAW,CAAC;IACvC,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE;IAC/B,MAAM,EAAE;QACJ,OAAO,EAAE;YACL,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,KAAK;SACpB;QACD,IAAI,EAAE;YACF,IAAI,EAAE,QAAQ;SACjB;KACJ;CACJ,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,W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