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,312 @@
1
+ import { createClass, Entity, KlassInstance, Relation } from "@shared";
2
+ import { GlobalBoundState } from "./computedDataHandles/Computation.js";
3
+ import { RecordBoundState } from "./computedDataHandles/Computation.js";
4
+ import { DataContext } from "./computedDataHandles/ComputedDataHandle.js";
5
+ import { InteractionEvent } from "./InteractionCall.js";
6
+ export type SystemCallback = (...arg: any[]) => any;
7
+ export type RecordMutationCallback = (mutationEvents: RecordMutationEvent[]) => Promise<{
8
+ events?: RecordMutationEvent[];
9
+ } | undefined | void>;
10
+ export declare const SYSTEM_RECORD = "_System_";
11
+ export declare const EVENT_RECORD = "_Event_";
12
+ export declare const ACTIVITY_RECORD = "_Activity_";
13
+ export type Storage = {
14
+ map: any;
15
+ beginTransaction: (transactionName?: string) => Promise<any>;
16
+ commitTransaction: (transactionName?: string) => Promise<any>;
17
+ rollbackTransaction: (transactionName?: string) => Promise<any>;
18
+ get: (itemName: string, id: string, initialValue?: any) => Promise<any>;
19
+ set: (itemName: string, id: string, value: any, events?: RecordMutationEvent[]) => Promise<any>;
20
+ setup: (entities: KlassInstance<typeof Entity>[], relations: KlassInstance<typeof Relation>[], createTables?: boolean) => any;
21
+ findOne: (entityName: string, ...arg: any[]) => Promise<any>;
22
+ update: (entityName: string, ...arg: any[]) => Promise<any>;
23
+ find: (entityName: string, ...arg: any[]) => Promise<any[]>;
24
+ create: (entityName: string, data: any, events?: RecordMutationEvent[]) => Promise<any>;
25
+ delete: (entityName: string, data: any, events?: RecordMutationEvent[]) => Promise<any>;
26
+ findOneRelationByName: (relationName: string, ...arg: any[]) => Promise<any>;
27
+ findRelationByName: (relationName: string, ...arg: any[]) => Promise<any>;
28
+ updateRelationByName: (relationName: string, matchExpressionData: any, rawData: any, events?: RecordMutationEvent[]) => Promise<any>;
29
+ removeRelationByName: (relationName: string, matchExpressionData: any, events?: RecordMutationEvent[]) => Promise<any>;
30
+ addRelationByNameById: (relationName: string, sourceEntityId: string, targetEntityId: string, rawData: any, events?: RecordMutationEvent[]) => Promise<any>;
31
+ getRelationName: (...arg: any[]) => string;
32
+ getEntityName: (...arg: any[]) => string;
33
+ listen: (callback: RecordMutationCallback) => any;
34
+ };
35
+ export type RecordMutationEvent = {
36
+ recordName: string;
37
+ type: 'create' | 'update' | 'delete';
38
+ keys?: string[];
39
+ record?: EntityIdRef & {
40
+ [key: string]: any;
41
+ };
42
+ oldRecord?: EntityIdRef & {
43
+ [key: string]: any;
44
+ };
45
+ };
46
+ export type SystemLogger = {
47
+ error: (arg: SystemLogType) => any;
48
+ info: (arg: SystemLogType) => any;
49
+ debug: (arg: SystemLogType) => any;
50
+ child: (fixed: object) => SystemLogger;
51
+ };
52
+ export type SystemLogType = {
53
+ label: string;
54
+ message: string;
55
+ [k: string]: any;
56
+ };
57
+ export type ComputationState = {
58
+ dataContext: DataContext;
59
+ state: {
60
+ [key: string]: RecordBoundState<any> | GlobalBoundState<any>;
61
+ };
62
+ };
63
+ export interface System {
64
+ getEvent: (query: any) => Promise<InteractionEvent[]>;
65
+ saveEvent: (interactionEvent: InteractionEvent, mutationEvents: RecordMutationEvent[]) => Promise<any>;
66
+ createActivity: (activity: any) => Promise<any>;
67
+ updateActivity: (match: any, activity: any) => Promise<any>;
68
+ getActivity: (query?: any) => Promise<any[]>;
69
+ conceptClass: Map<string, ReturnType<typeof createClass>>;
70
+ storage: Storage;
71
+ logger: SystemLogger;
72
+ setup: (entities: KlassInstance<typeof Entity>[], relations: KlassInstance<typeof Relation>[], states: ComputationState[], install?: boolean) => Promise<any>;
73
+ updateEntityPropertyState: (entityId: any, target: any, propertyId: any, fromState: any, toState: any) => Promise<any>;
74
+ updateGlobalState: (id: any, fromState: any, toState: any) => Promise<any>;
75
+ updateEntityState: (entityId: any, target: any, fromState: any, toState: any) => Promise<any>;
76
+ updateRelationState: (relationId: any, source: any, target: any, fromState: any, toState: any) => Promise<any>;
77
+ }
78
+ export type EntityIdRef = {
79
+ id: string;
80
+ [ROW_ID_ATTR]?: string;
81
+ [k: string]: any;
82
+ };
83
+ export declare const ID_ATTR = "id";
84
+ export declare const ROW_ID_ATTR = "_rowId";
85
+ export type DatabaseLogger = {
86
+ info: (arg: {
87
+ type: string;
88
+ name: string;
89
+ sql: string;
90
+ params?: any[];
91
+ }) => any;
92
+ child: (fixed: object) => DatabaseLogger;
93
+ };
94
+ export type Database = {
95
+ open: () => Promise<any>;
96
+ logger: DatabaseLogger;
97
+ scheme: (sql: string, name?: string) => Promise<any>;
98
+ query: <T extends any>(sql: string, values: any[], name?: string) => Promise<T[]>;
99
+ delete: <T extends any>(sql: string, where: any[], name?: string) => Promise<T[]>;
100
+ insert: (sql: string, values: any[], name?: string) => Promise<EntityIdRef>;
101
+ update: (sql: string, values: any[], idField?: string, name?: string) => Promise<EntityIdRef[]>;
102
+ getAutoId: (recordName: string) => Promise<string>;
103
+ parseMatchExpression?: (key: string, value: [string, any], fieldName: string, fieldType: string, isReferenceValue: boolean, getReferenceFieldValue: (v: string) => string, genPlaceholder: (name?: string) => string) => any;
104
+ getPlaceholder?: () => (name?: string) => string;
105
+ mapToDBFieldType: (type: string, collection?: boolean) => string;
106
+ };
107
+ export declare const SystemEntity: import("@shared").KlassInstanceOfPublic<{
108
+ name: {
109
+ type: "string";
110
+ required: true;
111
+ constraints: {
112
+ nameFormat: (arg: {
113
+ name: string;
114
+ }) => boolean;
115
+ };
116
+ };
117
+ properties: {
118
+ type: import("@shared").Klass<{
119
+ name: {
120
+ type: "string";
121
+ required: true;
122
+ constraints: {
123
+ format: (arg: {
124
+ name: string;
125
+ }) => boolean;
126
+ length: (arg: {
127
+ name: string;
128
+ }) => boolean;
129
+ };
130
+ };
131
+ type: {
132
+ type: "string";
133
+ required: true;
134
+ options: () => string[];
135
+ };
136
+ collection: {
137
+ type: "boolean";
138
+ required: false;
139
+ };
140
+ defaultValue: {
141
+ type: "function";
142
+ required: false;
143
+ };
144
+ computed: {
145
+ type: "function";
146
+ required: false;
147
+ };
148
+ computedData: {
149
+ type: import("@shared").Klass<any>[];
150
+ collection: false;
151
+ required: false;
152
+ };
153
+ }>;
154
+ collection: true;
155
+ required: true;
156
+ constraints: {
157
+ eachNameUnique: (arg: {
158
+ properties: any[];
159
+ }) => boolean;
160
+ };
161
+ defaultValue: () => any[];
162
+ };
163
+ computedData: {
164
+ type: import("@shared").Klass<any>[];
165
+ collection: false;
166
+ required: false;
167
+ };
168
+ }>;
169
+ type EntityType = {
170
+ name: string;
171
+ properties: {
172
+ name: string;
173
+ type: string;
174
+ collection: boolean;
175
+ required?: boolean;
176
+ }[];
177
+ };
178
+ type InferType<T> = T extends {
179
+ type: 'string';
180
+ } ? string : T extends {
181
+ type: 'number';
182
+ } ? number : unknown;
183
+ export type EntityInstanceType<T extends EntityType> = {
184
+ [P in T['properties'][number] as P['name']]: P['collection'] extends true ? Array<InferType<P>> : InferType<P>;
185
+ };
186
+ export declare const InteractionEventEntity: import("@shared").KlassInstanceOfPublic<{
187
+ name: {
188
+ type: "string";
189
+ required: true;
190
+ constraints: {
191
+ nameFormat: (arg: {
192
+ name: string;
193
+ }) => boolean;
194
+ };
195
+ };
196
+ properties: {
197
+ type: import("@shared").Klass<{
198
+ name: {
199
+ type: "string";
200
+ required: true;
201
+ constraints: {
202
+ format: (arg: {
203
+ name: string;
204
+ }) => boolean;
205
+ length: (arg: {
206
+ name: string;
207
+ }) => boolean;
208
+ };
209
+ };
210
+ type: {
211
+ type: "string";
212
+ required: true;
213
+ options: () => string[];
214
+ };
215
+ collection: {
216
+ type: "boolean";
217
+ required: false;
218
+ };
219
+ defaultValue: {
220
+ type: "function";
221
+ required: false;
222
+ };
223
+ computed: {
224
+ type: "function";
225
+ required: false;
226
+ };
227
+ computedData: {
228
+ type: import("@shared").Klass<any>[];
229
+ collection: false;
230
+ required: false;
231
+ };
232
+ }>;
233
+ collection: true;
234
+ required: true;
235
+ constraints: {
236
+ eachNameUnique: (arg: {
237
+ properties: any[];
238
+ }) => boolean;
239
+ };
240
+ defaultValue: () => any[];
241
+ };
242
+ computedData: {
243
+ type: import("@shared").Klass<any>[];
244
+ collection: false;
245
+ required: false;
246
+ };
247
+ }>;
248
+ export declare const ActivityStateEntity: import("@shared").KlassInstanceOfPublic<{
249
+ name: {
250
+ type: "string";
251
+ required: true;
252
+ constraints: {
253
+ nameFormat: (arg: {
254
+ name: string;
255
+ }) => boolean;
256
+ };
257
+ };
258
+ properties: {
259
+ type: import("@shared").Klass<{
260
+ name: {
261
+ type: "string";
262
+ required: true;
263
+ constraints: {
264
+ format: (arg: {
265
+ name: string;
266
+ }) => boolean;
267
+ length: (arg: {
268
+ name: string;
269
+ }) => boolean;
270
+ };
271
+ };
272
+ type: {
273
+ type: "string";
274
+ required: true;
275
+ options: () => string[];
276
+ };
277
+ collection: {
278
+ type: "boolean";
279
+ required: false;
280
+ };
281
+ defaultValue: {
282
+ type: "function";
283
+ required: false;
284
+ };
285
+ computed: {
286
+ type: "function";
287
+ required: false;
288
+ };
289
+ computedData: {
290
+ type: import("@shared").Klass<any>[];
291
+ collection: false;
292
+ required: false;
293
+ };
294
+ }>;
295
+ collection: true;
296
+ required: true;
297
+ constraints: {
298
+ eachNameUnique: (arg: {
299
+ properties: any[];
300
+ }) => boolean;
301
+ };
302
+ defaultValue: () => any[];
303
+ };
304
+ computedData: {
305
+ type: import("@shared").Klass<any>[];
306
+ collection: false;
307
+ required: false;
308
+ };
309
+ }>;
310
+ export type InteractionEventRecord = InteractionEvent & EntityIdRef;
311
+ export {};
312
+ //# sourceMappingURL=System.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"System.d.ts","sourceRoot":"","sources":["../../src/runtime/System.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAE,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@ -0,0 +1,90 @@
1
+ import { Entity, Property } from "@shared";
2
+ export const SYSTEM_RECORD = '_System_';
3
+ export const EVENT_RECORD = '_Event_';
4
+ export const ACTIVITY_RECORD = '_Activity_';
5
+ export const ID_ATTR = 'id';
6
+ export const ROW_ID_ATTR = '_rowId';
7
+ // state 等系统配置数据的实体化
8
+ // FIXME 应该独立到外部
9
+ export const SystemEntity = Entity.create({
10
+ name: SYSTEM_RECORD,
11
+ properties: [
12
+ Property.create({
13
+ name: 'concept',
14
+ type: 'string',
15
+ collection: false,
16
+ }),
17
+ Property.create({
18
+ name: 'key',
19
+ type: 'string',
20
+ collection: false,
21
+ }),
22
+ Property.create({
23
+ name: 'value',
24
+ type: 'string',
25
+ collection: false,
26
+ })
27
+ ]
28
+ });
29
+ // event 的实体化
30
+ export const InteractionEventEntity = Entity.create({
31
+ name: EVENT_RECORD,
32
+ properties: [
33
+ Property.create({
34
+ name: 'interactionId',
35
+ type: 'string',
36
+ collection: false,
37
+ }),
38
+ Property.create({
39
+ name: 'interactionName',
40
+ type: 'string',
41
+ collection: false,
42
+ }),
43
+ Property.create({
44
+ name: 'activityId',
45
+ type: 'string',
46
+ collection: false,
47
+ }),
48
+ Property.create({
49
+ name: 'payload',
50
+ type: 'object',
51
+ collection: false,
52
+ }),
53
+ Property.create({
54
+ name: 'user',
55
+ type: 'object',
56
+ collection: false,
57
+ }),
58
+ Property.create({
59
+ name: 'query',
60
+ type: 'object',
61
+ collection: false,
62
+ }),
63
+ ]
64
+ });
65
+ export const ActivityStateEntity = Entity.create({
66
+ name: ACTIVITY_RECORD,
67
+ properties: [
68
+ Property.create({
69
+ name: 'name',
70
+ type: 'string',
71
+ collection: false,
72
+ }),
73
+ Property.create({
74
+ name: 'uuid',
75
+ type: 'string',
76
+ collection: false,
77
+ }),
78
+ Property.create({
79
+ name: 'state',
80
+ type: 'string',
81
+ collection: false,
82
+ }),
83
+ Property.create({
84
+ name: 'refs',
85
+ type: 'string',
86
+ collection: false,
87
+ })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ionContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncInteractionContext.d.ts","sourceRoot":"","sources":["../../src/runtime/asyncInteractionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,uBAAuB,4BAA0B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { AsyncLocalStorage } from 'async_hooks';
2
+ export const asyncInteractionContext = new AsyncLocalStorage();
3
+ //# sourceMappingURL=asyncInteractionContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asyncInteractionContext.js","sourceRoot":"","sources":["../../src/runtime/asyncInteractionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,23 @@
1
+ export declare const OperatorNames: {
2
+ '||': string;
3
+ '&&': string;
4
+ '!': string;
5
+ };
6
+ export declare const enum BoolExpressionNodeTypes {
7
+ group = "group",
8
+ variable = "variable"
9
+ }
10
+ export type BoolExpression = GroupNode | VariableNode;
11
+ export type GroupNode = {
12
+ type: BoolExpressionNodeTypes.group;
13
+ op: string;
14
+ left: BoolExpression;
15
+ right?: BoolExpression;
16
+ };
17
+ export type VariableNode = {
18
+ type: BoolExpressionNodeTypes.variable;
19
+ name: string;
20
+ [k: string]: any;
21
+ };
22
+ export declare function parse(exp: string, options?: any[]): BoolExpression;
23
+ //# sourceMappingURL=boolExpression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolExpression.d.ts","sourceRoot":"","sources":["../../src/runtime/boolExpression.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa;;;;CAIzB,CAAA;AAED,0BAAkB,uBAAuB;IACrC,KAAK,UAAS;IACd,QAAQ,aAAa;CACxB;AAED,MAAM,MAAM,cAAc,GAAG,SAAS,GAAC,YAAY,CAAA;AAEnD,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,uBAAuB,CAAC,KAAK,CAAC;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,CAAC,EAAE,cAAc,CAAA;CACzB,CAAA;AAGD,MAAM,MAAM,YAAY,GAAG;IACvB,IAAI,EAAE,uBAAuB,CAAC,QAAQ,CAAA;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAAA;AA6BD,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,GAAG,EAAO,kBAKrD"}
@@ -0,0 +1,43 @@
1
+ import { parse as parseStr } from 'acorn';
2
+ import { indexBy } from "./util.js";
3
+ export const OperatorNames = {
4
+ '||': '||',
5
+ '&&': '&&',
6
+ '!': '!',
7
+ };
8
+ // @ts-ignore
9
+ function astNodeToAttrNode(astNode, optionsByName) {
10
+ if (astNode.type === "LogicalExpression") {
11
+ return {
12
+ type: "group" /* BoolExpressionNodeTypes.group */,
13
+ // @ts-ignore
14
+ op: OperatorNames[astNode.operator],
15
+ left: astNodeToAttrNode(astNode.left, optionsByName),
16
+ right: astNodeToAttrNode(astNode.right, optionsByName)
17
+ };
18
+ }
19
+ else if (astNode.type === "Identifier") {
20
+ return {
21
+ type: "variable" /* BoolExpressionNodeTypes.variable */,
22
+ name: astNode.name,
23
+ uuid: optionsByName[astNode.name]?.uuid
24
+ };
25
+ }
26
+ else if (astNode.type === "UnaryExpression") {
27
+ return {
28
+ type: "group" /* BoolExpressionNodeTypes.group */,
29
+ op: OperatorNames['!'],
30
+ left: astNodeToAttrNode(astNode.argument, optionsByName)
31
+ };
32
+ }
33
+ else {
34
+ throw new Error('unknown ast node type');
35
+ }
36
+ }
37
+ export function parse(exp, options = []) {
38
+ const optionsByName = indexBy(options, 'name');
39
+ const ast = parseStr(exp, { ecmaVersion: 2020 });
40
+ // @ts-ignore
41
+ return astNodeToAttrNode(ast.body[0].expression, optionsByName);
42
+ }
43
+ //# sourceMappingURL=boolExpression.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolExpression.js","sourceRoot":"","sources":["../../src/runtime/boolExpression.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,IAAI,QAAQ,EAAC,MAAM,OAAO,CAAA;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAGlC,MAAM,CAAC,MAAM,aAAa,GAAG;IACzB,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,GAAG;CACX,CAAA;AAuBD,aAAa;AACb,SAAS,iBAAiB,CAAC,OAAO,EAAE,aAAa;IAC7C,IAAI,OAAO,CAAC,IAAI,KAAK,mBAAmB,EAAE,CAAC;QACvC,OAAO;YACH,IAAI,6CAA+B;YACnC,aAAa;YACb,EAAE,EAAE,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC;YACnC,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC;YACpD,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,aAAa,CAAC;SACzD,CAAA;IACL,CAAC;SAAM,IAAI,OAAO,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;QACvC,OAAO;YACH,IAAI,mDAAkC;YACtC,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,IAAI,EAAE,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI;SAC1C,CAAA;IACL,CAAC;SAAM,IAAI,OAAO,CAAC,IAAI,KAAI,iBAAiB,EAAE,CAAC;QAC3C,OAAO;YACH,IAAI,6CAA+B;YACnC,EAAE,EAAE,aAAa,CAAC,GAAG,CAAC;YACtB,IAAI,EAAE,iBAAiB,CAAC,OAAO,CAAC,QAAQ,EAAE,aAAa,CAAC;SAC3D,CAAA;IACL,CAAC;SAAM,CAAC;QACJ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;IAC5C,CAAC;AACL,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,GAAW,EAAE,UAAiB,EAAE;IAClD,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC9C,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,CAAA;IAC9C,aAAa;IACb,OAAO,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;AACnE,CAAC"}
@@ -0,0 +1,52 @@
1
+ import { DataContext, PropertyDataContext } from "./ComputedDataHandle.js";
2
+ import { Any, KlassInstance, Relation } from "@shared";
3
+ import { Controller } from "../Controller.js";
4
+ import { DataDep, GlobalBoundState, RecordBoundState, RelationBoundState } from "./Computation.js";
5
+ import { DataBasedComputation } from "./Computation.js";
6
+ import { EtityMutationEvent } from "../Scheduler.js";
7
+ import { AttributeQueryData } from "@storage";
8
+ export declare class GlobalAnyHandle implements DataBasedComputation {
9
+ controller: Controller;
10
+ dataContext: DataContext;
11
+ callback: (this: Controller, item: any) => boolean;
12
+ state: ReturnType<typeof this.createState>;
13
+ useLastValue: boolean;
14
+ dataDeps: {
15
+ [key: string]: DataDep;
16
+ };
17
+ constructor(controller: Controller, args: KlassInstance<typeof Any>, dataContext: DataContext);
18
+ createState(): {
19
+ matchCount: GlobalBoundState<number>;
20
+ };
21
+ getDefaultValue(): boolean;
22
+ compute({ main: records }: {
23
+ main: any[];
24
+ }): Promise<boolean>;
25
+ incrementalCompute(lastValue: boolean, mutationEvent: EtityMutationEvent): Promise<boolean>;
26
+ }
27
+ export declare class PropertyAnyHandle implements DataBasedComputation {
28
+ controller: Controller;
29
+ dataContext: PropertyDataContext;
30
+ callback: (this: Controller, item: any) => boolean;
31
+ state: ReturnType<typeof this.createState>;
32
+ useLastValue: boolean;
33
+ dataDeps: {
34
+ [key: string]: DataDep;
35
+ };
36
+ relationAttr: string;
37
+ relatedRecordName: string;
38
+ isSource: boolean;
39
+ relation: KlassInstance<typeof Relation>;
40
+ relationAttributeQuery: AttributeQueryData;
41
+ constructor(controller: Controller, args: KlassInstance<typeof Any>, dataContext: PropertyDataContext);
42
+ createState(): {
43
+ matchCount: RecordBoundState<number>;
44
+ isItemMatch: RelationBoundState<boolean>;
45
+ };
46
+ getDefaultValue(): boolean;
47
+ compute({ _current }: {
48
+ _current: any;
49
+ }): Promise<boolean>;
50
+ incrementalCompute(lastValue: boolean, mutationEvent: EtityMutationEvent): Promise<boolean>;
51
+ }
52
+ //# sourceMappingURL=Any.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Any.d.ts","sourceRoot":"","sources":["../../../src/runtime/computedDataHandles/Any.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAY,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGxD,qBAAa,eAAgB,YAAW,oBAAoB;IAKrC,UAAU,EAAE,UAAU;IAA4C,WAAW,EAAE,WAAW;IAJ7G,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,KAAK,OAAO,CAAA;IAClD,KAAK,EAAG,UAAU,CAAC,OAAO,IAAI,CAAC,WAAW,CAA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