@freelog/freelog-cg-collection 1.2.12 → 1.2.14

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 (151) hide show
  1. package/dist/model/exp/FunctionCallInfo.d.ts +5 -7
  2. package/dist/model/exp-condition/ExpCondition.d.ts +6 -8
  3. package/dist/model/policy/ActionInfo.d.ts +1 -0
  4. package/dist/model/policy/PolicyInfo.d.ts +25 -26
  5. package/dist/resources/context_config/event_configs.json +126 -0
  6. package/dist/src/calculator/CalculatorFactory.d.ts +17 -0
  7. package/dist/src/calculator/CalculatorFactory.js +40 -0
  8. package/dist/src/calculator/CalculatorFactoryBuilder.d.ts +4 -0
  9. package/dist/src/calculator/CalculatorFactoryBuilder.js +13 -0
  10. package/dist/src/calculator/ExpArgsGroupCalculator.d.ts +12 -0
  11. package/dist/src/calculator/ExpArgsGroupCalculator.js +25 -0
  12. package/dist/src/calculator/ExpBooleanCalculator.d.ts +13 -0
  13. package/dist/src/calculator/ExpBooleanCalculator.js +81 -0
  14. package/dist/src/calculator/ExpCalculator.d.ts +17 -0
  15. package/dist/src/calculator/ExpCalculator.js +56 -0
  16. package/dist/src/calculator/ExpCollectionCalculator.d.ts +0 -0
  17. package/dist/src/calculator/ExpCollectionCalculator.js +1 -0
  18. package/dist/src/calculator/ExpConditionCalculator.d.ts +12 -0
  19. package/dist/src/calculator/ExpConditionCalculator.js +34 -0
  20. package/dist/src/contract-declaration-executor/DefaultContractDeclarationExecutor.d.ts +8 -0
  21. package/dist/src/contract-declaration-executor/DefaultContractDeclarationExecutor.js +13 -0
  22. package/dist/src/contract-declaration-executor/DynamicContractDeclarationExecutor.d.ts +7 -0
  23. package/dist/src/contract-declaration-executor/DynamicContractDeclarationExecutor.js +21 -0
  24. package/dist/src/contract-declaration-executor/USEContractDeclaration.d.ts +4 -0
  25. package/dist/src/contract-declaration-executor/USEContractDeclaration.js +23 -0
  26. package/dist/src/function-executor/ApiFunctionExecutor.d.ts +11 -0
  27. package/dist/src/function-executor/ApiFunctionExecutor.js +17 -0
  28. package/dist/src/function-executor/DefaultFunctionExecutor.d.ts +11 -0
  29. package/dist/src/function-executor/DefaultFunctionExecutor.js +19 -0
  30. package/dist/src/function-executor/DynamicFunctionExecutor.d.ts +13 -0
  31. package/dist/src/function-executor/DynamicFunctionExecutor.js +58 -0
  32. package/dist/src/function-executor/FunFunctionExecutor.d.ts +15 -0
  33. package/dist/src/function-executor/FunFunctionExecutor.js +48 -0
  34. package/dist/src/function-executor/KitFunctionExecutor.d.ts +9 -0
  35. package/dist/src/function-executor/KitFunctionExecutor.js +32 -0
  36. package/dist/src/function-executor/QueryFunctionExecutor.d.ts +40 -0
  37. package/dist/src/function-executor/QueryFunctionExecutor.js +42 -0
  38. package/dist/src/function-executor/TimeFunctionExecutor.d.ts +8 -0
  39. package/dist/src/function-executor/TimeFunctionExecutor.js +51 -0
  40. package/dist/src/helper/ContractDeclarationHelper.d.ts +7 -0
  41. package/dist/src/helper/ContractDeclarationHelper.js +28 -0
  42. package/dist/src/helper/ExpHelper.d.ts +16 -0
  43. package/dist/src/helper/ExpHelper.js +86 -0
  44. package/dist/src/helper/FunctionHelper.d.ts +41 -0
  45. package/dist/src/helper/FunctionHelper.js +161 -0
  46. package/dist/src/helper/GetPostHelper.d.ts +5 -0
  47. package/dist/src/helper/GetPostHelper.js +13 -0
  48. package/dist/src/helper/PolicyHelper.d.ts +102 -0
  49. package/dist/src/helper/PolicyHelper.js +519 -0
  50. package/dist/src/interface/Calculator.d.ts +5 -0
  51. package/dist/src/interface/Calculator.js +3 -0
  52. package/dist/src/interface/ConstantForApi.d.ts +12 -0
  53. package/dist/src/interface/ConstantForApi.js +17 -0
  54. package/dist/src/interface/ContractDeclarationExecute.d.ts +3 -0
  55. package/dist/src/interface/ContractDeclarationExecute.js +3 -0
  56. package/dist/src/interface/ExpHelperAware.d.ts +4 -0
  57. package/dist/src/interface/ExpHelperAware.js +3 -0
  58. package/dist/src/interface/FunctionHelperAware.d.ts +4 -0
  59. package/dist/src/interface/FunctionHelperAware.js +3 -0
  60. package/dist/src/interface/FunctionInvoke.d.ts +4 -0
  61. package/dist/src/interface/FunctionInvoke.js +3 -0
  62. package/dist/src/interface/GetPostInvoke.d.ts +4 -0
  63. package/dist/src/interface/GetPostInvoke.js +3 -0
  64. package/dist/src/interface/OutsideApiServiceAware.d.ts +4 -0
  65. package/dist/src/interface/OutsideApiServiceAware.js +3 -0
  66. package/dist/src/interface/VarContextCapable.d.ts +3 -0
  67. package/dist/src/interface/VarContextCapable.js +3 -0
  68. package/dist/src/model/AssignmentClauseInfo.d.ts +3 -0
  69. package/dist/src/model/AssignmentClauseInfo.js +3 -0
  70. package/dist/src/model/contract-declaration/VarContractDeclarationInfo.d.ts +17 -0
  71. package/dist/src/model/contract-declaration/VarContractDeclarationInfo.js +3 -0
  72. package/dist/src/model/exp/EntityInfo.d.ts +6 -0
  73. package/dist/src/model/exp/EntityInfo.js +3 -0
  74. package/dist/src/model/exp/Exp.d.ts +3 -0
  75. package/dist/src/model/exp/Exp.js +3 -0
  76. package/dist/src/model/exp/ExpAtom.d.ts +3 -0
  77. package/dist/src/model/exp/ExpAtom.js +3 -0
  78. package/dist/src/model/exp/ExpOp.d.ts +7 -0
  79. package/dist/src/model/exp/ExpOp.js +3 -0
  80. package/dist/src/model/exp/ExpParen.d.ts +5 -0
  81. package/dist/src/model/exp/ExpParen.js +3 -0
  82. package/dist/src/model/exp/ExpSigned.d.ts +6 -0
  83. package/dist/src/model/exp/ExpSigned.js +3 -0
  84. package/dist/src/model/exp/FunctionCallInfo.d.ts +12 -0
  85. package/dist/src/model/exp/FunctionCallInfo.js +3 -0
  86. package/dist/src/model/exp/NumberInfo.d.ts +5 -0
  87. package/dist/src/model/exp/NumberInfo.js +3 -0
  88. package/dist/src/model/exp/StringInfo.d.ts +5 -0
  89. package/dist/src/model/exp/StringInfo.js +3 -0
  90. package/dist/src/model/exp/VariableChainInfo.d.ts +6 -0
  91. package/dist/src/model/exp/VariableChainInfo.js +3 -0
  92. package/dist/src/model/exp-args-group/ExpArgsGroup.d.ts +9 -0
  93. package/dist/src/model/exp-args-group/ExpArgsGroup.js +3 -0
  94. package/dist/src/model/exp-boolean/BooleanInfo.d.ts +5 -0
  95. package/dist/src/model/exp-boolean/BooleanInfo.js +3 -0
  96. package/dist/src/model/exp-boolean/ExpBoolean.d.ts +3 -0
  97. package/dist/src/model/exp-boolean/ExpBoolean.js +3 -0
  98. package/dist/src/model/exp-boolean/ExpBooleanAtom.d.ts +3 -0
  99. package/dist/src/model/exp-boolean/ExpBooleanAtom.js +3 -0
  100. package/dist/src/model/exp-boolean/ExpBooleanOpCollection.d.ts +7 -0
  101. package/dist/src/model/exp-boolean/ExpBooleanOpCollection.js +3 -0
  102. package/dist/src/model/exp-boolean/ExpBooleanOpCompare.d.ts +7 -0
  103. package/dist/src/model/exp-boolean/ExpBooleanOpCompare.js +3 -0
  104. package/dist/src/model/exp-boolean/ExpBooleanOpLogic.d.ts +7 -0
  105. package/dist/src/model/exp-boolean/ExpBooleanOpLogic.js +3 -0
  106. package/dist/src/model/exp-boolean/ExpBooleanParen.d.ts +5 -0
  107. package/dist/src/model/exp-boolean/ExpBooleanParen.js +3 -0
  108. package/dist/src/model/exp-collection/ExpCollection.d.ts +9 -0
  109. package/dist/src/model/exp-collection/ExpCollection.js +3 -0
  110. package/dist/src/model/exp-condition/ExpCondition.d.ts +11 -0
  111. package/dist/src/model/exp-condition/ExpCondition.js +3 -0
  112. package/dist/src/model/policy/ActionInfo.d.ts +20 -0
  113. package/dist/src/model/policy/ActionInfo.js +3 -0
  114. package/dist/src/model/policy/ContractDeclarationInfo.d.ts +7 -0
  115. package/dist/src/model/policy/ContractDeclarationInfo.js +7 -0
  116. package/dist/src/model/policy/EventInfo.d.ts +27 -0
  117. package/dist/src/model/policy/EventInfo.js +3 -0
  118. package/dist/src/model/policy/PolicyInfo.d.ts +32 -0
  119. package/dist/src/model/policy/PolicyInfo.js +3 -0
  120. package/dist/src/model/policy/VarDeclarationInfo.d.ts +10 -0
  121. package/dist/src/model/policy/VarDeclarationInfo.js +3 -0
  122. package/dist/src/service/OutsideApiService.d.ts +58 -0
  123. package/dist/src/service/OutsideApiService.js +62 -0
  124. package/dist/src/state-machine/ContractFsmHook.d.ts +17 -0
  125. package/dist/src/state-machine/ContractFsmHook.js +33 -0
  126. package/dist/src/state-machine/ContractStateMachine.d.ts +51 -0
  127. package/dist/src/state-machine/ContractStateMachine.js +190 -0
  128. package/dist/src/tools/PolicyDecompiler.d.ts +26 -0
  129. package/dist/src/tools/PolicyDecompiler.js +298 -0
  130. package/dist/src/tools/PolicyMapper.d.ts +3 -0
  131. package/dist/src/tools/PolicyMapper.js +83 -0
  132. package/dist/tools/PolicyDecompiler.d.ts +26 -0
  133. package/dist/tools/PolicyDecompiler.js +298 -0
  134. package/dist/tools/PolicyMapper.d.ts +3 -0
  135. package/dist/tools/PolicyMapper.js +81 -0
  136. package/index.js +5 -0
  137. package/package.json +1 -1
  138. package/resources/zhaojn.json +1947 -7
  139. package/resources/zhaojn.sc +58 -2
  140. package/resources/zhaojn2.json +61 -113
  141. package/resources/zhaojn3.json +76 -0
  142. package/src/model/exp/FunctionCallInfo.ts +2 -2
  143. package/src/model/exp-condition/ExpCondition.ts +2 -2
  144. package/src/model/policy/ActionInfo.ts +1 -1
  145. package/src/model/policy/PolicyInfo.ts +28 -22
  146. package/src/tools/PolicyDecompiler.ts +329 -0
  147. package/src/tools/PolicyMapper.ts +80 -0
  148. package/test/library/MomentTest.test.ts +12 -0
  149. package/test/tools/PolicyDecompilerTest.test.ts +9 -0
  150. package/test/tools/PolicyMapperTest.test.ts +15 -0
  151. package/tsconfig.json +2 -0
