@reventlessdev/reventless-gwt 1.0.0-alpha.100
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.
- package/CHANGELOG.md +916 -0
- package/LICENSE +202 -0
- package/bin/reventless-dev.mjs +21 -0
- package/package.json +54 -0
- package/rescript.json +36 -0
- package/src/.gwtignore +10 -0
- package/src/Automation_GWT.res +207 -0
- package/src/Automation_GWT.res.mjs +160 -0
- package/src/Behavior_GWT.res +569 -0
- package/src/Behavior_GWT.res.mjs +523 -0
- package/src/Bind.res +29 -0
- package/src/Bind.res.mjs +22 -0
- package/src/BuildClassifier.res +147 -0
- package/src/BuildClassifier.res.mjs +136 -0
- package/src/Cancellation.res +37 -0
- package/src/Cancellation.res.mjs +46 -0
- package/src/ChildProcess.res +102 -0
- package/src/ChildProcess.res.mjs +107 -0
- package/src/Cli.res +905 -0
- package/src/Cli.res.mjs +952 -0
- package/src/Collector.res +212 -0
- package/src/Collector.res.mjs +218 -0
- package/src/ComponentMeta.res +77 -0
- package/src/ComponentMeta.res.mjs +91 -0
- package/src/ComponentScan.res +103 -0
- package/src/ComponentScan.res.mjs +105 -0
- package/src/Delegate_GWT.res +303 -0
- package/src/Delegate_GWT.res.mjs +372 -0
- package/src/Diff.res +91 -0
- package/src/Diff.res.mjs +98 -0
- package/src/Discovery.res +105 -0
- package/src/Discovery.res.mjs +99 -0
- package/src/DomainDeadCode.res +98 -0
- package/src/DomainDeadCode.res.mjs +72 -0
- package/src/DomainGraph.res +0 -0
- package/src/DomainGraph.res.mjs +0 -0
- package/src/EventMapping_GWT.res +29 -0
- package/src/EventMapping_GWT.res.mjs +44 -0
- package/src/Filter.res +45 -0
- package/src/Filter.res.mjs +47 -0
- package/src/Flow_GWT.res +664 -0
- package/src/Flow_GWT.res.mjs +604 -0
- package/src/FormatterHuman.res +109 -0
- package/src/FormatterHuman.res.mjs +115 -0
- package/src/FormatterJson.res +264 -0
- package/src/FormatterJson.res.mjs +322 -0
- package/src/FormatterJunit.res +93 -0
- package/src/FormatterJunit.res.mjs +90 -0
- package/src/FormatterTap.res +100 -0
- package/src/FormatterTap.res.mjs +131 -0
- package/src/FormatterVsCode.res +352 -0
- package/src/FormatterVsCode.res.mjs +546 -0
- package/src/Hint.res +119 -0
- package/src/Hint.res.mjs +124 -0
- package/src/InboundTranslation_GWT.res +83 -0
- package/src/InboundTranslation_GWT.res.mjs +94 -0
- package/src/JestBind.res +70 -0
- package/src/JestBind.res.mjs +63 -0
- package/src/Loader.res +24 -0
- package/src/Loader.res.mjs +23 -0
- package/src/LocalHost.res +119 -0
- package/src/LocalHost.res.mjs +99 -0
- package/src/Mapping_GWT.res +474 -0
- package/src/Mapping_GWT.res.mjs +322 -0
- package/src/MismatchRender.res +72 -0
- package/src/MismatchRender.res.mjs +127 -0
- package/src/MultiSourceProjection_GWT.res +316 -0
- package/src/MultiSourceProjection_GWT.res.mjs +354 -0
- package/src/OutboundTranslation_GWT.res +238 -0
- package/src/OutboundTranslation_GWT.res.mjs +186 -0
- package/src/Outcome.res +97 -0
- package/src/Outcome.res.mjs +93 -0
- package/src/PackageScan.res +80 -0
- package/src/PackageScan.res.mjs +81 -0
- package/src/PlatformRunner.res +181 -0
- package/src/PlatformRunner.res.mjs +176 -0
- package/src/PlatformScan.res +142 -0
- package/src/PlatformScan.res.mjs +132 -0
- package/src/ProcessManager.res +135 -0
- package/src/ProcessManager.res.mjs +119 -0
- package/src/Projection_GWT.res +312 -0
- package/src/Projection_GWT.res.mjs +332 -0
- package/src/Query_GWT.res +379 -0
- package/src/Query_GWT.res.mjs +367 -0
- package/src/RenderRescript.res +125 -0
- package/src/RenderRescript.res.mjs +141 -0
- package/src/RunWorker.res +24 -0
- package/src/RunWorker.res.mjs +16 -0
- package/src/RunnerTypes.res +68 -0
- package/src/RunnerTypes.res.mjs +60 -0
- package/src/SideEffect_GWT.res +157 -0
- package/src/SideEffect_GWT.res.mjs +113 -0
- package/src/StateChange/ExternalAddCategorySlice.res +25 -0
- package/src/StateChange/ExternalAddCategorySlice.res.mjs +34 -0
- package/src/StateChange/ExternalAddCategorySlice_Behavior.res +19 -0
- package/src/StateChange/ExternalAddCategorySlice_Behavior.res.mjs +46 -0
- package/src/StateChange/WithFixtures.res +22 -0
- package/src/StateChange/WithFixtures.res.mjs +31 -0
- package/src/StateChange/WithFixtures_Behavior.res +17 -0
- package/src/StateChange/WithFixtures_Behavior.res.mjs +37 -0
- package/src/StateChange/WithManualOpen.res +23 -0
- package/src/StateChange/WithManualOpen.res.mjs +31 -0
- package/src/StateChange/WithManualOpen_Behavior.res +17 -0
- package/src/StateChange/WithManualOpen_Behavior.res.mjs +37 -0
- package/src/StubRuntime.res +54 -0
- package/src/StubRuntime.res.mjs +55 -0
- package/src/TestFixtures.res +16 -0
- package/src/TestFixtures.res.mjs +34 -0
- package/src/Watch.res +108 -0
- package/src/Watch.res.mjs +85 -0
- package/src/WatcherProbe.res +56 -0
- package/src/WatcherProbe.res.mjs +59 -0
- package/src/Worker.res +24 -0
- package/src/Worker.res.mjs +9 -0
- package/tests/AutomationGwtTest.res +71 -0
- package/tests/AutomationGwtTest.res.mjs +189 -0
- package/tests/BuildClassifierTest.res +133 -0
- package/tests/BuildClassifierTest.res.mjs +176 -0
- package/tests/CliRunEntryTest.res +57 -0
- package/tests/CliRunEntryTest.res.mjs +65 -0
- package/tests/CliWatchScopeTest.res +62 -0
- package/tests/CliWatchScopeTest.res.mjs +95 -0
- package/tests/ComponentMetaTest.res +67 -0
- package/tests/ComponentMetaTest.res.mjs +71 -0
- package/tests/DelegateGwtTest.res +487 -0
- package/tests/DelegateGwtTest.res.mjs +891 -0
- package/tests/DiscoveryTest.res +42 -0
- package/tests/DiscoveryTest.res.mjs +43 -0
- package/tests/DomainDeadCodeTest.res +119 -0
- package/tests/DomainDeadCodeTest.res.mjs +158 -0
- package/tests/DomainGraphTest.res +448 -0
- package/tests/DomainGraphTest.res.mjs +505 -0
- package/tests/FlowAggregateGwtTest.res +171 -0
- package/tests/FlowAggregateGwtTest.res.mjs +273 -0
- package/tests/FlowCrossPluginGwtTest.res +340 -0
- package/tests/FlowCrossPluginGwtTest.res.mjs +798 -0
- package/tests/FlowGwtTest.res +222 -0
- package/tests/FlowGwtTest.res.mjs +433 -0
- package/tests/FormatterGoldenTest.res +125 -0
- package/tests/FormatterGoldenTest.res.mjs +162 -0
- package/tests/FormatterVsCodeMessageTest.res +41 -0
- package/tests/FormatterVsCodeMessageTest.res.mjs +42 -0
- package/tests/InboundTranslationGwtTest.res +34 -0
- package/tests/InboundTranslationGwtTest.res.mjs +99 -0
- package/tests/LocalHostIntegration.res +70 -0
- package/tests/LocalHostIntegration.res.mjs +64 -0
- package/tests/LocalHostTest.res +71 -0
- package/tests/LocalHostTest.res.mjs +63 -0
- package/tests/MappingGwtTest.res +350 -0
- package/tests/MappingGwtTest.res.mjs +596 -0
- package/tests/OutboundTranslationGwtTest.res +59 -0
- package/tests/OutboundTranslationGwtTest.res.mjs +139 -0
- package/tests/PlatformRunnerTest.res +66 -0
- package/tests/PlatformRunnerTest.res.mjs +85 -0
- package/tests/PlatformScanTest.res +61 -0
- package/tests/PlatformScanTest.res.mjs +56 -0
- package/tests/QueryGwtTest.res +161 -0
- package/tests/QueryGwtTest.res.mjs +314 -0
- package/tests/QueryResolverGwtTest.res +71 -0
- package/tests/QueryResolverGwtTest.res.mjs +136 -0
- package/tests/RunnerUnitTest.res +219 -0
- package/tests/RunnerUnitTest.res.mjs +244 -0
- package/tests/SideEffect/FakeOrderNotification.res +23 -0
- package/tests/SideEffect/FakeOrderNotification.res.mjs +36 -0
- package/tests/SideEffect/FakeOrderNotificationGwtTest.res +35 -0
- package/tests/SideEffect/FakeOrderNotificationGwtTest.res.mjs +73 -0
- package/tests/SideEffect/MockEmail.res +18 -0
- package/tests/SideEffect/MockEmail.res.mjs +47 -0
- package/tests/StateChange/ExternalAddCategorySlice_GWT.res +27 -0
- package/tests/StateChange/ExternalAddCategorySlice_GWT.res.mjs +70 -0
- package/tests/StateChange/WithFixtures_Fixtures.res +9 -0
- package/tests/StateChange/WithFixtures_Fixtures.res.mjs +20 -0
- package/tests/StateChange/WithFixtures_GWT.res +23 -0
- package/tests/StateChange/WithFixtures_GWT.res.mjs +56 -0
- package/tests/StateChange/WithManualOpen_Fixtures.res +7 -0
- package/tests/StateChange/WithManualOpen_Fixtures.res.mjs +20 -0
- package/tests/StateChange/WithManualOpen_GWT.res +17 -0
- package/tests/StateChange/WithManualOpen_GWT.res.mjs +56 -0
- package/tests/StateChangeSliceGwtTest.res +160 -0
- package/tests/StateChangeSliceGwtTest.res.mjs +280 -0
- package/tests/StateViewSliceGwtTest.res +64 -0
- package/tests/StateViewSliceGwtTest.res.mjs +161 -0
- package/tests/WatchDebounceTest.res +106 -0
- package/tests/WatchDebounceTest.res.mjs +128 -0
|
@@ -0,0 +1,891 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as S from "sury/src/S.res.mjs";
|
|
4
|
+
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
5
|
+
import * as Delegate_GWT$ReventlessGwt from "../src/Delegate_GWT.res.mjs";
|
|
6
|
+
|
|
7
|
+
S.enableJson();
|
|
8
|
+
|
|
9
|
+
let commandSchema = S.literal("NoCommand");
|
|
10
|
+
|
|
11
|
+
let eventSchema = S.union([
|
|
12
|
+
S.schema(s => ({
|
|
13
|
+
TAG: "ProductBecameAvailable",
|
|
14
|
+
productId: s.m(S.string),
|
|
15
|
+
name: s.m(S.string),
|
|
16
|
+
price: s.m(S.float)
|
|
17
|
+
})),
|
|
18
|
+
S.schema(s => ({
|
|
19
|
+
TAG: "ProductPriceChanged",
|
|
20
|
+
productId: s.m(S.string),
|
|
21
|
+
price: s.m(S.float)
|
|
22
|
+
}))
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
let directiveSchema = S.literal("NoDirective");
|
|
26
|
+
|
|
27
|
+
function commandAuthorization(param) {
|
|
28
|
+
return "AllowAuthenticated";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let ProductsEpSpec = {
|
|
32
|
+
name: "Catalog.Products",
|
|
33
|
+
moduleUrl: "",
|
|
34
|
+
commandSchema: commandSchema,
|
|
35
|
+
eventSchema: eventSchema,
|
|
36
|
+
directiveSchema: directiveSchema,
|
|
37
|
+
commandAuthorization: commandAuthorization
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
let name = "Product";
|
|
41
|
+
|
|
42
|
+
let commandSchema$1 = S.literal("NoCommand");
|
|
43
|
+
|
|
44
|
+
let eventSchema$1 = S.union([
|
|
45
|
+
S.schema(s => ({
|
|
46
|
+
TAG: "ProductAdded",
|
|
47
|
+
productId: s.m(S.string),
|
|
48
|
+
name: s.m(S.string),
|
|
49
|
+
price: s.m(S.float)
|
|
50
|
+
})),
|
|
51
|
+
S.schema(s => ({
|
|
52
|
+
TAG: "ProductPriceChanged",
|
|
53
|
+
productId: s.m(S.string),
|
|
54
|
+
price: s.m(S.float)
|
|
55
|
+
}))
|
|
56
|
+
]);
|
|
57
|
+
|
|
58
|
+
let errorSchema = S.literal("NoError");
|
|
59
|
+
|
|
60
|
+
let moduleUrl = "";
|
|
61
|
+
|
|
62
|
+
function commandAuthorization$1(param) {
|
|
63
|
+
return "AllowAuthenticated";
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let ProductDelegate = {
|
|
67
|
+
Id: undefined,
|
|
68
|
+
name: name,
|
|
69
|
+
commandSchema: commandSchema$1,
|
|
70
|
+
eventSchema: eventSchema$1,
|
|
71
|
+
errorSchema: errorSchema,
|
|
72
|
+
moduleUrl: moduleUrl,
|
|
73
|
+
commandAuthorization: commandAuthorization$1
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
let moduleUrl$1 = "test:DelegateGwtTest:ProductsEpMapping";
|
|
77
|
+
|
|
78
|
+
function mapIncomingCommand(_id, _command, _meta) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
let mapOutgoingEvent = (_id, event, _meta, _queryEngine) => {
|
|
83
|
+
if (event.TAG === "ProductAdded") {
|
|
84
|
+
let productId = event.productId;
|
|
85
|
+
return [{
|
|
86
|
+
TAG: "PublishEvent",
|
|
87
|
+
_0: productId,
|
|
88
|
+
_1: {
|
|
89
|
+
TAG: "ProductBecameAvailable",
|
|
90
|
+
productId: productId,
|
|
91
|
+
name: event.name,
|
|
92
|
+
price: event.price
|
|
93
|
+
}
|
|
94
|
+
}];
|
|
95
|
+
}
|
|
96
|
+
let productId$1 = event.productId;
|
|
97
|
+
return [{
|
|
98
|
+
TAG: "PublishEvent",
|
|
99
|
+
_0: productId$1,
|
|
100
|
+
_1: {
|
|
101
|
+
TAG: "ProductPriceChanged",
|
|
102
|
+
productId: productId$1,
|
|
103
|
+
price: event.price
|
|
104
|
+
}
|
|
105
|
+
}];
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
let ProductsEpMapping = {
|
|
109
|
+
ExtensionPoint: undefined,
|
|
110
|
+
Delegate: undefined,
|
|
111
|
+
moduleUrl: moduleUrl$1,
|
|
112
|
+
mapIncomingCommand: mapIncomingCommand,
|
|
113
|
+
mapOutgoingEvent: mapOutgoingEvent
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
let ProductsEpGwt = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
|
|
117
|
+
ExtensionPoint: ProductsEpSpec,
|
|
118
|
+
Delegate: {
|
|
119
|
+
Id: {
|
|
120
|
+
schema: Id$Reventless.StringPure.schema,
|
|
121
|
+
make: prim => prim,
|
|
122
|
+
makeFromString: prim => prim,
|
|
123
|
+
toString: prim => prim,
|
|
124
|
+
cmp: Id$Reventless.StringPure.cmp
|
|
125
|
+
},
|
|
126
|
+
name: name,
|
|
127
|
+
eventSchema: eventSchema$1,
|
|
128
|
+
errorSchema: errorSchema,
|
|
129
|
+
commandSchema: commandSchema$1,
|
|
130
|
+
moduleUrl: moduleUrl,
|
|
131
|
+
commandAuthorization: commandAuthorization$1
|
|
132
|
+
},
|
|
133
|
+
moduleUrl: moduleUrl$1,
|
|
134
|
+
mapIncomingCommand: mapIncomingCommand,
|
|
135
|
+
mapOutgoingEvent: mapOutgoingEvent
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
ProductsEpGwt.describe("Products ExtensionPoint mapping (FromExtensionPoint)", () => {
|
|
139
|
+
ProductsEpGwt.test("ProductAdded publishes ProductBecameAvailable", undefined, () => ProductsEpGwt.thenPublishesEvent(ProductsEpGwt.whenDelegateEvent({
|
|
140
|
+
TAG: "ProductAdded",
|
|
141
|
+
productId: "p1",
|
|
142
|
+
name: "Book",
|
|
143
|
+
price: 9.99
|
|
144
|
+
}), "p1", {
|
|
145
|
+
TAG: "ProductBecameAvailable",
|
|
146
|
+
productId: "p1",
|
|
147
|
+
name: "Book",
|
|
148
|
+
price: 9.99
|
|
149
|
+
}));
|
|
150
|
+
ProductsEpGwt.test("ProductPriceChanged publishes ProductPriceChanged", undefined, () => ProductsEpGwt.thenPublishesEvent(ProductsEpGwt.whenDelegateEvent({
|
|
151
|
+
TAG: "ProductPriceChanged",
|
|
152
|
+
productId: "p1",
|
|
153
|
+
price: 7.5
|
|
154
|
+
}), "p1", {
|
|
155
|
+
TAG: "ProductPriceChanged",
|
|
156
|
+
productId: "p1",
|
|
157
|
+
price: 7.5
|
|
158
|
+
}));
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
let commandSchema$2 = S.literal("NoCommand");
|
|
162
|
+
|
|
163
|
+
let eventSchema$2 = S.union([
|
|
164
|
+
S.schema(s => ({
|
|
165
|
+
TAG: "ItemOrdered",
|
|
166
|
+
productId: s.m(S.string),
|
|
167
|
+
orderId: s.m(S.string),
|
|
168
|
+
customerId: s.m(S.string)
|
|
169
|
+
})),
|
|
170
|
+
S.schema(s => ({
|
|
171
|
+
TAG: "ItemOrderCancelled",
|
|
172
|
+
productId: s.m(S.string),
|
|
173
|
+
orderId: s.m(S.string)
|
|
174
|
+
}))
|
|
175
|
+
]);
|
|
176
|
+
|
|
177
|
+
let directiveSchema$1 = S.literal("NoDirective");
|
|
178
|
+
|
|
179
|
+
function commandAuthorization$2(param) {
|
|
180
|
+
return "AllowAuthenticated";
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
let OrdersEpSpec = {
|
|
184
|
+
name: "Ordering.Orders",
|
|
185
|
+
moduleUrl: "",
|
|
186
|
+
commandSchema: commandSchema$2,
|
|
187
|
+
eventSchema: eventSchema$2,
|
|
188
|
+
directiveSchema: directiveSchema$1,
|
|
189
|
+
commandAuthorization: commandAuthorization$2
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
let name$1 = "Order";
|
|
193
|
+
|
|
194
|
+
let commandSchema$3 = S.literal("NoCommand");
|
|
195
|
+
|
|
196
|
+
let eventSchema$3 = S.union([
|
|
197
|
+
S.schema(s => ({
|
|
198
|
+
TAG: "OrderPlaced",
|
|
199
|
+
orderId: s.m(S.string),
|
|
200
|
+
customerId: s.m(S.string),
|
|
201
|
+
productIds: s.m(S.array(S.string))
|
|
202
|
+
})),
|
|
203
|
+
S.schema(s => ({
|
|
204
|
+
TAG: "OrderCancelled",
|
|
205
|
+
orderId: s.m(S.string),
|
|
206
|
+
productIds: s.m(S.array(S.string))
|
|
207
|
+
}))
|
|
208
|
+
]);
|
|
209
|
+
|
|
210
|
+
let errorSchema$1 = S.literal("NoError");
|
|
211
|
+
|
|
212
|
+
let moduleUrl$2 = "";
|
|
213
|
+
|
|
214
|
+
function commandAuthorization$3(param) {
|
|
215
|
+
return "AllowAuthenticated";
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
let OrderDelegate = {
|
|
219
|
+
Id: undefined,
|
|
220
|
+
name: name$1,
|
|
221
|
+
commandSchema: commandSchema$3,
|
|
222
|
+
eventSchema: eventSchema$3,
|
|
223
|
+
errorSchema: errorSchema$1,
|
|
224
|
+
moduleUrl: moduleUrl$2,
|
|
225
|
+
commandAuthorization: commandAuthorization$3
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
let moduleUrl$3 = "test:DelegateGwtTest:OrdersEpMapping";
|
|
229
|
+
|
|
230
|
+
function mapIncomingCommand$1(_id, _command, _meta) {
|
|
231
|
+
return [];
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
let mapOutgoingEvent$1 = (_id, event, _meta, _queryEngine) => {
|
|
235
|
+
if (event.TAG === "OrderPlaced") {
|
|
236
|
+
let customerId = event.customerId;
|
|
237
|
+
let orderId = event.orderId;
|
|
238
|
+
return event.productIds.map(pid => ({
|
|
239
|
+
TAG: "PublishEvent",
|
|
240
|
+
_0: pid,
|
|
241
|
+
_1: {
|
|
242
|
+
TAG: "ItemOrdered",
|
|
243
|
+
productId: pid,
|
|
244
|
+
orderId: orderId,
|
|
245
|
+
customerId: customerId
|
|
246
|
+
}
|
|
247
|
+
}));
|
|
248
|
+
}
|
|
249
|
+
let orderId$1 = event.orderId;
|
|
250
|
+
return event.productIds.map(pid => ({
|
|
251
|
+
TAG: "PublishEvent",
|
|
252
|
+
_0: pid,
|
|
253
|
+
_1: {
|
|
254
|
+
TAG: "ItemOrderCancelled",
|
|
255
|
+
productId: pid,
|
|
256
|
+
orderId: orderId$1
|
|
257
|
+
}
|
|
258
|
+
}));
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
let OrdersEpMapping = {
|
|
262
|
+
ExtensionPoint: undefined,
|
|
263
|
+
Delegate: undefined,
|
|
264
|
+
moduleUrl: moduleUrl$3,
|
|
265
|
+
mapIncomingCommand: mapIncomingCommand$1,
|
|
266
|
+
mapOutgoingEvent: mapOutgoingEvent$1
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
let OrdersEpGwt = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
|
|
270
|
+
ExtensionPoint: OrdersEpSpec,
|
|
271
|
+
Delegate: {
|
|
272
|
+
Id: {
|
|
273
|
+
schema: Id$Reventless.StringPure.schema,
|
|
274
|
+
make: prim => prim,
|
|
275
|
+
makeFromString: prim => prim,
|
|
276
|
+
toString: prim => prim,
|
|
277
|
+
cmp: Id$Reventless.StringPure.cmp
|
|
278
|
+
},
|
|
279
|
+
name: name$1,
|
|
280
|
+
eventSchema: eventSchema$3,
|
|
281
|
+
errorSchema: errorSchema$1,
|
|
282
|
+
commandSchema: commandSchema$3,
|
|
283
|
+
moduleUrl: moduleUrl$2,
|
|
284
|
+
commandAuthorization: commandAuthorization$3
|
|
285
|
+
},
|
|
286
|
+
moduleUrl: moduleUrl$3,
|
|
287
|
+
mapIncomingCommand: mapIncomingCommand$1,
|
|
288
|
+
mapOutgoingEvent: mapOutgoingEvent$1
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
OrdersEpGwt.describe("Orders ExtensionPoint mapping — fan-out", () => {
|
|
292
|
+
OrdersEpGwt.test("OrderPlaced fans out to one ItemOrdered per product", undefined, () => OrdersEpGwt.thenPublishesEvents(OrdersEpGwt.whenDelegateEvent({
|
|
293
|
+
TAG: "OrderPlaced",
|
|
294
|
+
orderId: "o1",
|
|
295
|
+
customerId: "c1",
|
|
296
|
+
productIds: [
|
|
297
|
+
"p1",
|
|
298
|
+
"p2"
|
|
299
|
+
]
|
|
300
|
+
}), [
|
|
301
|
+
[
|
|
302
|
+
"p1",
|
|
303
|
+
{
|
|
304
|
+
TAG: "ItemOrdered",
|
|
305
|
+
productId: "p1",
|
|
306
|
+
orderId: "o1",
|
|
307
|
+
customerId: "c1"
|
|
308
|
+
}
|
|
309
|
+
],
|
|
310
|
+
[
|
|
311
|
+
"p2",
|
|
312
|
+
{
|
|
313
|
+
TAG: "ItemOrdered",
|
|
314
|
+
productId: "p2",
|
|
315
|
+
orderId: "o1",
|
|
316
|
+
customerId: "c1"
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
]));
|
|
320
|
+
OrdersEpGwt.test("OrderPlaced with no products publishes nothing", undefined, () => OrdersEpGwt.thenPublishesNothing(OrdersEpGwt.whenDelegateEvent({
|
|
321
|
+
TAG: "OrderPlaced",
|
|
322
|
+
orderId: "o2",
|
|
323
|
+
customerId: "c1",
|
|
324
|
+
productIds: []
|
|
325
|
+
})));
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
let name$2 = "SyncCatalogProduct";
|
|
329
|
+
|
|
330
|
+
let commandSchema$4 = S.union([
|
|
331
|
+
S.schema(s => ({
|
|
332
|
+
TAG: "SyncNewProduct",
|
|
333
|
+
productId: s.m(S.string),
|
|
334
|
+
name: s.m(S.string),
|
|
335
|
+
price: s.m(S.float)
|
|
336
|
+
})),
|
|
337
|
+
S.schema(s => ({
|
|
338
|
+
TAG: "ChangeSyncedPrice",
|
|
339
|
+
productId: s.m(S.string),
|
|
340
|
+
price: s.m(S.float)
|
|
341
|
+
}))
|
|
342
|
+
]);
|
|
343
|
+
|
|
344
|
+
let eventSchema$4 = S.literal("NoEvent");
|
|
345
|
+
|
|
346
|
+
let errorSchema$2 = S.literal("NoError");
|
|
347
|
+
|
|
348
|
+
let moduleUrl$4 = "";
|
|
349
|
+
|
|
350
|
+
function commandAuthorization$4(param) {
|
|
351
|
+
return "AllowAuthenticated";
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
let SyncDelegate = {
|
|
355
|
+
Id: undefined,
|
|
356
|
+
name: name$2,
|
|
357
|
+
commandSchema: commandSchema$4,
|
|
358
|
+
eventSchema: eventSchema$4,
|
|
359
|
+
errorSchema: errorSchema$2,
|
|
360
|
+
moduleUrl: moduleUrl$4,
|
|
361
|
+
commandAuthorization: commandAuthorization$4
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
let moduleUrl$5 = "";
|
|
365
|
+
|
|
366
|
+
let delegateModuleUrl = "";
|
|
367
|
+
|
|
368
|
+
function mapIncomingEvent(_id, event, _meta, _pluginDef, _queryEngine) {
|
|
369
|
+
if (event.TAG === "ProductBecameAvailable") {
|
|
370
|
+
return [{
|
|
371
|
+
TAG: "PublishStateChangeSliceCommand",
|
|
372
|
+
_0: {
|
|
373
|
+
TAG: "SyncNewProduct",
|
|
374
|
+
productId: event.productId,
|
|
375
|
+
name: event.name,
|
|
376
|
+
price: event.price
|
|
377
|
+
}
|
|
378
|
+
}];
|
|
379
|
+
} else {
|
|
380
|
+
return [{
|
|
381
|
+
TAG: "PublishStateChangeSliceCommand",
|
|
382
|
+
_0: {
|
|
383
|
+
TAG: "ChangeSyncedPrice",
|
|
384
|
+
productId: event.productId,
|
|
385
|
+
price: event.price
|
|
386
|
+
}
|
|
387
|
+
}];
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
let ProductsExtMapping = {
|
|
392
|
+
ExtensionPoint: undefined,
|
|
393
|
+
Delegate: undefined,
|
|
394
|
+
moduleUrl: moduleUrl$5,
|
|
395
|
+
delegateModuleUrl: delegateModuleUrl,
|
|
396
|
+
mapIncomingEvent: mapIncomingEvent,
|
|
397
|
+
mapOutgoingEvent: undefined
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
let ProductsExtGwt = Delegate_GWT$ReventlessGwt.FromExtension({
|
|
401
|
+
ExtensionPoint: ProductsEpSpec,
|
|
402
|
+
Delegate: {
|
|
403
|
+
Id: {
|
|
404
|
+
schema: Id$Reventless.StringPure.schema,
|
|
405
|
+
make: prim => prim,
|
|
406
|
+
makeFromString: prim => prim,
|
|
407
|
+
toString: prim => prim,
|
|
408
|
+
cmp: Id$Reventless.StringPure.cmp
|
|
409
|
+
},
|
|
410
|
+
name: name$2,
|
|
411
|
+
eventSchema: eventSchema$4,
|
|
412
|
+
errorSchema: errorSchema$2,
|
|
413
|
+
commandSchema: commandSchema$4,
|
|
414
|
+
moduleUrl: moduleUrl$4,
|
|
415
|
+
commandAuthorization: commandAuthorization$4
|
|
416
|
+
},
|
|
417
|
+
moduleUrl: moduleUrl$5,
|
|
418
|
+
delegateModuleUrl: delegateModuleUrl,
|
|
419
|
+
mapIncomingEvent: mapIncomingEvent,
|
|
420
|
+
mapOutgoingEvent: undefined
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
ProductsExtGwt.describe("Products Extension delegate (FromExtension)", () => {
|
|
424
|
+
ProductsExtGwt.test("ProductBecameAvailable issues SyncNewProduct", undefined, () => ProductsExtGwt.thenPublishesCommand(ProductsExtGwt.whenIncomingEvent({
|
|
425
|
+
TAG: "ProductBecameAvailable",
|
|
426
|
+
productId: "p1",
|
|
427
|
+
name: "Book",
|
|
428
|
+
price: 9.99
|
|
429
|
+
}), {
|
|
430
|
+
TAG: "SyncNewProduct",
|
|
431
|
+
productId: "p1",
|
|
432
|
+
name: "Book",
|
|
433
|
+
price: 9.99
|
|
434
|
+
}));
|
|
435
|
+
ProductsExtGwt.test("ProductPriceChanged issues ChangeSyncedPrice", undefined, () => ProductsExtGwt.thenPublishesCommand(ProductsExtGwt.whenIncomingEvent({
|
|
436
|
+
TAG: "ProductPriceChanged",
|
|
437
|
+
productId: "p1",
|
|
438
|
+
price: 7.5
|
|
439
|
+
}), {
|
|
440
|
+
TAG: "ChangeSyncedPrice",
|
|
441
|
+
productId: "p1",
|
|
442
|
+
price: 7.5
|
|
443
|
+
}));
|
|
444
|
+
});
|
|
445
|
+
|
|
446
|
+
let commandSchema$5 = S.schema(s => ({
|
|
447
|
+
TAG: "Restock",
|
|
448
|
+
sku: s.m(S.string),
|
|
449
|
+
qty: s.m(S.int)
|
|
450
|
+
}));
|
|
451
|
+
|
|
452
|
+
let eventSchema$5 = S.literal("NoEvent");
|
|
453
|
+
|
|
454
|
+
let directiveSchema$2 = S.literal("NoDirective");
|
|
455
|
+
|
|
456
|
+
function commandAuthorization$5(param) {
|
|
457
|
+
return "AllowAuthenticated";
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
let InventoryEpSpec = {
|
|
461
|
+
name: "Catalog.Inventory",
|
|
462
|
+
moduleUrl: "",
|
|
463
|
+
commandSchema: commandSchema$5,
|
|
464
|
+
eventSchema: eventSchema$5,
|
|
465
|
+
directiveSchema: directiveSchema$2,
|
|
466
|
+
commandAuthorization: commandAuthorization$5
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
let name$3 = "Stock";
|
|
470
|
+
|
|
471
|
+
let commandSchema$6 = S.schema(s => ({
|
|
472
|
+
TAG: "Restock",
|
|
473
|
+
sku: s.m(S.string),
|
|
474
|
+
qty: s.m(S.int)
|
|
475
|
+
}));
|
|
476
|
+
|
|
477
|
+
let eventSchema$6 = S.literal("NoEvent");
|
|
478
|
+
|
|
479
|
+
let errorSchema$3 = S.literal("NoError");
|
|
480
|
+
|
|
481
|
+
let moduleUrl$6 = "";
|
|
482
|
+
|
|
483
|
+
function commandAuthorization$6(param) {
|
|
484
|
+
return "AllowAuthenticated";
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
let StockDelegate = {
|
|
488
|
+
Id: undefined,
|
|
489
|
+
name: name$3,
|
|
490
|
+
commandSchema: commandSchema$6,
|
|
491
|
+
eventSchema: eventSchema$6,
|
|
492
|
+
errorSchema: errorSchema$3,
|
|
493
|
+
moduleUrl: moduleUrl$6,
|
|
494
|
+
commandAuthorization: commandAuthorization$6
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
let moduleUrl$7 = "test:DelegateGwtTest:InventoryEpMapping";
|
|
498
|
+
|
|
499
|
+
function mapIncomingCommand$2(id, command, _meta) {
|
|
500
|
+
return [{
|
|
501
|
+
TAG: "PublishCommand",
|
|
502
|
+
_0: id,
|
|
503
|
+
_1: {
|
|
504
|
+
TAG: "Restock",
|
|
505
|
+
sku: command.sku,
|
|
506
|
+
qty: command.qty
|
|
507
|
+
}
|
|
508
|
+
}];
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
let InventoryEpMapping = {
|
|
512
|
+
ExtensionPoint: undefined,
|
|
513
|
+
Delegate: undefined,
|
|
514
|
+
moduleUrl: moduleUrl$7,
|
|
515
|
+
mapIncomingCommand: mapIncomingCommand$2,
|
|
516
|
+
mapOutgoingEvent: undefined
|
|
517
|
+
};
|
|
518
|
+
|
|
519
|
+
let InventoryEpGwt = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
|
|
520
|
+
ExtensionPoint: InventoryEpSpec,
|
|
521
|
+
Delegate: {
|
|
522
|
+
Id: {
|
|
523
|
+
schema: Id$Reventless.StringPure.schema,
|
|
524
|
+
make: prim => prim,
|
|
525
|
+
makeFromString: prim => prim,
|
|
526
|
+
toString: prim => prim,
|
|
527
|
+
cmp: Id$Reventless.StringPure.cmp
|
|
528
|
+
},
|
|
529
|
+
name: name$3,
|
|
530
|
+
eventSchema: eventSchema$6,
|
|
531
|
+
errorSchema: errorSchema$3,
|
|
532
|
+
commandSchema: commandSchema$6,
|
|
533
|
+
moduleUrl: moduleUrl$6,
|
|
534
|
+
commandAuthorization: commandAuthorization$6
|
|
535
|
+
},
|
|
536
|
+
moduleUrl: moduleUrl$7,
|
|
537
|
+
mapIncomingCommand: mapIncomingCommand$2,
|
|
538
|
+
mapOutgoingEvent: undefined
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
InventoryEpGwt.describe("Inventory ExtensionPoint mapping — incoming command", () => InventoryEpGwt.test("Restock protocol command routes to the Stock delegate", undefined, () => InventoryEpGwt.thenPublishesCommand(InventoryEpGwt.whenIncomingCommand({
|
|
542
|
+
TAG: "Restock",
|
|
543
|
+
sku: "s1",
|
|
544
|
+
qty: 5
|
|
545
|
+
}), "gwt-id", {
|
|
546
|
+
TAG: "Restock",
|
|
547
|
+
sku: "s1",
|
|
548
|
+
qty: 5
|
|
549
|
+
})));
|
|
550
|
+
|
|
551
|
+
let commandSchema$7 = S.schema(s => ({
|
|
552
|
+
TAG: "AckProduct",
|
|
553
|
+
productId: s.m(S.string)
|
|
554
|
+
}));
|
|
555
|
+
|
|
556
|
+
let eventSchema$7 = S.literal("NoEvent");
|
|
557
|
+
|
|
558
|
+
let directiveSchema$3 = S.literal("NoDirective");
|
|
559
|
+
|
|
560
|
+
function commandAuthorization$7(param) {
|
|
561
|
+
return "AllowAuthenticated";
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
let FeedbackEpSpec = {
|
|
565
|
+
name: "Ordering.Feedback",
|
|
566
|
+
moduleUrl: "",
|
|
567
|
+
commandSchema: commandSchema$7,
|
|
568
|
+
eventSchema: eventSchema$7,
|
|
569
|
+
directiveSchema: directiveSchema$3,
|
|
570
|
+
commandAuthorization: commandAuthorization$7
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
let name$4 = "SyncedProduct";
|
|
574
|
+
|
|
575
|
+
let commandSchema$8 = S.literal("NoCommand");
|
|
576
|
+
|
|
577
|
+
let eventSchema$8 = S.schema(s => ({
|
|
578
|
+
TAG: "ProductSynced",
|
|
579
|
+
productId: s.m(S.string)
|
|
580
|
+
}));
|
|
581
|
+
|
|
582
|
+
let errorSchema$4 = S.literal("NoError");
|
|
583
|
+
|
|
584
|
+
let moduleUrl$8 = "";
|
|
585
|
+
|
|
586
|
+
function commandAuthorization$8(param) {
|
|
587
|
+
return "AllowAuthenticated";
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
let SyncedDelegate = {
|
|
591
|
+
Id: undefined,
|
|
592
|
+
name: name$4,
|
|
593
|
+
commandSchema: commandSchema$8,
|
|
594
|
+
eventSchema: eventSchema$8,
|
|
595
|
+
errorSchema: errorSchema$4,
|
|
596
|
+
moduleUrl: moduleUrl$8,
|
|
597
|
+
commandAuthorization: commandAuthorization$8
|
|
598
|
+
};
|
|
599
|
+
|
|
600
|
+
let moduleUrl$9 = "";
|
|
601
|
+
|
|
602
|
+
let delegateModuleUrl$1 = "";
|
|
603
|
+
|
|
604
|
+
function mapIncomingEvent$1(_id, event, _meta, _pluginDef, _queryEngine) {
|
|
605
|
+
return [];
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
let mapOutgoingEvent$2 = (id, event, _meta, _pluginDef) => [{
|
|
609
|
+
TAG: "PublishExtensionPointCommand",
|
|
610
|
+
_0: id,
|
|
611
|
+
_1: {
|
|
612
|
+
TAG: "AckProduct",
|
|
613
|
+
productId: event.productId
|
|
614
|
+
}
|
|
615
|
+
}];
|
|
616
|
+
|
|
617
|
+
let FeedbackExtMapping = {
|
|
618
|
+
ExtensionPoint: undefined,
|
|
619
|
+
Delegate: undefined,
|
|
620
|
+
moduleUrl: moduleUrl$9,
|
|
621
|
+
delegateModuleUrl: delegateModuleUrl$1,
|
|
622
|
+
mapIncomingEvent: mapIncomingEvent$1,
|
|
623
|
+
mapOutgoingEvent: mapOutgoingEvent$2
|
|
624
|
+
};
|
|
625
|
+
|
|
626
|
+
let FeedbackExtGwt = Delegate_GWT$ReventlessGwt.FromExtension({
|
|
627
|
+
ExtensionPoint: FeedbackEpSpec,
|
|
628
|
+
Delegate: {
|
|
629
|
+
Id: {
|
|
630
|
+
schema: Id$Reventless.StringPure.schema,
|
|
631
|
+
make: prim => prim,
|
|
632
|
+
makeFromString: prim => prim,
|
|
633
|
+
toString: prim => prim,
|
|
634
|
+
cmp: Id$Reventless.StringPure.cmp
|
|
635
|
+
},
|
|
636
|
+
name: name$4,
|
|
637
|
+
eventSchema: eventSchema$8,
|
|
638
|
+
errorSchema: errorSchema$4,
|
|
639
|
+
commandSchema: commandSchema$8,
|
|
640
|
+
moduleUrl: moduleUrl$8,
|
|
641
|
+
commandAuthorization: commandAuthorization$8
|
|
642
|
+
},
|
|
643
|
+
moduleUrl: moduleUrl$9,
|
|
644
|
+
delegateModuleUrl: delegateModuleUrl$1,
|
|
645
|
+
mapIncomingEvent: mapIncomingEvent$1,
|
|
646
|
+
mapOutgoingEvent: mapOutgoingEvent$2
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
FeedbackExtGwt.describe("Feedback Extension delegate — outgoing command", () => FeedbackExtGwt.test("ProductSynced publishes the AckProduct protocol command", undefined, () => FeedbackExtGwt.thenPublishesExtensionPointCommand(FeedbackExtGwt.whenDelegateEvent({
|
|
650
|
+
TAG: "ProductSynced",
|
|
651
|
+
productId: "p1"
|
|
652
|
+
}), "gwt-id", {
|
|
653
|
+
TAG: "AckProduct",
|
|
654
|
+
productId: "p1"
|
|
655
|
+
})));
|
|
656
|
+
|
|
657
|
+
let commandSchema$9 = S.literal("NoCommand");
|
|
658
|
+
|
|
659
|
+
let eventSchema$9 = S.schema(s => ({
|
|
660
|
+
TAG: "Pinged",
|
|
661
|
+
productId: s.m(S.string)
|
|
662
|
+
}));
|
|
663
|
+
|
|
664
|
+
let directiveSchema$4 = S.union([
|
|
665
|
+
S.schema(s => ({
|
|
666
|
+
TAG: "NotifyOps",
|
|
667
|
+
channel: s.m(S.string)
|
|
668
|
+
})),
|
|
669
|
+
S.literal("FlushCache")
|
|
670
|
+
]);
|
|
671
|
+
|
|
672
|
+
function commandAuthorization$9(param) {
|
|
673
|
+
return "AllowAuthenticated";
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
let NotifyEpSpec = {
|
|
677
|
+
name: "Catalog.Notify",
|
|
678
|
+
moduleUrl: "",
|
|
679
|
+
commandSchema: commandSchema$9,
|
|
680
|
+
eventSchema: eventSchema$9,
|
|
681
|
+
directiveSchema: directiveSchema$4,
|
|
682
|
+
commandAuthorization: commandAuthorization$9
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
let moduleUrl$10 = "test:DelegateGwtTest:NotifyEpMapping";
|
|
686
|
+
|
|
687
|
+
function handleDirective(_c, _d, _q, _dir) {
|
|
688
|
+
return Promise.resolve();
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
function mapIncomingCommand$3(_id, _command, _meta) {
|
|
692
|
+
return [];
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
let mapOutgoingEvent$3 = (_id, event, _meta, _queryEngine) => {
|
|
696
|
+
if (event.TAG === "ProductAdded") {
|
|
697
|
+
let productId = event.productId;
|
|
698
|
+
return [
|
|
699
|
+
{
|
|
700
|
+
TAG: "PublishEvent",
|
|
701
|
+
_0: productId,
|
|
702
|
+
_1: {
|
|
703
|
+
TAG: "Pinged",
|
|
704
|
+
productId: productId
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
{
|
|
708
|
+
TAG: "HandleDirective",
|
|
709
|
+
_0: handleDirective,
|
|
710
|
+
_1: {
|
|
711
|
+
TAG: "NotifyOps",
|
|
712
|
+
channel: "ops"
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
];
|
|
716
|
+
}
|
|
717
|
+
let productId$1 = event.productId;
|
|
718
|
+
return [{
|
|
719
|
+
TAG: "PublishEvent",
|
|
720
|
+
_0: productId$1,
|
|
721
|
+
_1: {
|
|
722
|
+
TAG: "Pinged",
|
|
723
|
+
productId: productId$1
|
|
724
|
+
}
|
|
725
|
+
}];
|
|
726
|
+
};
|
|
727
|
+
|
|
728
|
+
let NotifyEpMapping = {
|
|
729
|
+
ExtensionPoint: undefined,
|
|
730
|
+
Delegate: undefined,
|
|
731
|
+
moduleUrl: moduleUrl$10,
|
|
732
|
+
handleDirective: handleDirective,
|
|
733
|
+
mapIncomingCommand: mapIncomingCommand$3,
|
|
734
|
+
mapOutgoingEvent: mapOutgoingEvent$3
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
let NotifyEpGwt = Delegate_GWT$ReventlessGwt.FromExtensionPoint({
|
|
738
|
+
ExtensionPoint: NotifyEpSpec,
|
|
739
|
+
Delegate: {
|
|
740
|
+
Id: {
|
|
741
|
+
schema: Id$Reventless.StringPure.schema,
|
|
742
|
+
make: prim => prim,
|
|
743
|
+
makeFromString: prim => prim,
|
|
744
|
+
toString: prim => prim,
|
|
745
|
+
cmp: Id$Reventless.StringPure.cmp
|
|
746
|
+
},
|
|
747
|
+
name: name,
|
|
748
|
+
eventSchema: eventSchema$1,
|
|
749
|
+
errorSchema: errorSchema,
|
|
750
|
+
commandSchema: commandSchema$1,
|
|
751
|
+
moduleUrl: moduleUrl,
|
|
752
|
+
commandAuthorization: commandAuthorization$1
|
|
753
|
+
},
|
|
754
|
+
moduleUrl: moduleUrl$10,
|
|
755
|
+
mapIncomingCommand: mapIncomingCommand$3,
|
|
756
|
+
mapOutgoingEvent: mapOutgoingEvent$3
|
|
757
|
+
});
|
|
758
|
+
|
|
759
|
+
NotifyEpGwt.describe("Notify ExtensionPoint mapping — directives", () => {
|
|
760
|
+
NotifyEpGwt.test("ProductAdded handles the NotifyOps directive", undefined, () => NotifyEpGwt.thenHandlesDirective(NotifyEpGwt.whenDelegateEvent({
|
|
761
|
+
TAG: "ProductAdded",
|
|
762
|
+
productId: "p1",
|
|
763
|
+
name: "Book",
|
|
764
|
+
price: 9.99
|
|
765
|
+
}), {
|
|
766
|
+
TAG: "NotifyOps",
|
|
767
|
+
channel: "ops"
|
|
768
|
+
}));
|
|
769
|
+
NotifyEpGwt.test("ProductAdded still publishes only the Pinged event", undefined, () => NotifyEpGwt.thenPublishesEvent(NotifyEpGwt.whenDelegateEvent({
|
|
770
|
+
TAG: "ProductAdded",
|
|
771
|
+
productId: "p1",
|
|
772
|
+
name: "Book",
|
|
773
|
+
price: 9.99
|
|
774
|
+
}), "p1", {
|
|
775
|
+
TAG: "Pinged",
|
|
776
|
+
productId: "p1"
|
|
777
|
+
}));
|
|
778
|
+
NotifyEpGwt.test("ProductPriceChanged raises no directive", undefined, () => NotifyEpGwt.thenHandlesNoDirective(NotifyEpGwt.whenDelegateEvent({
|
|
779
|
+
TAG: "ProductPriceChanged",
|
|
780
|
+
productId: "p1",
|
|
781
|
+
price: 7.5
|
|
782
|
+
})));
|
|
783
|
+
});
|
|
784
|
+
|
|
785
|
+
let moduleUrl$11 = "";
|
|
786
|
+
|
|
787
|
+
let delegateModuleUrl$2 = "";
|
|
788
|
+
|
|
789
|
+
function handleDirective$1(_dir) {
|
|
790
|
+
return Promise.resolve();
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
function mapIncomingEvent$2(_id, event, _meta, _pluginDef, _queryEngine) {
|
|
794
|
+
return [
|
|
795
|
+
{
|
|
796
|
+
TAG: "PublishStateChangeSliceCommand",
|
|
797
|
+
_0: {
|
|
798
|
+
TAG: "ChangeSyncedPrice",
|
|
799
|
+
productId: event.productId,
|
|
800
|
+
price: 0.0
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
TAG: "HandleDirective",
|
|
805
|
+
_0: handleDirective$1,
|
|
806
|
+
_1: "FlushCache"
|
|
807
|
+
}
|
|
808
|
+
];
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
let NotifyExtMapping = {
|
|
812
|
+
ExtensionPoint: undefined,
|
|
813
|
+
Delegate: undefined,
|
|
814
|
+
moduleUrl: moduleUrl$11,
|
|
815
|
+
delegateModuleUrl: delegateModuleUrl$2,
|
|
816
|
+
handleDirective: handleDirective$1,
|
|
817
|
+
mapIncomingEvent: mapIncomingEvent$2,
|
|
818
|
+
mapOutgoingEvent: undefined
|
|
819
|
+
};
|
|
820
|
+
|
|
821
|
+
let NotifyExtGwt = Delegate_GWT$ReventlessGwt.FromExtension({
|
|
822
|
+
ExtensionPoint: NotifyEpSpec,
|
|
823
|
+
Delegate: {
|
|
824
|
+
Id: {
|
|
825
|
+
schema: Id$Reventless.StringPure.schema,
|
|
826
|
+
make: prim => prim,
|
|
827
|
+
makeFromString: prim => prim,
|
|
828
|
+
toString: prim => prim,
|
|
829
|
+
cmp: Id$Reventless.StringPure.cmp
|
|
830
|
+
},
|
|
831
|
+
name: name$2,
|
|
832
|
+
eventSchema: eventSchema$4,
|
|
833
|
+
errorSchema: errorSchema$2,
|
|
834
|
+
commandSchema: commandSchema$4,
|
|
835
|
+
moduleUrl: moduleUrl$4,
|
|
836
|
+
commandAuthorization: commandAuthorization$4
|
|
837
|
+
},
|
|
838
|
+
moduleUrl: moduleUrl$11,
|
|
839
|
+
delegateModuleUrl: delegateModuleUrl$2,
|
|
840
|
+
mapIncomingEvent: mapIncomingEvent$2,
|
|
841
|
+
mapOutgoingEvent: undefined
|
|
842
|
+
});
|
|
843
|
+
|
|
844
|
+
NotifyExtGwt.describe("Notify Extension delegate — directives", () => {
|
|
845
|
+
NotifyExtGwt.test("Pinged handles the FlushCache directive", undefined, () => NotifyExtGwt.thenHandlesDirective(NotifyExtGwt.whenIncomingEvent({
|
|
846
|
+
TAG: "Pinged",
|
|
847
|
+
productId: "p1"
|
|
848
|
+
}), "FlushCache"));
|
|
849
|
+
NotifyExtGwt.test("Pinged still publishes only the ChangeSyncedPrice command", undefined, () => NotifyExtGwt.thenPublishesCommand(NotifyExtGwt.whenIncomingEvent({
|
|
850
|
+
TAG: "Pinged",
|
|
851
|
+
productId: "p1"
|
|
852
|
+
}), {
|
|
853
|
+
TAG: "ChangeSyncedPrice",
|
|
854
|
+
productId: "p1",
|
|
855
|
+
price: 0.0
|
|
856
|
+
}));
|
|
857
|
+
});
|
|
858
|
+
|
|
859
|
+
let EPM;
|
|
860
|
+
|
|
861
|
+
let EM;
|
|
862
|
+
|
|
863
|
+
export {
|
|
864
|
+
EPM,
|
|
865
|
+
EM,
|
|
866
|
+
ProductsEpSpec,
|
|
867
|
+
ProductDelegate,
|
|
868
|
+
ProductsEpMapping,
|
|
869
|
+
ProductsEpGwt,
|
|
870
|
+
OrdersEpSpec,
|
|
871
|
+
OrderDelegate,
|
|
872
|
+
OrdersEpMapping,
|
|
873
|
+
OrdersEpGwt,
|
|
874
|
+
SyncDelegate,
|
|
875
|
+
ProductsExtMapping,
|
|
876
|
+
ProductsExtGwt,
|
|
877
|
+
InventoryEpSpec,
|
|
878
|
+
StockDelegate,
|
|
879
|
+
InventoryEpMapping,
|
|
880
|
+
InventoryEpGwt,
|
|
881
|
+
FeedbackEpSpec,
|
|
882
|
+
SyncedDelegate,
|
|
883
|
+
FeedbackExtMapping,
|
|
884
|
+
FeedbackExtGwt,
|
|
885
|
+
NotifyEpSpec,
|
|
886
|
+
NotifyEpMapping,
|
|
887
|
+
NotifyEpGwt,
|
|
888
|
+
NotifyExtMapping,
|
|
889
|
+
NotifyExtGwt,
|
|
890
|
+
}
|
|
891
|
+
/* Not a pure module */
|