dsh-xrxs-lingting 0.4.0-dev.48 → 0.4.0-dev.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-xrxs-lingting",
3
- "version": "0.4.0-dev.48",
3
+ "version": "0.4.0-dev.49",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite --host 127.0.0.1",
@@ -4449,24 +4449,39 @@ function isState(value) {
4449
4449
  const state = value;
4450
4450
  return typeof state?.reason === "string" && typeof state.businessReady === "boolean";
4451
4451
  }
4452
+ function unavailableHostState() {
4453
+ return {
4454
+ protocol: 1,
4455
+ providerAvailable: false,
4456
+ configured: false,
4457
+ authorized: false,
4458
+ businessReady: false,
4459
+ reason: "state-unavailable",
4460
+ context: null,
4461
+ capabilities: { atomicSnapshot: false, recoverSession: false, versioned: false }
4462
+ };
4463
+ }
4452
4464
  async function fetchXinHostState(fetchImpl = (input, init) => fetch(input, init)) {
4453
4465
  let response;
4454
4466
  try {
4455
4467
  response = await fetchImpl(XIN_STATE_ENDPOINT, { headers: { accept: "application/json" } });
4456
4468
  } catch {
4457
- return null;
4469
+ return unavailableHostState();
4458
4470
  }
4459
- if (!response.ok) return null;
4471
+ if (response.status === 404) return null;
4472
+ if (!response.ok) return unavailableHostState();
4460
4473
  try {
4461
4474
  const payload = await response.json();
4462
- return isState(payload) ? payload : null;
4475
+ return isState(payload) ? payload : unavailableHostState();
4463
4476
  } catch {
4464
- return null;
4477
+ return unavailableHostState();
4465
4478
  }
4466
4479
  }
4467
4480
  function explainXinState(state) {
4468
4481
  if (!state || state.businessReady) return "";
4469
4482
  switch (state.reason) {
4483
+ case "state-unavailable":
4484
+ return "\u65E0\u6CD5\u8BFB\u53D6\u85AA\u4EBA\u85AA\u4E8B\u6388\u6743\u72B6\u6001\uFF0C\u8BF7\u91CD\u65B0\u68C0\u67E5\uFF1B\u82E5\u6301\u7EED\u5931\u8D25\uFF0C\u8BF7\u91CD\u542F\u5BA2\u6237\u7AEF\u3002";
4470
4485
  case "provider-missing":
4471
4486
  return "\u672A\u5B89\u88C5\u300C\u85AA\u4EBA\u85AA\u4E8B\u6388\u6743\u300D\u63D2\u4EF6\uFF1A\u8BF7\u5728\u540C\u4E00 profile \u4E2D\u5B89\u88C5\u540E\u91CD\u542F DSH\u3002";
4472
4487
  case "provider-unconfigured":
@@ -65,7 +65,7 @@ var PRESENCE_STATES = /* @__PURE__ */ new Set(["idle", "starting", "recording",
65
65
  function registerMeetingRoutes(connection, runtime) {
66
66
  const disposers = [];
67
67
  const register = (path, methods, fetch2) => {
68
- disposers.push(connection.fetch.register({ path, methods, fetch: fetch2 }));
68
+ disposers.push(connection.fetch.register({ path, methods, requestBody: "buffered", fetch: fetch2 }));
69
69
  };
70
70
  register("/api/lingting/meeting.state", ["GET"], () => json(runtime.view()));
71
71
  register("/api/lingting/runtime.state", ["GET"], () => {
@@ -2840,7 +2840,7 @@ function registerXinRoutes(deps) {
2840
2840
  let counter = 0;
2841
2841
  const requestId = () => `xz-${Date.now().toString(36)}-${(counter += 1).toString(36)}`;
2842
2842
  const register = (path, methods, fetch2) => {
2843
- disposers.push(deps.connection.fetch.register({ path, methods, fetch: fetch2 }));
2843
+ disposers.push(deps.connection.fetch.register({ path, methods, requestBody: "buffered", fetch: fetch2 }));
2844
2844
  };
2845
2845
  register("/api/lingting/xin.state", ["GET"], async () => {
2846
2846
  const state = await deps.context.state();