@@ -1,4 +1,60 @@
1
- FOR PUBLIC
1
+ // 所有人都可以签该策略,所以身份信息不在签约时判定,下面的echoSubject = echoSubject和echoPolicyId = echoCorePolicyId可以不写,因为它需要和labels一起使用,来判断某用户组是否有某标签
2
+ FOR USER(echoSubject = echoSubject, echoPolicyId = echoCorePolicyId, labels = ["vip1"])
3
+ USE &Contract(subject = Echo.<连载小说的会员>, policyId = echoCorePolicyId, licensee = contract.licensee) AS membership
2
4
 
3
- Initial Full:
5
+ labels0 = Query.EchoService.Labels({"subject":echoSubject, "policyId":echoCorePolicyId, "licensee":contract.licensee})
6
+
7
+ echoSubject <- Echo.<连载小说的会员>
8
+
9
+ echoCorePolicyId = "xxx连载小说会员的主策略ID"
10
+
11
+ unitPrice <- (+1)
12
+
13
+ setUnlocked = []
14
+
15
+ setTemp = []
16
+
17
+ setFree = []
18
+
19
+ defExpr s2CalculateExpr(sumAmounts, discount1, discount2) = [
20
+ sumAmounts greater 10000 : discount1 * (sumAmounts - 10000) + discount2 * 7500,
21
+ sumAmounts greater 2500 and sumAmounts lessOrEqual 10000 : discount2 * (sumAmounts - 2500),
22
+ 0]
23
+
24
+ Initial None:
25
+ let labels = Query.EchoService.Labels({"subject":echoSubject, "licensee":contract.licensee})
26
+ // Event.Void("vip1" in labels) -> AUTH_VIP1
27
+ // Event.Void(not ("vip1" in labels)) -> AUTH_MEMBER
28
+ // Event.Echo.Labels({"subject":echoSubject, "licensee":contract.licensee, "label":"vip1"}) -> AUTH_VIP1
29
+ Event.Void(not ("vip2" in labels)) -> AUTH_MEMBER{fun.setLabel({"label":"vip2", "ttl":7200})}
30
+
31
+ AUTH_MEMBER Partial{setUnlocked, setTemp}:
32
+ Event.Transaction.Pay(amount = unitPrice, elemsNum = 1) -> AUTH_MEMBER{fun.addElements(setUnlocked, contract.licenseeSelectedElems, false)}
33
+ Event.Transaction.Pay(amount = unitPrice * 10 * 0.8, elemsNum = 10) -> AUTH_MEMBER{fun.addElements(setUnlocked, contract.licenseeSelectedElems, false)}
34
+ Event.Custom.AcceptEvent({"title":"MembershipChange", "subject":echoSubject, "label":"vip1"}) -> AUTH_VIP1
35
+
36
+ Event.Custom.WatchAD(elemsNum = 1) -> AUTH_MEMBER{fun.addElements(setTemp, contract.licenseeSelectedElems, false)}
37
+ Event.Time.Schedule(Time.AddTime(Time.GetTime(Time.Now(), "day"), 1, "day")) -> AUTH_MEMBER{fun.clearElems(setTemp)}
38
+
39
+ AUTH_VIP1 Partial{setUnlocked, setTemp, setFree}:
40
+ let a = 1
41
+ let b = []
42
+ a = 3
43
+ Event.Transaction.Pay(amount = unitPrice * 0.75, elemsNum = 1) -> AUTH_VIP1{fun.addElements(setUnlocked, contract.licenseeSelectedElems, false)}
44
+ Event.Transaction.Pay(amount = unitPrice * 10 * 0.6, elemsNum = 10) -> AUTH_VIP1{fun.addElements(setUnlocked, contract.licenseeSelectedElems, false)}
45
+ Event.Custom.AcceptEvent({"title":"MembershipChange", "subject":echoSubject, "label":"member"}) -> AUTH_MEMBER
46
+
47
+ Event.Custom.WatchAD(elemsNum = 1) -> AUTH_VIP1{fun.addElements(setTemp, contract.licenseeSelectedElems, false)}
48
+ Event.Time.Schedule(Time.AddTime(Time.GetTime(Time.Now(), "day"), 1, "day")) -> AUTH_VIP1{fun.clearElems(setTemp)}
49
+
50
+ Event.Transaction.Pay(amount = 0, elemsNum = 1) -> FREE_UNLOCK_ROUTE[elems:contract.licenseeSelectedElems]{a = 2; b = fun.addElements(b, [a], false);Kit.Min(1, 2)}
51
+ Event.Time.Schedule(Time.AddTime(Time.GetTime(Time.Now(), "month"), 1, "month")) -> AUTH_VIP1{fun.clearElems(setFree)}
52
+
53
+ // 一个中间态来实现if-else的功能
54
+ FREE_UNLOCK_ROUTE None[elems]:
55
+ let freeUnlockedSize = Kit.Array.Size(setFree)
56
+ Event.Void(freeUnlockedSize < 4) -> AUTH_VIP1{fun.addElements(setFree, elems, false)}
57
+ Event.Void(freeUnlockedSize >= 4) -> AUTH_VIP1
58
+
59
+ ABC:
4
60
  terminate
