@kevisual/cli 0.1.29 → 0.1.30

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.
@@ -23714,7 +23714,7 @@ var require_lib2 = __commonJS((exports, module) => {
23714
23714
  };
23715
23715
  });
23716
23716
 
23717
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router.js
23717
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router.js
23718
23718
  import { createRequire as createRequire2 } from "node:module";
23719
23719
  import { webcrypto as crypto2 } from "node:crypto";
23720
23720
  import http from "node:http";
@@ -41232,7 +41232,7 @@ class QueryRouter {
41232
41232
  console.error("=====debug====:", e);
41233
41233
  console.error("=====debug====:[path:key]:", `${route.path}-${route.key}`);
41234
41234
  }
41235
- if (e instanceof CustomError) {
41235
+ if (e instanceof CustomError || e?.code) {
41236
41236
  ctx.code = e.code;
41237
41237
  ctx.message = e.message;
41238
41238
  } else {
@@ -41495,6 +41495,39 @@ class QueryRouterServer extends QueryRouter {
41495
41495
  const { path, key, id } = api2;
41496
41496
  return this.run({ path, key, id, payload }, ctx);
41497
41497
  }
41498
+ async createAuth(fun) {
41499
+ this.route({
41500
+ path: "auth",
41501
+ key: "auth",
41502
+ id: "auth",
41503
+ description: "token验证"
41504
+ }).define(async (ctx) => {
41505
+ if (fun) {
41506
+ await fun(ctx, "auth");
41507
+ }
41508
+ }).addTo(this, { overwrite: false });
41509
+ this.route({
41510
+ path: "auth-admin",
41511
+ key: "auth-admin",
41512
+ id: "auth-admin",
41513
+ description: "admin token验证",
41514
+ middleware: ["auth"]
41515
+ }).define(async (ctx) => {
41516
+ if (fun) {
41517
+ await fun(ctx, "auth-admin");
41518
+ }
41519
+ }).addTo(this, { overwrite: false });
41520
+ this.route({
41521
+ path: "auth-can",
41522
+ key: "auth-can",
41523
+ id: "auth-can",
41524
+ description: "权限验证"
41525
+ }).define(async (ctx) => {
41526
+ if (fun) {
41527
+ await fun(ctx, "auth-can");
41528
+ }
41529
+ }).addTo(this, { overwrite: false });
41530
+ }
41498
41531
  }
41499
41532
  var isNode2 = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
41500
41533
  var isBrowser2 = typeof window !== "undefined" && typeof document !== "undefined" && typeof document.createElement === "function";
@@ -42419,7 +42452,7 @@ class App extends QueryRouterServer {
42419
42452
  }
42420
42453
  }
42421
42454
 
42422
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router-simple.js
42455
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router-simple.js
42423
42456
  import url3 from "node:url";
42424
42457
  var __create3 = Object.create;
42425
42458
  var __getProtoOf3 = Object.getPrototypeOf;
@@ -44586,7 +44619,7 @@ class AssistantConfig {
44586
44619
  const routes = ["@kevisual/cnb/routes"];
44587
44620
  if (isCNB) {
44588
44621
  routes.push("@kevisual/project-search/routes");
44589
- id = "cnb-dev";
44622
+ id = "dev-cnb";
44590
44623
  }
44591
44624
  return {
44592
44625
  app: {
@@ -52670,7 +52703,7 @@ class RemoteApp {
52670
52703
  }
52671
52704
  }
52672
52705
 
52673
- // ../node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query-browser.js
52706
+ // ../node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query-browser.js
52674
52707
  var isTextForContentType = (contentType) => {
52675
52708
  if (!contentType)
52676
52709
  return false;
@@ -52873,10 +52906,6 @@ class Query {
52873
52906
  });
52874
52907
  }
52875
52908
  }
