@reventlessdev/reventless-core 3.0.0-alpha.296 → 3.0.0-alpha.298

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.
@@ -17,6 +17,7 @@ import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js
17
17
  import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.js";
18
18
  import * as DcbDecode$Reventless from "@reventlessdev/reventless-spec/src/components/DcbDecode.res.mjs";
19
19
  import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
20
+ import * as OwnerScope$Reventless from "@reventlessdev/reventless-spec/src/types/OwnerScope.res.mjs";
20
21
  import * as Message$ReventlessCore from "../../Message.res.mjs";
21
22
  import * as Component$ReventlessCore from "../Component.res.mjs";
22
23
  import * as EventTopic$ReventlessCore from "../EventTopic/EventTopic.res.mjs";
@@ -35,6 +36,7 @@ function Make(RuntimeEnvironment) {
35
36
  let queryDbName = Spec.name + "Todo";
36
37
  let moduleUrl = import.meta.url;
37
38
  let config = ReadModel$Reventless.config(undefined, undefined, undefined);
39
+ let authorization = OwnerScope$Reventless.operators();
38
40
  let SpecificQueryDb = QueryDb_Builder$ReventlessCore.Make({
39
41
  Id: Id$Reventless.$$String,
40
42
  name: queryDbName,
@@ -42,7 +44,7 @@ function Make(RuntimeEnvironment) {
42
44
  stateSchema: OutboundTranslationSlice_Callback$ReventlessCore.todoRowSchema,
43
45
  config: config,
44
46
  subIdConfig: undefined,
45
- authorization: "AllowAuthenticated",
47
+ authorization: authorization,
46
48
  visibility: "Public"
47
49
  })(QueryDbStorage)(QueryDbResolvers);
48
50
  let SpecificEventCollector = EventCollector_Builder$ReventlessCore.Make(RuntimeEnvironment)(EventCollectorChannel);
@@ -146,6 +146,7 @@ module PsTwoRuleFeed = {
146
146
  @schema type command = AddProduct({sku: string}) | AddCategory({sku: string})
147
147
  let targetName = "AddProduct"
148
148
  let externalSystem = None
149
+ let endpoint = None
149
150
  type role = Reventless.Role.name
150
151
  let authorizationOf = (name: string): Reventless.Authorization.rule<role> =>
151
152
  switch name {
@@ -178,6 +178,8 @@ globalThis.describe("requiredAccess derived from the authorization rule", () =>
178
178
  });
179
179
  });
180
180
 
181
+ let name = "PsTwoRuleFeed";
182
+
181
183
  let moduleUrl = "ps-two-rule-feed://spec";
182
184
 
183
185
  let externalInputSchema = Sury.$schema(s => ({
@@ -195,6 +197,8 @@ let commandSchema = Sury.union([
195
197
  }))
196
198
  ]);
197
199
 
200
+ let targetName = "AddProduct";
201
+
198
202
  function authorizationOf(name) {
199
203
  switch (name) {
200
204
  case "AddCategory" :
@@ -215,12 +219,13 @@ function authorizationOf(name) {
215
219
  let traits = [];
216
220
 
217
221
  let PsTwoRuleFeed = {
218
- name: "PsTwoRuleFeed",
222
+ name: name,
219
223
  moduleUrl: moduleUrl,
220
224
  externalInputSchema: externalInputSchema,
221
225
  commandSchema: commandSchema,
222
- targetName: "AddProduct",
226
+ targetName: targetName,
223
227
  externalSystem: undefined,
228
+ endpoint: undefined,
224
229
  authorizationOf: authorizationOf,
225
230
  traits: traits
226
231
  };
@@ -241,8 +246,19 @@ function make$3(param, param$1, param$2) {
241
246
  return 0;
242
247
  }
243
248
 
249
+ let PsTwoRuleFeedSlice_Spec = {
250
+ name: name,
251
+ moduleUrl: moduleUrl,
252
+ externalInputSchema: externalInputSchema,
253
+ commandSchema: commandSchema,
254
+ targetName: targetName,
255
+ externalSystem: undefined,
256
+ authorizationOf: authorizationOf,
257
+ endpoint: undefined
258
+ };
259
+
244
260
  let PsTwoRuleFeedSlice = {
245
- Spec: PsTwoRuleFeed,
261
+ Spec: PsTwoRuleFeedSlice_Spec,
246
262
  Translation: Translation,
247
263
  queryDbName: "PsTwoRuleFeedAudit",
248
264
  make: make$3