weaver-work-cli 0.1.36 → 0.1.38

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.
Files changed (93) hide show
  1. package/dist/chunks/{archive-XBVH7JU7.js → archive-PDV724YK.js} +5 -4
  2. package/dist/chunks/{archive-oa-MZM3EKFQ.js → archive-oa-4XE4MNXQ.js} +4 -3
  3. package/dist/chunks/{asset-4XO7UOUW.js → asset-PDL2QE2N.js} +8 -7
  4. package/dist/chunks/{attachment-content-VXSWANAC.js → attachment-content-MDDGOE5E.js} +3 -3
  5. package/dist/chunks/{blog-PGZKOPSC.js → blog-UYR3EUXW.js} +5 -4
  6. package/dist/chunks/{caizhilian-BH4ZVGUN.js → caizhilian-LG2X5NMF.js} +5 -4
  7. package/dist/chunks/{calendar-MXEMTIO4.js → calendar-FG4BAZHE.js} +4 -3
  8. package/dist/chunks/{chunk-NCOVUAZK.js → chunk-6FTTSA45.js} +4 -3
  9. package/dist/chunks/{chunk-HXJQI5NM.js → chunk-6LTFIFLM.js} +3 -2
  10. package/dist/chunks/{chunk-QYGO5EE2.js → chunk-CORFRD7Q.js} +4 -3
  11. package/dist/chunks/{chunk-QHFANTX7.js → chunk-DMV2TOMH.js} +1348 -90
  12. package/dist/chunks/{chunk-TC6MZAO3.js → chunk-ELYDWBZJ.js} +52 -2
  13. package/dist/chunks/{chunk-JCSN3JGM.js → chunk-FUWVHMVV.js} +7 -6
  14. package/dist/chunks/{chunk-BPE37FPB.js → chunk-GGJFMNJM.js} +3 -3
  15. package/dist/chunks/{chunk-6LLJFKJE.js → chunk-IZUDA353.js} +1 -1
  16. package/dist/chunks/{chunk-XMGSYD6S.js → chunk-J7USS3ED.js} +4 -4
  17. package/dist/chunks/{chunk-F746NKNF.js → chunk-JSMFPO43.js} +1 -1
  18. package/dist/chunks/{chunk-T72N74ZT.js → chunk-KKRL3REV.js} +5 -4
  19. package/dist/chunks/{chunk-VPUTVEMC.js → chunk-NI6GIPIM.js} +98 -3
  20. package/dist/chunks/{chunk-VPXOPQJI.js → chunk-NR6RKXPA.js} +2 -2
  21. package/dist/chunks/{chunk-JNG42JKG.js → chunk-OJQUJZQF.js} +4 -6
  22. package/dist/chunks/{chunk-I6QGIBDM.js → chunk-UJJD4QWF.js} +4 -3
  23. package/dist/chunks/{chunk-JUXVYKII.js → chunk-UZZBA6PV.js} +174 -14
  24. package/dist/chunks/{chunk-JYKABYCV.js → chunk-VRYHGG6O.js} +2 -2
  25. package/dist/chunks/{chunk-WXFPWCXG.js → chunk-XJY7G4DD.js} +3 -3
  26. package/dist/chunks/{chunk-5DQEEGCC.js → chunk-Z32KWY6G.js} +1 -1
  27. package/dist/chunks/{conflict-JAB2LJEZ.js → conflict-BQZEQ4SP.js} +2 -2
  28. package/dist/chunks/{contract-XI2EEIZU.js → contract-XIRAFTEV.js} +4 -3
  29. package/dist/chunks/{cowork-SCPGLBA4.js → cowork-BLG62BL2.js} +4 -3
  30. package/dist/chunks/{ebuilder-form-EYLHNOTA.js → ebuilder-form-NUKG5QW4.js} +3 -3
  31. package/dist/chunks/{ehr-EAP77IMT.js → ehr-2STW5ILH.js} +4 -3
  32. package/dist/chunks/{esb-2TGGXEE7.js → esb-UUDQUNKY.js} +4 -4
  33. package/dist/chunks/{fna-2X7ZE7BU.js → fna-6RCY4NU5.js} +4 -3
  34. package/dist/chunks/{host-C6EL2RKL.js → host-7RXEDMAH.js} +3 -3
  35. package/dist/chunks/{host-XCLDDXKQ.js → host-EJZFROU3.js} +3 -3
  36. package/dist/chunks/{host-I4NRK4MX.js → host-FWDOSRH5.js} +3 -3
  37. package/dist/chunks/{host-Q4LZGCRU.js → host-RHM3NPXV.js} +3 -3
  38. package/dist/chunks/{host-UEI5FGDM.js → host-UFF33TWJ.js} +3 -3
  39. package/dist/chunks/{hrm-YXERJM76.js → hrm-PKJ6ELSH.js} +3 -3
  40. package/dist/chunks/{im-A4VZN2TQ.js → im-YJAXS7CO.js} +3 -3
  41. package/dist/chunks/{invoice-2Z6YPMIS.js → invoice-HWVSXGX6.js} +3 -3
  42. package/dist/chunks/{jiuchuanhui-AR5GMKZB.js → jiuchuanhui-L7VKILZB.js} +4 -3
  43. package/dist/chunks/{lazy-dispatch-QXW7P4X3.js → lazy-dispatch-NMYEIHRH.js} +4 -4
  44. package/dist/chunks/{mail-7GZ6CPBJ.js → mail-B42RRU7G.js} +4 -3
  45. package/dist/chunks/{meeting-3NMGA3MB.js → meeting-CFYVBJSS.js} +13 -12
  46. package/dist/chunks/{okr-BZ6XUOAG.js → okr-GCLF6V7W.js} +4 -3
  47. package/dist/chunks/{plan-DR5CMUYP.js → plan-ZVL7GBRI.js} +4 -3
  48. package/dist/chunks/{project-6J63MK33.js → project-4YWAAE2K.js} +4 -3
  49. package/dist/chunks/{registry-VRTNC6UR.js → registry-EP4VTHZS.js} +8 -8
  50. package/dist/chunks/{registry-KDD7DHNK.js → registry-FRJ6H7BT.js} +4 -4
  51. package/dist/chunks/{registry-TKX2E7C7.js → registry-SG2PGVCF.js} +2 -2
  52. package/dist/chunks/{room-recommend-XCWRMB5P.js → room-recommend-R3JVUUAC.js} +4 -4
  53. package/dist/chunks/{schedule-IVBICP32.js → schedule-NIJBTYDO.js} +4 -4
  54. package/dist/chunks/{workflow-D74NFK3C.js → workflow-BB24DFBY.js} +4 -4
  55. package/dist/index.js +27 -27
  56. package/dist/internal/e10/auth-recovery.js +114 -1
  57. package/dist/internal/e10/client.js +16 -2
  58. package/dist/internal/e10/request-runtime.js +103 -7
  59. package/dist/shortcuts/archive/host.js +3 -2
  60. package/dist/shortcuts/archive-oa/host.js +2 -1
  61. package/dist/shortcuts/asset/host.js +6 -5
  62. package/dist/shortcuts/blog/host.js +3 -2
  63. package/dist/shortcuts/caizhilian/host.js +3 -2
  64. package/dist/shortcuts/calendar/host.js +2 -1
  65. package/dist/shortcuts/contract/host.js +2 -1
  66. package/dist/shortcuts/cowork/host.js +2 -1
  67. package/dist/shortcuts/ebuilder-form/host.js +3 -1
  68. package/dist/shortcuts/ehr/host.js +2 -1
  69. package/dist/shortcuts/esb/host.js +2 -1
  70. package/dist/shortcuts/fna/host.js +2 -1
  71. package/dist/shortcuts/hrm/host.js +2 -1
  72. package/dist/shortcuts/im/host.js +3 -2
  73. package/dist/shortcuts/invoice/host.js +5 -4
  74. package/dist/shortcuts/jiuchuanhui/host.js +2 -1
  75. package/dist/shortcuts/mail/host.js +2 -1
  76. package/dist/shortcuts/meeting/host.js +3 -2
  77. package/dist/shortcuts/meeting/invitation/text.js +71 -0
  78. package/dist/shortcuts/meeting/operations/eb/create-flow.js +1073 -50
  79. package/dist/shortcuts/meeting/operations/eb/crm-search.js +478 -0
  80. package/dist/shortcuts/meeting/operations/eb/factory.js +60 -1
  81. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  82. package/dist/shortcuts/meeting/operations/invitation.js +122 -9
  83. package/dist/shortcuts/okr/host.js +2 -1
  84. package/dist/shortcuts/plan/host.js +2 -1
  85. package/dist/shortcuts/project/host.js +2 -1
  86. package/dist/shortcuts/workflow/operations/form.js +160 -2
  87. package/package.json +1 -1
  88. package/skills/weaver-e10-meeting/SKILL.md +250 -301
  89. package/skills/weaver-e10-meeting/references/meeting-eb.md +203 -0
  90. package/skills/weaver-e10-meeting/references/meeting-invitation.md +37 -5
  91. package/skills/weaver-e10-meeting.zip +0 -0
  92. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  93. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