52876
- const headers2 = req.headers || {};
52877
- if (options?.token && !headers2["Authorization"]) {
52878
- headers2["Authorization"] = `Bearer ${options.token}`;
52879
- }
52880
52909
  } catch (e) {
52881
52910
  console.error("request beforeFn error", e, req);
52882
52911
  return wrapperError({
@@ -52937,20 +52966,20 @@ class Query {
52937
52966
  this.afterResponse = fn;
52938
52967
  }
52939
52968
  async fetchText(urlOrOptions, options) {
52940
- let _options = { method: "GET", ...options };
52969
+ let _options = { ...options };
52941
52970
  if (typeof urlOrOptions === "string" && !_options.url) {
52942
52971
  _options.url = urlOrOptions;
52943
52972
  }
52944
52973
  if (typeof urlOrOptions === "object") {
52945
52974
  _options = { ...urlOrOptions, ..._options };
52946
52975
  }
52947
- const headers = { ...this.headers, ..._options.headers };
52948
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
52949
- headers["Authorization"] = `Bearer ${options.token}`;
52950
- }
52951
52976
  const res = await adapter({
52977
+ method: "GET",
52952
52978
  ..._options,
52953
- headers
52979
+ headers: {
52980
+ ...this.headers,
52981
+ ..._options?.headers || {}
52982
+ }
52954
52983
  });
52955
52984
  if (res && !res.code) {
52956
52985
  return {
@@ -52962,7 +52991,7 @@ class Query {
52962
52991
  }
52963
52992
  }
52964
52993
 
52965
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router-browser.js
52994
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router-browser.js
52966
52995
  var __create5 = Object.create;
52967
52996
  var __getProtoOf5 = Object.getPrototypeOf;
52968
52997
  var __defProp5 = Object.defineProperty;
@@ -100609,7 +100638,7 @@ var checkLocalUser = async (opts) => {
100609
100638
  }
100610
100639
  }
100611
100640
  };
100612
- // ../node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query.js
100641
+ // ../node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query.js
100613
100642
  var isTextForContentType2 = (contentType) => {
100614
100643
  if (!contentType)
100615
100644
  return false;
@@ -100812,10 +100841,6 @@ class Query2 {
100812
100841
  });
100813
100842
  }
100814
100843
  }
