@kosdev-code/kos-ui-sdk 0.1.0-next.948 → 0.1.0-next.958
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/.kos.json +2 -1
- package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts +2 -0
- package/core/core/decorators/kos-container-aware-reconcile.test-d.d.ts.map +1 -0
- package/core/core/decorators/kos-container-aware.d.ts +150 -88
- package/core/core/decorators/kos-container-aware.d.ts.map +1 -1
- package/core/core/decorators/kos-reload-aware.d.ts +10 -8
- package/core/core/decorators/kos-reload-aware.d.ts.map +1 -1
- package/core/core/decorators/kosModel.d.ts.map +1 -1
- package/core/core/kosCore.d.ts +4 -1
- package/core/core/kosCore.d.ts.map +1 -1
- package/core/core/kosModel.d.ts +16 -8
- package/core/core/kosModel.d.ts.map +1 -1
- package/core/core/lifecycle/constants.d.ts +6 -2
- package/core/core/lifecycle/constants.d.ts.map +1 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts +11 -1
- package/core/core/lifecycle/kosCoreLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/kosModelLifecycle.d.ts +6 -0
- package/core/core/lifecycle/kosModelLifecycle.d.ts.map +1 -1
- package/core/core/lifecycle/model-machine.d.ts +6 -0
- package/core/core/lifecycle/model-machine.d.ts.map +1 -1
- package/core/core/model/kos-fsm-manager.d.ts +6 -0
- package/core/core/model/kos-fsm-manager.d.ts.map +1 -1
- package/core/core/reconnect/reconnect-fixture.d.ts +17 -0
- package/core/core/reconnect/reconnect-fixture.d.ts.map +1 -0
- package/core/core/transport/transport.d.ts +1 -1
- package/core/core/transport/transport.d.ts.map +1 -1
- package/core/core/transport/webSocketTransport.d.ts +10 -0
- package/core/core/transport/webSocketTransport.d.ts.map +1 -1
- package/index.cjs +134 -90
- package/index.cjs.map +1 -1
- package/index.js +163 -119
- package/index.js.map +1 -1
- package/models/models/config-bean/config-bean-model.d.ts +9 -0
- package/models/models/config-bean/config-bean-model.d.ts.map +1 -1
- package/models/models/gpio-chip/gpio-chip-builders.d.ts +14 -0
- package/models/models/gpio-chip/gpio-chip-builders.d.ts.map +1 -0
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts +2 -1
- package/models/models/gpio-chip/gpio-chip-container-model.d.ts.map +1 -1
- package/models/models/trouble-container/trouble-builders.d.ts +11 -0
- package/models/models/trouble-container/trouble-builders.d.ts.map +1 -0
- package/models/models/trouble-container/trouble-container-model.d.ts +2 -1
- package/models/models/trouble-container/trouble-container-model.d.ts.map +1 -1
- package/package.json +3 -3
- package/{software-info-registration-CuuEsH8v.js → software-info-registration-C8kf-pBB.js} +467 -163
- package/software-info-registration-C8kf-pBB.js.map +1 -0
- package/{software-info-registration-CY_E6Rw7.cjs → software-info-registration-Y1iADHWT.cjs} +438 -134
- package/software-info-registration-Y1iADHWT.cjs.map +1 -0
- package/testing.cjs +1 -1
- package/testing.js +1 -1
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts +9 -0
- package/ui/components/connection-dev-button/connection-dev-button-styles.d.ts.map +1 -0
- package/ui/components/connection-dev-button/index.d.ts +36 -0
- package/ui/components/connection-dev-button/index.d.ts.map +1 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts +29 -0
- package/ui/components/connection-dev-button/use-connection-dev-state.d.ts.map +1 -0
- package/ui/components/index.d.ts +1 -0
- package/ui/components/index.d.ts.map +1 -1
- package/software-info-registration-CY_E6Rw7.cjs.map +0 -1
- package/software-info-registration-CuuEsH8v.js.map +0 -1
|
@@ -849,7 +849,8 @@ function kosContainerAware(options) {
|
|
|
849
849
|
includeGetters,
|
|
850
850
|
modelsProperty,
|
|
851
851
|
containerOptions,
|
|
852
|
-
legacy: options?.legacy || false
|
|
852
|
+
legacy: options?.legacy || false,
|
|
853
|
+
reconcile: options?.reconcile
|
|
853
854
|
};
|
|
854
855
|
return target;
|
|
855
856
|
};
|
|
@@ -2316,6 +2317,66 @@ class KosModelContainer {
|
|
|
2316
2317
|
};
|
|
2317
2318
|
}
|
|
2318
2319
|
}
|
|
2320
|
+
const deltas = (projectedModels, currentModels) => {
|
|
2321
|
+
const newIds = projectedModels.map((entity) => entity.id);
|
|
2322
|
+
const currentIds = currentModels.map((entity) => entity.id);
|
|
2323
|
+
const toRemove = currentIds.filter((modelId) => !newIds.includes(modelId));
|
|
2324
|
+
return toRemove;
|
|
2325
|
+
};
|
|
2326
|
+
const DEFAULT_REMOVE_MAPPER = (id) => id;
|
|
2327
|
+
const DEFAULT_ID_MAPPER = (entity) => entity;
|
|
2328
|
+
const resolveContainerDeltas = ({
|
|
2329
|
+
container,
|
|
2330
|
+
onAddItem,
|
|
2331
|
+
onUpdateItem,
|
|
2332
|
+
onRemoveItem = DEFAULT_REMOVE_MAPPER,
|
|
2333
|
+
idMapper = DEFAULT_ID_MAPPER
|
|
2334
|
+
}) => (entities) => {
|
|
2335
|
+
const mappedEntities = entities.map(idMapper);
|
|
2336
|
+
const toRemove = deltas(mappedEntities, container.data);
|
|
2337
|
+
const removedIds = toRemove.map(onRemoveItem).filter(Boolean);
|
|
2338
|
+
container.removeAll(removedIds);
|
|
2339
|
+
const toAdd = mappedEntities.map((entity) => {
|
|
2340
|
+
const existing = container.getModel(entity.id);
|
|
2341
|
+
if (!existing) {
|
|
2342
|
+
return onAddItem(entity);
|
|
2343
|
+
} else if (onUpdateItem) {
|
|
2344
|
+
return onUpdateItem(entity, existing);
|
|
2345
|
+
} else {
|
|
2346
|
+
return onAddItem(entity);
|
|
2347
|
+
}
|
|
2348
|
+
}).filter(Boolean);
|
|
2349
|
+
container.addAll(toAdd);
|
|
2350
|
+
};
|
|
2351
|
+
const resolveListDeltas = ({
|
|
2352
|
+
container,
|
|
2353
|
+
onAddItem,
|
|
2354
|
+
onRemoveItem = DEFAULT_REMOVE_MAPPER,
|
|
2355
|
+
idMapper = DEFAULT_ID_MAPPER
|
|
2356
|
+
}) => (entities) => {
|
|
2357
|
+
const mappedLayers = entities.map(idMapper);
|
|
2358
|
+
const toRemove = deltas(mappedLayers, container.models);
|
|
2359
|
+
toRemove.forEach(onRemoveItem);
|
|
2360
|
+
mappedLayers.forEach(onAddItem);
|
|
2361
|
+
};
|
|
2362
|
+
const resolveItemListDeltas = ({
|
|
2363
|
+
items,
|
|
2364
|
+
onAddItem,
|
|
2365
|
+
onRemoveItem,
|
|
2366
|
+
idMapper = DEFAULT_ID_MAPPER
|
|
2367
|
+
}) => (entities) => {
|
|
2368
|
+
const mappedLayers = entities.map(idMapper);
|
|
2369
|
+
const toRemove = deltas(mappedLayers, items);
|
|
2370
|
+
toRemove.forEach(onRemoveItem);
|
|
2371
|
+
mappedLayers.forEach(onAddItem);
|
|
2372
|
+
};
|
|
2373
|
+
const processId = (id, prefix = "parent-") => {
|
|
2374
|
+
let _id = id;
|
|
2375
|
+
if (_id.startsWith(prefix)) {
|
|
2376
|
+
_id = _id.replace(prefix, "");
|
|
2377
|
+
}
|
|
2378
|
+
return _id;
|
|
2379
|
+
};
|
|
2319
2380
|
var KosModelState = /* @__PURE__ */ ((KosModelState2) => {
|
|
2320
2381
|
KosModelState2["CREATING"] = `creating`;
|
|
2321
2382
|
KosModelState2["CREATED"] = `created`;
|
|
@@ -2337,6 +2398,9 @@ var KosModelState = /* @__PURE__ */ ((KosModelState2) => {
|
|
|
2337
2398
|
KosModelState2["ACTIVE"] = "active";
|
|
2338
2399
|
KosModelState2["ACTIVATING"] = "activating";
|
|
2339
2400
|
KosModelState2["DEACTIVATING"] = "deactivating";
|
|
2401
|
+
KosModelState2["RELOADING"] = `reloading`;
|
|
2402
|
+
KosModelState2["REATTACHING"] = `reattaching`;
|
|
2403
|
+
KosModelState2["RELOAD_READYING"] = `reload_readying`;
|
|
2340
2404
|
return KosModelState2;
|
|
2341
2405
|
})(KosModelState || {});
|
|
2342
2406
|
var KosModelEvents = /* @__PURE__ */ ((KosModelEvents2) => {
|
|
@@ -2352,6 +2416,7 @@ var KosModelEvents = /* @__PURE__ */ ((KosModelEvents2) => {
|
|
|
2352
2416
|
KosModelEvents2["GO_ACTIVE"] = "go_active";
|
|
2353
2417
|
KosModelEvents2["GO_INACTIVE"] = "go_inactive";
|
|
2354
2418
|
KosModelEvents2["TIMEOUT"] = "timeout";
|
|
2419
|
+
KosModelEvents2["RELOAD"] = `reload`;
|
|
2355
2420
|
return KosModelEvents2;
|
|
2356
2421
|
})(KosModelEvents || {});
|
|
2357
2422
|
const whenReady = async (dataModel) => {
|
|
@@ -3039,6 +3104,23 @@ function injectTroubleAwareSupport(modelInstance) {
|
|
|
3039
3104
|
configurable: true
|
|
3040
3105
|
});
|
|
3041
3106
|
}
|
|
3107
|
+
function createContainerReconcile(container, reconcile) {
|
|
3108
|
+
const { create, update, idMapper, filter, afterCreate } = reconcile;
|
|
3109
|
+
const apply = resolveContainerDeltas({
|
|
3110
|
+
container,
|
|
3111
|
+
onAddItem: (dto) => {
|
|
3112
|
+
const model = create(dto);
|
|
3113
|
+
afterCreate?.(model, dto);
|
|
3114
|
+
return model;
|
|
3115
|
+
},
|
|
3116
|
+
onUpdateItem: update ? (dto, existing) => {
|
|
3117
|
+
update(dto, existing);
|
|
3118
|
+
return null;
|
|
3119
|
+
} : void 0,
|
|
3120
|
+
idMapper
|
|
3121
|
+
});
|
|
3122
|
+
return (list) => apply(filter ? list.filter(filter) : list);
|
|
3123
|
+
}
|
|
3042
3124
|
function injectContainerAwareSupport(modelInstance, modelId) {
|
|
3043
3125
|
const containerSetup = modelInstance[ContainerAwareSetup];
|
|
3044
3126
|
if (!containerSetup) return;
|
|
@@ -3048,7 +3130,8 @@ function injectContainerAwareSupport(modelInstance, modelId) {
|
|
|
3048
3130
|
includeGetters,
|
|
3049
3131
|
modelsProperty,
|
|
3050
3132
|
containerOptions,
|
|
3051
|
-
legacy
|
|
3133
|
+
legacy,
|
|
3134
|
+
reconcile
|
|
3052
3135
|
} = containerSetup;
|
|
3053
3136
|
const finalContainerOptions = {
|
|
3054
3137
|
...containerOptions,
|
|
@@ -3078,6 +3161,9 @@ function injectContainerAwareSupport(modelInstance, modelId) {
|
|
|
3078
3161
|
modelInstance.removeAndDestroy = async (id) => container.removeAndDestroy(id);
|
|
3079
3162
|
modelInstance.removeAndDestroyAll = async (ids) => container.removeAndDestroyAll(ids);
|
|
3080
3163
|
}
|
|
3164
|
+
if (reconcile) {
|
|
3165
|
+
modelInstance.reconcile = createContainerReconcile(container, reconcile);
|
|
3166
|
+
}
|
|
3081
3167
|
if (includeGetters) {
|
|
3082
3168
|
Object.defineProperty(modelInstance, modelsProperty, {
|
|
3083
3169
|
get() {
|
|
@@ -4692,6 +4778,14 @@ const onlineMachine = (model) => {
|
|
|
4692
4778
|
const machine = (model) => {
|
|
4693
4779
|
const active = activeMachine(model).service;
|
|
4694
4780
|
const online = onlineMachine(model).service;
|
|
4781
|
+
const setStatus = (status) => kosAction(() => {
|
|
4782
|
+
model.status = status;
|
|
4783
|
+
});
|
|
4784
|
+
const failed = transition(
|
|
4785
|
+
`error`,
|
|
4786
|
+
KosModelState.FAILED,
|
|
4787
|
+
action$1(() => setStatus(KosModelState.FAILED))
|
|
4788
|
+
);
|
|
4695
4789
|
return createMachine(KosModelState.CREATING, {
|
|
4696
4790
|
[KosModelState.CREATING]: state(
|
|
4697
4791
|
transition(KosModelEvents.CREATE, KosModelState.CREATED)
|
|
@@ -4797,6 +4891,7 @@ const machine = (model) => {
|
|
|
4797
4891
|
action$1(model.unload?.bind(model))
|
|
4798
4892
|
),
|
|
4799
4893
|
transition(KosModelEvents.RESET, KosModelState.RESETTING),
|
|
4894
|
+
transition(KosModelEvents.RELOAD, KosModelState.RELOADING),
|
|
4800
4895
|
transition(
|
|
4801
4896
|
KosModelEvents.GO_ONLINE,
|
|
4802
4897
|
KosModelState.READY,
|
|
@@ -4826,6 +4921,49 @@ const machine = (model) => {
|
|
|
4826
4921
|
})
|
|
4827
4922
|
)
|
|
4828
4923
|
),
|
|
4924
|
+
[KosModelState.RELOADING]: invoke(
|
|
4925
|
+
() => {
|
|
4926
|
+
setStatus(KosModelState.RELOADING);
|
|
4927
|
+
return model.reloadData();
|
|
4928
|
+
},
|
|
4929
|
+
transition(`done`, KosModelState.REATTACHING),
|
|
4930
|
+
transition(
|
|
4931
|
+
`error`,
|
|
4932
|
+
KosModelState.REATTACHING,
|
|
4933
|
+
action$1((_ctx, event) => {
|
|
4934
|
+
KosLog.error(
|
|
4935
|
+
`Model ${model.modelId} - ${model.modelTypeName} failed to reload; its data stays as it was. ${String(
|
|
4936
|
+
event?.error
|
|
4937
|
+
)}`
|
|
4938
|
+
);
|
|
4939
|
+
})
|
|
4940
|
+
)
|
|
4941
|
+
),
|
|
4942
|
+
[KosModelState.REATTACHING]: invoke(
|
|
4943
|
+
() => {
|
|
4944
|
+
setStatus(KosModelState.REATTACHING);
|
|
4945
|
+
return model.reattach();
|
|
4946
|
+
},
|
|
4947
|
+
transition(`done`, KosModelState.RELOAD_READYING),
|
|
4948
|
+
failed
|
|
4949
|
+
),
|
|
4950
|
+
[KosModelState.RELOAD_READYING]: invoke(
|
|
4951
|
+
() => {
|
|
4952
|
+
setStatus(KosModelState.READYING);
|
|
4953
|
+
return model.ready();
|
|
4954
|
+
},
|
|
4955
|
+
transition(
|
|
4956
|
+
`done`,
|
|
4957
|
+
KosModelState.READY,
|
|
4958
|
+
action$1(() => {
|
|
4959
|
+
setStatus(KosModelState.READY);
|
|
4960
|
+
if (!KosCore.getInstance().isOnline) {
|
|
4961
|
+
online.send(KosModelEvents.GO_OFFLINE);
|
|
4962
|
+
}
|
|
4963
|
+
})
|
|
4964
|
+
),
|
|
4965
|
+
failed
|
|
4966
|
+
),
|
|
4829
4967
|
[KosModelState.UNLOADED]: state(),
|
|
4830
4968
|
[KosModelState.FAILED]: state()
|
|
4831
4969
|
});
|
|
@@ -4904,6 +5042,26 @@ class KosFSMManager {
|
|
|
4904
5042
|
this.disposer = void 0;
|
|
4905
5043
|
});
|
|
4906
5044
|
}
|
|
5045
|
+
/**
|
|
5046
|
+
* Re-enters a READY model through RELOADING, REATTACHING and READYING and
|
|
5047
|
+
* resolves once it is READY again; rejects if it fails. A model that is not
|
|
5048
|
+
* READY is left alone.
|
|
5049
|
+
*/
|
|
5050
|
+
async reload() {
|
|
5051
|
+
if (this.current !== KosModelState.READY) {
|
|
5052
|
+
this.log.debug(
|
|
5053
|
+
`Model ${this.model.modelId} is ${this.current}, not READY; skipping reload`
|
|
5054
|
+
);
|
|
5055
|
+
return;
|
|
5056
|
+
}
|
|
5057
|
+
this.service.send(KosModelEvents.RELOAD);
|
|
5058
|
+
await when(
|
|
5059
|
+
() => this.model.status === KosModelState.READY || this.model.status === KosModelState.FAILED
|
|
5060
|
+
);
|
|
5061
|
+
if (this.model.status === KosModelState.FAILED) {
|
|
5062
|
+
throw new Error(`reload failed for model ${this.model.modelId}`);
|
|
5063
|
+
}
|
|
5064
|
+
}
|
|
4907
5065
|
/**
|
|
4908
5066
|
* Checks if a given target maps to status, activeStatus, or onlineStatus.
|
|
4909
5067
|
* Online/offline transitions are tracked on model.onlineStatus because the
|
|
@@ -8855,9 +9013,9 @@ class MockInterceptorTransport {
|
|
|
8855
9013
|
this.inner.send(data);
|
|
8856
9014
|
}
|
|
8857
9015
|
}
|
|
8858
|
-
close() {
|
|
9016
|
+
close(code, reason) {
|
|
8859
9017
|
this.unregisterInjector();
|
|
8860
|
-
return this.inner.close();
|
|
9018
|
+
return this.inner.close(code, reason);
|
|
8861
9019
|
}
|
|
8862
9020
|
addEventListener(type, listener, options) {
|
|
8863
9021
|
this.inner.addEventListener(type, listener, options);
|
|
@@ -9392,13 +9550,9 @@ class WebSocketTransport {
|
|
|
9392
9550
|
if (connectionEstablished) {
|
|
9393
9551
|
log$v.warn("Connection Established");
|
|
9394
9552
|
this.reconnectAttempts = 0;
|
|
9395
|
-
publish(
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
);
|
|
9399
|
-
if (initialized) {
|
|
9400
|
-
publish(WebSocketEvents.RELOAD, WebSocketEvents.RELOAD);
|
|
9401
|
-
}
|
|
9553
|
+
publish(WebSocketEvents.CONNECTED, {
|
|
9554
|
+
reconnect: initialized
|
|
9555
|
+
});
|
|
9402
9556
|
initialized = true;
|
|
9403
9557
|
}
|
|
9404
9558
|
}
|
|
@@ -9573,6 +9727,13 @@ ${dstAddr}topics:${topic}
|
|
|
9573
9727
|
status: `success`
|
|
9574
9728
|
};
|
|
9575
9729
|
}
|
|
9730
|
+
dropConnection() {
|
|
9731
|
+
if (!this.connectionEstablished) {
|
|
9732
|
+
log$v.debug("dropConnection ignored: the connection is already closed");
|
|
9733
|
+
return;
|
|
9734
|
+
}
|
|
9735
|
+
this.socket?.socket.close(1e3);
|
|
9736
|
+
}
|
|
9576
9737
|
get token() {
|
|
9577
9738
|
return this._token;
|
|
9578
9739
|
}
|
|
@@ -10760,18 +10921,63 @@ class KosModel {
|
|
|
10760
10921
|
);
|
|
10761
10922
|
this.subscriptionManager?.registerAll(lifecycle);
|
|
10762
10923
|
}
|
|
10763
|
-
/**
|
|
10764
|
-
|
|
10765
|
-
|
|
10766
|
-
|
|
10767
|
-
|
|
10768
|
-
|
|
10769
|
-
|
|
10924
|
+
/** Narrow, framework-owned teardown for a reload; never the author's unload(). */
|
|
10925
|
+
suspendForReload() {
|
|
10926
|
+
this.subscriptionManager?.disposeAll();
|
|
10927
|
+
this.effectManager?.disposeAll();
|
|
10928
|
+
this.httpRouteManager?.dispose();
|
|
10929
|
+
this.onlineLifecycleManager?.dispose();
|
|
10930
|
+
kosAction(() => {
|
|
10931
|
+
this.loaded = false;
|
|
10932
|
+
});
|
|
10933
|
+
}
|
|
10934
|
+
/** @internal */
|
|
10935
|
+
async reloadData() {
|
|
10936
|
+
log$u.info(`reloading model ${this.modelTypeName} with id ${this.modelId}`);
|
|
10937
|
+
this.suspendForReload();
|
|
10938
|
+
const data = this.modelData;
|
|
10939
|
+
if (typeof data?.reload === "function" && !data[SelfManagedReload]) {
|
|
10940
|
+
await data.reload();
|
|
10941
|
+
}
|
|
10942
|
+
}
|
|
10943
|
+
/** @internal */
|
|
10944
|
+
async reattach() {
|
|
10945
|
+
log$u.info(`reattaching model ${this.modelTypeName} with id ${this.modelId}`);
|
|
10946
|
+
kosAction(() => {
|
|
10947
|
+
this.loaded = true;
|
|
10948
|
+
});
|
|
10770
10949
|
this.subscriptionManager?.registerAll();
|
|
10771
10950
|
this.httpRouteManager?.registerAll();
|
|
10772
10951
|
this.effectManager?.setup();
|
|
10773
|
-
|
|
10774
|
-
|
|
10952
|
+
this.onlineLifecycleManager?.register();
|
|
10953
|
+
await this.reenterChildren();
|
|
10954
|
+
}
|
|
10955
|
+
// A READY child runs its own reload sequence; one created by reload() and
|
|
10956
|
+
// still booting is awaited through its normal lifecycle.
|
|
10957
|
+
async reenterChildren() {
|
|
10958
|
+
const children = this.getChildren();
|
|
10959
|
+
const ready = children.filter(
|
|
10960
|
+
(child) => child.fsm.current === KosModelState.READY
|
|
10961
|
+
);
|
|
10962
|
+
const booting = children.filter(
|
|
10963
|
+
(child) => child.fsm.current !== KosModelState.READY && child.fsm.current !== KosModelState.UNLOADED
|
|
10964
|
+
);
|
|
10965
|
+
const [reloaded] = await Promise.all([
|
|
10966
|
+
Promise.allSettled(ready.map((child) => child.fsm.reload())),
|
|
10967
|
+
executeListLifecycle(
|
|
10968
|
+
this,
|
|
10969
|
+
booting,
|
|
10970
|
+
Transitions.READY,
|
|
10971
|
+
DependencyLifecycle.READY
|
|
10972
|
+
)
|
|
10973
|
+
]);
|
|
10974
|
+
reloaded.forEach((result, index) => {
|
|
10975
|
+
if (result.status === "rejected") {
|
|
10976
|
+
log$u.error(
|
|
10977
|
+
`reload of child ${ready[index].modelId} of ${this.modelId} failed`,
|
|
10978
|
+
result.reason
|
|
10979
|
+
);
|
|
10980
|
+
}
|
|
10775
10981
|
});
|
|
10776
10982
|
}
|
|
10777
10983
|
/**
|
|
@@ -11351,6 +11557,9 @@ var KosCoreState = /* @__PURE__ */ ((KosCoreState2) => {
|
|
|
11351
11557
|
KosCoreState2["UNLOADING"] = `unloading`;
|
|
11352
11558
|
KosCoreState2["UNLOADED"] = `unloaded`;
|
|
11353
11559
|
KosCoreState2["RELOADING"] = `reloading`;
|
|
11560
|
+
KosCoreState2["RECONNECTING"] = `reconnecting`;
|
|
11561
|
+
KosCoreState2["RECONNECT_INTERRUPTED"] = `reconnect_interrupted`;
|
|
11562
|
+
KosCoreState2["RECONNECT_PENDING"] = `reconnect_pending`;
|
|
11354
11563
|
KosCoreState2["FAILED"] = `failed`;
|
|
11355
11564
|
return KosCoreState2;
|
|
11356
11565
|
})(KosCoreState || {});
|
|
@@ -11362,6 +11571,7 @@ var KosCoreEvents = /* @__PURE__ */ ((KosCoreEvents2) => {
|
|
|
11362
11571
|
KosCoreEvents2["GO_OFFLINE"] = `go_offline`;
|
|
11363
11572
|
KosCoreEvents2["UNLOAD"] = `unload`;
|
|
11364
11573
|
KosCoreEvents2["RELOAD"] = `reload`;
|
|
11574
|
+
KosCoreEvents2["RECONNECT"] = `reconnect`;
|
|
11365
11575
|
return KosCoreEvents2;
|
|
11366
11576
|
})(KosCoreEvents || {});
|
|
11367
11577
|
const reportFailure = async (step, run) => {
|
|
@@ -11408,8 +11618,23 @@ const coreFsm = (core) => {
|
|
|
11408
11618
|
});
|
|
11409
11619
|
const online = interpret(
|
|
11410
11620
|
onlineMachine2,
|
|
11411
|
-
(_service) => log$M.debug(_service.machine.current)
|
|
11621
|
+
(_service) => log$M.debug(`KOS Core connection: ${_service.machine.current}`)
|
|
11412
11622
|
);
|
|
11623
|
+
const syncOnline = () => online.send(
|
|
11624
|
+
core.transport.connectionEstablished ? "go_online" : "go_offline"
|
|
11625
|
+
/* GO_OFFLINE */
|
|
11626
|
+
);
|
|
11627
|
+
const setReconnecting = (reconnecting) => runInAction(() => {
|
|
11628
|
+
core.reconnecting = reconnecting;
|
|
11629
|
+
});
|
|
11630
|
+
const reconnectDone = action$1(() => setReconnecting(false));
|
|
11631
|
+
const reconnectedOnline = action$1(() => {
|
|
11632
|
+
setReconnecting(false);
|
|
11633
|
+
online.send(
|
|
11634
|
+
"go_online"
|
|
11635
|
+
/* GO_ONLINE */
|
|
11636
|
+
);
|
|
11637
|
+
});
|
|
11413
11638
|
const failed = transition(
|
|
11414
11639
|
`error`,
|
|
11415
11640
|
"failed",
|
|
@@ -11494,10 +11719,56 @@ const coreFsm = (core) => {
|
|
|
11494
11719
|
runInAction(() => {
|
|
11495
11720
|
core.status = "ready";
|
|
11496
11721
|
});
|
|
11722
|
+
syncOnline();
|
|
11497
11723
|
})
|
|
11498
11724
|
),
|
|
11499
11725
|
failed
|
|
11500
11726
|
),
|
|
11727
|
+
[
|
|
11728
|
+
"reconnecting"
|
|
11729
|
+
/* RECONNECTING */
|
|
11730
|
+
]: invoke(
|
|
11731
|
+
() => reportFailure("reconnecting", () => core.reload()),
|
|
11732
|
+
transition(`done`, "ready", reconnectedOnline),
|
|
11733
|
+
transition(`error`, "ready", reconnectedOnline),
|
|
11734
|
+
transition(
|
|
11735
|
+
"go_offline",
|
|
11736
|
+
"reconnect_interrupted"
|
|
11737
|
+
/* RECONNECT_INTERRUPTED */
|
|
11738
|
+
)
|
|
11739
|
+
),
|
|
11740
|
+
[
|
|
11741
|
+
"reconnect_interrupted"
|
|
11742
|
+
/* RECONNECT_INTERRUPTED */
|
|
11743
|
+
]: state(
|
|
11744
|
+
transition(`done`, "ready", reconnectDone),
|
|
11745
|
+
transition(`error`, "ready", reconnectDone),
|
|
11746
|
+
transition(
|
|
11747
|
+
"reconnect",
|
|
11748
|
+
"reconnect_pending"
|
|
11749
|
+
/* RECONNECT_PENDING */
|
|
11750
|
+
)
|
|
11751
|
+
),
|
|
11752
|
+
[
|
|
11753
|
+
"reconnect_pending"
|
|
11754
|
+
/* RECONNECT_PENDING */
|
|
11755
|
+
]: state(
|
|
11756
|
+
transition(
|
|
11757
|
+
`done`,
|
|
11758
|
+
"reconnecting"
|
|
11759
|
+
/* RECONNECTING */
|
|
11760
|
+
),
|
|
11761
|
+
transition(
|
|
11762
|
+
`error`,
|
|
11763
|
+
"reconnecting"
|
|
11764
|
+
/* RECONNECTING */
|
|
11765
|
+
),
|
|
11766
|
+
transition(
|
|
11767
|
+
"go_offline",
|
|
11768
|
+
"reconnect_interrupted"
|
|
11769
|
+
/* RECONNECT_INTERRUPTED */
|
|
11770
|
+
)
|
|
11771
|
+
),
|
|
11501
11772
|
[
|
|
11502
11773
|
"reloading"
|
|
11503
11774
|
/* RELOADING */
|
|
@@ -11523,6 +11794,11 @@ const coreFsm = (core) => {
|
|
|
11523
11794
|
"reloading"
|
|
11524
11795
|
/* RELOADING */
|
|
11525
11796
|
),
|
|
11797
|
+
transition(
|
|
11798
|
+
"reconnect",
|
|
11799
|
+
"reconnecting",
|
|
11800
|
+
action$1(() => setReconnecting(true))
|
|
11801
|
+
),
|
|
11526
11802
|
transition(
|
|
11527
11803
|
"unload",
|
|
11528
11804
|
"unloaded",
|
|
@@ -11556,7 +11832,7 @@ const coreFsm = (core) => {
|
|
|
11556
11832
|
});
|
|
11557
11833
|
const service2 = interpret(
|
|
11558
11834
|
machine2,
|
|
11559
|
-
(_service) => log$M.debug(_service.machine.current)
|
|
11835
|
+
(_service) => log$M.debug(`KOS Core state: ${_service.machine.current}`)
|
|
11560
11836
|
);
|
|
11561
11837
|
return { service: service2, online };
|
|
11562
11838
|
};
|
|
@@ -11634,6 +11910,15 @@ const rejectAfterDelay = (ms, model) => {
|
|
|
11634
11910
|
};
|
|
11635
11911
|
const isReloadable = (model) => typeof model.reload === "function";
|
|
11636
11912
|
const isSelfManagedReload = (model) => !!model[SelfManagedReload];
|
|
11913
|
+
const isCoreReloaded = (model) => isReloadable(model.modelData) && !isSelfManagedReload(model.modelData);
|
|
11914
|
+
const addDescendants = (model, into) => {
|
|
11915
|
+
model.getChildren().forEach((child) => {
|
|
11916
|
+
if (!into.has(child)) {
|
|
11917
|
+
into.add(child);
|
|
11918
|
+
addDescendants(child, into);
|
|
11919
|
+
}
|
|
11920
|
+
});
|
|
11921
|
+
};
|
|
11637
11922
|
const isUnloadable = (model) => typeof model.unload === "function";
|
|
11638
11923
|
var AuthState = /* @__PURE__ */ ((AuthState2) => {
|
|
11639
11924
|
AuthState2["LOGGED_IN"] = "logged_in";
|
|
@@ -11651,6 +11936,7 @@ class KosCore {
|
|
|
11651
11936
|
authState;
|
|
11652
11937
|
isOnline;
|
|
11653
11938
|
_reloading;
|
|
11939
|
+
reconnecting;
|
|
11654
11940
|
_unloading;
|
|
11655
11941
|
lifecycleStarted = false;
|
|
11656
11942
|
connectionAlias;
|
|
@@ -11662,6 +11948,7 @@ class KosCore {
|
|
|
11662
11948
|
this.status = KosCoreState.CREATED;
|
|
11663
11949
|
this.authState = "logged_out";
|
|
11664
11950
|
this._reloading = false;
|
|
11951
|
+
this.reconnecting = false;
|
|
11665
11952
|
this._unloading = false;
|
|
11666
11953
|
makeAutoObservable(this);
|
|
11667
11954
|
subscribe("token", (data) => {
|
|
@@ -11672,12 +11959,11 @@ class KosCore {
|
|
|
11672
11959
|
subscribe(WebSocketEvents.DISCONNECTED, () => {
|
|
11673
11960
|
this.fsmService.service.send(KosCoreEvents.GO_OFFLINE);
|
|
11674
11961
|
});
|
|
11675
|
-
subscribe(WebSocketEvents.CONNECTED,
|
|
11676
|
-
|
|
11677
|
-
this.
|
|
11678
|
-
|
|
11962
|
+
subscribe(WebSocketEvents.CONNECTED, (msg) => {
|
|
11963
|
+
const reconnect = msg?.body?.reconnect;
|
|
11964
|
+
this.fsmService.service.send(
|
|
11965
|
+
reconnect ? KosCoreEvents.RECONNECT : KosCoreEvents.GO_ONLINE
|
|
11679
11966
|
);
|
|
11680
|
-
this.fsmService.service.send(KosCoreEvents.GO_ONLINE);
|
|
11681
11967
|
});
|
|
11682
11968
|
subscribe("/studioServer/auth/LOGGED_IN", () => {
|
|
11683
11969
|
runInAction(() => {
|
|
@@ -11754,64 +12040,74 @@ alias:${alias}
|
|
|
11754
12040
|
this.fsmService.service.send(KosCoreEvents.CREATE);
|
|
11755
12041
|
}
|
|
11756
12042
|
get onlineStatus() {
|
|
11757
|
-
return this.isOnline && !this.
|
|
12043
|
+
return this.isOnline && !this.reloading && !this._unloading;
|
|
11758
12044
|
}
|
|
11759
12045
|
get reloading() {
|
|
11760
|
-
return this._reloading;
|
|
12046
|
+
return this._reloading || this.reconnecting;
|
|
11761
12047
|
}
|
|
11762
12048
|
get unloading() {
|
|
11763
12049
|
return this._unloading;
|
|
11764
12050
|
}
|
|
11765
12051
|
async reload() {
|
|
11766
|
-
const currentTime = Date.now();
|
|
11767
12052
|
if (this._reloading) {
|
|
11768
12053
|
log$r.info("reload already in progress");
|
|
11769
12054
|
return;
|
|
11770
12055
|
}
|
|
11771
12056
|
this._reloading = true;
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11776
|
-
|
|
11777
|
-
|
|
11778
|
-
|
|
11779
|
-
|
|
12057
|
+
try {
|
|
12058
|
+
log$r.warn("reloading KOS Core");
|
|
12059
|
+
log$r.warn("reloading preloaded models");
|
|
12060
|
+
const modelManager = this.modelManager;
|
|
12061
|
+
const preloaded = [...modelManager.preloadedModels];
|
|
12062
|
+
const covered = /* @__PURE__ */ new Set();
|
|
12063
|
+
modelManager.models.filter((model) => isCoreReloaded(model)).forEach((model) => addDescendants(model, covered));
|
|
12064
|
+
const reloadRoot = async (model) => {
|
|
12065
|
+
await this.reloadOne(model);
|
|
12066
|
+
addDescendants(model, covered);
|
|
12067
|
+
};
|
|
12068
|
+
for (const model of preloaded) {
|
|
12069
|
+
if (isReloadable(model.modelData) && !covered.has(model)) {
|
|
12070
|
+
if (isSelfManagedReload(model.modelData)) {
|
|
12071
|
+
log$r.info(`skipping self-managed model ${model.modelId}`);
|
|
12072
|
+
continue;
|
|
12073
|
+
}
|
|
12074
|
+
log$r.info(`reloading model ${model.modelId}`);
|
|
12075
|
+
await reloadRoot(model);
|
|
12076
|
+
log$r.info(`reloading model ${model.modelId} complete`);
|
|
11780
12077
|
}
|
|
11781
|
-
log$r.info(`reloading model ${model.modelId}`);
|
|
11782
|
-
await this.reloadModel(model, model.modelData);
|
|
11783
|
-
log$r.info(`reloading model ${model.modelId} complete`);
|
|
11784
12078
|
}
|
|
11785
|
-
|
|
11786
|
-
|
|
11787
|
-
|
|
11788
|
-
|
|
11789
|
-
|
|
11790
|
-
|
|
12079
|
+
for (const model of [...modelManager.models]) {
|
|
12080
|
+
if (!preloaded.includes(model) && isReloadable(model.modelData) && !covered.has(model)) {
|
|
12081
|
+
if (isSelfManagedReload(model.modelData)) {
|
|
12082
|
+
log$r.info(`skipping self-managed model ${model.modelId}`);
|
|
12083
|
+
continue;
|
|
12084
|
+
}
|
|
12085
|
+
log$r.warn(`reloading model ${model.modelId}`);
|
|
12086
|
+
await reloadRoot(model);
|
|
11791
12087
|
}
|
|
11792
|
-
log$r.warn(`reloading model ${model.modelId}`);
|
|
11793
|
-
await this.reloadModel(model, model.modelData);
|
|
11794
12088
|
}
|
|
11795
|
-
}
|
|
11796
|
-
const elapsed = Date.now() - currentTime;
|
|
11797
|
-
setTimeout(() => {
|
|
12089
|
+
} finally {
|
|
11798
12090
|
runInAction(() => {
|
|
11799
12091
|
log$r.warn("reloading KOS Core complete");
|
|
11800
12092
|
this._reloading = false;
|
|
11801
12093
|
});
|
|
11802
|
-
}
|
|
12094
|
+
}
|
|
11803
12095
|
}
|
|
11804
|
-
//
|
|
11805
|
-
|
|
11806
|
-
|
|
11807
|
-
|
|
11808
|
-
|
|
11809
|
-
|
|
12096
|
+
// reload never calls unload(); the model machine owns the narrow teardown
|
|
12097
|
+
async reloadOne(model) {
|
|
12098
|
+
try {
|
|
12099
|
+
await model.fsm.reload();
|
|
12100
|
+
} catch (e) {
|
|
12101
|
+
log$r.error(`reload of ${model.modelId} failed`, e);
|
|
12102
|
+
}
|
|
11810
12103
|
}
|
|
11811
12104
|
async online() {
|
|
11812
12105
|
log$r.debug("KOS Core going online");
|
|
11813
12106
|
await this._transport.whenReady();
|
|
11814
12107
|
log$r.debug("KOS Transport Ready. Calling online() for models");
|
|
12108
|
+
this.modelManager.models.forEach(
|
|
12109
|
+
(model) => model.onlineLifecycleManager?.register()
|
|
12110
|
+
);
|
|
11815
12111
|
publish("/kosCore/online", "/kosCore/online");
|
|
11816
12112
|
console.timeEnd("kosCore:startup");
|
|
11817
12113
|
}
|
|
@@ -13623,6 +13919,20 @@ let ConfigBeanModelImpl = class {
|
|
|
13623
13919
|
*/
|
|
13624
13920
|
async load() {
|
|
13625
13921
|
log$k.debug(`loading config bean ${this.path}`);
|
|
13922
|
+
await this.fetchBean();
|
|
13923
|
+
}
|
|
13924
|
+
/**
|
|
13925
|
+
* @internal
|
|
13926
|
+
*
|
|
13927
|
+
* @remarks
|
|
13928
|
+
* Fetches the bean again and updates its values and schema in place, so a
|
|
13929
|
+
* KOS Core reload after a reconnect leaves the same instance current.
|
|
13930
|
+
*/
|
|
13931
|
+
async reload() {
|
|
13932
|
+
log$k.debug(`reloading config bean ${this.path}`);
|
|
13933
|
+
await this.fetchBean();
|
|
13934
|
+
}
|
|
13935
|
+
async fetchBean() {
|
|
13626
13936
|
const response = await this._getConfigBean(
|
|
13627
13937
|
this.path,
|
|
13628
13938
|
this.serviceBasePath,
|
|
@@ -18943,30 +19253,6 @@ const LogStreamContainer = new SingletonKosModelRegistrationFactory({
|
|
|
18943
19253
|
LogStreamContainer.addRelatedModel(LogStream);
|
|
18944
19254
|
LogStreamContainer.addRelatedModel(LogBlockContainer);
|
|
18945
19255
|
LogStreamContainer.addRelatedModel(LogBlock);
|
|
18946
|
-
const isRankedInfo = (i) => i?.rank !== void 0;
|
|
18947
|
-
const isRoleAwareInfo = (i) => i?.visibleRole !== void 0;
|
|
18948
|
-
const isColorAwareInfo = (i) => i?.color !== void 0;
|
|
18949
|
-
const defaultTroubleRankMapper = (trouble) => {
|
|
18950
|
-
const info = trouble.info ?? {};
|
|
18951
|
-
if (isRankedInfo(info)) {
|
|
18952
|
-
return info.rank;
|
|
18953
|
-
}
|
|
18954
|
-
return 0;
|
|
18955
|
-
};
|
|
18956
|
-
const defaultTroubleColorMapper = (trouble) => {
|
|
18957
|
-
const info = trouble.info ?? {};
|
|
18958
|
-
if (isColorAwareInfo(info)) {
|
|
18959
|
-
return info.color;
|
|
18960
|
-
}
|
|
18961
|
-
return "orange";
|
|
18962
|
-
};
|
|
18963
|
-
const defaultTroubleRoleMapper = (trouble) => {
|
|
18964
|
-
const info = trouble.info ?? {};
|
|
18965
|
-
if (isRoleAwareInfo(info)) {
|
|
18966
|
-
return info.visibleRole;
|
|
18967
|
-
}
|
|
18968
|
-
return "TECHNICIAN";
|
|
18969
|
-
};
|
|
18970
19256
|
const { URL: URL$7 } = resolveServiceUrl();
|
|
18971
19257
|
const { getAll: getAll$4, postModel: postModel$1 } = ServiceFactory.build({
|
|
18972
19258
|
basePath: `${URL$7}/api/kos/troubles`
|
|
@@ -19033,6 +19319,30 @@ const bulkResolveTroubles = async (troubleIds, servicePath = "/api/kos/troubles"
|
|
|
19033
19319
|
return futureResponse;
|
|
19034
19320
|
}
|
|
19035
19321
|
};
|
|
19322
|
+
const isRankedInfo = (i) => i?.rank !== void 0;
|
|
19323
|
+
const isRoleAwareInfo = (i) => i?.visibleRole !== void 0;
|
|
19324
|
+
const isColorAwareInfo = (i) => i?.color !== void 0;
|
|
19325
|
+
const defaultTroubleRankMapper = (trouble) => {
|
|
19326
|
+
const info = trouble.info ?? {};
|
|
19327
|
+
if (isRankedInfo(info)) {
|
|
19328
|
+
return info.rank;
|
|
19329
|
+
}
|
|
19330
|
+
return 0;
|
|
19331
|
+
};
|
|
19332
|
+
const defaultTroubleColorMapper = (trouble) => {
|
|
19333
|
+
const info = trouble.info ?? {};
|
|
19334
|
+
if (isColorAwareInfo(info)) {
|
|
19335
|
+
return info.color;
|
|
19336
|
+
}
|
|
19337
|
+
return "orange";
|
|
19338
|
+
};
|
|
19339
|
+
const defaultTroubleRoleMapper = (trouble) => {
|
|
19340
|
+
const info = trouble.info ?? {};
|
|
19341
|
+
if (isRoleAwareInfo(info)) {
|
|
19342
|
+
return info.visibleRole;
|
|
19343
|
+
}
|
|
19344
|
+
return "TECHNICIAN";
|
|
19345
|
+
};
|
|
19036
19346
|
const EXTENSION_TROUBLE_DATA_MAPPER = "troubleDataMapper";
|
|
19037
19347
|
const troubleMappers$1 = /* @__PURE__ */ new Map();
|
|
19038
19348
|
registerExtensionPoint(EXTENSION_TROUBLE_DATA_MAPPER, {
|
|
@@ -19320,29 +19630,24 @@ const Trouble = {
|
|
|
19320
19630
|
predicate: isKosModel(MODEL_TYPE$e),
|
|
19321
19631
|
factory: Kos.Factory.create(MODEL_TYPE$e)
|
|
19322
19632
|
};
|
|
19323
|
-
|
|
19324
|
-
|
|
19325
|
-
|
|
19326
|
-
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
19327
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
19328
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
19329
|
-
if (decorator = decorators[i])
|
|
19330
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19331
|
-
if (kind && result) __defProp$b(target, key, result);
|
|
19332
|
-
return result;
|
|
19333
|
-
};
|
|
19334
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
19335
|
-
const addTrouble = (trouble) => {
|
|
19336
|
-
const options = {
|
|
19633
|
+
function mapTroubleToOptions(dto) {
|
|
19634
|
+
const { trouble } = dto;
|
|
19635
|
+
return {
|
|
19337
19636
|
...trouble,
|
|
19637
|
+
servicePath: dto.servicePath,
|
|
19338
19638
|
rank: troubleRankMapper(trouble),
|
|
19339
19639
|
color: troubleColorMapper(trouble),
|
|
19340
19640
|
role: troubleRoleMapper(trouble),
|
|
19341
|
-
id: String(trouble.id)
|
|
19641
|
+
id: String(trouble.id),
|
|
19642
|
+
rawJson: trouble
|
|
19342
19643
|
};
|
|
19343
|
-
|
|
19344
|
-
|
|
19345
|
-
|
|
19644
|
+
}
|
|
19645
|
+
function createTroubleModel(dto) {
|
|
19646
|
+
return Trouble.factory(dto.id)(mapTroubleToOptions(dto));
|
|
19647
|
+
}
|
|
19648
|
+
function mapTroubleToDto(trouble, servicePath) {
|
|
19649
|
+
return { id: `trouble-${trouble.id}`, servicePath, trouble };
|
|
19650
|
+
}
|
|
19346
19651
|
function troubleRankMapper(trouble) {
|
|
19347
19652
|
const _rank = ExtensionManager.propertyMapper.hasMapper(
|
|
19348
19653
|
KosCoreModelPropertyMapper.TroubleRank
|
|
@@ -19370,6 +19675,18 @@ function troubleRoleMapper(trouble) {
|
|
|
19370
19675
|
) : defaultTroubleRoleMapper(trouble);
|
|
19371
19676
|
return role.toLowerCase();
|
|
19372
19677
|
}
|
|
19678
|
+
var __defProp$b = Object.defineProperty;
|
|
19679
|
+
var __getOwnPropDesc$e = Object.getOwnPropertyDescriptor;
|
|
19680
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
19681
|
+
var __decorateClass$e = (decorators, target, key, kind) => {
|
|
19682
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$e(target, key) : target;
|
|
19683
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
19684
|
+
if (decorator = decorators[i])
|
|
19685
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
19686
|
+
if (kind && result) __defProp$b(target, key, result);
|
|
19687
|
+
return result;
|
|
19688
|
+
};
|
|
19689
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "", value);
|
|
19373
19690
|
const MODEL_TYPE$d = "trouble-container-model";
|
|
19374
19691
|
class Troubles {
|
|
19375
19692
|
static INDEX_TROUBLES_BY_IFACE = "byIface";
|
|
@@ -19390,30 +19707,21 @@ let TroubleContainerModelImpl = class {
|
|
|
19390
19707
|
async reload() {
|
|
19391
19708
|
this.logger.info("reloading trouble container");
|
|
19392
19709
|
const _troubles = await getTroubles(this.servicePath);
|
|
19393
|
-
|
|
19394
|
-
|
|
19395
|
-
|
|
19396
|
-
|
|
19397
|
-
|
|
19398
|
-
this.troubles.addAll(toAdd);
|
|
19710
|
+
this.reconcile(
|
|
19711
|
+
(_troubles?.data ?? []).map(
|
|
19712
|
+
(trouble) => mapTroubleToDto(trouble, this.servicePath)
|
|
19713
|
+
)
|
|
19714
|
+
);
|
|
19399
19715
|
}
|
|
19400
19716
|
async load() {
|
|
19401
19717
|
this.logger.debug("loading trouble container");
|
|
19402
19718
|
try {
|
|
19403
19719
|
const _troubles = await getTroubles(this.servicePath);
|
|
19404
|
-
|
|
19405
|
-
|
|
19406
|
-
|
|
19407
|
-
|
|
19408
|
-
|
|
19409
|
-
color: troubleColorMapper(trouble),
|
|
19410
|
-
role: troubleRoleMapper(trouble),
|
|
19411
|
-
id: String(trouble.id),
|
|
19412
|
-
rawJson: trouble
|
|
19413
|
-
};
|
|
19414
|
-
const newTrouble = Trouble.factory(`trouble-${trouble.id}`)(options);
|
|
19415
|
-
this.troubles.addModel(newTrouble);
|
|
19416
|
-
});
|
|
19720
|
+
this.reconcile(
|
|
19721
|
+
(_troubles?.data ?? []).map(
|
|
19722
|
+
(trouble) => mapTroubleToDto(trouble, this.servicePath)
|
|
19723
|
+
)
|
|
19724
|
+
);
|
|
19417
19725
|
} catch (e) {
|
|
19418
19726
|
this.logger.error(e);
|
|
19419
19727
|
throw e;
|
|
@@ -19432,20 +19740,11 @@ let TroubleContainerModelImpl = class {
|
|
|
19432
19740
|
}
|
|
19433
19741
|
}
|
|
19434
19742
|
handleTroubleAdded(trouble) {
|
|
19435
|
-
const
|
|
19436
|
-
|
|
19437
|
-
servicePath: this.servicePath,
|
|
19438
|
-
rank: troubleRankMapper(trouble),
|
|
19439
|
-
color: troubleColorMapper(trouble),
|
|
19440
|
-
role: troubleRoleMapper(trouble),
|
|
19441
|
-
id: String(trouble.id),
|
|
19442
|
-
rawJson: trouble
|
|
19443
|
-
};
|
|
19444
|
-
if (options.role === "NONE") {
|
|
19743
|
+
const dto = mapTroubleToDto(trouble, this.servicePath);
|
|
19744
|
+
if (mapTroubleToOptions(dto).role === "NONE") {
|
|
19445
19745
|
return;
|
|
19446
19746
|
}
|
|
19447
|
-
|
|
19448
|
-
this.troubles.addModel(newTrouble);
|
|
19747
|
+
this.troubles.addModel(createTroubleModel(dto));
|
|
19449
19748
|
}
|
|
19450
19749
|
};
|
|
19451
19750
|
__publicField(TroubleContainerModelImpl, "Registration");
|
|
@@ -19476,7 +19775,8 @@ TroubleContainerModelImpl = __decorateClass$e([
|
|
|
19476
19775
|
[Troubles.INDEX_TROUBLES_BY_DEFERRED]: "deferred"
|
|
19477
19776
|
},
|
|
19478
19777
|
sortKey: Troubles.SORT_KEY_RANK
|
|
19479
|
-
}
|
|
19778
|
+
},
|
|
19779
|
+
reconcile: { create: createTroubleModel }
|
|
19480
19780
|
})
|
|
19481
19781
|
], TroubleContainerModelImpl);
|
|
19482
19782
|
const TroubleContainer = TroubleContainerModelImpl.Registration;
|
|
@@ -24304,22 +24604,26 @@ export {
|
|
|
24304
24604
|
kosWhen as e7,
|
|
24305
24605
|
mapConfigBeanModelToDto as e8,
|
|
24306
24606
|
mapDataToModel as e9,
|
|
24307
|
-
|
|
24308
|
-
|
|
24309
|
-
|
|
24310
|
-
|
|
24311
|
-
|
|
24312
|
-
|
|
24313
|
-
|
|
24314
|
-
|
|
24315
|
-
|
|
24316
|
-
|
|
24317
|
-
|
|
24318
|
-
|
|
24319
|
-
|
|
24320
|
-
|
|
24321
|
-
|
|
24322
|
-
|
|
24607
|
+
resolveKosCompanion as eA,
|
|
24608
|
+
resolveKosContext as eB,
|
|
24609
|
+
resolveKosProfiles as eC,
|
|
24610
|
+
resolveListDeltas as eD,
|
|
24611
|
+
resolveServiceRequestParameters as eE,
|
|
24612
|
+
resolveServiceUrl as eF,
|
|
24613
|
+
sendAsyncIntent as eG,
|
|
24614
|
+
sendBroadcastMessage as eH,
|
|
24615
|
+
sendIntent as eI,
|
|
24616
|
+
sendKosHttpMessageResponse as eJ,
|
|
24617
|
+
sendKosMessage as eK,
|
|
24618
|
+
sendStudioMessage as eL,
|
|
24619
|
+
sendStudioMessageRequest as eM,
|
|
24620
|
+
troubleByTypeReducer as eN,
|
|
24621
|
+
troubleDataFactory as eO,
|
|
24622
|
+
unloadKosModel as eP,
|
|
24623
|
+
waitForAppToStart as eQ,
|
|
24624
|
+
waitForAppsToStart as eR,
|
|
24625
|
+
wrapWithFutureLifecycle as eS,
|
|
24626
|
+
service as eT,
|
|
24323
24627
|
mapDtoToConfigBeanModel as ea,
|
|
24324
24628
|
mapDtoToFutureModel as eb,
|
|
24325
24629
|
mapDtoToFutureOptions as ec,
|
|
@@ -24333,19 +24637,19 @@ export {
|
|
|
24333
24637
|
pipe as ek,
|
|
24334
24638
|
post as el,
|
|
24335
24639
|
preloadKosModel as em,
|
|
24336
|
-
|
|
24337
|
-
|
|
24338
|
-
|
|
24339
|
-
|
|
24340
|
-
|
|
24341
|
-
|
|
24342
|
-
|
|
24343
|
-
|
|
24344
|
-
|
|
24345
|
-
|
|
24346
|
-
|
|
24347
|
-
|
|
24348
|
-
|
|
24640
|
+
processId as en,
|
|
24641
|
+
put as eo,
|
|
24642
|
+
registerCompanionModel as ep,
|
|
24643
|
+
registerCoreModels as eq,
|
|
24644
|
+
registerExtensionPoint as er,
|
|
24645
|
+
registerHttpRoutes as es,
|
|
24646
|
+
registerKosModel as et,
|
|
24647
|
+
registerLegacyModel as eu,
|
|
24648
|
+
resetKosModel as ev,
|
|
24649
|
+
resolveBaseUrl as ew,
|
|
24650
|
+
resolveChild as ex,
|
|
24651
|
+
resolveContainerDeltas as ey,
|
|
24652
|
+
resolveItemListDeltas as ez,
|
|
24349
24653
|
KosModelVisitor as f,
|
|
24350
24654
|
KosCore as g,
|
|
24351
24655
|
sendKosMessageResponse as h,
|
|
@@ -24368,4 +24672,4 @@ export {
|
|
|
24368
24672
|
getStateBeanData as y,
|
|
24369
24673
|
StateBean as z
|
|
24370
24674
|
};
|
|
24371
|
-
//# sourceMappingURL=software-info-registration-
|
|
24675
|
+
//# sourceMappingURL=software-info-registration-C8kf-pBB.js.map
|