@dj1029/plugin-smart-sl 0.0.21 → 0.0.23

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.
@@ -1 +1 @@
1
- {"version":3,"file":"http-client.service.d.ts","sourceRoot":"","sources":["../../src/lib/http-client.service.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,OAAO,+BAGX,CAAC;AA8HH,eAAe,OAAO,CAAA;AAGtB,qBACa,iBAAiB;IAC1B,OAAO,CAAC,aAAa,CAAC;;IAqBtB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAC,IAAI,CAAC,EAAE,GAAG;IAI1B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAK/B"}
1
+ {"version":3,"file":"http-client.service.d.ts","sourceRoot":"","sources":["../../src/lib/http-client.service.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,OAAO,+BAGX,CAAC;AAkIH,eAAe,OAAO,CAAA;AAGtB,qBACa,iBAAiB;IAC1B,OAAO,CAAC,aAAa,CAAC;;IAqBtB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAC,IAAI,CAAC,EAAE,GAAG;IAI1B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAK/B"}
@@ -15,6 +15,10 @@ const service = axios.create({
15
15
  service.interceptors.request.use(config => {
16
16
  // 是否需要设置 token
17
17
  console.log("axios1 ---- config ---- ", config);
18
+ const isToken = config.headers.isToken === false;
19
+ if (!isToken) {
20
+ config.headers['Authorization'] = `Bearer ${config.headers.token}`;
21
+ }
18
22
  // get请求映射params参数
19
23
  if (config.method === 'get' && config.params) {
20
24
  let url = config.url + '?' + tansParams(config.params);
@@ -47,6 +47,6 @@ export declare class SmartStrategy implements IToolsetStrategy<any> {
47
47
  }, {
48
48
  username?: string;
49
49
  password?: string;
50
- }, any>[];
50
+ }, string | import("axios").AxiosResponse<any, any, {}>>[];
51
51
  }
52
52
  //# sourceMappingURL=smart.strategy.d.ts.map
@@ -14,5 +14,5 @@ export declare function buildSmartTool(): import("@langchain/core/tools").Dynami
14
14
  }, {
15
15
  username?: string;
16
16
  password?: string;
17
- }, any>;
17
+ }, string | import("axios").AxiosResponse<any, any, {}>>;
18
18
  //# sourceMappingURL=tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/lib/tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,wBAAgB,cAAc;;;;;;;;;;;;;;;QAqC7B"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/lib/tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,wBAAgB,cAAc;;;;;;;;;;;;;;;yDAqC7B"}
package/dist/lib/tool.js CHANGED
@@ -15,12 +15,12 @@ export function buildSmartTool() {
15
15
  method: 'post',
16
16
  data: input,
17
17
  headers: {
18
- isToken: false
19
- },
18
+ isToken: false,
19
+ token: 'abcdefghijklmnopqrstuvwsyz'
20
+ }
20
21
  });
21
22
  console.log("req ---------- ", req);
22
- console.log("req.data ---------- ", req.data);
23
- return req.data.token;
23
+ return req;
24
24
  }
25
25
  catch (error) {
26
26
  return "I don't know how to do that because: " + getErrorMessage(error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dj1029/plugin-smart-sl",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",