@@ -8,7 +8,7 @@ import {
8
8
  isXiaoERuntimeAgent,
9
9
  startFetchTiming,
10
10
  tryXiaoEUnifiedLogin
11
- } from "./chunk-JNG42JKG.js";
11
+ } from "./chunk-OJQUJZQF.js";
12
12
  import {
13
13
  CliError
14
14
  } from "./chunk-LUSPKZKY.js";
@@ -36,6 +36,81 @@ var AUTH_REQUIRED_MARKERS = [
36
36
  "not logged in",
37
37
  "not login"
38
38
  ];
39
+ var REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
40
+ var LOGIN_REDIRECT_MARKERS = [
41
+ "login",
42
+ "passport",
43
+ "sso",
44
+ "oauth",
45
+ "signin",
46
+ "sign-in",
47
+ "authorize",
48
+ "authn",
49
+ "atrust",
50
+ "checkticket"
51
+ ];
52
+ var FILE_REDIRECT_MARKERS = [
53
+ "fileservice",
54
+ "/file/download",
55
+ "/file/remotedownload",
56
+ "/remotedownload/",
57
+ "/api/file/",
58
+ "/download/",
59
+ "aliyuncs.com",
60
+ "myqcloud.com",
61
+ "qiniucdn.com",
62
+ "qbox.me",
63
+ "jdcloud.com",
64
+ "amazonaws.com",
65
+ "blob.core.windows.net",
66
+ "ctyunapi.cn",
67
+ "hiclouds.com",
68
+ "minio",
69
+ "s3.",
70
+ "obs.",
71
+ "ks3"
72
+ ];
73
+ var FILE_REQUEST_PATH_MARKERS = [
74
+ "/api/file/",
75
+ "/file/download",
76
+ "/remotedownload/",
77
+ "/fileservice",
78
+ "/download"
79
+ ];
80
+ var APP_SHELL_REDIRECT = /(?:\.html?(?:[?#]|$)|#\/|wui\/)/u;
81
+ function isE10RedirectStatus(status) {
82
+ return REDIRECT_STATUSES.has(status);
83
+ }
84
+ function redirectTarget(location) {
85
+ const raw = location.trim().toLowerCase();
86
+ if (!raw) return "";
87
+ try {
88
+ const url = new URL(raw, "https://e10.invalid");
89
+ return `${url.hostname}${url.pathname}${url.hash}`.toLowerCase();
90
+ } catch {
91
+ return raw.split("?")[0];
92
+ }
93
+ }
94
+ function classifyE10Redirect(response) {
95
+ if (!isE10RedirectStatus(response.status)) return "other";
96
+ const target = redirectTarget(response.headers?.get("location") || "");
97
+ if (!target) return "other";
98
+ if (LOGIN_REDIRECT_MARKERS.some((marker) => target.includes(marker))) return "login";
99
+ if (FILE_REDIRECT_MARKERS.some((marker) => target.includes(marker))) return "file";
100
+ const requestPath = (response.requestPath || "").toLowerCase();
101
+ if (requestPath && FILE_REQUEST_PATH_MARKERS.some((marker) => requestPath.includes(marker)) && !APP_SHELL_REDIRECT.test(target)) {
102
+ return "file";
103
+ }
104
+ return "other";
105
+ }
106
+ function isE10FileRedirect(response) {
107
+ return classifyE10Redirect(response) === "file";
108
+ }
109
+ function isE10SessionExpiredResponse(response) {
110
+ if (response.status === 401) return true;
111
+ if (isE10RedirectStatus(response.status)) return !isE10FileRedirect(response);
112
+ return false;
113
+ }
39
114
  var recoveryInFlight = /* @__PURE__ */ new Map();
40
115
  function asRecord(value) {
41
116
  return value && typeof value === "object" && !Array.isArray(value) ? value : null;
@@ -71,7 +146,7 @@ function responseText(response) {
71
146
  return "";
72
147
  }
73
148
  function isE10AuthenticationRequired(response) {
74
- if (response.status === 401 || response.status === 302) return true;
149
+ if (isE10SessionExpiredResponse(response)) return true;
75
150
  if (responseCodes(response.value).some((code) => AUTH_REQUIRED_CODES.has(code))) return true;
76
151
  const text = responseText(response).toLowerCase();
77
152
  if (!text) return false;
@@ -140,6 +215,7 @@ async function requireE10Session(ctx, load = {}) {
140
215
  // src/internal/e10/request-runtime.ts
141
216
  var DEFAULT_TIMEOUT_MS = 3e4;
142
217
  var DEFAULT_BIG_INT_STRINGS = true;
218
+ var MAX_DOWNLOAD_REDIRECTS = 3;
143
219
  var RESERVED_HEADERS = [
144
220
  "authorization",
145
221
  "cookie",
@@ -199,12 +275,12 @@ var E10RequestRuntime = class {
199
275
  }
200
276
  stripReservedHeaders(mutable.headers);
201
277
  const requestEteamsId = this.session.eteamsId;
202
- let parsed = await this.executeRequest(mutable, request.trustedHeaders);
203
- if (!mutable.streamBody && isE10AuthenticationRequired(parsed) && await this.recoverExpiredSession(requestEteamsId)) {
204
- parsed = await this.executeRequest(mutable, request.trustedHeaders);
278
+ let attempt = await this.executeRequest(mutable, request.trustedHeaders);
279
+ if (!mutable.streamBody && !attempt.fromFileRedirect && isE10AuthenticationRequired(authenticationProbe(mutable, attempt.parsed)) && await this.recoverExpiredSession(requestEteamsId)) {
280
+ attempt = await this.executeRequest(mutable, request.trustedHeaders);
205
281
  }
206
- await this.runAfterResponse(mutable, this.sessionContext(), parsed);
207
- return parsed;
282
+ await this.runAfterResponse(mutable, this.sessionContext(), attempt.parsed);
283
+ return attempt.parsed;
208
284
  } catch (error) {
209
285
  await this.runOnError(mutable, this.sessionContext(), error);
210
286
  throw error;
@@ -215,13 +291,77 @@ var E10RequestRuntime = class {
215
291
  const headers = this.composeHeaders(request, trustedHeaders);
216
292
  const init = this.buildFetchInit(request, headers);
217
293
  const response = await this.fetchWithTimeout(url, init, request.timeoutMs);
218
- return this.readResponse(
219
- response,
220
- request.responseType,
221
- request.bigIntStrings,
222
- request.maxResponseBytes,
223
- request.timeoutMs
224
- );
294
+ const followed = request.responseType === "binary" ? await this.followDownloadRedirect(response, request, url) : { response, followed: false };
295
+ if (followed.followed && (followed.response.status === 401 || followed.response.status === 403)) {
296
+ throw new E10ApiError(
297
+ "network",
298
+ "download_file_service_denied",
299
+ `\u6587\u4EF6\u670D\u52A1\u62D2\u7EDD\u4E0B\u8F7D\uFF08HTTP ${followed.response.status}\uFF09\uFF0C\u76F4\u94FE\u53EF\u80FD\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u8BD5\u4E0B\u8F7D`,
300
+ {
301
+ retryable: true,
302
+ exitCode: 4 /* NetworkError */,
303
+ details: { status: followed.response.status }
304
+ }
305
+ );
306
+ }
307
+ return {
308
+ parsed: await this.readResponse(
309
+ followed.response,
310
+ request.responseType,
311
+ request.bigIntStrings,
312
+ request.maxResponseBytes,
313
+ request.timeoutMs
314
+ ),
315
+ fromFileRedirect: followed.followed
316
+ };
317
+ }
318
+ /**
319
+ * 跟随下载直传的 3xx。仅当跳转目标是文件服务(非登录页)时才跟随,最多
320
+ * `MAX_DOWNLOAD_REDIRECTS` 跳;登录类跳转原样返回,交给上层认证恢复处理。
321
+ * 凭证规则:同源才继续带 Cookie/eteamsid,跨域(对象存储)不带任何鉴权头。
322
+ */
323
+ async followDownloadRedirect(response, request, requestUrl) {
324
+ const baseOrigin = safeOrigin(this.session.getBaseUrl());
325
+ let current = response;
326
+ let currentUrl = requestUrl;
327
+ let followed = false;
328
+ for (let hop = 0; hop < MAX_DOWNLOAD_REDIRECTS; hop += 1) {
329
+ const kind = classifyE10Redirect({
330
+ status: current.status,
331
+ headers: current.headers,
332
+ requestPath: request.path
333
+ });
334
+ if (kind !== "file") return { response: current, followed };
335
+ const location = current.headers.get("location");
336
+ if (!location) return { response: current, followed };
337
+ let next;
338
+ try {
339
+ next = new URL(location, currentUrl);
340
+ } catch {
341
+ return { response: current, followed };
342
+ }
343
+ if (!/^https?:$/u.test(next.protocol)) return { response: current, followed };
344
+ const sameOrigin = baseOrigin !== "" && safeOrigin(next.toString()) === baseOrigin;
345
+ current = await this.fetchWithTimeout(
346
+ next,
347
+ this.buildDownloadRedirectInit(sameOrigin),
348
+ request.timeoutMs
349
+ );
350
+ currentUrl = next;
351
+ followed = true;
352
+ }
353
+ return { response: current, followed };
354
+ }
355
+ buildDownloadRedirectInit(sameOrigin) {
356
+ const headers = {
357
+ Accept: "application/octet-stream, */*",
358
+ "User-Agent": this.session.uaHeader()
359
+ };
360
+ if (sameOrigin) {
361
+ headers.Cookie = this.attachSessionTicket ? this.session.cookieHeaderWithSessionTicket() : this.session.cookieHeader();
362
+ headers.eteamsid = this.session.eteamsId;
363
+ }
364
+ return { method: "GET", headers, redirect: "manual" };
225
365
  }
226
366
  async recoverExpiredSession(requestEteamsId) {
227
367
  if (this.session.eteamsId && this.session.eteamsId !== requestEteamsId) return true;
@@ -402,6 +542,25 @@ var E10RequestRuntime = class {
402
542
  function parseJsonPreservingBigInts(text) {
403
543
  return JSON.parse(quoteLargeJsonIntegers(text));
404
544
  }
545
+ function authenticationProbe(request, response) {
546
+ if ("content" in response) {
547
+ return { status: response.status, headers: response.headers, requestPath: request.path };
548
+ }
549
+ return {
550
+ status: response.status,
551
+ headers: response.headers,
552
+ requestPath: request.path,
553
+ text: response.text,
554
+ value: response.value
555
+ };
556
+ }
557
+ function safeOrigin(rawUrl) {
558
+ try {
559
+ return new URL(rawUrl).origin.toLowerCase();
560
+ } catch {
561
+ return "";
562
+ }
563
+ }
405
564
  var LONG_INTEGER_MIN_DIGITS = 16;
406
565
  var JSON_STRING_OR_NUMBER = /"(?:[^"\\]|\\.)*"|-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g;
407
566
  var LONG_DIGIT_RUN = /\d{16}/;
@@ -507,6 +666,7 @@ function cloneForHook(value) {
507
666
  }
508
667
 
509
668
  export {
669
+ isE10SessionExpiredResponse,
510
670
  requireE10Session,
511
671
  E10ApiError,
512
672
  createE10RequestRuntime
@@ -19,7 +19,7 @@ import {
19
19
  } from "./chunk-AJ62BGAW.js";
20
20
  import {
21
21
  clearInvoiceTokenForSession
22
- } from "./chunk-JCSN3JGM.js";
22
+ } from "./chunk-FUWVHMVV.js";
23
23
  import {
24
24
  E10AuthSession,
25
25
  XIAOE_AGENT_TYPE,
@@ -48,7 +48,7 @@ import {
48
48
  setActiveProfile,
49
49
  switchActiveProfile,
50
50
  tryXiaoEUnifiedLogin
51
- } from "./chunk-JNG42JKG.js";
51
+ } from "./chunk-OJQUJZQF.js";
52
52
  import {
53
53
  CliError,
54
54
  isCliError,
@@ -12,7 +12,7 @@ import {
12
12
  meetingValidationError,
13
13
  queryBody,
14
14
  toIdCsv
15
- } from "./chunk-TC6MZAO3.js";
15
+ } from "./chunk-ELYDWBZJ.js";
16
16
 
17
17
  // src/shortcuts/meeting/operations/eb/conflict.ts
18
18
  var ACTIVE_MT_STATUS = "1,2,8,9";
@@ -296,7 +296,7 @@ var ebMeetingWritePreflight = async ({ endpoint, payload, args, env, extras }) =
296
296
  const items = rawMembers.split(/[,;,;]+/u).map((item) => item.trim()).filter((item) => item !== "");
297
297
  const nameLike = items.filter((item) => !/^\d+$/u.test(item));
298
298
  if (nameLike.length > 0) {
299
- const { resolveMemberIdsByName } = await import("./schedule-IVBICP32.js");
299
+ const { resolveMemberIdsByName } = await import("./schedule-NIJBTYDO.js");
300
300
  const idsByName = await resolveMemberIdsByName(env, nameLike);
301
301
  const resolved = items.map((item) => idsByName.get(item) ?? item);
302
302
  payload.mainTable.hrm_members = [...new Set(resolved)].join(",");
@@ -610,7 +610,7 @@ async function findCommonFreeSlots(env, input) {
610
610
  const scheduleItems = [];
611
611
  if (includeSchedule) {
612
612
  try {
613
- const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-IVBICP32.js");
613
+ const { runScheduleConflictFlow, parseScheduleConflictMessage, resolveMemberIdsByName } = await import("./schedule-NIJBTYDO.js");
614
614
  const dayBegin = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 0, 0, 0, 0);
615
615
  const dayEnd = new Date(rangeStart.getFullYear(), rangeStart.getMonth(), rangeStart.getDate(), 23, 59, 0, 0);
616
616
  const flow = await runScheduleConflictFlow(env, {
@@ -5,7 +5,7 @@ import {
5
5
  ebBusinessSuccess,
6
6
  meetingSuccess,
7
7
  meetingValidationError
8
- } from "./chunk-TC6MZAO3.js";
8
+ } from "./chunk-ELYDWBZJ.js";
9
9
 
10
10
  // src/shortcuts/meeting/operations/env.ts
11
11
  import { existsSync } from "node:fs";
@@ -7,8 +7,8 @@ import {
7
7
  findCommonFreeSlots,
8
8
  meetingEbConflictOperations,
9
9
  runEbConflictCheck
10
- } from "./chunk-WXFPWCXG.js";
11
- import "./chunk-TC6MZAO3.js";
10
+ } from "./chunk-XJY7G4DD.js";
11
+ import "./chunk-ELYDWBZJ.js";
12
12
  import "./chunk-LUSPKZKY.js";
13
13
  import "./chunk-BUSC6UAE.js";
14
14
  export {
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
+ isE10SessionExpiredResponse,
6
7
  requireE10Session
7
- } from "./chunk-JUXVYKII.js";
8
+ } from "./chunk-UZZBA6PV.js";
8
9
  import {
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-OJQUJZQF.js";
12
13
  import {
13
14
  CliError,
14
15
  isCliError,
@@ -308,7 +309,7 @@ function createContractHost(ctx, dependencies = {}) {
308
309
  }
309
310
  throw error;
310
311
  }
311
- if (response.status === 401 || response.status === 302) {
312
+ if (isE10SessionExpiredResponse(response)) {
312
313
  throw contractAuthError(
313
314
  "session_expired",
314
315
  E10_SESSION_EXPIRED_MESSAGE,
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
+ isE10SessionExpiredResponse,
6
7
  requireE10Session
7
- } from "./chunk-JUXVYKII.js";
8
+ } from "./chunk-UZZBA6PV.js";
8
9
  import {
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-OJQUJZQF.js";
12
13
  import {
13
14
  CliError,
14
15
  isCliError,
@@ -306,7 +307,7 @@ function createCoworkHost(ctx, dependencies = {}) {
306
307
  coworkPerf.requestCount += 1;
307
308
  coworkPerf.requestMs += Date.now() - reqStart;
308
309
  }
309
- if (response.status === 401 || response.status === 302) {
310
+ if (isE10SessionExpiredResponse(response)) {
310
311
  throw coworkAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
311
312
  }
312
313
  if (response.parseError) {
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createEbuilderFormHost
5
- } from "./chunk-QYGO5EE2.js";
5
+ } from "./chunk-CORFRD7Q.js";
6
6
  import {
7
7
  createEbuilderFormContinuationSigner
8
8
  } from "./chunk-3SO6QL6U.js";
@@ -13,8 +13,8 @@ import {
13
13
  import {
14
14
  ebuilderValidationError
15
15
  } from "./chunk-BYATLLEF.js";
16
- import "./chunk-JUXVYKII.js";
17
- import "./chunk-JNG42JKG.js";
16
+ import "./chunk-UZZBA6PV.js";
17
+ import "./chunk-OJQUJZQF.js";
18
18
  import {
19
19
  isCliError,
20
20
  toErrorEnvelope
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
+ isE10SessionExpiredResponse,
6
7
  requireE10Session
7
- } from "./chunk-JUXVYKII.js";
8
+ } from "./chunk-UZZBA6PV.js";
8
9
  import {
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-OJQUJZQF.js";
12
13
  import {
13
14
  CliError,
14
15
  isCliError,
@@ -276,7 +277,7 @@ function createEhrHost(ctx, dependencies = {}) {
276
277
  } catch (error) {
277
278
  mapRuntimeNetworkError(error);
278
279
  }
279
- if (response.status === 401 || response.status === 302) {
280
+ if (isE10SessionExpiredResponse(response)) {
280
281
  throw ehrAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
281
282
  }
282
283
  if (response.parseError) {
@@ -9,15 +9,15 @@ import {
9
9
  assertNoForbiddenKeys,
10
10
  esbManifest,
11
11
  getEsbOperation
12
- } from "./chunk-6LLJFKJE.js";
12
+ } from "./chunk-IZUDA353.js";
13
13
  import {
14
14
  createEsbHost
15
- } from "./chunk-I6QGIBDM.js";
15
+ } from "./chunk-UJJD4QWF.js";
16
16
  import {
17
17
  esbValidationError
18
18
  } from "./chunk-GPMFD4RD.js";
19
- import "./chunk-JUXVYKII.js";
20
- import "./chunk-JNG42JKG.js";
19
+ import "./chunk-UZZBA6PV.js";
20
+ import "./chunk-OJQUJZQF.js";
21
21
  import {
22
22
  isCliError,
23
23
  toErrorEnvelope
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
+ isE10SessionExpiredResponse,
6
7
  requireE10Session
7
- } from "./chunk-JUXVYKII.js";
8
+ } from "./chunk-UZZBA6PV.js";
8
9
  import {
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-OJQUJZQF.js";
12
13
  import {
13
14
  CliError,
14
15
  isCliError,
@@ -251,7 +252,7 @@ function createFnaHost(ctx, dependencies = {}) {
251
252
  } catch (error) {
252
253
  mapRuntimeNetworkError(error);
253
254
  }
254
- if (response.status === 401 || response.status === 302) {
255
+ if (isE10SessionExpiredResponse(response)) {
255
256
  throw fnaAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
256
257
  }
257
258
  if (response.parseError) {
@@ -5,10 +5,10 @@ import {
5
5
  extractApiBusinessError,
6
6
  isAtustRedirect,
7
7
  isLoginExpired
8
- } from "./chunk-VPXOPQJI.js";
8
+ } from "./chunk-NR6RKXPA.js";
9
9
  import "./chunk-FMPJJYYI.js";
10
- import "./chunk-JUXVYKII.js";
11
- import "./chunk-JNG42JKG.js";
10
+ import "./chunk-UZZBA6PV.js";
11
+ import "./chunk-OJQUJZQF.js";
12
12
  import "./chunk-LUSPKZKY.js";
13
13
  import "./chunk-BUSC6UAE.js";
14
14
  export {
@@ -4,10 +4,10 @@ import {
4
4
  businessMessage,
5
5
  createHrmHost,
6
6
  isBusinessSuccess
7
- } from "./chunk-NCOVUAZK.js";
7
+ } from "./chunk-6FTTSA45.js";
8
8
  import "./chunk-OOUTBLZ4.js";
9
- import "./chunk-JUXVYKII.js";
10
- import "./chunk-JNG42JKG.js";
9
+ import "./chunk-UZZBA6PV.js";
10
+ import "./chunk-OJQUJZQF.js";
11
11
  import "./chunk-LUSPKZKY.js";
12
12
  import "./chunk-BUSC6UAE.js";
13
13
  export {
@@ -6,10 +6,10 @@ import {
6
6
  createEsbHost,
7
7
  isEsbFlowUnavailable,
8
8
  triggerResultCode
9
- } from "./chunk-I6QGIBDM.js";
9
+ } from "./chunk-UJJD4QWF.js";
10
10
  import "./chunk-GPMFD4RD.js";
11
- import "./chunk-JUXVYKII.js";
12
- import "./chunk-JNG42JKG.js";
11
+ import "./chunk-UZZBA6PV.js";
12
+ import "./chunk-OJQUJZQF.js";
13
13
  import "./chunk-LUSPKZKY.js";
14
14
  import "./chunk-BUSC6UAE.js";
15
15
  export {
@@ -7,10 +7,10 @@ import {
7
7
  dirname,
8
8
  mkdir,
9
9
  writeFile
10
- } from "./chunk-T72N74ZT.js";
10
+ } from "./chunk-KKRL3REV.js";
11
11
  import "./chunk-ZEDWSH32.js";
12
- import "./chunk-JUXVYKII.js";
13
- import "./chunk-JNG42JKG.js";
12
+ import "./chunk-UZZBA6PV.js";
13
+ import "./chunk-OJQUJZQF.js";
14
14
  import "./chunk-LUSPKZKY.js";
15
15
  import "./chunk-BUSC6UAE.js";
16
16
  export {
@@ -7,10 +7,10 @@ import {
7
7
  pickEbuilderDataKey,
8
8
  resolveApiPrefix,
9
9
  routeEbuilderPath
10
- } from "./chunk-QYGO5EE2.js";
10
+ } from "./chunk-CORFRD7Q.js";
11
11
  import "./chunk-BYATLLEF.js";
12
- import "./chunk-JUXVYKII.js";
13
- import "./chunk-JNG42JKG.js";
12
+ import "./chunk-UZZBA6PV.js";
13
+ import "./chunk-OJQUJZQF.js";
14
14
  import "./chunk-LUSPKZKY.js";
15
15
  import "./chunk-BUSC6UAE.js";
16
16
  export {
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createHrmHost
5
- } from "./chunk-NCOVUAZK.js";
5
+ } from "./chunk-6FTTSA45.js";
6
6
  import {
7
7
  getHrmOperation,
8
8
  hrmOperationDefinitions
@@ -14,8 +14,8 @@ import {
14
14
  import {
15
15
  hrmValidationError
16
16
  } from "./chunk-OOUTBLZ4.js";
17
- import "./chunk-JUXVYKII.js";
18
- import "./chunk-JNG42JKG.js";
17
+ import "./chunk-UZZBA6PV.js";
18
+ import "./chunk-OJQUJZQF.js";
19
19
  import {
20
20
  isCliError,
21
21
  toErrorEnvelope
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-2LV74IWP.js";
9
9
  import {
10
10
  createImHost
11
- } from "./chunk-T72N74ZT.js";
11
+ } from "./chunk-KKRL3REV.js";
12
12
  import {
13
13
  createImContinuationSigner
14
14
  } from "./chunk-P26ZWSKU.js";
@@ -16,8 +16,8 @@ import {
16
16
  imValidationError
17
17
  } from "./chunk-ZEDWSH32.js";
18
18
  import "./chunk-YLCYX7LE.js";
19
- import "./chunk-JUXVYKII.js";
20
- import "./chunk-JNG42JKG.js";
19
+ import "./chunk-UZZBA6PV.js";
20
+ import "./chunk-OJQUJZQF.js";
21
21
  import {
22
22
  isCliError,
23
23
  toErrorEnvelope
@@ -7,9 +7,9 @@ import {
7
7
  invoicePartialError,
8
8
  invoiceValidationError,
9
9
  isInvoiceNetworkError
10
- } from "./chunk-JCSN3JGM.js";
11
- import "./chunk-JUXVYKII.js";
12
- import "./chunk-JNG42JKG.js";
10
+ } from "./chunk-FUWVHMVV.js";
11
+ import "./chunk-UZZBA6PV.js";
12
+ import "./chunk-OJQUJZQF.js";
13
13
  import {
14
14
  isCliError,
15
15
  toErrorEnvelope
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
+ isE10SessionExpiredResponse,
6
7
  requireE10Session
7
- } from "./chunk-JUXVYKII.js";
8
+ } from "./chunk-UZZBA6PV.js";
8
9
  import {
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-OJQUJZQF.js";
12
13
  import {
13
14
  CliError,
14
15
  isCliError,
@@ -260,7 +261,7 @@ function createJiuchuanhuiHost(ctx, dependencies = {}) {
260
261
  } catch (error) {
261
262
  mapRuntimeNetworkError(error);
262
263
  }
263
- if (response.status === 401 || response.status === 302) {
264
+ if (isE10SessionExpiredResponse(response)) {
264
265
  throw jiuchuanhuiAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
265
266
  }
266
267
  if (response.parseError) {
@@ -5,12 +5,12 @@ import {
5
5
  createProgram,
6
6
  registerCommands,
7
7
  toCommandMetadata
8
- } from "./chunk-JYKABYCV.js";
8
+ } from "./chunk-VRYHGG6O.js";
9
9
  import "./chunk-EG6ZU444.js";
10
10
  import "./chunk-AJ62BGAW.js";
11
- import "./chunk-JCSN3JGM.js";
12
- import "./chunk-JUXVYKII.js";
13
- import "./chunk-JNG42JKG.js";
11
+ import "./chunk-FUWVHMVV.js";
12
+ import "./chunk-UZZBA6PV.js";
13
+ import "./chunk-OJQUJZQF.js";
14
14
  import "./chunk-LUSPKZKY.js";
15
15
  import "./chunk-BUSC6UAE.js";
16
16
 
@@ -3,12 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  E10ApiError,
5
5
  createE10RequestRuntime,
6
+ isE10SessionExpiredResponse,
6
7
  requireE10Session
7
- } from "./chunk-JUXVYKII.js";
8
+ } from "./chunk-UZZBA6PV.js";
8
9
  import {
9
10
  E10_SESSION_EXPIRED_MESSAGE,
10
11
  getActiveProfile
11
- } from "./chunk-JNG42JKG.js";
12
+ } from "./chunk-OJQUJZQF.js";
12
13
  import {
13
14
  CliError,
14
15
  isCliError,
@@ -296,7 +297,7 @@ function createMailHost(ctx, dependencies = {}) {
296
297
  mailPerf.requestCount += 1;
297
298
  mailPerf.requestMs += Date.now() - reqStart;
298
299
  }
299
- if (response.status === 401 || response.status === 302) {
300
+ if (isE10SessionExpiredResponse(response)) {
300
301
  throw mailAuthError("session_expired", E10_SESSION_EXPIRED_MESSAGE, { httpStatus: response.status });
301
302
  }
302
303
  if (response.parseError) {