@@ -1,125 +1,73 @@
1
1
  {
2
- "audienceInfo": {
2
+ "state_machine": {
3
3
  "audiences": [
4
- "USER"
5
- ],
6
- "condition": {
7
- "echoSubject": {
8
- "expType": "entity",
9
- "entityType": "Echo",
10
- "entityName": "连载小说的会员",
11
- "variableChainList": []
12
- },
13
- "echoPolicyId": "xxx连载小说会员的主策略ID",
14
- "labels": [
15
- "vip1"
16
- ]
17
- }
18
- },
19
- "varContractDeclarationList": [],
20
- "varGlobalList": [
21
- {
22
- "varName": "policy.subject",
23
- "varValue": {
24
- "expType": "entity",
25
- "entityType": "Resource",
26
- "entityName": "12345676789/haohaoxuexi"
27
- }
28
- },
29
- {
30
- "varName": "policy.policyId",
31
- "varValue": "694e2a95b5a8cc1a4ca11924"
32
- },
33
- {
34
- "varName": "contract.contractId",
35
- "varValue": "69a6a68490e845dce6b08e05"
36
- },
37
- {
38
- "varName": "contract.licensee",
39
- "varValue": {
40
- "expType": "entity",
41
- "entityType": "User",
42
- "entityName": "zhaojn"
43
- }
44
- },
45
- {
46
- "varName": "contract.licenseeOwner",
47
- "varValue": {
48
- "expType": "entity",
49
- "entityType": "User",
50
- "entityName": "zhaojn"
51
- }
52
- },
53
- {
54
- "varName": "contract.licenseeSelectedElems",
55
- "varValue": []
56
- },
57
- {
58
- "varName": "echoCorePolicyId",
59
- "varValue": "xxx连载小说会员的主策略ID"
60
- },
61
- {
62
- "varName": "labels0",
63
- "varValue": [
64
- "vip1"
65
- ]
66
- },
67
- {
68
- "varName": "setUnlocked",
69
- "varValue": []
70
- },
71
- {
72
- "varName": "setTemp",
73
- "varValue": []
74
- },
75
- {
76
- "varName": "setFree",
77
- "varValue": []
78
- }
79
- ],
80
- "currentStateInfo": {
81
- "currentState": "Initial",
82
- "currentServiceState": "None",
83
- "serviceStateCollection": [],
84
- "varLocalAtStateList": [],
85
- "varLocalCurrentStateList": [
86
4
  {
87
- "varName": "labels",
88
- "varValue": [
89
- "vip1"
90
- ]
5
+ "name": "public",
6
+ "type": "public"
91
7
  }
92
8
  ],
93
- "currentEventInfos": [
94
- {
95
- "eventType": "normal",
96
- "eventCode": "V101",
97
- "eventName": "Void",
98
- "eventId": "b3449b02",
99
- "varLocalAtEventList": [
100
- {
101
- "varName": "condition",
102
- "varValue": true
103
- }
104
- ]
105
- },
106
- {
107
- "eventType": "normal",
108
- "eventCode": "T201",
109
- "eventPath": "Time",
110
- "eventName": "Relative",
111
- "eventId": "04e9cfdc",
112
- "varLocalAtEventList": [
9
+ "subjectIcon": {},
10
+ "declarations": {
11
+ "serviceStates": [
12
+ {
13
+ "name": "active",
14
+ "type": "authorization"
15
+ }
16
+ ]
17
+ },
18
+ "states": {
19
+ "initial": {
20
+ "transitions": [
113
21
  {
114
- "varName": "elapsed",
115
- "varValue": 1
22
+ "toState": "auth",
23
+ "service": "freelog",
24
+ "name": "TransactionEvent",
25
+ "args": {
26
+ "amount": 1.9,
27
+ "account": "self.account"
28
+ },
29
+ "code": "S201",
30
+ "description": "one time transaction",
31
+ "isSingleton": true,
32
+ "id": "a2da448a"
116
33
  },
117
34
  {
118
- "varName": "timeUnit",
119
- "varValue": "minute"
35
+ "toState": "finish",
36
+ "service": "freelog",
37
+ "name": "TimeEvent",
38
+ "args": {
39
+ "dateTime": "2024-12-31 00:00"
40
+ },
41
+ "code": "A102",
42
+ "description": "fired on a pre-determined time",
43
+ "isSingleton": false,
44
+ "id": "c656f9cb"
120
45
  }
46
+ ],
47
+ "serviceStates": [],
48
+ "isInitial": true
49
+ },
50
+ "auth": {
51
+ "transitions": [],
52
+ "serviceStates": [
53
+ "active"
121
54
  ]
55
+ },
56
+ "finish": {
57
+ "transitions": [],
58
+ "serviceStates": []
122
59
  }
123
- ]
124
- }
60
+ },
61
+ "description": {
62
+ "symbolArgs": {
63
+ "envArgs": [
64
+ "self.account"
65
+ ]
66
+ }
67
+ }
68
+ },
69
+ "warnings": [],
70
+ "warningObjects": [],
71
+ "errors": [],
72
+ "errorObjects": []
125
73
  }
@@ -0,0 +1,76 @@
1
+ {
2
+ "audienceSection": {
3
+ "conditions": [],
4
+ "audiences": [
5
+ "PUBLIC"
6
+ ]
7
+ },
8
+ "contractDeclarationSection": {
9
+ "contractDeclarations": []
10
+ },
11
+ "varDeclarationList": [],
12
+ "stateMachine": [
13
+ {
14
+ "stateName": "Initial",
15
+ "serviceStateSection": {},
16
+ "events": [
17
+ {
18
+ "type": "normal",
19
+ "eventName": "Pay",
20
+ "eventPath": "Transaction",
21
+ "eventParamList": [
22
+ {
23
+ "paramValueObj": {
24
+ "expType": "number",
25
+ "value": 1.9
26
+ }
27
+ },
28
+ {
29
+ "paramValueObj": {
30
+ "expType": "number",
31
+ "value": 1
32
+ }
33
+ }
34
+ ],
35
+ "toState": "auth"
36
+ },
37
+ {
38
+ "type": "normal",
39
+ "eventName": "Schedule",
40
+ "eventPath": "Time",
41
+ "eventParamList": [
42
+ {
43
+ "paramValueObj": {
44
+ "expType": "string",
45
+ "value": "2024-12-31 00:00"
46
+ }
47
+ }
48
+ ],
49
+ "toState": "finish"
50
+ }
51
+ ]
52
+ },
53
+ {
54
+ "stateName": "auth",
55
+ "serviceStateSection": {
56
+ "serviceState": "Permit"
57
+ },
58
+ "events": [
59
+ {
60
+ "type": "terminate",
61
+ "eventName": "terminate"
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "stateName": "finish",
67
+ "serviceStateSection": {},
68
+ "events": [
69
+ {
70
+ "type": "terminate",
71
+ "eventName": "terminate"
72
+ }
73
+ ]
74
+ }
75
+ ]
76
+ }
@@ -5,9 +5,9 @@ export interface FunctionCallInfo extends Exp {
5
5
  expType: "functionCall";
6
6
  varChain?: string;
7
7
  funcName: string;
8
- paramList: [{
8
+ paramList: {
9
9
  paramName?: string;
10
10
  paramValue: string;
11
11
  paramValueObj: AssignmentClauseInfo;
12
- }];
12
+ }[];
13
13
  }
@@ -3,10 +3,10 @@ import {ExpBoolean} from "../exp-boolean/ExpBoolean";
3
3
 
4
4
  export interface ExpCondition extends AssignmentClauseInfo {
5
5
  expType: "expCondition";
6
- paramList: [{
6
+ paramList: {
7
7
  paramCondition?: string;
8
8
  paramConditionObj?: ExpBoolean;
9
9
  paramValue: string;
10
10
  paramValueObj: any;
11
- }];
11
+ }[];
12
12
  }
@@ -2,7 +2,7 @@ import {FunctionCallInfo} from "../exp/FunctionCallInfo";
2
2
  import {AssignmentClauseInfo} from "../AssignmentClauseInfo";
3
3
 
4
4
  export interface ActionInfo {
5
-
5
+ type: string;
6
6
  }
7
7
 
8
8
  export interface ActionFunctionCall extends ActionInfo {
@@ -4,27 +4,33 @@ import {AssignmentClauseInfo} from "../AssignmentClauseInfo";
4
4
  import {ContractDeclarationInfo} from "./ContractDeclarationInfo";
5
5
 
6
6
  export interface PolicyInfo {
7
- audienceSection: {
8
- audiences: string[];
9
- conditions: [{
10
- paramName?: string;
11
- paramValue: string;
12
- paramValueObj: AssignmentClauseInfo;
13
- content: string;
14
- }];
15
- };
16
- contractDeclarationSection: {
17
- contractDeclarations: ContractDeclarationInfo[];
18
- };
7
+ audienceSection: AudienceSection;
8
+ contractDeclarationSection: ContractDeclarationSection;
19
9
  varDeclarationList: VarDeclarationInfo[];
20
- stateMachine: [{
21
- stateName: string;
22
- assignments: VarDeclarationInfo[];
23
- events: EventInfo[];
24
- serviceStateSection?: {
25
- serviceState?: string;
26
- serviceStateCollection?: string[];
27
- };
28
- stateContextArgs?: string[];
29
- }];
10
+ stateMachine: StateInfo[];
11
+ }
12
+
13
+ export interface AudienceSection {
14
+ audiences: string[];
15
+ conditions: {
16
+ paramName?: string;
17
+ paramValue: string;
18
+ paramValueObj: AssignmentClauseInfo;
19
+ content: string;
20
+ }[];
30
21
  }
22
+
23
+ export interface ContractDeclarationSection {
24
+ contractDeclarations: ContractDeclarationInfo[];
25
+ }
26
+
27
+ export interface StateInfo {
28
+ stateName: string;
29
+ assignments: VarDeclarationInfo[];
30
+ events: EventInfo[];
31
+ serviceStateSection?: {
32
+ serviceState?: string;
33
+ serviceStateCollection?: string[];
34
+ };
35
+ stateContextArgs?: string[];
36
+ }