@kosdev-code/kos-ui-sdk 0.1.0-next.868 → 0.1.0-next.888

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/index.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const service$8 = require("./index-DsRhHHtS.cjs");
3
+ const service$8 = require("./index-DUoSahlA.cjs");
4
4
  const mobx = require("mobx");
5
5
  const log$s = require("loglevel");
6
6
  const dateFns = require("date-fns");
@@ -3085,6 +3085,10 @@ const FutureManager = {
3085
3085
  getFuture
3086
3086
  };
3087
3087
  const isFutureResponse = (response) => !response || !response.data;
3088
+ const resolveFutureHandler = (model) => {
3089
+ const handlerProperty = model?.[service$8.MultipleFutureContainerSetup]?.handlerProperty ?? model?.[service$8.FutureContainerSetup]?.handlerProperty ?? "futureHandler";
3090
+ return model[handlerProperty];
3091
+ };
3088
3092
  function wrapWithFutureLifecycle(original, methodName, props = {}) {
3089
3093
  const {
3090
3094
  alias,
@@ -3114,7 +3118,7 @@ function wrapWithFutureLifecycle(original, methodName, props = {}) {
3114
3118
  service$8.KosLog.debug(`future ${future.id} is ready`);
3115
3119
  service$8.kosAction(() => {
3116
3120
  service$8.KosLog.debug(`Adding future ${future.id} to futureHandler`);
3117
- this.futureHandler.addFuture(future, alias);
3121
+ resolveFutureHandler(this).addFuture(future, alias);
3118
3122
  });
3119
3123
  if (abortController && abortControllerInstance) {
3120
3124
  effectDisposer = service$8.kosAutoEffect(() => {
@@ -3187,7 +3191,7 @@ function wrapWithFutureLifecycle(original, methodName, props = {}) {
3187
3191
  );
3188
3192
  }
3189
3193
  } else {
3190
- this.futureHandler.removeFuture(alias);
3194
+ resolveFutureHandler(this).removeFuture(alias);
3191
3195
  }
3192
3196
  cleanup();
3193
3197
  return response;
@@ -10345,10 +10349,10 @@ let CanvasDispatcherModelImpl = class {
10345
10349
  }
10346
10350
  async handlePatternApplication(req, res) {
10347
10351
  const pattern = req.params.pattern;
10348
- const endpoint = req.params.endpoint;
10349
- const rendererModel = this._endpointRenderers.getModel(endpoint);
10352
+ const endpoint2 = req.params.endpoint;
10353
+ const rendererModel = this._endpointRenderers.getModel(endpoint2);
10350
10354
  if (!rendererModel) {
10351
- res.status?.(404).send({ error: `Endpoint "${endpoint}" not found` });
10355
+ res.status?.(404).send({ error: `Endpoint "${endpoint2}" not found` });
10352
10356
  return;
10353
10357
  }
10354
10358
  if (!this._patterns.has(pattern)) {
@@ -10378,10 +10382,10 @@ let CanvasDispatcherModelImpl = class {
10378
10382
  res.status?.(400).send({ error: "Invalid color format" });
10379
10383
  return;
10380
10384
  }
10381
- const endpoint = req.params.endpoint;
10382
- const rendererModel = this._endpointRenderers.getModel(endpoint);
10385
+ const endpoint2 = req.params.endpoint;
10386
+ const rendererModel = this._endpointRenderers.getModel(endpoint2);
10383
10387
  if (!rendererModel) {
10384
- res.status?.(404).send({ error: `Endpoint "${endpoint}" not found` });
10388
+ res.status?.(404).send({ error: `Endpoint "${endpoint2}" not found` });
10385
10389
  return;
10386
10390
  }
10387
10391
  const { r, b, g } = rgb;
@@ -12176,18 +12180,31 @@ const updateRegion = async (region) => {
12176
12180
  regionInfo.updateProperty(region);
12177
12181
  };
12178
12182
  async function getKosServiceApi() {
12179
- const { default: API } = await Promise.resolve().then(() => require("./index-DsRhHHtS.cjs")).then((n) => n.service);
12183
+ const { default: API } = await Promise.resolve().then(() => require("./index-DUoSahlA.cjs")).then((n) => n.service);
12180
12184
  return API;
12181
12185
  }
12182
12186
  function kosServiceRequest$7(params2) {
12183
12187
  return service$8.kosServiceRequest(params2);
12184
12188
  }
12189
+ function endpoint$1(path, method) {
12190
+ return { path, method };
12191
+ }
12192
+ function serviceRequest$1(ep, opts) {
12193
+ return kosServiceRequest$7({
12194
+ path: ep.path,
12195
+ method: ep.method,
12196
+ errorHandler: { strategy: "log", defaultValue: null },
12197
+ ...opts
12198
+ });
12199
+ }
12185
12200
  const api$7 = service$8.createClient();
12186
12201
  const service$7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12187
12202
  __proto__: null,
12188
12203
  api: api$7,
12189
12204
  default: api$7,
12190
- kosServiceRequest: kosServiceRequest$7
12205
+ endpoint: endpoint$1,
12206
+ kosServiceRequest: kosServiceRequest$7,
12207
+ serviceRequest: serviceRequest$1
12191
12208
  }, Symbol.toStringTag, { value: "Module" }));
12192
12209
  function kosServiceRequest$6(params2) {
12193
12210
  return service$8.kosServiceRequest(params2);
@@ -12222,12 +12239,25 @@ const service$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePro
12222
12239
  function kosServiceRequest$3(params2) {
12223
12240
  return service$8.kosServiceRequest(params2);
12224
12241
  }
12242
+ function endpoint(path, method) {
12243
+ return { path, method };
12244
+ }
12245
+ function serviceRequest(ep, opts) {
12246
+ return kosServiceRequest$3({
12247
+ path: ep.path,
12248
+ method: ep.method,
12249
+ errorHandler: { strategy: "log", defaultValue: null },
12250
+ ...opts
12251
+ });
12252
+ }
12225
12253
  const api$3 = service$8.createClient();
12226
12254
  const service$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12227
12255
  __proto__: null,
12228
12256
  api: api$3,
12229
12257
  default: api$3,
12230
- kosServiceRequest: kosServiceRequest$3
12258
+ endpoint,
12259
+ kosServiceRequest: kosServiceRequest$3,
12260
+ serviceRequest
12231
12261
  }, Symbol.toStringTag, { value: "Module" }));
12232
12262
  function kosServiceRequest$2(params2) {
12233
12263
  return service$8.kosServiceRequest(params2);
@@ -12902,8 +12932,8 @@ GpioChipModelImpl = __decorateClass$2([
12902
12932
  const GpioChip = GpioChipModelImpl.Registration;
12903
12933
  const GPIO_CHIP_PATH = "/api/kos/gpio/chips";
12904
12934
  const GPIO_PIN_PATH = "/api/kos/gpio/pins";
12905
- const gpioServiceRequest = kosServiceRequest$5;
12906
- const gpioApi = api$5;
12935
+ const gpioServiceRequest = kosServiceRequest$4;
12936
+ const gpioApi = api$4;
12907
12937
  const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12908
12938
  __proto__: null,
12909
12939
  GPIO_CHIP_PATH,
@@ -16035,10 +16065,10 @@ exports.GpioChipServices = index$1;
16035
16065
  exports.GpioPin = GpioPin;
16036
16066
  exports.GpioPinContainer = GpioPinContainer;
16037
16067
  exports.KOS_RECOVERING_SESSION_KEY = KOS_RECOVERING_SESSION_KEY;
16038
- exports.KOS_SERVICE = service$4;
16039
- exports.KOS_SERVICE_1_6_5 = service$7;
16040
- exports.KOS_SERVICE_1_8_1 = service$6;
16041
- exports.KOS_SERVICE_1_9_X = service$5;
16068
+ exports.KOS_SERVICE = service$7;
16069
+ exports.KOS_SERVICE_1_6_5 = service$6;
16070
+ exports.KOS_SERVICE_1_8_1 = service$5;
16071
+ exports.KOS_SERVICE_1_9_X = service$4;
16042
16072
  exports.KeyValue = KeyValue;
16043
16073
  exports.KeyValueServices = index$c;
16044
16074
  exports.KosConfigPropertySpec = Registration;
@@ -16117,10 +16147,10 @@ exports.Troubles = Troubles;
16117
16147
  exports.UsbUpdate = UsbUpdate;
16118
16148
  exports.UsbUpdateContainer = UsbUpdateContainer;
16119
16149
  exports.UsbUpdateServices = index$3;
16120
- exports.VFS_SERVICE = service;
16121
- exports.VFS_SERVICE_1_6_5 = service$3;
16122
- exports.VFS_SERVICE_1_8_1 = service$2;
16123
- exports.VFS_SERVICE_1_9_X = service$1;
16150
+ exports.VFS_SERVICE = service$3;
16151
+ exports.VFS_SERVICE_1_6_5 = service$2;
16152
+ exports.VFS_SERVICE_1_8_1 = service$1;
16153
+ exports.VFS_SERVICE_1_9_X = service;
16124
16154
  exports.WS_EVENT_TYPE = WS_EVENT_TYPE;
16125
16155
  exports.WsEventFactory = WsEventFactory;
16126
16156
  exports.acceptOrgInvitation = acceptOrgInvitation;