100815
- const headers2 = req.headers || {};
100816
- if (options?.token && !headers2["Authorization"]) {
100817
- headers2["Authorization"] = `Bearer ${options.token}`;
100818
- }
100819
100844
  } catch (e) {
100820
100845
  console.error("request beforeFn error", e, req);
100821
100846
  return wrapperError2({
@@ -100876,20 +100901,20 @@ class Query2 {
100876
100901
  this.afterResponse = fn;
100877
100902
  }
100878
100903
  async fetchText(urlOrOptions, options) {
100879
- let _options = { method: "GET", ...options };
100904
+ let _options = { ...options };
100880
100905
  if (typeof urlOrOptions === "string" && !_options.url) {
100881
100906
  _options.url = urlOrOptions;
100882
100907
  }
100883
100908
  if (typeof urlOrOptions === "object") {
100884
100909
  _options = { ...urlOrOptions, ..._options };
100885
100910
  }
100886
- const headers = { ...this.headers, ..._options.headers };
100887
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
100888
- headers["Authorization"] = `Bearer ${options.token}`;
100889
- }
100890
100911
  const res = await adapter2({
100912
+ method: "GET",
100891
100913
  ..._options,
100892
- headers
100914
+ headers: {
100915
+ ...this.headers,
100916
+ ..._options?.headers || {}
100917
+ }
100893
100918
  });
100894
100919
  if (res && !res.code) {
100895
100920
  return {
@@ -103445,7 +103470,7 @@ var simpleRouter = useContextKey("simpleRouter", () => {
103445
103470
  });
103446
103471
  app.createRouteList();
103447
103472
 
103448
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/opencode.js
103473
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/opencode.js
103449
103474
  import { createRequire as createRequire4 } from "node:module";
103450
103475
  import { webcrypto as crypto4 } from "node:crypto";
103451
103476
  var __create7 = Object.create;
@@ -123001,7 +123026,7 @@ var createOSInfo = (more = false) => {
123001
123026
  return labels;
123002
123027
  };
123003
123028
 
123004
- // src/routes/cnb-board/cnb-dev-env.ts
123029
+ // src/routes/cnb-board/dev-cnb-env.ts
123005
123030
  var notCNBCheck = (ctx) => {
123006
123031
  const isCNB = useKey2("CNB");
123007
123032
  if (!isCNB) {
@@ -124157,7 +124182,7 @@ var import_busboy = __toESM(require_lib2(), 1);
124157
124182
  import path16 from "path";
124158
124183
  import fs19 from "fs";
124159
124184
 
124160
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/src/server/cookie.ts
124185
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/src/server/cookie.ts
124161
124186
  var NullObject2 = /* @__PURE__ */ (() => {
124162
124187
  const C2 = function() {};
124163
124188
  C2.prototype = Object.create(null);
@@ -62838,7 +62838,7 @@ var useKey = (envKey, initKey = "context") => {
62838
62838
  return null;
62839
62839
  };
62840
62840
 
62841
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router.js
62841
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router.js
62842
62842
  import { createRequire as createRequire2 } from "node:module";
62843
62843
  import { webcrypto as crypto2 } from "node:crypto";
62844
62844
  import http from "node:http";
@@ -80356,7 +80356,7 @@ class QueryRouter {
80356
80356
  console.error("=====debug====:", e);
80357
80357
  console.error("=====debug====:[path:key]:", `${route.path}-${route.key}`);
80358
80358
  }
80359
- if (e instanceof CustomError) {
80359
+ if (e instanceof CustomError || e?.code) {
80360
80360
  ctx.code = e.code;
80361
80361
  ctx.message = e.message;
80362
80362
  } else {
@@ -80619,6 +80619,39 @@ class QueryRouterServer extends QueryRouter {
80619
80619
  const { path, key, id } = api2;
80620
80620
  return this.run({ path, key, id, payload }, ctx);
80621
80621
  }
80622
+ async createAuth(fun) {
80623
+ this.route({
80624
+ path: "auth",
80625
+ key: "auth",
80626
+ id: "auth",
80627
+ description: "token验证"
80628
+ }).define(async (ctx) => {
80629
+ if (fun) {
80630
+ await fun(ctx, "auth");
80631
+ }
80632
+ }).addTo(this, { overwrite: false });
80633
+ this.route({
80634
+ path: "auth-admin",
80635
+ key: "auth-admin",
80636
+ id: "auth-admin",
80637
+ description: "admin token验证",
80638
+ middleware: ["auth"]
80639
+ }).define(async (ctx) => {
80640
+ if (fun) {
80641
+ await fun(ctx, "auth-admin");
80642
+ }
80643
+ }).addTo(this, { overwrite: false });
80644
+ this.route({
80645
+ path: "auth-can",
80646
+ key: "auth-can",
80647
+ id: "auth-can",
80648
+ description: "权限验证"
80649
+ }).define(async (ctx) => {
80650
+ if (fun) {
80651
+ await fun(ctx, "auth-can");
80652
+ }
80653
+ }).addTo(this, { overwrite: false });
80654
+ }
80622
80655
  }
80623
80656
  var isNode2 = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
80624
80657
  var isBrowser22 = typeof window !== "undefined" && typeof document !== "undefined" && typeof document.createElement === "function";
@@ -81543,7 +81576,7 @@ class App extends QueryRouterServer {
81543
81576
  }
81544
81577
  }
81545
81578
 
81546
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router-simple.js
81579
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router-simple.js
81547
81580
  import url3 from "node:url";
81548
81581
  var __create3 = Object.create;
81549
81582
  var __getProtoOf3 = Object.getPrototypeOf;
@@ -83721,7 +83754,7 @@ class AssistantConfig {
83721
83754
  const routes = ["@kevisual/cnb/routes"];
83722
83755
  if (isCNB) {
83723
83756
  routes.push("@kevisual/project-search/routes");
83724
- id = "cnb-dev";
83757
+ id = "dev-cnb";
83725
83758
  }
83726
83759
  return {
83727
83760
  app: {
@@ -92550,7 +92583,7 @@ class RemoteApp {
92550
92583
  }
92551
92584
  }
92552
92585
 
92553
- // ../node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query-browser.js
92586
+ // ../node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query-browser.js
92554
92587
  var isTextForContentType = (contentType) => {
92555
92588
  if (!contentType)
92556
92589
  return false;
@@ -92753,10 +92786,6 @@ class Query {
92753
92786
  });
92754
92787
  }
92755
92788
  }
92756
- const headers2 = req.headers || {};
92757
- if (options?.token && !headers2["Authorization"]) {
92758
- headers2["Authorization"] = `Bearer ${options.token}`;
92759
- }
92760
92789
  } catch (e) {
92761
92790
  console.error("request beforeFn error", e, req);
92762
92791
  return wrapperError({
@@ -92817,20 +92846,20 @@ class Query {
92817
92846
  this.afterResponse = fn;
92818
92847
  }
92819
92848
  async fetchText(urlOrOptions, options) {
92820
- let _options = { method: "GET", ...options };
92849
+ let _options = { ...options };
92821
92850
  if (typeof urlOrOptions === "string" && !_options.url) {
92822
92851
  _options.url = urlOrOptions;
92823
92852
  }
92824
92853
  if (typeof urlOrOptions === "object") {
92825
92854
  _options = { ...urlOrOptions, ..._options };
92826
92855
  }
92827
- const headers = { ...this.headers, ..._options.headers };
92828
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
92829
- headers["Authorization"] = `Bearer ${options.token}`;
92830
- }
92831
92856
  const res = await adapter({
92857
+ method: "GET",
92832
92858
  ..._options,
92833
- headers
92859
+ headers: {
92860
+ ...this.headers,
92861
+ ..._options?.headers || {}
92862
+ }
92834
92863
  });
92835
92864
  if (res && !res.code) {
92836
92865
  return {
@@ -92842,7 +92871,7 @@ class Query {
92842
92871
  }
92843
92872
  }
92844
92873
 
92845
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router-browser.js
92874
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router-browser.js
92846
92875
  var __create5 = Object.create;
92847
92876
  var __getProtoOf5 = Object.getPrototypeOf;
92848
92877
  var __defProp5 = Object.defineProperty;
@@ -139907,7 +139936,7 @@ var checkLocalUser = async (opts) => {
139907
139936
  }
139908
139937
  }
139909
139938
  };
139910
- // ../node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query.js
139939
+ // ../node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query.js
139911
139940
  var isTextForContentType2 = (contentType) => {
139912
139941
  if (!contentType)
139913
139942
  return false;
@@ -140110,10 +140139,6 @@ class Query2 {
140110
140139
  });
140111
140140
  }
140112
140141
  }
140113
- const headers2 = req.headers || {};
140114
- if (options?.token && !headers2["Authorization"]) {
140115
- headers2["Authorization"] = `Bearer ${options.token}`;
140116
- }
140117
140142
  } catch (e) {
140118
140143
  console.error("request beforeFn error", e, req);
140119
140144
  return wrapperError2({
@@ -140174,20 +140199,20 @@ class Query2 {
140174
140199
  this.afterResponse = fn;
140175
140200
  }
140176
140201
  async fetchText(urlOrOptions, options) {
140177
- let _options = { method: "GET", ...options };
140202
+ let _options = { ...options };
140178
140203
  if (typeof urlOrOptions === "string" && !_options.url) {
140179
140204
  _options.url = urlOrOptions;
140180
140205
  }
140181
140206
  if (typeof urlOrOptions === "object") {
140182
140207
  _options = { ...urlOrOptions, ..._options };
140183
140208
  }
140184
- const headers = { ...this.headers, ..._options.headers };
140185
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
140186
- headers["Authorization"] = `Bearer ${options.token}`;
140187
- }
140188
140209
  const res = await adapter2({
140210
+ method: "GET",
140189
140211
  ..._options,
140190
- headers
140212
+ headers: {
140213
+ ...this.headers,
140214
+ ..._options?.headers || {}
140215
+ }
140191
140216
  });
140192
140217
  if (res && !res.code) {
140193
140218
  return {
@@ -147295,7 +147320,7 @@ var createOSInfo = (more = false) => {
147295
147320
  return labels;
147296
147321
  };
147297
147322
 
147298
- // src/routes/cnb-board/cnb-dev-env.ts
147323
+ // src/routes/cnb-board/dev-cnb-env.ts
147299
147324
  var notCNBCheck = (ctx) => {
147300
147325
  const isCNB = useKey("CNB");
147301
147326
  if (!isCNB) {
@@ -149128,7 +149153,7 @@ var import_busboy = __toESM(require_lib2(), 1);
149128
149153
  import path20 from "path";
149129
149154
  import fs23 from "fs";
149130
149155
 
149131
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/src/server/cookie.ts
149156
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/src/server/cookie.ts
149132
149157
  var NullObject2 = /* @__PURE__ */ (() => {
149133
149158
  const C2 = function() {};
149134
149159
  C2.prototype = Object.create(null);
package/dist/assistant.js CHANGED
@@ -28859,7 +28859,7 @@ class AssistantConfig {
28859
28859
  const routes = ["@kevisual/cnb/routes"];
28860
28860
  if (isCNB) {
28861
28861
  routes.push("@kevisual/project-search/routes");
28862
- id = "cnb-dev";
28862
+ id = "dev-cnb";
28863
28863
  }
28864
28864
  return {
28865
28865
  app: {
@@ -36931,7 +36931,7 @@ class RemoteApp {
36931
36931
  }
36932
36932
  }
36933
36933
 
36934
- // ../node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query-browser.js
36934
+ // ../node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query-browser.js
36935
36935
  var isTextForContentType = (contentType) => {
36936
36936
  if (!contentType)
36937
36937
  return false;
@@ -37134,10 +37134,6 @@ class Query {
37134
37134
  });
37135
37135
  }
37136
37136
  }
37137
- const headers2 = req.headers || {};
37138
- if (options?.token && !headers2["Authorization"]) {
37139
- headers2["Authorization"] = `Bearer ${options.token}`;
37140
- }
37141
37137
  } catch (e) {
37142
37138
  console.error("request beforeFn error", e, req);
37143
37139
  return wrapperError({
@@ -37198,20 +37194,20 @@ class Query {
37198
37194
  this.afterResponse = fn;
37199
37195
  }
37200
37196
  async fetchText(urlOrOptions, options) {
37201
- let _options = { method: "GET", ...options };
37197
+ let _options = { ...options };
37202
37198
  if (typeof urlOrOptions === "string" && !_options.url) {
37203
37199
  _options.url = urlOrOptions;
37204
37200
  }
37205
37201
  if (typeof urlOrOptions === "object") {
37206
37202
  _options = { ...urlOrOptions, ..._options };
37207
37203
  }
37208
- const headers = { ...this.headers, ..._options.headers };
37209
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
37210
- headers["Authorization"] = `Bearer ${options.token}`;
37211
- }
37212
37204
  const res = await adapter({
37205
+ method: "GET",
37213
37206
  ..._options,
37214
- headers
37207
+ headers: {
37208
+ ...this.headers,
37209
+ ..._options?.headers || {}
37210
+ }
37215
37211
  });
37216
37212
  if (res && !res.code) {
37217
37213
  return {
@@ -37223,7 +37219,7 @@ class Query {
37223
37219
  }
37224
37220
  }
37225
37221
 
37226
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router-browser.js
37222
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router-browser.js
37227
37223
  var __create3 = Object.create;
37228
37224
  var __getProtoOf3 = Object.getPrototypeOf;
37229
37225
  var __defProp3 = Object.defineProperty;
@@ -70228,7 +70224,7 @@ var getStringHash = (str) => {
70228
70224
  return crypto2.createHash("md5").update(str).digest("hex");
70229
70225
  };
70230
70226
 
70231
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router.js
70227
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router.js
70232
70228
  import { createRequire as createRequire3 } from "node:module";
70233
70229
  import { webcrypto as crypto3 } from "node:crypto";
70234
70230
  import http from "node:http";
@@ -87730,7 +87726,7 @@ class QueryRouter {
87730
87726
  console.error("=====debug====:", e);
87731
87727
  console.error("=====debug====:[path:key]:", `${route.path}-${route.key}`);
87732
87728
  }
87733
- if (e instanceof CustomError) {
87729
+ if (e instanceof CustomError || e?.code) {
87734
87730
  ctx.code = e.code;
87735
87731
  ctx.message = e.message;
87736
87732
  } else {
@@ -87993,6 +87989,39 @@ class QueryRouterServer2 extends QueryRouter {
87993
87989
  const { path: path7, key, id } = api2;
87994
87990
  return this.run({ path: path7, key, id, payload }, ctx);
87995
87991
  }
87992
+ async createAuth(fun) {
87993
+ this.route({
87994
+ path: "auth",
87995
+ key: "auth",
87996
+ id: "auth",
87997
+ description: "token验证"
87998
+ }).define(async (ctx) => {
87999
+ if (fun) {
88000
+ await fun(ctx, "auth");
88001
+ }
88002
+ }).addTo(this, { overwrite: false });
88003
+ this.route({
88004
+ path: "auth-admin",
88005
+ key: "auth-admin",
88006
+ id: "auth-admin",
88007
+ description: "admin token验证",
88008
+ middleware: ["auth"]
88009
+ }).define(async (ctx) => {
88010
+ if (fun) {
88011
+ await fun(ctx, "auth-admin");
88012
+ }
88013
+ }).addTo(this, { overwrite: false });
88014
+ this.route({
88015
+ path: "auth-can",
88016
+ key: "auth-can",
88017
+ id: "auth-can",
88018
+ description: "权限验证"
88019
+ }).define(async (ctx) => {
88020
+ if (fun) {
88021
+ await fun(ctx, "auth-can");
88022
+ }
88023
+ }).addTo(this, { overwrite: false });
88024
+ }
87996
88025
  }
87997
88026
  var isNode22 = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
87998
88027
  var isBrowser22 = typeof window !== "undefined" && typeof document !== "undefined" && typeof document.createElement === "function";
@@ -88917,7 +88946,7 @@ class App extends QueryRouterServer2 {
88917
88946
  }
88918
88947
  }
88919
88948
 
88920
- // ../node_modules/.pnpm/@kevisual+router@0.1.5/node_modules/@kevisual/router/dist/router-simple.js
88949
+ // ../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router-simple.js
88921
88950
  import url5 from "node:url";
88922
88951
  var __create5 = Object.create;
88923
88952
  var __getProtoOf5 = Object.getPrototypeOf;
@@ -90114,7 +90143,7 @@ var source_default = chalk;
90114
90143
  // src/module/chalk.ts
90115
90144
  var chalk2 = new Chalk({ level: 3 });
90116
90145
 
90117
- // ../node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query.js
90146
+ // ../node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query.js
90118
90147
  var isTextForContentType2 = (contentType) => {
90119
90148
  if (!contentType)
90120
90149
  return false;
@@ -90317,10 +90346,6 @@ class Query2 {
90317
90346
  });
90318
90347
  }
90319
90348
  }
90320
- const headers2 = req.headers || {};
90321
- if (options?.token && !headers2["Authorization"]) {
90322
- headers2["Authorization"] = `Bearer ${options.token}`;
90323
- }
90324
90349
  } catch (e) {
90325
90350
  console.error("request beforeFn error", e, req);
90326
90351
  return wrapperError2({
@@ -90381,20 +90406,20 @@ class Query2 {
90381
90406
  this.afterResponse = fn;
90382
90407
  }
90383
90408
  async fetchText(urlOrOptions, options) {
90384
- let _options = { method: "GET", ...options };
90409
+ let _options = { ...options };
90385
90410
  if (typeof urlOrOptions === "string" && !_options.url) {
90386
90411
  _options.url = urlOrOptions;
90387
90412
  }
90388
90413
  if (typeof urlOrOptions === "object") {
90389
90414
  _options = { ...urlOrOptions, ..._options };
90390
90415
  }
90391
- const headers = { ...this.headers, ..._options.headers };
90392
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
90393
- headers["Authorization"] = `Bearer ${options.token}`;
90394
- }
90395
90416
  const res = await adapter2({
90417
+ method: "GET",
90396
90418
  ..._options,
90397
- headers
90419
+ headers: {
90420
+ ...this.headers,
90421
+ ..._options?.headers || {}
90422
+ }
90398
90423
  });
90399
90424
  if (res && !res.code) {
90400
90425
  return {
package/dist/envision.js CHANGED
@@ -22530,8 +22530,8 @@ InitEnv.init();
22530
22530
  var version = useContextKey("version", () => {
22531
22531
  let version2 = "0.0.64";
22532
22532
  try {
22533
- if ("0.1.28")
22534
- version2 = "0.1.28";
22533
+ if ("0.1.29")
22534
+ version2 = "0.1.29";
22535
22535
  } catch (e) {}
22536
22536
  return version2;
22537
22537
  });
@@ -25366,7 +25366,7 @@ var dist_default6 = createPrompt((config, done) => {
25366
25366
  var import_md5 = __toESM(require_md5(), 1);
25367
25367
  var import_jsonwebtoken = __toESM(require_jsonwebtoken(), 1);
25368
25368
 
25369
- // node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query.js
25369
+ // node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query.js
25370
25370
  var isTextForContentType = (contentType) => {
25371
25371
  if (!contentType)
25372
25372
  return false;
@@ -25569,10 +25569,6 @@ class Query {
25569
25569
  });
25570
25570
  }
25571
25571
  }
25572
- const headers2 = req.headers || {};
25573
- if (options?.token && !headers2["Authorization"]) {
25574
- headers2["Authorization"] = `Bearer ${options.token}`;
25575
- }
25576
25572
  } catch (e) {
25577
25573
  console.error("request beforeFn error", e, req);
25578
25574
  return wrapperError({
@@ -25633,20 +25629,20 @@ class Query {
25633
25629
  this.afterResponse = fn;
25634
25630
  }
25635
25631
  async fetchText(urlOrOptions, options) {
25636
- let _options = { method: "GET", ...options };
25632
+ let _options = { ...options };
25637
25633
  if (typeof urlOrOptions === "string" && !_options.url) {
25638
25634
  _options.url = urlOrOptions;
25639
25635
  }
25640
25636
  if (typeof urlOrOptions === "object") {
25641
25637
  _options = { ...urlOrOptions, ..._options };
25642
25638
  }
25643
- const headers = { ...this.headers, ..._options.headers };
25644
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
25645
- headers["Authorization"] = `Bearer ${options.token}`;
25646
- }
25647
25639
  const res = await adapter({
25640
+ method: "GET",
25648
25641
  ..._options,
25649
- headers
25642
+ headers: {
25643
+ ...this.headers,
25644
+ ..._options?.headers || {}
25645
+ }
25650
25646
  });
25651
25647
  if (res && !res.code) {
25652
25648
  return {
@@ -25658,7 +25654,7 @@ class Query {
25658
25654
  }
25659
25655
  }
25660
25656
 
25661
- // node_modules/.pnpm/@kevisual+query@0.0.53/node_modules/@kevisual/query/dist/query-browser.js
25657
+ // node_modules/.pnpm/@kevisual+query@0.0.55/node_modules/@kevisual/query/dist/query-browser.js
25662
25658
  var isTextForContentType2 = (contentType) => {
25663
25659
  if (!contentType)
25664
25660
  return false;
@@ -25861,10 +25857,6 @@ class Query2 {
25861
25857
  });
25862
25858
  }
25863
25859
  }
25864
- const headers2 = req.headers || {};
25865
- if (options?.token && !headers2["Authorization"]) {
25866
- headers2["Authorization"] = `Bearer ${options.token}`;
25867
- }
25868
25860
  } catch (e) {
25869
25861
  console.error("request beforeFn error", e, req);
25870
25862
  return wrapperError2({
@@ -25925,20 +25917,20 @@ class Query2 {
25925
25917
  this.afterResponse = fn;
25926
25918
  }
25927
25919
  async fetchText(urlOrOptions, options) {
25928
- let _options = { method: "GET", ...options };
25920
+ let _options = { ...options };
25929
25921
  if (typeof urlOrOptions === "string" && !_options.url) {
25930
25922
  _options.url = urlOrOptions;
25931
25923
  }
25932
25924
  if (typeof urlOrOptions === "object") {
25933
25925
  _options = { ...urlOrOptions, ..._options };
25934
25926
  }
25935
- const headers = { ...this.headers, ..._options.headers };
25936
- if (options?.token && !headers["Authorization"] && _options.method !== "GET") {
25937
- headers["Authorization"] = `Bearer ${options.token}`;
25938
- }
25939
25927
  const res = await adapter2({
25928
+ method: "GET",
25940
25929
  ..._options,
25941
- headers
25930
+ headers: {
25931
+ ...this.headers,
25932
+ ..._options?.headers || {}
25933
+ }
25942
25934
  });
25943
25935
  if (res && !res.code) {
25944
25936
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cli",
3
- "version": "0.1.29",
3
+ "version": "0.1.30",
4
4
  "description": "envision 命令行工具",
5
5
  "type": "module",
6
6
  "basename": "/root/cli",
@@ -45,7 +45,7 @@
45
45
  "@kevisual/app": "^0.0.2",
46
46
  "@kevisual/auth": "^2.0.3",
47
47
  "@kevisual/context": "^0.0.8",
48
- "@kevisual/router": "^0.1.5",
48
+ "@kevisual/router": "^0.1.6",
49
49
  "@kevisual/use-config": "^1.0.30",
50
50
  "@opencode-ai/sdk": "^1.2.27",
51
51
  "@types/busboy": "^1.5.4",
@@ -66,8 +66,8 @@
66
66
  "@kevisual/dts": "^0.0.4",
67
67
  "@kevisual/load": "^0.0.6",
68
68
  "@kevisual/logger": "^0.0.4",
69
- "@kevisual/query": "0.0.53",
70
- "@types/bun": "^1.3.10",
69
+ "@kevisual/query": "0.0.55",
70
+ "@types/bun": "^1.3.11",
71
71
  "@types/crypto-js": "^4.2.2",
72
72
  "@types/jsonwebtoken": "^9.0.10",
73
73
  "@types/micromatch": "^4.0.10",