@reventlessdev/reventless-local 3.0.0-alpha.152 → 3.0.0-alpha.153
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 +7 -0
- package/package.json +10 -10
- package/src/Platform.res +40 -184
- package/src/Platform.res.mjs +54 -353
- package/src/adapter/Api/LocalGraphQL_Adapter.res +1 -11
- package/src/adapter/Api/LocalGraphQL_Adapter.res.mjs +0 -7
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res +6 -6
- package/src/adapter/CommandGenerator/CommandGeneratorResolvers_GraphQL.res.mjs +3 -5
- package/src/adapter/DomainGraphQL_Server.res +323 -131
- package/src/adapter/DomainGraphQL_Server.res.mjs +252 -123
- package/src/adapter/GraphQL_Server.res.mjs +41 -17
- package/tests/adapter/DomainGraphQL_ServerTest.res +161 -0
- package/tests/adapter/DomainGraphQL_ServerTest.res.mjs +192 -0
- package/tests/plugin/ApiFragmentRegistryBehavior_GWT.res +0 -131
- package/tests/plugin/ApiFragmentRegistryBehavior_GWT.res.mjs +0 -268
- package/tests/plugin/ApiFragmentsProjection_GWT.res +0 -108
- package/tests/plugin/ApiFragmentsProjection_GWT.res.mjs +0 -172
package/src/Platform.res.mjs
CHANGED
|
@@ -23,7 +23,6 @@ import * as LocalBus$ReventlessLocal from "./adapter/LocalBus.res.mjs";
|
|
|
23
23
|
import * as Api_Naming$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/Api_Naming.res.mjs";
|
|
24
24
|
import * as PluginSpec$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/lifecycle/PluginSpec.res.mjs";
|
|
25
25
|
import * as UserStore$ReventlessLocal from "./adapter/Auth/UserStore.res.mjs";
|
|
26
|
-
import * as Api_Builder$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/Api_Builder.res.mjs";
|
|
27
26
|
import * as TestRunner$ReventlessLocal from "./test/TestRunner.res.mjs";
|
|
28
27
|
import * as UiFragments$ReventlessCore from "@reventlessdev/reventless-core/src/admin/UiFragmentRegistry/StateViewSlice/UiFragments.res.mjs";
|
|
29
28
|
import * as CommandTopic$ReventlessCore from "@reventlessdev/reventless-core/src/components/CommandTopic/CommandTopic.res.mjs";
|
|
@@ -57,12 +56,9 @@ import * as PgProjectionCatchup$ReventlessLocal from "./adapter/PgProjectionCatc
|
|
|
57
56
|
import * as PluginsReadModelSpec$ReventlessCore from "@reventlessdev/reventless-core/src/plugin/lifecycle/PluginsReadModelSpec.res.mjs";
|
|
58
57
|
import * as DomainGraphQL_Server$ReventlessLocal from "./adapter/DomainGraphQL_Server.res.mjs";
|
|
59
58
|
import * as EventPublish_Callback$ReventlessCore from "@reventlessdev/reventless-core/src/components/EventLog/EventPublish_Callback.res.mjs";
|
|
60
|
-
import * as LocalGraphQL_Adapter$ReventlessLocal from "./adapter/Api/LocalGraphQL_Adapter.res.mjs";
|
|
61
59
|
import * as ProjectionCheckpoint$ReventlessLocal from "./adapter/ProjectionCheckpoint.res.mjs";
|
|
62
|
-
import * as ApiFragmentsProjection$ReventlessCore from "@reventlessdev/reventless-core/src/admin/ApiFragmentRegistry/ApiFragmentsProjection.res.mjs";
|
|
63
60
|
import * as ExtensionPointMapping$ReventlessInfra from "@reventlessdev/reventless-infra/src/types/ExtensionPointMapping.res.mjs";
|
|
64
61
|
import * as UiFragments_Projection$ReventlessCore from "@reventlessdev/reventless-core/src/admin/UiFragmentRegistry/StateViewSlice/UiFragments_Projection.res.mjs";
|
|
65
|
-
import * as ApiFragmentRegistrySpec$ReventlessCore from "@reventlessdev/reventless-core/src/admin/ApiFragmentRegistry/ApiFragmentRegistrySpec.res.mjs";
|
|
66
62
|
import * as EventLogStorage_Sqlite$ReventlessLocal from "./adapter/EventLog/EventLogStorage_Sqlite.res.mjs";
|
|
67
63
|
import * as ExtensionPoint_Builder$ReventlessLocal from "./components/ExtensionPoint_Builder.res.mjs";
|
|
68
64
|
import * as PlatformGraphQL_Server$ReventlessLocal from "./adapter/PlatformGraphQL_Server.res.mjs";
|
|
@@ -73,13 +69,10 @@ import * as LocalDcbEventLogStorage$ReventlessLocal from "./adapter/DcbEventLog/
|
|
|
73
69
|
import * as LocalRuntimeEnvironment$ReventlessLocal from "./adapter/Runtime/LocalRuntimeEnvironment.res.mjs";
|
|
74
70
|
import * as LocalScheduledPublisher$ReventlessLocal from "./adapter/Scheduler/LocalScheduledPublisher.res.mjs";
|
|
75
71
|
import * as Platform_Admin_Structure$ReventlessCore from "@reventlessdev/reventless-core/src/admin/Platform_Admin_Structure.res.mjs";
|
|
76
|
-
import * as Platform_ApiFragmentsApi$ReventlessCore from "@reventlessdev/reventless-core/src/admin/Platform_ApiFragmentsApi.res.mjs";
|
|
77
|
-
import * as ApiFragmentsReadModelSpec$ReventlessCore from "@reventlessdev/reventless-core/src/admin/ApiFragmentRegistry/ApiFragmentsReadModelSpec.res.mjs";
|
|
78
72
|
import * as LocalCommandTopicChannel$ReventlessLocal from "./adapter/CommandTopic/LocalCommandTopicChannel.res.mjs";
|
|
79
73
|
import * as LocalEventTopicPublisher$ReventlessLocal from "./adapter/EventTopic/LocalEventTopicPublisher.res.mjs";
|
|
80
74
|
import * as StateChangeSlice_Builder$ReventlessLocal from "./components/StateChangeSlice_Builder.res.mjs";
|
|
81
75
|
import * as DcbEventLogStorage_Sqlite$ReventlessLocal from "./adapter/DcbEventLog/DcbEventLogStorage_Sqlite.res.mjs";
|
|
82
|
-
import * as ApiFragmentRegistryBehavior$ReventlessCore from "@reventlessdev/reventless-core/src/admin/ApiFragmentRegistry/ApiFragmentRegistryBehavior.res.mjs";
|
|
83
76
|
import * as LocalEventCollectorChannel$ReventlessLocal from "./adapter/EventCollector/LocalEventCollectorChannel.res.mjs";
|
|
84
77
|
import * as PluginRuntime_Builder_Micro$ReventlessCore from "@reventlessdev/reventless-core/src/adapter/Runtime/PluginRuntime_Builder_Micro.res.mjs";
|
|
85
78
|
import * as UiFragmentRegistry_Behavior$ReventlessCore from "@reventlessdev/reventless-core/src/admin/UiFragmentRegistry/StateChangeSlice/UiFragmentRegistry_Behavior.res.mjs";
|
|
@@ -122,14 +115,6 @@ function decodeUiFragmentRegistryEventEnvelope(eventJson) {
|
|
|
122
115
|
}
|
|
123
116
|
}
|
|
124
117
|
|
|
125
|
-
function decodeApiFragmentRegistryEventEnvelope(eventJson) {
|
|
126
|
-
try {
|
|
127
|
-
return Stdlib_Option.map(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(eventJson), d => d["event"]), payload => S.parseJsonOrThrow(payload, ApiFragmentRegistrySpec$ReventlessCore.eventSchema));
|
|
128
|
-
} catch (exn) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
118
|
function MakeWithConfig(Config) {
|
|
134
119
|
TestRunner$ReventlessLocal.setup();
|
|
135
120
|
let match = Config.backend;
|
|
@@ -160,6 +145,22 @@ function MakeWithConfig(Config) {
|
|
|
160
145
|
let currentDeployTarget = {
|
|
161
146
|
contents: "Domain"
|
|
162
147
|
};
|
|
148
|
+
let pluginScopeCounter = {
|
|
149
|
+
contents: 0
|
|
150
|
+
};
|
|
151
|
+
let buildPluginInScope = (makePlugin, builtInfos) => {
|
|
152
|
+
pluginScopeCounter.contents = pluginScopeCounter.contents + 1 | 0;
|
|
153
|
+
let scopeToken = `plugin-` + pluginScopeCounter.contents.toString();
|
|
154
|
+
DomainGraphQL_Server$ReventlessLocal.setScope(scopeToken);
|
|
155
|
+
let countBefore = builtInfos.contents.length;
|
|
156
|
+
let component = makePlugin();
|
|
157
|
+
let info = builtInfos.contents[countBefore];
|
|
158
|
+
if (info !== undefined) {
|
|
159
|
+
DomainGraphQL_Server$ReventlessLocal.relabelScope(scopeToken, info.name);
|
|
160
|
+
}
|
|
161
|
+
DomainGraphQL_Server$ReventlessLocal.resetScope();
|
|
162
|
+
return component;
|
|
163
|
+
};
|
|
163
164
|
let adminRegisteredServers = {
|
|
164
165
|
contents: []
|
|
165
166
|
};
|
|
@@ -696,24 +697,6 @@ function MakeWithConfig(Config) {
|
|
|
696
697
|
let InboundTranslationSlice = {
|
|
697
698
|
Make: Make$11
|
|
698
699
|
};
|
|
699
|
-
let emptyBaseFragment = GraphQL_Stitcher$ReventlessCore.encode({
|
|
700
|
-
types: [],
|
|
701
|
-
mutations: [],
|
|
702
|
-
queries: [],
|
|
703
|
-
subscriptions: [],
|
|
704
|
-
subscriptionSources: []
|
|
705
|
-
});
|
|
706
|
-
let Make$12 = FragmentConfig => {
|
|
707
|
-
let Builder = Api_Builder$ReventlessCore.Make(LocalGraphQL_Adapter$ReventlessLocal);
|
|
708
|
-
let effectiveBaseFragment = Config.splitApi ? emptyBaseFragment : FragmentConfig.baseFragment;
|
|
709
|
-
let make = (name, opts) => Builder.make(name, effectiveBaseFragment, opts);
|
|
710
|
-
return {
|
|
711
|
-
make: make
|
|
712
|
-
};
|
|
713
|
-
};
|
|
714
|
-
let Api = {
|
|
715
|
-
Make: Make$12
|
|
716
|
-
};
|
|
717
700
|
let PluginMaker = Plugin_Builder$ReventlessLocal.Make(Bus)({
|
|
718
701
|
hooks: hooks
|
|
719
702
|
});
|
|
@@ -772,53 +755,8 @@ function MakeWithConfig(Config) {
|
|
|
772
755
|
authorization: PluginsReadModelSpec$ReventlessCore.authorization,
|
|
773
756
|
visibility: PluginsReadModelSpec$ReventlessCore.visibility
|
|
774
757
|
})(PluginsReadModelMappings);
|
|
775
|
-
let $$let$3 =
|
|
776
|
-
Id: Id$Reventless.$$String,
|
|
777
|
-
name: ApiFragmentRegistrySpec$ReventlessCore.name,
|
|
778
|
-
eventSchema: ApiFragmentRegistrySpec$ReventlessCore.eventSchema,
|
|
779
|
-
errorSchema: ApiFragmentRegistrySpec$ReventlessCore.errorSchema,
|
|
780
|
-
commandSchema: ApiFragmentRegistrySpec$ReventlessCore.commandSchema,
|
|
781
|
-
moduleUrl: ApiFragmentRegistrySpec$ReventlessCore.moduleUrl,
|
|
782
|
-
commandAuthorization: ApiFragmentRegistrySpec$ReventlessCore.commandAuthorization
|
|
783
|
-
})({
|
|
784
|
-
initialState: ApiFragmentRegistryBehavior$ReventlessCore.initialState,
|
|
785
|
-
evolve: ApiFragmentRegistryBehavior$ReventlessCore.evolve,
|
|
786
|
-
decide: ApiFragmentRegistryBehavior$ReventlessCore.decide,
|
|
787
|
-
snapshot: undefined,
|
|
788
|
-
moduleUrl: ApiFragmentRegistryBehavior$ReventlessCore.moduleUrl
|
|
789
|
-
})(NoEventMappings$ReventlessInfra.Make({
|
|
790
|
-
name: ApiFragmentRegistrySpec$ReventlessCore.name,
|
|
791
|
-
Id: Id$Reventless.$$String,
|
|
792
|
-
commandSchema: ApiFragmentRegistrySpec$ReventlessCore.commandSchema
|
|
793
|
-
}));
|
|
794
|
-
let LocalApiFragmentRegistryAggregate_Spec = $$let$3.Spec;
|
|
795
|
-
let LocalApiFragmentRegistryAggregate_make = $$let$3.make;
|
|
796
|
-
let LocalApiFragmentRegistryAggregate_outputs = $$let$3.outputs;
|
|
797
|
-
let LocalApiFragmentRegistryAggregate_operations = $$let$3.operations;
|
|
798
|
-
let LocalApiFragmentRegistryAggregate_finish = $$let$3.finish;
|
|
799
|
-
let LocalApiFragmentRegistryAggregate = {
|
|
800
|
-
Spec: LocalApiFragmentRegistryAggregate_Spec,
|
|
801
|
-
make: LocalApiFragmentRegistryAggregate_make,
|
|
802
|
-
outputs: LocalApiFragmentRegistryAggregate_outputs,
|
|
803
|
-
operations: LocalApiFragmentRegistryAggregate_operations,
|
|
804
|
-
finish: LocalApiFragmentRegistryAggregate_finish
|
|
805
|
-
};
|
|
806
|
-
let ApiFragmentsReadModelMappings = {
|
|
807
|
-
moduleUrl: ApiFragmentsProjection$ReventlessCore.moduleUrl,
|
|
808
|
-
mappings: ApiFragmentsProjection$ReventlessCore.mappings
|
|
809
|
-
};
|
|
810
|
-
let ApiFragmentsReadModel = ReadModelMaker.MakeNoResolver({
|
|
811
|
-
Id: Id$Reventless.$$String,
|
|
812
|
-
name: ApiFragmentsReadModelSpec$ReventlessCore.name,
|
|
813
|
-
moduleUrl: ApiFragmentsReadModelSpec$ReventlessCore.moduleUrl,
|
|
814
|
-
stateSchema: ApiFragmentsReadModelSpec$ReventlessCore.stateSchema,
|
|
815
|
-
config: ApiFragmentsReadModelSpec$ReventlessCore.config,
|
|
816
|
-
subIdConfig: undefined,
|
|
817
|
-
authorization: ApiFragmentsReadModelSpec$ReventlessCore.authorization,
|
|
818
|
-
visibility: ApiFragmentsReadModelSpec$ReventlessCore.visibility
|
|
819
|
-
})(ApiFragmentsReadModelMappings);
|
|
758
|
+
let $$let$3 = LocalCommandTopicChannel$ReventlessLocal.Make(Bus);
|
|
820
759
|
let $$let$4 = LocalCommandTopicChannel$ReventlessLocal.Make(Bus);
|
|
821
|
-
let $$let$5 = LocalCommandTopicChannel$ReventlessLocal.Make(Bus);
|
|
822
760
|
let Admin = Platform_Admin$ReventlessCore.Make({
|
|
823
761
|
make: LocalRuntimeEnvironment$ReventlessLocal.make,
|
|
824
762
|
groupBySource: LocalRuntimeEnvironment$ReventlessLocal.groupBySource,
|
|
@@ -834,9 +772,9 @@ function MakeWithConfig(Config) {
|
|
|
834
772
|
asEventHandler: prim => prim,
|
|
835
773
|
asEffectHandler: prim => prim
|
|
836
774
|
})(EventCollectorChannel))(LocalDcbEventLogStorage$ReventlessLocal.Make(Bus))(LocalEventTopicPublisher$ReventlessLocal.Make(Bus))({
|
|
837
|
-
make: $$let$
|
|
775
|
+
make: $$let$3.make
|
|
838
776
|
})({
|
|
839
|
-
make: $$let$
|
|
777
|
+
make: $$let$4.make
|
|
840
778
|
})({
|
|
841
779
|
silent: Config.silent,
|
|
842
780
|
splitApi: Config.splitApi,
|
|
@@ -897,31 +835,6 @@ function MakeWithConfig(Config) {
|
|
|
897
835
|
};
|
|
898
836
|
return Bus.dispatchCommand(adminDcbCmdTopicKey, CommandTopic$ReventlessCore.encodeCommandJson(cmdJson));
|
|
899
837
|
};
|
|
900
|
-
let apiFragmentRegistryCmdTopicKey = ApiFragmentRegistrySpec$ReventlessCore.name + "AggrCmdTopic";
|
|
901
|
-
let apiFragmentRegistryEventTopicKey = ApiFragmentRegistrySpec$ReventlessCore.name + "AggrEventTopic";
|
|
902
|
-
let dispatchApiFragmentCommand = command => {
|
|
903
|
-
let cmdJson_meta = Message$ReventlessCore.generateMeta(ApiFragmentRegistrySpec$ReventlessCore.name, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
904
|
-
let cmdJson_commandJson = S.reverseConvertToJsonOrThrow(command, ApiFragmentRegistrySpec$ReventlessCore.commandSchema);
|
|
905
|
-
let cmdJson = {
|
|
906
|
-
id: "registry",
|
|
907
|
-
meta: cmdJson_meta,
|
|
908
|
-
commandJson: cmdJson_commandJson
|
|
909
|
-
};
|
|
910
|
-
return Bus.dispatchCommand(apiFragmentRegistryCmdTopicKey, CommandTopic$ReventlessCore.encodeCommandJson(cmdJson));
|
|
911
|
-
};
|
|
912
|
-
let apiFragmentsQueryResolver = async (_root, _args, _ctx) => {
|
|
913
|
-
let scanAll = Bus.getQueryDbScan(ApiFragmentsReadModelSpec$ReventlessCore.name);
|
|
914
|
-
let items = scanAll !== undefined ? scanAll() : [];
|
|
915
|
-
return Stdlib_Array.filterMap(items, item => {
|
|
916
|
-
let state;
|
|
917
|
-
try {
|
|
918
|
-
state = S.parseOrThrow(item, ApiFragmentsReadModelSpec$ReventlessCore.stateSchema);
|
|
919
|
-
} catch (exn) {
|
|
920
|
-
return;
|
|
921
|
-
}
|
|
922
|
-
return Platform_ApiFragmentsApi$ReventlessCore.encodeApiFragmentEntry(state);
|
|
923
|
-
});
|
|
924
|
-
};
|
|
925
838
|
let pluginStatusSubTopic = "onPluginStatusChange";
|
|
926
839
|
let uiFragmentSubTopic = "onUIFragmentChange";
|
|
927
840
|
let adminDcbEventTopicKey = ComponentType$ReventlessCore.name("Admin", "EventTopic");
|
|
@@ -994,26 +907,6 @@ function MakeWithConfig(Config) {
|
|
|
994
907
|
return publishUIFragment(match.pluginId, "Deregistered", null);
|
|
995
908
|
}
|
|
996
909
|
});
|
|
997
|
-
Bus.subscribeToEvents(apiFragmentRegistryEventTopicKey, async (_service, _meta, eventJson) => {
|
|
998
|
-
let match = decodeApiFragmentRegistryEventEnvelope(eventJson);
|
|
999
|
-
if (match === undefined) {
|
|
1000
|
-
return;
|
|
1001
|
-
}
|
|
1002
|
-
switch (match.TAG) {
|
|
1003
|
-
case "ApiFragmentRegistered" :
|
|
1004
|
-
case "ApiFragmentUpdated" :
|
|
1005
|
-
break;
|
|
1006
|
-
default:
|
|
1007
|
-
return;
|
|
1008
|
-
}
|
|
1009
|
-
dispatchApiFragmentCommand({
|
|
1010
|
-
TAG: "RecordApiFragmentPush",
|
|
1011
|
-
pluginId: match.pluginId,
|
|
1012
|
-
ok: true,
|
|
1013
|
-
message: "",
|
|
1014
|
-
at: new Date().toISOString()
|
|
1015
|
-
});
|
|
1016
|
-
});
|
|
1017
910
|
};
|
|
1018
911
|
let connectPlugin = pluginComponents => {
|
|
1019
912
|
pluginComponents.forEach(plugin => {
|
|
@@ -1029,7 +922,6 @@ function MakeWithConfig(Config) {
|
|
|
1029
922
|
outputs.pluginStructure
|
|
1030
923
|
]).apply(param => {
|
|
1031
924
|
let uiFragments = param[6];
|
|
1032
|
-
let apiSchemaFragment = param[5];
|
|
1033
925
|
let id = param[0];
|
|
1034
926
|
let pluginName = Stdlib_Option.getOr(id.split("@")[0], id);
|
|
1035
927
|
let pluginDefinition = {
|
|
@@ -1054,7 +946,7 @@ function MakeWithConfig(Config) {
|
|
|
1054
946
|
}),
|
|
1055
947
|
eventCollector: param[2].name,
|
|
1056
948
|
extensionProtocols: [],
|
|
1057
|
-
apiSchemaFragment:
|
|
949
|
+
apiSchemaFragment: param[5],
|
|
1058
950
|
apiTarget: undefined,
|
|
1059
951
|
structure: param[7],
|
|
1060
952
|
dcbEventLog: undefined,
|
|
@@ -1071,15 +963,6 @@ function MakeWithConfig(Config) {
|
|
|
1071
963
|
manifest: uiFragments,
|
|
1072
964
|
at: new Date().toISOString()
|
|
1073
965
|
});
|
|
1074
|
-
}
|
|
1075
|
-
if (apiSchemaFragment !== undefined) {
|
|
1076
|
-
dispatchApiFragmentCommand({
|
|
1077
|
-
TAG: "RegisterApiFragment",
|
|
1078
|
-
pluginId: pluginName,
|
|
1079
|
-
fragment: apiSchemaFragment,
|
|
1080
|
-
apiTarget: "Domain",
|
|
1081
|
-
at: new Date().toISOString()
|
|
1082
|
-
});
|
|
1083
966
|
return;
|
|
1084
967
|
}
|
|
1085
968
|
});
|
|
@@ -1287,11 +1170,7 @@ function MakeWithConfig(Config) {
|
|
|
1287
1170
|
hooks_apiRole.contents = {
|
|
1288
1171
|
val: undefined
|
|
1289
1172
|
};
|
|
1290
|
-
let admin = Admin.construct(version, [], [
|
|
1291
|
-
LocalPluginAggregate,
|
|
1292
|
-
LocalApiFragmentRegistryAggregate
|
|
1293
|
-
], [
|
|
1294
|
-
{
|
|
1173
|
+
let admin = Admin.construct(version, [], [LocalPluginAggregate], [{
|
|
1295
1174
|
Spec: PluginsReadModel.Spec,
|
|
1296
1175
|
sourceNames: PluginsReadModel.sourceNames,
|
|
1297
1176
|
consumedEventNames: PluginsReadModel.consumedEventNames,
|
|
@@ -1299,17 +1178,7 @@ function MakeWithConfig(Config) {
|
|
|
1299
1178
|
outputs: PluginsReadModel.outputs,
|
|
1300
1179
|
operations: PluginsReadModel.operations,
|
|
1301
1180
|
finish: PluginsReadModel.finish
|
|
1302
|
-
},
|
|
1303
|
-
{
|
|
1304
|
-
Spec: ApiFragmentsReadModel.Spec,
|
|
1305
|
-
sourceNames: ApiFragmentsReadModel.sourceNames,
|
|
1306
|
-
consumedEventNames: ApiFragmentsReadModel.consumedEventNames,
|
|
1307
|
-
make: ApiFragmentsReadModel.make,
|
|
1308
|
-
outputs: ApiFragmentsReadModel.outputs,
|
|
1309
|
-
operations: ApiFragmentsReadModel.operations,
|
|
1310
|
-
finish: ApiFragmentsReadModel.finish
|
|
1311
|
-
}
|
|
1312
|
-
], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
1181
|
+
}], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
1313
1182
|
hooks_adminExtensionPoints.contents = admin.extensionPointsOutputs.apply(eps => Object.fromEntries(eps.map(ep => [
|
|
1314
1183
|
ep.name,
|
|
1315
1184
|
ep
|
|
@@ -1323,7 +1192,7 @@ function MakeWithConfig(Config) {
|
|
|
1323
1192
|
Stdlib_Option.forEach(existingBuiltHook, h => h(info));
|
|
1324
1193
|
builtInfos.contents.push(info);
|
|
1325
1194
|
});
|
|
1326
|
-
let plugins$1 = plugins.map(plugin => plugin.make
|
|
1195
|
+
let plugins$1 = plugins.map(plugin => buildPluginInScope(plugin.make, builtInfos));
|
|
1327
1196
|
Plugin_Helpers$ReventlessCore.onPluginBuiltHook.contents = existingBuiltHook;
|
|
1328
1197
|
let allPluginOutputs = plugins$1.map(Component$ReventlessCore.outputs);
|
|
1329
1198
|
firePluginDeployedHooks(builtInfos.contents, allPluginOutputs);
|
|
@@ -1518,7 +1387,6 @@ function MakeWithConfig(Config) {
|
|
|
1518
1387
|
});
|
|
1519
1388
|
return Object.values(latestByName).map(param => Platform_UIFragmentsApi$ReventlessCore.encodeUIFragmentEntry(param[1]));
|
|
1520
1389
|
};
|
|
1521
|
-
queryResolvers["Platform_ApiFragments"] = apiFragmentsQueryResolver;
|
|
1522
1390
|
registerAdminItemsAndIndexResolvers(queryResolvers, true);
|
|
1523
1391
|
platformGraphQL.registerQueries(baseParts.queries, queryResolvers);
|
|
1524
1392
|
let argId = args => Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(args), d => d["id"]), Stdlib_JSON.Decode.string), "");
|
|
@@ -1681,15 +1549,7 @@ function MakeWithConfig(Config) {
|
|
|
1681
1549
|
hooks_apiRole.contents = {
|
|
1682
1550
|
val: undefined
|
|
1683
1551
|
};
|
|
1684
|
-
Admin.construct(version, [], [
|
|
1685
|
-
Spec: ApiFragmentsReadModel.Spec,
|
|
1686
|
-
sourceNames: ApiFragmentsReadModel.sourceNames,
|
|
1687
|
-
consumedEventNames: ApiFragmentsReadModel.consumedEventNames,
|
|
1688
|
-
make: ApiFragmentsReadModel.make,
|
|
1689
|
-
outputs: ApiFragmentsReadModel.outputs,
|
|
1690
|
-
operations: ApiFragmentsReadModel.operations,
|
|
1691
|
-
finish: ApiFragmentsReadModel.finish
|
|
1692
|
-
}], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
1552
|
+
Admin.construct(version, [], [], [], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
1693
1553
|
currentDeployTarget.contents = "Platform";
|
|
1694
1554
|
let adminGraphQL = resolveTargetGraphQL();
|
|
1695
1555
|
let adminMCP = resolveTargetMCP();
|
|
@@ -1700,7 +1560,6 @@ function MakeWithConfig(Config) {
|
|
|
1700
1560
|
queryResolvers[adminQueryEntry.singleFieldName] = async (_root, _args, _ctx) => null;
|
|
1701
1561
|
queryResolvers[adminQueryEntry.listFieldName] = async (_root, _args, _ctx) => connectionResponse([]);
|
|
1702
1562
|
queryResolvers["Platform_UIFragments"] = async (_root, _args, _ctx) => [];
|
|
1703
|
-
queryResolvers["Platform_ApiFragments"] = apiFragmentsQueryResolver;
|
|
1704
1563
|
registerAdminItemsAndIndexResolvers(queryResolvers, false);
|
|
1705
1564
|
adminGraphQL.registerQueries(baseParts.queries, queryResolvers);
|
|
1706
1565
|
let mutationResolvers = {};
|
|
@@ -1788,11 +1647,7 @@ function MakeWithConfig(Config) {
|
|
|
1788
1647
|
hooks_apiRole.contents = {
|
|
1789
1648
|
val: undefined
|
|
1790
1649
|
};
|
|
1791
|
-
let admin = Admin.construct("", [], [
|
|
1792
|
-
LocalPluginAggregate,
|
|
1793
|
-
LocalApiFragmentRegistryAggregate
|
|
1794
|
-
], [
|
|
1795
|
-
{
|
|
1650
|
+
let admin = Admin.construct("", [], [LocalPluginAggregate], [{
|
|
1796
1651
|
Spec: PluginsReadModel.Spec,
|
|
1797
1652
|
sourceNames: PluginsReadModel.sourceNames,
|
|
1798
1653
|
consumedEventNames: PluginsReadModel.consumedEventNames,
|
|
@@ -1800,17 +1655,7 @@ function MakeWithConfig(Config) {
|
|
|
1800
1655
|
outputs: PluginsReadModel.outputs,
|
|
1801
1656
|
operations: PluginsReadModel.operations,
|
|
1802
1657
|
finish: PluginsReadModel.finish
|
|
1803
|
-
},
|
|
1804
|
-
{
|
|
1805
|
-
Spec: ApiFragmentsReadModel.Spec,
|
|
1806
|
-
sourceNames: ApiFragmentsReadModel.sourceNames,
|
|
1807
|
-
consumedEventNames: ApiFragmentsReadModel.consumedEventNames,
|
|
1808
|
-
make: ApiFragmentsReadModel.make,
|
|
1809
|
-
outputs: ApiFragmentsReadModel.outputs,
|
|
1810
|
-
operations: ApiFragmentsReadModel.operations,
|
|
1811
|
-
finish: ApiFragmentsReadModel.finish
|
|
1812
|
-
}
|
|
1813
|
-
], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
1658
|
+
}], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
1814
1659
|
hooks_adminExtensionPoints.contents = admin.extensionPointsOutputs.apply(eps => Object.fromEntries(eps.map(ep => [
|
|
1815
1660
|
ep.name,
|
|
1816
1661
|
ep
|
|
@@ -1823,7 +1668,7 @@ function MakeWithConfig(Config) {
|
|
|
1823
1668
|
Stdlib_Option.forEach(existingBuiltHook, h => h(info));
|
|
1824
1669
|
builtInfos.contents.push(info);
|
|
1825
1670
|
});
|
|
1826
|
-
let pluginComponent = plugin.make
|
|
1671
|
+
let pluginComponent = buildPluginInScope(plugin.make, builtInfos);
|
|
1827
1672
|
Plugin_Helpers$ReventlessCore.onPluginBuiltHook.contents = existingBuiltHook;
|
|
1828
1673
|
let adminGraphQL = resolveTargetGraphQL();
|
|
1829
1674
|
if (!adminRegisteredServers.contents.some(s => s === adminGraphQL)) {
|
|
@@ -1846,7 +1691,6 @@ function MakeWithConfig(Config) {
|
|
|
1846
1691
|
return Platform_UIFragmentsApi$ReventlessCore.encodeUIFragmentEntry(state);
|
|
1847
1692
|
});
|
|
1848
1693
|
};
|
|
1849
|
-
queryResolvers["Platform_ApiFragments"] = apiFragmentsQueryResolver;
|
|
1850
1694
|
queryResolvers["Platform_ComponentDefinitions"] = async (_root, _args, _ctx) => Object.entries(pluginStructuresStore.contents).map(param => Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry(param[0], param[1]));
|
|
1851
1695
|
registerAdminItemsAndIndexResolvers(queryResolvers, true);
|
|
1852
1696
|
adminGraphQL.registerQueries(baseParts.queries, queryResolvers);
|
|
@@ -1931,7 +1775,6 @@ function MakeWithConfig(Config) {
|
|
|
1931
1775
|
AutomationSlice: AutomationSlice,
|
|
1932
1776
|
OutboundTranslationSlice: OutboundTranslationSlice,
|
|
1933
1777
|
InboundTranslationSlice: InboundTranslationSlice,
|
|
1934
|
-
Api: Api,
|
|
1935
1778
|
mcpSupported: true,
|
|
1936
1779
|
Plugin: Plugin,
|
|
1937
1780
|
makePlatform: makePlatform,
|
|
@@ -1971,6 +1814,22 @@ function Make($star) {
|
|
|
1971
1814
|
let currentDeployTarget = {
|
|
1972
1815
|
contents: "Domain"
|
|
1973
1816
|
};
|
|
1817
|
+
let pluginScopeCounter = {
|
|
1818
|
+
contents: 0
|
|
1819
|
+
};
|
|
1820
|
+
let buildPluginInScope = (makePlugin, builtInfos) => {
|
|
1821
|
+
pluginScopeCounter.contents = pluginScopeCounter.contents + 1 | 0;
|
|
1822
|
+
let scopeToken = `plugin-` + pluginScopeCounter.contents.toString();
|
|
1823
|
+
DomainGraphQL_Server$ReventlessLocal.setScope(scopeToken);
|
|
1824
|
+
let countBefore = builtInfos.contents.length;
|
|
1825
|
+
let component = makePlugin();
|
|
1826
|
+
let info = builtInfos.contents[countBefore];
|
|
1827
|
+
if (info !== undefined) {
|
|
1828
|
+
DomainGraphQL_Server$ReventlessLocal.relabelScope(scopeToken, info.name);
|
|
1829
|
+
}
|
|
1830
|
+
DomainGraphQL_Server$ReventlessLocal.resetScope();
|
|
1831
|
+
return component;
|
|
1832
|
+
};
|
|
1974
1833
|
let adminRegisteredServers = {
|
|
1975
1834
|
contents: []
|
|
1976
1835
|
};
|
|
@@ -2501,23 +2360,6 @@ function Make($star) {
|
|
|
2501
2360
|
let InboundTranslationSlice = {
|
|
2502
2361
|
Make: Make$12
|
|
2503
2362
|
};
|
|
2504
|
-
let emptyBaseFragment = GraphQL_Stitcher$ReventlessCore.encode({
|
|
2505
|
-
types: [],
|
|
2506
|
-
mutations: [],
|
|
2507
|
-
queries: [],
|
|
2508
|
-
subscriptions: [],
|
|
2509
|
-
subscriptionSources: []
|
|
2510
|
-
});
|
|
2511
|
-
let Make$13 = FragmentConfig => {
|
|
2512
|
-
let Builder = Api_Builder$ReventlessCore.Make(LocalGraphQL_Adapter$ReventlessLocal);
|
|
2513
|
-
let make = (name, opts) => Builder.make(name, emptyBaseFragment, opts);
|
|
2514
|
-
return {
|
|
2515
|
-
make: make
|
|
2516
|
-
};
|
|
2517
|
-
};
|
|
2518
|
-
let Api = {
|
|
2519
|
-
Make: Make$13
|
|
2520
|
-
};
|
|
2521
2363
|
let PluginMaker = Plugin_Builder$ReventlessLocal.Make(Bus)({
|
|
2522
2364
|
hooks: hooks
|
|
2523
2365
|
});
|
|
@@ -2576,53 +2418,8 @@ function Make($star) {
|
|
|
2576
2418
|
authorization: PluginsReadModelSpec$ReventlessCore.authorization,
|
|
2577
2419
|
visibility: PluginsReadModelSpec$ReventlessCore.visibility
|
|
2578
2420
|
})(PluginsReadModelMappings);
|
|
2579
|
-
let $$let$3 =
|
|
2580
|
-
Id: Id$Reventless.$$String,
|
|
2581
|
-
name: ApiFragmentRegistrySpec$ReventlessCore.name,
|
|
2582
|
-
eventSchema: ApiFragmentRegistrySpec$ReventlessCore.eventSchema,
|
|
2583
|
-
errorSchema: ApiFragmentRegistrySpec$ReventlessCore.errorSchema,
|
|
2584
|
-
commandSchema: ApiFragmentRegistrySpec$ReventlessCore.commandSchema,
|
|
2585
|
-
moduleUrl: ApiFragmentRegistrySpec$ReventlessCore.moduleUrl,
|
|
2586
|
-
commandAuthorization: ApiFragmentRegistrySpec$ReventlessCore.commandAuthorization
|
|
2587
|
-
})({
|
|
2588
|
-
initialState: ApiFragmentRegistryBehavior$ReventlessCore.initialState,
|
|
2589
|
-
evolve: ApiFragmentRegistryBehavior$ReventlessCore.evolve,
|
|
2590
|
-
decide: ApiFragmentRegistryBehavior$ReventlessCore.decide,
|
|
2591
|
-
snapshot: undefined,
|
|
2592
|
-
moduleUrl: ApiFragmentRegistryBehavior$ReventlessCore.moduleUrl
|
|
2593
|
-
})(NoEventMappings$ReventlessInfra.Make({
|
|
2594
|
-
name: ApiFragmentRegistrySpec$ReventlessCore.name,
|
|
2595
|
-
Id: Id$Reventless.$$String,
|
|
2596
|
-
commandSchema: ApiFragmentRegistrySpec$ReventlessCore.commandSchema
|
|
2597
|
-
}));
|
|
2598
|
-
let LocalApiFragmentRegistryAggregate_Spec = $$let$3.Spec;
|
|
2599
|
-
let LocalApiFragmentRegistryAggregate_make = $$let$3.make;
|
|
2600
|
-
let LocalApiFragmentRegistryAggregate_outputs = $$let$3.outputs;
|
|
2601
|
-
let LocalApiFragmentRegistryAggregate_operations = $$let$3.operations;
|
|
2602
|
-
let LocalApiFragmentRegistryAggregate_finish = $$let$3.finish;
|
|
2603
|
-
let LocalApiFragmentRegistryAggregate = {
|
|
2604
|
-
Spec: LocalApiFragmentRegistryAggregate_Spec,
|
|
2605
|
-
make: LocalApiFragmentRegistryAggregate_make,
|
|
2606
|
-
outputs: LocalApiFragmentRegistryAggregate_outputs,
|
|
2607
|
-
operations: LocalApiFragmentRegistryAggregate_operations,
|
|
2608
|
-
finish: LocalApiFragmentRegistryAggregate_finish
|
|
2609
|
-
};
|
|
2610
|
-
let ApiFragmentsReadModelMappings = {
|
|
2611
|
-
moduleUrl: ApiFragmentsProjection$ReventlessCore.moduleUrl,
|
|
2612
|
-
mappings: ApiFragmentsProjection$ReventlessCore.mappings
|
|
2613
|
-
};
|
|
2614
|
-
let ApiFragmentsReadModel = ReadModelMaker.MakeNoResolver({
|
|
2615
|
-
Id: Id$Reventless.$$String,
|
|
2616
|
-
name: ApiFragmentsReadModelSpec$ReventlessCore.name,
|
|
2617
|
-
moduleUrl: ApiFragmentsReadModelSpec$ReventlessCore.moduleUrl,
|
|
2618
|
-
stateSchema: ApiFragmentsReadModelSpec$ReventlessCore.stateSchema,
|
|
2619
|
-
config: ApiFragmentsReadModelSpec$ReventlessCore.config,
|
|
2620
|
-
subIdConfig: undefined,
|
|
2621
|
-
authorization: ApiFragmentsReadModelSpec$ReventlessCore.authorization,
|
|
2622
|
-
visibility: ApiFragmentsReadModelSpec$ReventlessCore.visibility
|
|
2623
|
-
})(ApiFragmentsReadModelMappings);
|
|
2421
|
+
let $$let$3 = LocalCommandTopicChannel$ReventlessLocal.Make(Bus);
|
|
2624
2422
|
let $$let$4 = LocalCommandTopicChannel$ReventlessLocal.Make(Bus);
|
|
2625
|
-
let $$let$5 = LocalCommandTopicChannel$ReventlessLocal.Make(Bus);
|
|
2626
2423
|
let Admin = Platform_Admin$ReventlessCore.Make({
|
|
2627
2424
|
make: LocalRuntimeEnvironment$ReventlessLocal.make,
|
|
2628
2425
|
groupBySource: LocalRuntimeEnvironment$ReventlessLocal.groupBySource,
|
|
@@ -2638,9 +2435,9 @@ function Make($star) {
|
|
|
2638
2435
|
asEventHandler: prim => prim,
|
|
2639
2436
|
asEffectHandler: prim => prim
|
|
2640
2437
|
})(EventCollectorChannel))(LocalDcbEventLogStorage$ReventlessLocal.Make(Bus))(LocalEventTopicPublisher$ReventlessLocal.Make(Bus))({
|
|
2641
|
-
make: $$let$
|
|
2438
|
+
make: $$let$3.make
|
|
2642
2439
|
})({
|
|
2643
|
-
make: $$let$
|
|
2440
|
+
make: $$let$4.make
|
|
2644
2441
|
})({
|
|
2645
2442
|
silent: false,
|
|
2646
2443
|
splitApi: true,
|
|
@@ -2701,31 +2498,6 @@ function Make($star) {
|
|
|
2701
2498
|
};
|
|
2702
2499
|
return Bus.dispatchCommand(adminDcbCmdTopicKey, CommandTopic$ReventlessCore.encodeCommandJson(cmdJson));
|
|
2703
2500
|
};
|
|
2704
|
-
let apiFragmentRegistryCmdTopicKey = ApiFragmentRegistrySpec$ReventlessCore.name + "AggrCmdTopic";
|
|
2705
|
-
let apiFragmentRegistryEventTopicKey = ApiFragmentRegistrySpec$ReventlessCore.name + "AggrEventTopic";
|
|
2706
|
-
let dispatchApiFragmentCommand = command => {
|
|
2707
|
-
let cmdJson_meta = Message$ReventlessCore.generateMeta(ApiFragmentRegistrySpec$ReventlessCore.name, undefined, undefined, undefined, undefined, undefined, undefined, undefined);
|
|
2708
|
-
let cmdJson_commandJson = S.reverseConvertToJsonOrThrow(command, ApiFragmentRegistrySpec$ReventlessCore.commandSchema);
|
|
2709
|
-
let cmdJson = {
|
|
2710
|
-
id: "registry",
|
|
2711
|
-
meta: cmdJson_meta,
|
|
2712
|
-
commandJson: cmdJson_commandJson
|
|
2713
|
-
};
|
|
2714
|
-
return Bus.dispatchCommand(apiFragmentRegistryCmdTopicKey, CommandTopic$ReventlessCore.encodeCommandJson(cmdJson));
|
|
2715
|
-
};
|
|
2716
|
-
let apiFragmentsQueryResolver = async (_root, _args, _ctx) => {
|
|
2717
|
-
let scanAll = Bus.getQueryDbScan(ApiFragmentsReadModelSpec$ReventlessCore.name);
|
|
2718
|
-
let items = scanAll !== undefined ? scanAll() : [];
|
|
2719
|
-
return Stdlib_Array.filterMap(items, item => {
|
|
2720
|
-
let state;
|
|
2721
|
-
try {
|
|
2722
|
-
state = S.parseOrThrow(item, ApiFragmentsReadModelSpec$ReventlessCore.stateSchema);
|
|
2723
|
-
} catch (exn) {
|
|
2724
|
-
return;
|
|
2725
|
-
}
|
|
2726
|
-
return Platform_ApiFragmentsApi$ReventlessCore.encodeApiFragmentEntry(state);
|
|
2727
|
-
});
|
|
2728
|
-
};
|
|
2729
2501
|
let pluginStatusSubTopic = "onPluginStatusChange";
|
|
2730
2502
|
let uiFragmentSubTopic = "onUIFragmentChange";
|
|
2731
2503
|
let adminDcbEventTopicKey = ComponentType$ReventlessCore.name("Admin", "EventTopic");
|
|
@@ -2798,26 +2570,6 @@ function Make($star) {
|
|
|
2798
2570
|
return publishUIFragment(match.pluginId, "Deregistered", null);
|
|
2799
2571
|
}
|
|
2800
2572
|
});
|
|
2801
|
-
Bus.subscribeToEvents(apiFragmentRegistryEventTopicKey, async (_service, _meta, eventJson) => {
|
|
2802
|
-
let match = decodeApiFragmentRegistryEventEnvelope(eventJson);
|
|
2803
|
-
if (match === undefined) {
|
|
2804
|
-
return;
|
|
2805
|
-
}
|
|
2806
|
-
switch (match.TAG) {
|
|
2807
|
-
case "ApiFragmentRegistered" :
|
|
2808
|
-
case "ApiFragmentUpdated" :
|
|
2809
|
-
break;
|
|
2810
|
-
default:
|
|
2811
|
-
return;
|
|
2812
|
-
}
|
|
2813
|
-
dispatchApiFragmentCommand({
|
|
2814
|
-
TAG: "RecordApiFragmentPush",
|
|
2815
|
-
pluginId: match.pluginId,
|
|
2816
|
-
ok: true,
|
|
2817
|
-
message: "",
|
|
2818
|
-
at: new Date().toISOString()
|
|
2819
|
-
});
|
|
2820
|
-
});
|
|
2821
2573
|
};
|
|
2822
2574
|
let connectPlugin = pluginComponents => {
|
|
2823
2575
|
pluginComponents.forEach(plugin => {
|
|
@@ -2833,7 +2585,6 @@ function Make($star) {
|
|
|
2833
2585
|
outputs.pluginStructure
|
|
2834
2586
|
]).apply(param => {
|
|
2835
2587
|
let uiFragments = param[6];
|
|
2836
|
-
let apiSchemaFragment = param[5];
|
|
2837
2588
|
let id = param[0];
|
|
2838
2589
|
let pluginName = Stdlib_Option.getOr(id.split("@")[0], id);
|
|
2839
2590
|
let pluginDefinition = {
|
|
@@ -2858,7 +2609,7 @@ function Make($star) {
|
|
|
2858
2609
|
}),
|
|
2859
2610
|
eventCollector: param[2].name,
|
|
2860
2611
|
extensionProtocols: [],
|
|
2861
|
-
apiSchemaFragment:
|
|
2612
|
+
apiSchemaFragment: param[5],
|
|
2862
2613
|
apiTarget: undefined,
|
|
2863
2614
|
structure: param[7],
|
|
2864
2615
|
dcbEventLog: undefined,
|
|
@@ -2875,15 +2626,6 @@ function Make($star) {
|
|
|
2875
2626
|
manifest: uiFragments,
|
|
2876
2627
|
at: new Date().toISOString()
|
|
2877
2628
|
});
|
|
2878
|
-
}
|
|
2879
|
-
if (apiSchemaFragment !== undefined) {
|
|
2880
|
-
dispatchApiFragmentCommand({
|
|
2881
|
-
TAG: "RegisterApiFragment",
|
|
2882
|
-
pluginId: pluginName,
|
|
2883
|
-
fragment: apiSchemaFragment,
|
|
2884
|
-
apiTarget: "Domain",
|
|
2885
|
-
at: new Date().toISOString()
|
|
2886
|
-
});
|
|
2887
2629
|
return;
|
|
2888
2630
|
}
|
|
2889
2631
|
});
|
|
@@ -3086,11 +2828,7 @@ function Make($star) {
|
|
|
3086
2828
|
hooks_apiRole.contents = {
|
|
3087
2829
|
val: undefined
|
|
3088
2830
|
};
|
|
3089
|
-
let admin = Admin.construct(version, [], [
|
|
3090
|
-
LocalPluginAggregate,
|
|
3091
|
-
LocalApiFragmentRegistryAggregate
|
|
3092
|
-
], [
|
|
3093
|
-
{
|
|
2831
|
+
let admin = Admin.construct(version, [], [LocalPluginAggregate], [{
|
|
3094
2832
|
Spec: PluginsReadModel.Spec,
|
|
3095
2833
|
sourceNames: PluginsReadModel.sourceNames,
|
|
3096
2834
|
consumedEventNames: PluginsReadModel.consumedEventNames,
|
|
@@ -3098,17 +2836,7 @@ function Make($star) {
|
|
|
3098
2836
|
outputs: PluginsReadModel.outputs,
|
|
3099
2837
|
operations: PluginsReadModel.operations,
|
|
3100
2838
|
finish: PluginsReadModel.finish
|
|
3101
|
-
},
|
|
3102
|
-
{
|
|
3103
|
-
Spec: ApiFragmentsReadModel.Spec,
|
|
3104
|
-
sourceNames: ApiFragmentsReadModel.sourceNames,
|
|
3105
|
-
consumedEventNames: ApiFragmentsReadModel.consumedEventNames,
|
|
3106
|
-
make: ApiFragmentsReadModel.make,
|
|
3107
|
-
outputs: ApiFragmentsReadModel.outputs,
|
|
3108
|
-
operations: ApiFragmentsReadModel.operations,
|
|
3109
|
-
finish: ApiFragmentsReadModel.finish
|
|
3110
|
-
}
|
|
3111
|
-
], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
2839
|
+
}], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
3112
2840
|
hooks_adminExtensionPoints.contents = admin.extensionPointsOutputs.apply(eps => Object.fromEntries(eps.map(ep => [
|
|
3113
2841
|
ep.name,
|
|
3114
2842
|
ep
|
|
@@ -3122,7 +2850,7 @@ function Make($star) {
|
|
|
3122
2850
|
Stdlib_Option.forEach(existingBuiltHook, h => h(info));
|
|
3123
2851
|
builtInfos.contents.push(info);
|
|
3124
2852
|
});
|
|
3125
|
-
let plugins$1 = plugins.map(plugin => plugin.make
|
|
2853
|
+
let plugins$1 = plugins.map(plugin => buildPluginInScope(plugin.make, builtInfos));
|
|
3126
2854
|
Plugin_Helpers$ReventlessCore.onPluginBuiltHook.contents = existingBuiltHook;
|
|
3127
2855
|
let allPluginOutputs = plugins$1.map(Component$ReventlessCore.outputs);
|
|
3128
2856
|
firePluginDeployedHooks(builtInfos.contents, allPluginOutputs);
|
|
@@ -3317,7 +3045,6 @@ function Make($star) {
|
|
|
3317
3045
|
});
|
|
3318
3046
|
return Object.values(latestByName).map(param => Platform_UIFragmentsApi$ReventlessCore.encodeUIFragmentEntry(param[1]));
|
|
3319
3047
|
};
|
|
3320
|
-
queryResolvers["Platform_ApiFragments"] = apiFragmentsQueryResolver;
|
|
3321
3048
|
registerAdminItemsAndIndexResolvers(queryResolvers, true);
|
|
3322
3049
|
platformGraphQL.registerQueries(baseParts.queries, queryResolvers);
|
|
3323
3050
|
let argId = args => Stdlib_Option.getOr(Stdlib_Option.flatMap(Stdlib_Option.flatMap(Stdlib_JSON.Decode.object(args), d => d["id"]), Stdlib_JSON.Decode.string), "");
|
|
@@ -3473,15 +3200,7 @@ function Make($star) {
|
|
|
3473
3200
|
hooks_apiRole.contents = {
|
|
3474
3201
|
val: undefined
|
|
3475
3202
|
};
|
|
3476
|
-
Admin.construct(version, [], [
|
|
3477
|
-
Spec: ApiFragmentsReadModel.Spec,
|
|
3478
|
-
sourceNames: ApiFragmentsReadModel.sourceNames,
|
|
3479
|
-
consumedEventNames: ApiFragmentsReadModel.consumedEventNames,
|
|
3480
|
-
make: ApiFragmentsReadModel.make,
|
|
3481
|
-
outputs: ApiFragmentsReadModel.outputs,
|
|
3482
|
-
operations: ApiFragmentsReadModel.operations,
|
|
3483
|
-
finish: ApiFragmentsReadModel.finish
|
|
3484
|
-
}], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
3203
|
+
Admin.construct(version, [], [], [], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
3485
3204
|
currentDeployTarget.contents = "Platform";
|
|
3486
3205
|
let adminGraphQL = resolveTargetGraphQL();
|
|
3487
3206
|
let adminMCP = resolveTargetMCP();
|
|
@@ -3492,7 +3211,6 @@ function Make($star) {
|
|
|
3492
3211
|
queryResolvers[adminQueryEntry.singleFieldName] = async (_root, _args, _ctx) => null;
|
|
3493
3212
|
queryResolvers[adminQueryEntry.listFieldName] = async (_root, _args, _ctx) => connectionResponse([]);
|
|
3494
3213
|
queryResolvers["Platform_UIFragments"] = async (_root, _args, _ctx) => [];
|
|
3495
|
-
queryResolvers["Platform_ApiFragments"] = apiFragmentsQueryResolver;
|
|
3496
3214
|
registerAdminItemsAndIndexResolvers(queryResolvers, false);
|
|
3497
3215
|
adminGraphQL.registerQueries(baseParts.queries, queryResolvers);
|
|
3498
3216
|
let mutationResolvers = {};
|
|
@@ -3578,11 +3296,7 @@ function Make($star) {
|
|
|
3578
3296
|
hooks_apiRole.contents = {
|
|
3579
3297
|
val: undefined
|
|
3580
3298
|
};
|
|
3581
|
-
let admin = Admin.construct("", [], [
|
|
3582
|
-
LocalPluginAggregate,
|
|
3583
|
-
LocalApiFragmentRegistryAggregate
|
|
3584
|
-
], [
|
|
3585
|
-
{
|
|
3299
|
+
let admin = Admin.construct("", [], [LocalPluginAggregate], [{
|
|
3586
3300
|
Spec: PluginsReadModel.Spec,
|
|
3587
3301
|
sourceNames: PluginsReadModel.sourceNames,
|
|
3588
3302
|
consumedEventNames: PluginsReadModel.consumedEventNames,
|
|
@@ -3590,17 +3304,7 @@ function Make($star) {
|
|
|
3590
3304
|
outputs: PluginsReadModel.outputs,
|
|
3591
3305
|
operations: PluginsReadModel.operations,
|
|
3592
3306
|
finish: PluginsReadModel.finish
|
|
3593
|
-
},
|
|
3594
|
-
{
|
|
3595
|
-
Spec: ApiFragmentsReadModel.Spec,
|
|
3596
|
-
sourceNames: ApiFragmentsReadModel.sourceNames,
|
|
3597
|
-
consumedEventNames: ApiFragmentsReadModel.consumedEventNames,
|
|
3598
|
-
make: ApiFragmentsReadModel.make,
|
|
3599
|
-
outputs: ApiFragmentsReadModel.outputs,
|
|
3600
|
-
operations: ApiFragmentsReadModel.operations,
|
|
3601
|
-
finish: ApiFragmentsReadModel.finish
|
|
3602
|
-
}
|
|
3603
|
-
], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
3307
|
+
}], scheduler, LocalPluginSpec$ReventlessLocal.resourceNaming, undefined, undefined, [UiFragmentRegistrySlice], [UiFragmentsViewSlice], [], [], []);
|
|
3604
3308
|
hooks_adminExtensionPoints.contents = admin.extensionPointsOutputs.apply(eps => Object.fromEntries(eps.map(ep => [
|
|
3605
3309
|
ep.name,
|
|
3606
3310
|
ep
|
|
@@ -3613,7 +3317,7 @@ function Make($star) {
|
|
|
3613
3317
|
Stdlib_Option.forEach(existingBuiltHook, h => h(info));
|
|
3614
3318
|
builtInfos.contents.push(info);
|
|
3615
3319
|
});
|
|
3616
|
-
let pluginComponent = plugin.make
|
|
3320
|
+
let pluginComponent = buildPluginInScope(plugin.make, builtInfos);
|
|
3617
3321
|
Plugin_Helpers$ReventlessCore.onPluginBuiltHook.contents = existingBuiltHook;
|
|
3618
3322
|
let adminGraphQL = resolveTargetGraphQL();
|
|
3619
3323
|
if (!adminRegisteredServers.contents.some(s => s === adminGraphQL)) {
|
|
@@ -3636,7 +3340,6 @@ function Make($star) {
|
|
|
3636
3340
|
return Platform_UIFragmentsApi$ReventlessCore.encodeUIFragmentEntry(state);
|
|
3637
3341
|
});
|
|
3638
3342
|
};
|
|
3639
|
-
queryResolvers["Platform_ApiFragments"] = apiFragmentsQueryResolver;
|
|
3640
3343
|
queryResolvers["Platform_ComponentDefinitions"] = async (_root, _args, _ctx) => Object.entries(pluginStructuresStore.contents).map(param => Platform_ComponentDefinitionsApi$ReventlessCore.encodePluginStructureEntry(param[0], param[1]));
|
|
3641
3344
|
registerAdminItemsAndIndexResolvers(queryResolvers, true);
|
|
3642
3345
|
adminGraphQL.registerQueries(baseParts.queries, queryResolvers);
|
|
@@ -3716,7 +3419,6 @@ function Make($star) {
|
|
|
3716
3419
|
AutomationSlice: AutomationSlice,
|
|
3717
3420
|
OutboundTranslationSlice: OutboundTranslationSlice,
|
|
3718
3421
|
InboundTranslationSlice: InboundTranslationSlice,
|
|
3719
|
-
Api: Api,
|
|
3720
3422
|
mcpSupported: true,
|
|
3721
3423
|
Plugin: Plugin,
|
|
3722
3424
|
makePlatform: makePlatform,
|
|
@@ -3733,7 +3435,6 @@ export {
|
|
|
3733
3435
|
platformMCPRef,
|
|
3734
3436
|
decodePluginEventEnvelope,
|
|
3735
3437
|
decodeUiFragmentRegistryEventEnvelope,
|
|
3736
|
-
decodeApiFragmentRegistryEventEnvelope,
|
|
3737
3438
|
MakeWithConfig,
|
|
3738
3439
|
Make,
|
|
3739
3440
|
}
|