@dj1029/plugin-smart-sl 0.0.27 → 0.0.28

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.
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ export declare function getSmartBIAuthToken(): import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
3
+ username: z.ZodString;
4
+ password: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ username?: string;
7
+ password?: string;
8
+ }, {
9
+ username?: string;
10
+ password?: string;
11
+ }>, {
12
+ username?: string;
13
+ password?: string;
14
+ }, {
15
+ username?: string;
16
+ password?: string;
17
+ }, string | import("axios").AxiosResponse<any, any, {}>>;
18
+ //# sourceMappingURL=AuthTokenTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthTokenTool.d.ts","sourceRoot":"","sources":["../../src/lib/AuthTokenTool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,wBAAgB,mBAAmB;;;;;;;;;;;;;;;yDA8BlC"}
@@ -0,0 +1,33 @@
1
+ import { tool } from '@langchain/core/tools';
2
+ import { getErrorMessage } from '@xpert-ai/plugin-sdk';
3
+ import { z } from 'zod';
4
+ import request from "./http-client.service.js";
5
+ export function getSmartBIAuthToken() {
6
+ return tool(async (input) => {
7
+ try {
8
+ const req = await request({
9
+ url: '/login',
10
+ method: 'post',
11
+ data: input,
12
+ headers: {
13
+ isToken: false,
14
+ token: 'abcdefghijklmnopqrstuvwsyz'
15
+ }
16
+ });
17
+ console.log("req ---------- ", req);
18
+ return req;
19
+ }
20
+ catch (error) {
21
+ return "I don't know how to do that because: " + getErrorMessage(error);
22
+ }
23
+ }, {
24
+ name: 'smart_auth_token',
25
+ description: `获取smartBI系统的认证token`,
26
+ /** 这里决定了 测试的参数 */
27
+ schema: z.object({
28
+ username: z.string().describe('连接用户名'),
29
+ password: z.string().describe('连接密码')
30
+ }),
31
+ verboseParsingErrors: true
32
+ });
33
+ }
@@ -0,0 +1,18 @@
1
+ import { z } from 'zod';
2
+ export declare function getSmartBIAuthToken(): import("@langchain/core/tools").DynamicStructuredTool<z.ZodObject<{
3
+ username: z.ZodString;
4
+ token: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ username?: string;
7
+ token?: string;
8
+ }, {
9
+ username?: string;
10
+ token?: string;
11
+ }>, {
12
+ username?: string;
13
+ token?: string;
14
+ }, {
15
+ username?: string;
16
+ token?: string;
17
+ }, string | import("axios").AxiosResponse<any, any, {}>>;
18
+ //# sourceMappingURL=SysUserTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SysUserTool.d.ts","sourceRoot":"","sources":["../../src/lib/SysUserTool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,wBAAgB,mBAAmB;;;;;;;;;;;;;;;yDA6BlC"}
@@ -0,0 +1,32 @@
1
+ import { tool } from '@langchain/core/tools';
2
+ import { getErrorMessage } from '@xpert-ai/plugin-sdk';
3
+ import { z } from 'zod';
4
+ import request from "./http-client.service.js";
5
+ export function getSmartBIAuthToken() {
6
+ return tool(async (input) => {
7
+ try {
8
+ const req = await request({
9
+ url: '/system/user/list',
10
+ method: 'get',
11
+ data: input,
12
+ headers: {
13
+ token: 'abcdefghijklmnopqrstuvwsyz'
14
+ }
15
+ });
16
+ console.log("req ---------- ", req);
17
+ return req;
18
+ }
19
+ catch (error) {
20
+ return "I don't know how to do that because: " + getErrorMessage(error);
21
+ }
22
+ }, {
23
+ name: 'smart_user_list',
24
+ description: `获取smartBI系统的用户列表`,
25
+ /** 这里决定了 测试的参数 */
26
+ schema: z.object({
27
+ username: z.string().describe('连接用户名'),
28
+ token: z.string().describe('认证token')
29
+ }),
30
+ verboseParsingErrors: true
31
+ });
32
+ }
@@ -3,7 +3,7 @@ import { Injectable } from '@nestjs/common';
3
3
  import { ToolsetStrategy } from '@xpert-ai/plugin-sdk';
4
4
  import { SmartBIName, iconImage } from './types.js';
5
5
  import { SmartToolset } from "./toolset.js";
6
- import { getSmartBIAuthToken } from "./tool.js";
6
+ import { getSmartBIAuthToken } from "./AuthTokenTool.js";
7
7
  let SmartStrategy = class SmartStrategy {
8
8
  constructor() {
9
9
  this.meta = {
@@ -1,5 +1,5 @@
1
1
  import { BuiltinToolset } from '@xpert-ai/plugin-sdk';
2
- import { getSmartBIAuthToken } from './tool.js';
2
+ import { getSmartBIAuthToken } from './AuthTokenTool.js';
3
3
  export class SmartToolset extends BuiltinToolset {
4
4
  async _validateCredentials(credentials) {
5
5
  // No credentials needed for calculator toolset
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dj1029/plugin-smart-sl",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",