@reventlessdev/reventless-aws 3.0.0-alpha.231 → 3.0.0-alpha.233
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 +23 -0
- package/package.json +7 -7
- package/src/adapter/Api/AppSyncEventsSigner_Ops.res +137 -0
- package/src/adapter/Api/AppSyncEventsSigner_Ops.res.mjs +121 -0
- package/src/adapter/Api/Platform_AdminScan_Ops.res +136 -0
- package/src/adapter/Api/Platform_AdminScan_Ops.res.mjs +98 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +12 -90
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res.mjs +11 -84
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +86 -0
- package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res.mjs +79 -0
- package/src/adapter/Api/Platform_UIFragments_Lambda.res +9 -79
- package/src/adapter/Api/Platform_UIFragments_Lambda.res.mjs +7 -143
- package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res +48 -0
- package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res.mjs +63 -0
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +21 -80
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res.mjs +23 -68
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res +70 -0
- package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res.mjs +68 -0
- package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res +1 -1
- package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res.mjs +1 -1
- package/src/adapter/Postgres/PgMigration_Builder.res +1 -1
- package/src/adapter/Postgres/PgMigration_Builder.res.mjs +1 -1
- package/src/adapter/Runtime/AutomationSliceEntryPoint.mjs +42 -126
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +246 -0
- package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res.mjs +145 -0
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +27 -2
- package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res.mjs +10 -3
- package/src/adapter/Runtime/CounterEntryPoint.mjs +19 -73
- package/src/adapter/Runtime/CounterEntryPoint_Ops.res +145 -0
- package/src/adapter/Runtime/CounterEntryPoint_Ops.res.mjs +129 -0
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +16 -3
- package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res.mjs +11 -6
- package/src/adapter/Runtime/EventCollectorEntryPoint.mjs +52 -510
- package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res +816 -0
- package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res.mjs +651 -0
- package/src/adapter/Runtime/EventMapperEntryPoint.mjs +23 -67
- package/src/adapter/Runtime/EventMapperEntryPoint_Ops.res +126 -0
- package/src/adapter/Runtime/EventMapperEntryPoint_Ops.res.mjs +83 -0
- package/src/adapter/Runtime/ExtensionPointEntryPoint.mjs +16 -63
- package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res +150 -0
- package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res.mjs +111 -0
- package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res +96 -0
- package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res.mjs +70 -0
- package/src/adapter/Runtime/PgMigrationEntryPoint.res +54 -0
- package/src/adapter/Runtime/PgMigrationEntryPoint.res.mjs +37 -0
- package/src/adapter/Runtime/PgQueryResolverEntryPoint.mjs +20 -55
- package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res +155 -0
- package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res.mjs +94 -0
- package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res +80 -0
- package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res.mjs +39 -0
- package/src/adapter/Runtime/QueryDbEntryPoint_Ops.res +4 -4
- package/src/adapter/Runtime/ReadModelEntryPoint.mjs +34 -153
- package/src/adapter/Runtime/ReadModelEntryPoint_Ops.res +114 -0
- package/src/adapter/Runtime/ReadModelEntryPoint_Ops.res.mjs +83 -0
- package/src/adapter/Runtime/SideEffectEntryPoint.mjs +23 -64
- package/src/adapter/Runtime/SideEffectEntryPoint_Ops.res +71 -0
- package/src/adapter/Runtime/SideEffectEntryPoint_Ops.res.mjs +57 -0
- package/src/adapter/Runtime/StateViewSliceEntryPoint.mjs +34 -165
- package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res +206 -0
- package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res.mjs +105 -0
- package/src/adapter/Runtime/StreamRoutedEntryPoint_Ops.res +156 -0
- package/src/adapter/Runtime/StreamRoutedEntryPoint_Ops.res.mjs +123 -0
- package/src/adapter/Runtime/TaskBucketEntryPoint.mjs +18 -138
- package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res +198 -0
- package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res.mjs +155 -0
- package/src/adapter/StateTopic/StateTopic_AppSync.res +12 -170
- package/src/adapter/StateTopic/StateTopic_AppSync.res.mjs +7 -167
- package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +208 -0
- package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res.mjs +183 -0
- package/src/components/AutomationSlice_Builder.res +2 -0
- package/src/components/AutomationSlice_Builder.res.mjs +1 -1
- package/src/components/OutboundTranslationSlice_Builder.res +1 -0
- package/src/components/OutboundTranslationSlice_Builder.res.mjs +1 -1
- package/tests/AppSyncEventsSigner_OpsTest.res +75 -0
- package/tests/AppSyncEventsSigner_OpsTest.res.mjs +44 -0
- package/tests/AppSyncEventsSigner_ParityFixture.mjs +36 -0
- package/tests/AutomationSliceEntryPoint_OpsTest.res +165 -0
- package/tests/AutomationSliceEntryPoint_OpsTest.res.mjs +280 -0
- package/tests/CounterEntryPoint_OpsTest.res +115 -0
- package/tests/CounterEntryPoint_OpsTest.res.mjs +150 -0
- package/tests/EventCollectorEntryPoint_OpsTest.res +216 -0
- package/tests/EventCollectorEntryPoint_OpsTest.res.mjs +339 -0
- package/tests/EventMapperEntryPoint_OpsTest.res +103 -0
- package/tests/EventMapperEntryPoint_OpsTest.res.mjs +120 -0
- package/tests/ExtensionPointEntryPoint_OpsTest.res +57 -0
- package/tests/ExtensionPointEntryPoint_OpsTest.res.mjs +54 -0
- package/tests/PgMigrationEntryPoint_IntegrationTest.res +22 -31
- package/tests/PgMigrationEntryPoint_IntegrationTest.res.mjs +20 -23
- package/tests/PgQueryResolverEntryPoint_OpsTest.res +38 -0
- package/tests/PgQueryResolverEntryPoint_OpsTest.res.mjs +31 -0
- package/tests/Platform_AdminScan_OpsTest.res +80 -0
- package/tests/Platform_AdminScan_OpsTest.res.mjs +127 -0
- package/tests/ReadModelEntryPoint_OpsTest.res +141 -0
- package/tests/ReadModelEntryPoint_OpsTest.res.mjs +267 -0
- package/tests/SideEffectEntryPoint_OpsTest.res +79 -0
- package/tests/SideEffectEntryPoint_OpsTest.res.mjs +105 -0
- package/tests/StateViewSliceEntryPoint_OpsTest.res +167 -0
- package/tests/StateViewSliceEntryPoint_OpsTest.res.mjs +296 -0
- package/tests/TaskBucketEntryPoint_OpsTest.res +117 -0
- package/tests/TaskBucketEntryPoint_OpsTest.res.mjs +165 -0
- package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res +42 -13
- package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res.mjs +29 -6
- package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.mjs +0 -57
- package/src/adapter/Runtime/PgMigrationEntryPoint.mjs +0 -40
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
4
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
|
+
import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
|
|
6
|
+
import * as EventCollectorEntryPoint_Ops$ReventlessAws from "../src/adapter/Runtime/EventCollectorEntryPoint_Ops.res.mjs";
|
|
7
|
+
|
|
8
|
+
function str(prim) {
|
|
9
|
+
return prim;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function obj(pairs) {
|
|
13
|
+
return Object.fromEntries(pairs);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
globalThis.describe("EventCollectorEntryPoint_Ops.projectPluginRow", () => {
|
|
17
|
+
globalThis.test("rejects a non-object row", () => {
|
|
18
|
+
globalThis.expect(Stdlib_Option.isNone(EventCollectorEntryPoint_Ops$ReventlessAws.projectPluginRow("nope"))).toBe(true);
|
|
19
|
+
});
|
|
20
|
+
globalThis.test("rejects a row missing id or status", () => {
|
|
21
|
+
globalThis.expect(Stdlib_Option.isNone(EventCollectorEntryPoint_Ops$ReventlessAws.projectPluginRow(Object.fromEntries([[
|
|
22
|
+
"status",
|
|
23
|
+
"Connected"
|
|
24
|
+
]])))).toBe(true);
|
|
25
|
+
globalThis.expect(Stdlib_Option.isNone(EventCollectorEntryPoint_Ops$ReventlessAws.projectPluginRow(Object.fromEntries([[
|
|
26
|
+
"id",
|
|
27
|
+
"Catalog@1"
|
|
28
|
+
]])))).toBe(true);
|
|
29
|
+
});
|
|
30
|
+
globalThis.test("projects the id/status/eventCollector subset with defaults", () => {
|
|
31
|
+
let p = Stdlib_Option.getOrThrow(EventCollectorEntryPoint_Ops$ReventlessAws.projectPluginRow(Object.fromEntries([
|
|
32
|
+
[
|
|
33
|
+
"id",
|
|
34
|
+
"Catalog@1"
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
"status",
|
|
38
|
+
"Connected"
|
|
39
|
+
]
|
|
40
|
+
])), undefined);
|
|
41
|
+
globalThis.expect(p.id).toBe("Catalog@1");
|
|
42
|
+
globalThis.expect(p.status).toBe("Connected");
|
|
43
|
+
globalThis.expect(p.eventCollector).toBe("");
|
|
44
|
+
globalThis.expect(p.extensions.length).toBe(0);
|
|
45
|
+
globalThis.expect(p.extensionPoints.length).toBe(0);
|
|
46
|
+
globalThis.expect(Stdlib_Option.isNone(p.dcbEventLog)).toBe(true);
|
|
47
|
+
});
|
|
48
|
+
globalThis.test("decodes extensions, dropping entries without extensionPointName", () => {
|
|
49
|
+
let row = Object.fromEntries([
|
|
50
|
+
[
|
|
51
|
+
"id",
|
|
52
|
+
"Ordering@2"
|
|
53
|
+
],
|
|
54
|
+
[
|
|
55
|
+
"status",
|
|
56
|
+
"Connected"
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
"eventCollector",
|
|
60
|
+
"ec-arn"
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
"extensions",
|
|
64
|
+
[
|
|
65
|
+
Object.fromEntries([
|
|
66
|
+
[
|
|
67
|
+
"name",
|
|
68
|
+
"OrdersExt"
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
"extensionPointName",
|
|
72
|
+
"Catalog.Products"
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"dcbSources",
|
|
76
|
+
[
|
|
77
|
+
"prod",
|
|
78
|
+
7
|
|
79
|
+
]
|
|
80
|
+
]
|
|
81
|
+
]),
|
|
82
|
+
Object.fromEntries([[
|
|
83
|
+
"name",
|
|
84
|
+
"Malformed"
|
|
85
|
+
]])
|
|
86
|
+
]
|
|
87
|
+
]
|
|
88
|
+
]);
|
|
89
|
+
let p = Stdlib_Option.getOrThrow(EventCollectorEntryPoint_Ops$ReventlessAws.projectPluginRow(row), undefined);
|
|
90
|
+
globalThis.expect(p.eventCollector).toBe("ec-arn");
|
|
91
|
+
globalThis.expect(p.extensions.length).toBe(1);
|
|
92
|
+
let e = p.extensions[0];
|
|
93
|
+
globalThis.expect(e.name).toBe("OrdersExt");
|
|
94
|
+
globalThis.expect(e.extensionPointName).toBe("Catalog.Products");
|
|
95
|
+
globalThis.expect(e.dcbSources).toEqual(["prod"]);
|
|
96
|
+
});
|
|
97
|
+
globalThis.test("decodes extensionPoints and dcbEventLog; drops EPs without name/eventTopic", () => {
|
|
98
|
+
let row = Object.fromEntries([
|
|
99
|
+
[
|
|
100
|
+
"id",
|
|
101
|
+
"Catalog@1"
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"status",
|
|
105
|
+
"Connected"
|
|
106
|
+
],
|
|
107
|
+
[
|
|
108
|
+
"extensionPoints",
|
|
109
|
+
[
|
|
110
|
+
Object.fromEntries([
|
|
111
|
+
[
|
|
112
|
+
"name",
|
|
113
|
+
"Catalog.Products"
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
"eventTopic",
|
|
117
|
+
"t-arn"
|
|
118
|
+
]
|
|
119
|
+
]),
|
|
120
|
+
Object.fromEntries([[
|
|
121
|
+
"name",
|
|
122
|
+
"NoTopic"
|
|
123
|
+
]])
|
|
124
|
+
]
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
"dcbEventLog",
|
|
128
|
+
Object.fromEntries([
|
|
129
|
+
[
|
|
130
|
+
"name",
|
|
131
|
+
"catalog-dcb"
|
|
132
|
+
],
|
|
133
|
+
[
|
|
134
|
+
"eventTopicArn",
|
|
135
|
+
"dcb-arn"
|
|
136
|
+
]
|
|
137
|
+
])
|
|
138
|
+
]
|
|
139
|
+
]);
|
|
140
|
+
let p = Stdlib_Option.getOrThrow(EventCollectorEntryPoint_Ops$ReventlessAws.projectPluginRow(row), undefined);
|
|
141
|
+
globalThis.expect(p.extensionPoints.length).toBe(1);
|
|
142
|
+
let ep = p.extensionPoints[0];
|
|
143
|
+
globalThis.expect(ep.name).toBe("Catalog.Products");
|
|
144
|
+
globalThis.expect(ep.commandTopic).toBe("");
|
|
145
|
+
globalThis.expect(ep.eventTopic).toBe("t-arn");
|
|
146
|
+
let dcb = Stdlib_Option.getOrThrow(p.dcbEventLog, undefined);
|
|
147
|
+
globalThis.expect(dcb.name).toBe("catalog-dcb");
|
|
148
|
+
globalThis.expect(dcb.eventTopicArn).toBe("dcb-arn");
|
|
149
|
+
});
|
|
150
|
+
globalThis.test("drops a dcbEventLog missing eventTopicArn", () => {
|
|
151
|
+
let row = Object.fromEntries([
|
|
152
|
+
[
|
|
153
|
+
"id",
|
|
154
|
+
"Catalog@1"
|
|
155
|
+
],
|
|
156
|
+
[
|
|
157
|
+
"status",
|
|
158
|
+
"Connected"
|
|
159
|
+
],
|
|
160
|
+
[
|
|
161
|
+
"dcbEventLog",
|
|
162
|
+
Object.fromEntries([[
|
|
163
|
+
"name",
|
|
164
|
+
"catalog-dcb"
|
|
165
|
+
]])
|
|
166
|
+
]
|
|
167
|
+
]);
|
|
168
|
+
globalThis.expect(Stdlib_Option.isNone(Stdlib_Option.getOrThrow(EventCollectorEntryPoint_Ops$ReventlessAws.projectPluginRow(row), undefined).dcbEventLog)).toBe(true);
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
function minimalConfig(extras) {
|
|
173
|
+
return JSON.stringify(Object.fromEntries([
|
|
174
|
+
[
|
|
175
|
+
"queueUrl",
|
|
176
|
+
"q-url"
|
|
177
|
+
],
|
|
178
|
+
[
|
|
179
|
+
"pluginExtensionPointCmdTopicUrl",
|
|
180
|
+
"ep-url"
|
|
181
|
+
],
|
|
182
|
+
[
|
|
183
|
+
"eventTopicArn",
|
|
184
|
+
"topic-arn"
|
|
185
|
+
],
|
|
186
|
+
[
|
|
187
|
+
"pluginReadModelTableName",
|
|
188
|
+
"plugin-rm"
|
|
189
|
+
],
|
|
190
|
+
[
|
|
191
|
+
"appSyncApiId",
|
|
192
|
+
"NOT_AVAILABLE"
|
|
193
|
+
],
|
|
194
|
+
[
|
|
195
|
+
"schedulerRoleArn",
|
|
196
|
+
"role-arn"
|
|
197
|
+
],
|
|
198
|
+
[
|
|
199
|
+
"schedulerQueueArn",
|
|
200
|
+
""
|
|
201
|
+
],
|
|
202
|
+
[
|
|
203
|
+
"schedulerQueueName",
|
|
204
|
+
""
|
|
205
|
+
],
|
|
206
|
+
[
|
|
207
|
+
"extensionPoints",
|
|
208
|
+
[]
|
|
209
|
+
],
|
|
210
|
+
[
|
|
211
|
+
"extensions",
|
|
212
|
+
[]
|
|
213
|
+
],
|
|
214
|
+
[
|
|
215
|
+
"publishToAggregates",
|
|
216
|
+
Object.fromEntries([])
|
|
217
|
+
]
|
|
218
|
+
].concat(extras)));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function throws(f) {
|
|
222
|
+
try {
|
|
223
|
+
f();
|
|
224
|
+
return;
|
|
225
|
+
} catch (raw_exn) {
|
|
226
|
+
let exn = Primitive_exceptions.internalToException(raw_exn);
|
|
227
|
+
return Stdlib_Option.flatMap(Stdlib_JsExn.fromException(exn), Stdlib_JsExn.message);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
globalThis.describe("EventCollectorEntryPoint_Ops.parseHandlerConfig", () => {
|
|
232
|
+
globalThis.test("throws the named errors for empty / malformed / incomplete config", () => {
|
|
233
|
+
globalThis.expect(throws(() => EventCollectorEntryPoint_Ops$ReventlessAws.parseHandlerConfig(""))).toEqual("HANDLER_CONFIG env var is empty");
|
|
234
|
+
globalThis.expect(Stdlib_Option.mapOr(throws(() => EventCollectorEntryPoint_Ops$ReventlessAws.parseHandlerConfig("{nope")), false, m => m.startsWith("HANDLER_CONFIG JSON parse error:"))).toBe(true);
|
|
235
|
+
globalThis.expect(throws(() => EventCollectorEntryPoint_Ops$ReventlessAws.parseHandlerConfig(`{"queueUrl":"q"}`))).toEqual("HANDLER_CONFIG missing required field: pluginExtensionPointCmdTopicUrl");
|
|
236
|
+
});
|
|
237
|
+
globalThis.test("decodes a minimal config with empty-collection defaults", () => {
|
|
238
|
+
let c = EventCollectorEntryPoint_Ops$ReventlessAws.parseHandlerConfig(minimalConfig([]));
|
|
239
|
+
globalThis.expect(c.queueUrl).toBe("q-url");
|
|
240
|
+
globalThis.expect(Stdlib_Option.isNone(c.connectExtension)).toBe(true);
|
|
241
|
+
globalThis.expect(Object.keys(c.readModelQueueUrls).length).toBe(0);
|
|
242
|
+
globalThis.expect(Object.keys(c.readModelNamesForSourceName).length).toBe(0);
|
|
243
|
+
});
|
|
244
|
+
globalThis.test("connectExtension: JSON null (admin) maps to None; a record decodes", () => {
|
|
245
|
+
let asNull = EventCollectorEntryPoint_Ops$ReventlessAws.parseHandlerConfig(minimalConfig([[
|
|
246
|
+
"connectExtension",
|
|
247
|
+
null
|
|
248
|
+
]]));
|
|
249
|
+
globalThis.expect(Stdlib_Option.isNone(asNull.connectExtension)).toBe(true);
|
|
250
|
+
let asRecord = EventCollectorEntryPoint_Ops$ReventlessAws.parseHandlerConfig(minimalConfig([[
|
|
251
|
+
"connectExtension",
|
|
252
|
+
Object.fromEntries([
|
|
253
|
+
[
|
|
254
|
+
"specModule",
|
|
255
|
+
"spec.mjs"
|
|
256
|
+
],
|
|
257
|
+
[
|
|
258
|
+
"mappingsModule",
|
|
259
|
+
"map.mjs"
|
|
260
|
+
],
|
|
261
|
+
[
|
|
262
|
+
"extensionPointName",
|
|
263
|
+
"Platform.Plugin"
|
|
264
|
+
]
|
|
265
|
+
])
|
|
266
|
+
]]));
|
|
267
|
+
let ce = Stdlib_Option.getOrThrow(asRecord.connectExtension, undefined);
|
|
268
|
+
globalThis.expect(ce.extensionPointName).toBe("Platform.Plugin");
|
|
269
|
+
});
|
|
270
|
+
globalThis.test("extension entries get the former JS normalizer's defaults", () => {
|
|
271
|
+
let c = EventCollectorEntryPoint_Ops$ReventlessAws.parseHandlerConfig(minimalConfig([[
|
|
272
|
+
"extensions",
|
|
273
|
+
[Object.fromEntries([[
|
|
274
|
+
"extensionPointName",
|
|
275
|
+
"Ordering.Orders"
|
|
276
|
+
]])]
|
|
277
|
+
]]));
|
|
278
|
+
let ext = c.extensions[0];
|
|
279
|
+
globalThis.expect(ext.name).toBe("Ordering.Orders");
|
|
280
|
+
globalThis.expect(ext.specModule).toBe("");
|
|
281
|
+
globalThis.expect(ext.aggregateNames).toEqual([]);
|
|
282
|
+
globalThis.expect(ext.readModelNames).toEqual([]);
|
|
283
|
+
});
|
|
284
|
+
globalThis.test("decodes extensionPoints entries and the env-var maps", () => {
|
|
285
|
+
let c = EventCollectorEntryPoint_Ops$ReventlessAws.parseHandlerConfig(minimalConfig([
|
|
286
|
+
[
|
|
287
|
+
"extensionPoints",
|
|
288
|
+
[Object.fromEntries([
|
|
289
|
+
[
|
|
290
|
+
"specModule",
|
|
291
|
+
"s.mjs"
|
|
292
|
+
],
|
|
293
|
+
[
|
|
294
|
+
"mappingsModule",
|
|
295
|
+
"m.mjs"
|
|
296
|
+
],
|
|
297
|
+
[
|
|
298
|
+
"eventTopicArn",
|
|
299
|
+
"arn:ep"
|
|
300
|
+
],
|
|
301
|
+
[
|
|
302
|
+
"aggregateNames",
|
|
303
|
+
["Plugin"]
|
|
304
|
+
]
|
|
305
|
+
])]
|
|
306
|
+
],
|
|
307
|
+
[
|
|
308
|
+
"publishToAggregates",
|
|
309
|
+
Object.fromEntries([[
|
|
310
|
+
"Plugin",
|
|
311
|
+
"PTA_Plugin_QUEUE_URL"
|
|
312
|
+
]])
|
|
313
|
+
],
|
|
314
|
+
[
|
|
315
|
+
"readModelNamesForSourceName",
|
|
316
|
+
Object.fromEntries([[
|
|
317
|
+
"Ordering.Orders",
|
|
318
|
+
["ProductDemands"]
|
|
319
|
+
]])
|
|
320
|
+
]
|
|
321
|
+
]));
|
|
322
|
+
let ep = c.extensionPoints[0];
|
|
323
|
+
globalThis.expect(ep.eventTopicArn).toBe("arn:ep");
|
|
324
|
+
globalThis.expect(ep.aggregateNames).toEqual(["Plugin"]);
|
|
325
|
+
globalThis.expect(c.publishToAggregates["Plugin"]).toEqual("PTA_Plugin_QUEUE_URL");
|
|
326
|
+
globalThis.expect(c.readModelNamesForSourceName["Ordering.Orders"]).toEqual(["ProductDemands"]);
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
let project = EventCollectorEntryPoint_Ops$ReventlessAws.projectPluginRow;
|
|
331
|
+
|
|
332
|
+
export {
|
|
333
|
+
str,
|
|
334
|
+
obj,
|
|
335
|
+
project,
|
|
336
|
+
minimalConfig,
|
|
337
|
+
throws,
|
|
338
|
+
}
|
|
339
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Guards the typed cold-start core hoisted out of EventMapperEntryPoint.mjs:
|
|
2
|
+
// - parseHandlerConfig — the {targetSpecModule, mappingsModule, queueUrl}
|
|
3
|
+
// shape written by AggregateRuntime_Builder_Micro / _Micro_Async.
|
|
4
|
+
// - makeCounterOps — the queryEngine stub shape (the former shell's stub had
|
|
5
|
+
// `query`/`get` fields where QueryEngine.operations needs `scan`/`query`).
|
|
6
|
+
// - makeStreamHandler — the full pipeline: SQS-record body parse →
|
|
7
|
+
// commonEventsHandler → publish of the produced commands.
|
|
8
|
+
|
|
9
|
+
open JestGlobals
|
|
10
|
+
|
|
11
|
+
external toCbRecord: PulumiAws.SQS.Queue.record => PulumiAws.Lambda.CallbackFunction.record =
|
|
12
|
+
"%identity"
|
|
13
|
+
|
|
14
|
+
let sqsRecord = (body: string): PulumiAws.Lambda.CallbackFunction.record =>
|
|
15
|
+
(
|
|
16
|
+
{
|
|
17
|
+
messageId: "m1",
|
|
18
|
+
receiptHandle: "r1",
|
|
19
|
+
body,
|
|
20
|
+
md5OfBody: "",
|
|
21
|
+
eventSource: "aws:sqs",
|
|
22
|
+
eventSourceARN: "arn:aws:sqs:eu-west-1:000000000000:q",
|
|
23
|
+
awsRegion: "eu-west-1",
|
|
24
|
+
}: PulumiAws.SQS.Queue.record
|
|
25
|
+
)->toCbRecord
|
|
26
|
+
|
|
27
|
+
let context: PulumiAws.Lambda.context = {
|
|
28
|
+
callbackWaitsForEmptyEventLoop: false,
|
|
29
|
+
functionName: "test",
|
|
30
|
+
functionVersion: "1",
|
|
31
|
+
invokedFunctionArn: "arn:test",
|
|
32
|
+
memoryLimitInMB: 128,
|
|
33
|
+
awsRequestId: "req-1",
|
|
34
|
+
logGroupName: "lg",
|
|
35
|
+
logStreamName: "ls",
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
describe("EventMapperEntryPoint_Ops.parseHandlerConfig", () => {
|
|
39
|
+
testSync("reads the builder's field names", () => {
|
|
40
|
+
let config = EventMapperEntryPoint_Ops.parseHandlerConfig(
|
|
41
|
+
`{"targetSpecModule":"@x/p/src/Aggregate/Product.res.mjs","mappingsModule":"@x/p/src/Aggregate/Product_Mappings.res.mjs","queueUrl":"https://sqs/q"}`,
|
|
42
|
+
)
|
|
43
|
+
expect(config.targetSpecModule)->toEqual(Some("@x/p/src/Aggregate/Product.res.mjs"))
|
|
44
|
+
expect(config.mappingsModule)->toEqual(Some("@x/p/src/Aggregate/Product_Mappings.res.mjs"))
|
|
45
|
+
expect(config.queueUrl)->toEqual(Some("https://sqs/q"))
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
describe("EventMapperEntryPoint_Ops.makeCounterOps", () => {
|
|
50
|
+
test("queryEngine stubs return empty results instead of crashing", async () => {
|
|
51
|
+
let ops = EventMapperEntryPoint_Ops.makeCounterOps({queueUrl: "https://sqs/q"})
|
|
52
|
+
let scanned = await ops.queryEngine.scan(~readModelName="X", ~filterConfigs=[], ~limit=10)
|
|
53
|
+
expect(scanned->Array.length)->toBe(0)
|
|
54
|
+
let queried = await ops.queryEngine.query(
|
|
55
|
+
~readModelName="X",
|
|
56
|
+
~id=Reventless.QueryEngine.String("a"),
|
|
57
|
+
)
|
|
58
|
+
expect(queried->Array.length)->toBe(0)
|
|
59
|
+
})
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
describe("EventMapperEntryPoint_Ops.makeStreamHandler", () => {
|
|
63
|
+
test("parses SQS bodies, runs commonEventsHandler, publishes produced commands", async () => {
|
|
64
|
+
let received: ref<array<JSON.t>> = ref([])
|
|
65
|
+
let published: ref<array<ReventlessCore.Message.commandJson>> = ref([])
|
|
66
|
+
let ops: EventMapperEntryPoint_Ops.counterOps = {
|
|
67
|
+
publishJsons: async jsons => published := published.contents->Array.concat(jsons),
|
|
68
|
+
queryEngine: {
|
|
69
|
+
scan: async (~readModelName as _, ~filterConfigs as _, ~limit as _) => [],
|
|
70
|
+
query: async (
|
|
71
|
+
~readModelName as _,
|
|
72
|
+
~key as _=?,
|
|
73
|
+
~id as _,
|
|
74
|
+
~subIdConfig as _=?,
|
|
75
|
+
~filterConfigs as _=?,
|
|
76
|
+
~ascending as _=?,
|
|
77
|
+
~limit as _=?,
|
|
78
|
+
) => [],
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
let command: ReventlessCore.Message.commandJson = {
|
|
82
|
+
id: "prd-1",
|
|
83
|
+
meta: ReventlessCore.Message.generateMeta(~service="Product", ~ip="", ~user="test"),
|
|
84
|
+
commandJson: JSON.Encode.string("Add"),
|
|
85
|
+
}
|
|
86
|
+
let commonEventsHandler: EventMapperEntryPoint_Ops.commonEventsHandler = async jsons => {
|
|
87
|
+
received := received.contents->Array.concat(jsons)
|
|
88
|
+
(Promise.resolve([command]), [])
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
let streamHandler = EventMapperEntryPoint_Ops.makeStreamHandler(ops, commonEventsHandler)
|
|
92
|
+
let event: PulumiAws.Lambda.CallbackFunction.event = {
|
|
93
|
+
records: [sqsRecord(`{"id":"e1","event":"Added"}`), sqsRecord("not json")],
|
|
94
|
+
}
|
|
95
|
+
await streamHandler(event, context)->Effect.runPromise
|
|
96
|
+
|
|
97
|
+
// The unparsable body is dropped by the channel decode; the parsed one
|
|
98
|
+
// reaches the mapper and its produced command is published.
|
|
99
|
+
expect(received.contents->Array.length)->toBe(1)
|
|
100
|
+
expect(published.contents->Array.length)->toBe(1)
|
|
101
|
+
expect((published.contents->Array.getUnsafe(0)).id)->toBe("prd-1")
|
|
102
|
+
})
|
|
103
|
+
})
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Message$ReventlessCore from "@reventlessdev/reventless-core/src/Message.res.mjs";
|
|
5
|
+
import * as EventMapperEntryPoint_Ops$ReventlessAws from "../src/adapter/Runtime/EventMapperEntryPoint_Ops.res.mjs";
|
|
6
|
+
|
|
7
|
+
function sqsRecord(body) {
|
|
8
|
+
return {
|
|
9
|
+
messageId: "m1",
|
|
10
|
+
receiptHandle: "r1",
|
|
11
|
+
body: body,
|
|
12
|
+
md5OfBody: "",
|
|
13
|
+
eventSource: "aws:sqs",
|
|
14
|
+
eventSourceARN: "arn:aws:sqs:eu-west-1:000000000000:q",
|
|
15
|
+
awsRegion: "eu-west-1"
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let context = {
|
|
20
|
+
callbackWaitsForEmptyEventLoop: false,
|
|
21
|
+
functionName: "test",
|
|
22
|
+
functionVersion: "1",
|
|
23
|
+
invokedFunctionArn: "arn:test",
|
|
24
|
+
memoryLimitInMB: 128,
|
|
25
|
+
awsRequestId: "req-1",
|
|
26
|
+
logGroupName: "lg",
|
|
27
|
+
logStreamName: "ls"
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
globalThis.describe("EventMapperEntryPoint_Ops.parseHandlerConfig", () => {
|
|
31
|
+
globalThis.test("reads the builder's field names", () => {
|
|
32
|
+
let config = EventMapperEntryPoint_Ops$ReventlessAws.parseHandlerConfig(`{"targetSpecModule":"@x/p/src/Aggregate/Product.res.mjs","mappingsModule":"@x/p/src/Aggregate/Product_Mappings.res.mjs","queueUrl":"https://sqs/q"}`);
|
|
33
|
+
globalThis.expect(config.targetSpecModule).toEqual("@x/p/src/Aggregate/Product.res.mjs");
|
|
34
|
+
globalThis.expect(config.mappingsModule).toEqual("@x/p/src/Aggregate/Product_Mappings.res.mjs");
|
|
35
|
+
globalThis.expect(config.queueUrl).toEqual("https://sqs/q");
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
globalThis.describe("EventMapperEntryPoint_Ops.makeCounterOps", () => {
|
|
40
|
+
globalThis.test("queryEngine stubs return empty results instead of crashing", async () => {
|
|
41
|
+
let ops = EventMapperEntryPoint_Ops$ReventlessAws.makeCounterOps({
|
|
42
|
+
queueUrl: "https://sqs/q"
|
|
43
|
+
});
|
|
44
|
+
let scanned = await ops.queryEngine.scan("X", [], 10);
|
|
45
|
+
globalThis.expect(scanned.length).toBe(0);
|
|
46
|
+
let queried = await ops.queryEngine.query("X", undefined, {
|
|
47
|
+
TAG: "String",
|
|
48
|
+
_0: "a"
|
|
49
|
+
}, undefined, undefined, undefined, undefined);
|
|
50
|
+
globalThis.expect(queried.length).toBe(0);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
globalThis.describe("EventMapperEntryPoint_Ops.makeStreamHandler", () => {
|
|
55
|
+
globalThis.test("parses SQS bodies, runs commonEventsHandler, publishes produced commands", async () => {
|
|
56
|
+
let received = {
|
|
57
|
+
contents: []
|
|
58
|
+
};
|
|
59
|
+
let published = {
|
|
60
|
+
contents: []
|
|
61
|
+
};
|
|
62
|
+
let ops_publishJsons = async jsons => {
|
|
63
|
+
published.contents = published.contents.concat(jsons);
|
|
64
|
+
};
|
|
65
|
+
let ops_queryEngine = {
|
|
66
|
+
scan: async (param, param$1, param$2) => [],
|
|
67
|
+
query: async (param, param$1, param$2, param$3, param$4, param$5, param$6) => []
|
|
68
|
+
};
|
|
69
|
+
let ops = {
|
|
70
|
+
publishJsons: ops_publishJsons,
|
|
71
|
+
queryEngine: ops_queryEngine
|
|
72
|
+
};
|
|
73
|
+
let command_meta = Message$ReventlessCore.generateMeta("Product", "", "test", undefined, undefined, undefined, undefined, undefined);
|
|
74
|
+
let command = {
|
|
75
|
+
id: "prd-1",
|
|
76
|
+
meta: command_meta,
|
|
77
|
+
commandJson: "Add"
|
|
78
|
+
};
|
|
79
|
+
let commonEventsHandler = async jsons => {
|
|
80
|
+
received.contents = received.contents.concat(jsons);
|
|
81
|
+
return [
|
|
82
|
+
Promise.resolve([command]),
|
|
83
|
+
[]
|
|
84
|
+
];
|
|
85
|
+
};
|
|
86
|
+
let streamHandler = EventMapperEntryPoint_Ops$ReventlessAws.makeStreamHandler(ops, commonEventsHandler);
|
|
87
|
+
let event = {
|
|
88
|
+
Records: [
|
|
89
|
+
{
|
|
90
|
+
messageId: "m1",
|
|
91
|
+
receiptHandle: "r1",
|
|
92
|
+
body: `{"id":"e1","event":"Added"}`,
|
|
93
|
+
md5OfBody: "",
|
|
94
|
+
eventSource: "aws:sqs",
|
|
95
|
+
eventSourceARN: "arn:aws:sqs:eu-west-1:000000000000:q",
|
|
96
|
+
awsRegion: "eu-west-1"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
messageId: "m1",
|
|
100
|
+
receiptHandle: "r1",
|
|
101
|
+
body: "not json",
|
|
102
|
+
md5OfBody: "",
|
|
103
|
+
eventSource: "aws:sqs",
|
|
104
|
+
eventSourceARN: "arn:aws:sqs:eu-west-1:000000000000:q",
|
|
105
|
+
awsRegion: "eu-west-1"
|
|
106
|
+
}
|
|
107
|
+
]
|
|
108
|
+
};
|
|
109
|
+
await Effect.runPromise(streamHandler(event, context));
|
|
110
|
+
globalThis.expect(received.contents.length).toBe(1);
|
|
111
|
+
globalThis.expect(published.contents.length).toBe(1);
|
|
112
|
+
globalThis.expect(published.contents[0].id).toBe("prd-1");
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
export {
|
|
117
|
+
sqsRecord,
|
|
118
|
+
context,
|
|
119
|
+
}
|
|
120
|
+
/* Not a pure module */
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// Guards the typed cold-start core hoisted out of ExtensionPointEntryPoint.mjs:
|
|
2
|
+
// - parseHandlerConfig — the {specModule, mappingsModule, queueUrl,
|
|
3
|
+
// publishToAggregates} shape written by
|
|
4
|
+
// ExtensionPointRuntime_Builder_PerExtensionPoint.
|
|
5
|
+
// - makeCallbackSpec — env-var resolution of the per-aggregate publish dict
|
|
6
|
+
// and the stub shapes (the former shell's scheduler/resourceNaming stubs
|
|
7
|
+
// carried wrong field names, crashing with "not a function" instead of the
|
|
8
|
+
// intended error).
|
|
9
|
+
|
|
10
|
+
open JestGlobals
|
|
11
|
+
|
|
12
|
+
@val @scope("process") external processEnv: dict<string> = "env"
|
|
13
|
+
|
|
14
|
+
describe("ExtensionPointEntryPoint_Ops.parseHandlerConfig", () => {
|
|
15
|
+
testSync("reads the builder's field names", () => {
|
|
16
|
+
let config = ExtensionPointEntryPoint_Ops.parseHandlerConfig(
|
|
17
|
+
`{"specModule":"@x/spec/src/Products_ExtensionPoint.res.mjs","mappingsModule":"@x/p/src/ExtensionPoint/Products_ExtensionPointMapping.res.mjs","queueUrl":"https://sqs/ep","publishToAggregates":{"Product":"EP_TEST_PRODUCT_QUEUE"}}`,
|
|
18
|
+
)
|
|
19
|
+
expect(config.specModule)->toEqual(Some("@x/spec/src/Products_ExtensionPoint.res.mjs"))
|
|
20
|
+
expect(config.queueUrl)->toEqual(Some("https://sqs/ep"))
|
|
21
|
+
expect(config.publishToAggregates->Option.flatMap(d => d->Dict.get("Product")))->toEqual(
|
|
22
|
+
Some("EP_TEST_PRODUCT_QUEUE"),
|
|
23
|
+
)
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
describe("ExtensionPointEntryPoint_Ops.makeCallbackSpec", () => {
|
|
28
|
+
testSync("resolves publishToAggregates queue URLs via env vars", () => {
|
|
29
|
+
processEnv->Dict.set("EP_TEST_PRODUCT_QUEUE", "https://sqs/product")
|
|
30
|
+
let spec = ExtensionPointEntryPoint_Ops.makeCallbackSpec({
|
|
31
|
+
queueUrl: "https://sqs/ep",
|
|
32
|
+
publishToAggregates: Dict.fromArray([("Product", "EP_TEST_PRODUCT_QUEUE")]),
|
|
33
|
+
})
|
|
34
|
+
expect(spec.publishToAggregates->Dict.keysToArray)->toEqual(["Product"])
|
|
35
|
+
expect(spec.commandTopicResources->Array.length)->toBe(0)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
testSync("scheduler and queryEngine stubs throw the intended errors", () => {
|
|
39
|
+
let spec = ExtensionPointEntryPoint_Ops.makeCallbackSpec({})
|
|
40
|
+
let scanThrew = switch spec.queryEngine.scan(~readModelName="X", ~filterConfigs=[], ~limit=1) {
|
|
41
|
+
| _ => false
|
|
42
|
+
| exception _ => true
|
|
43
|
+
}
|
|
44
|
+
expect(scanThrew)->toBe(true)
|
|
45
|
+
let deleteThrew = switch spec.scheduler.deleteSchedule([], "s") {
|
|
46
|
+
| _ => false
|
|
47
|
+
| exception _ => true
|
|
48
|
+
}
|
|
49
|
+
expect(deleteThrew)->toBe(true)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
testSync("resourceNaming passes names through", () => {
|
|
53
|
+
let spec = ExtensionPointEntryPoint_Ops.makeCallbackSpec({})
|
|
54
|
+
expect(spec.resourceNaming.validateName("My-Name"))->toBe("My-Name")
|
|
55
|
+
expect(spec.resourceNaming.urnName("arn:x"))->toBe("arn:x")
|
|
56
|
+
})
|
|
57
|
+
})
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
+
|
|
3
|
+
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
4
|
+
import * as ExtensionPointEntryPoint_Ops$ReventlessAws from "../src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res.mjs";
|
|
5
|
+
|
|
6
|
+
globalThis.describe("ExtensionPointEntryPoint_Ops.parseHandlerConfig", () => {
|
|
7
|
+
globalThis.test("reads the builder's field names", () => {
|
|
8
|
+
let config = ExtensionPointEntryPoint_Ops$ReventlessAws.parseHandlerConfig(`{"specModule":"@x/spec/src/Products_ExtensionPoint.res.mjs","mappingsModule":"@x/p/src/ExtensionPoint/Products_ExtensionPointMapping.res.mjs","queueUrl":"https://sqs/ep","publishToAggregates":{"Product":"EP_TEST_PRODUCT_QUEUE"}}`);
|
|
9
|
+
globalThis.expect(config.specModule).toEqual("@x/spec/src/Products_ExtensionPoint.res.mjs");
|
|
10
|
+
globalThis.expect(config.queueUrl).toEqual("https://sqs/ep");
|
|
11
|
+
globalThis.expect(Stdlib_Option.flatMap(config.publishToAggregates, d => d["Product"])).toEqual("EP_TEST_PRODUCT_QUEUE");
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
globalThis.describe("ExtensionPointEntryPoint_Ops.makeCallbackSpec", () => {
|
|
16
|
+
globalThis.test("resolves publishToAggregates queue URLs via env vars", () => {
|
|
17
|
+
process.env["EP_TEST_PRODUCT_QUEUE"] = "https://sqs/product";
|
|
18
|
+
let spec = ExtensionPointEntryPoint_Ops$ReventlessAws.makeCallbackSpec({
|
|
19
|
+
queueUrl: "https://sqs/ep",
|
|
20
|
+
publishToAggregates: Object.fromEntries([[
|
|
21
|
+
"Product",
|
|
22
|
+
"EP_TEST_PRODUCT_QUEUE"
|
|
23
|
+
]])
|
|
24
|
+
});
|
|
25
|
+
globalThis.expect(Object.keys(spec.publishToAggregates)).toEqual(["Product"]);
|
|
26
|
+
globalThis.expect(spec.commandTopicResources.length).toBe(0);
|
|
27
|
+
});
|
|
28
|
+
globalThis.test("scheduler and queryEngine stubs throw the intended errors", () => {
|
|
29
|
+
let spec = ExtensionPointEntryPoint_Ops$ReventlessAws.makeCallbackSpec({});
|
|
30
|
+
let scanThrew;
|
|
31
|
+
try {
|
|
32
|
+
spec.queryEngine.scan("X", [], 1);
|
|
33
|
+
scanThrew = false;
|
|
34
|
+
} catch (exn) {
|
|
35
|
+
scanThrew = true;
|
|
36
|
+
}
|
|
37
|
+
globalThis.expect(scanThrew).toBe(true);
|
|
38
|
+
let deleteThrew;
|
|
39
|
+
try {
|
|
40
|
+
spec.scheduler.deleteSchedule([], "s");
|
|
41
|
+
deleteThrew = false;
|
|
42
|
+
} catch (exn$1) {
|
|
43
|
+
deleteThrew = true;
|
|
44
|
+
}
|
|
45
|
+
globalThis.expect(deleteThrew).toBe(true);
|
|
46
|
+
});
|
|
47
|
+
globalThis.test("resourceNaming passes names through", () => {
|
|
48
|
+
let spec = ExtensionPointEntryPoint_Ops$ReventlessAws.makeCallbackSpec({});
|
|
49
|
+
globalThis.expect(spec.resourceNaming.validateName("My-Name")).toBe("My-Name");
|
|
50
|
+
globalThis.expect(spec.resourceNaming.urnName("arn:x")).toBe("arn:x");
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/* Not a pure module */
|