smartbi-toolkit 1.0.1 → 1.1.2

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/README.md ADDED
@@ -0,0 +1,117 @@
1
+ # 非官方smartbi开发工具包
2
+
3
+ * 可用于第三方系统上使用smartbi接口服务,封装了常用接口
4
+ * 扩展包构建工具封装 (todo)
5
+
6
+ ### 在smartbi-toolkit中封装了通用的请求方法
7
+
8
+ * smartbi方法,RMI方法调用封装
9
+ ```javascript
10
+ smartbi('服务名', '方法名', ['参数1', '参数2', '...']).then(res => {
11
+ })
12
+ ```
13
+ * 登录方法
14
+ ```javascript
15
+ login('用户名', '密码').then(res => {})
16
+ ```
17
+
18
+ * setSmartbiEnv 为开发环境设置smartbi变量,注意账号密码安全问题,不要直接把账号密码写入,在开发环境设置后可实现自动登录,生产环境需要自行实现登录,或者运行在smartbi下,无需登录
19
+
20
+ ```javascript
21
+ setSmartbiEnv({
22
+ dev: {
23
+ username: 'admin',
24
+ password: 'manager',
25
+ }, // smartbi开发环境下的账号密码,注意打包时不要填写,避免信息暴露
26
+ mode:'dev', // dev/ prod 开发和生产模式 。默认dev模式,该参数可忽略,只影响到smartbi的判断
27
+ path:'/smartbi',// smartbi服务路径,默认为/smartbi,如果部署在tomcat的ROOT目录下,该参数改为 "/"
28
+ noop:30000 //心跳循环时间,默认30秒
29
+ })
30
+ ```
31
+ * 开始心跳
32
+ ```javascript
33
+ startHeartbeat()
34
+ ```
35
+ * 停止心跳
36
+ ```javascript
37
+ stopHeartbeat()
38
+ ```
39
+
40
+ * 心跳方法,不使用startHeartbeat()和stopHeartbeat()方法,手动实现心跳
41
+ ```javascript
42
+ noop()
43
+ ```
44
+
45
+ ### ext扩展包构建工具,通过vite实现
46
+ 该工具为vite插件,可以一键生成ext扩展包,但需要有java和Apache Ant环境
47
+
48
+ ```javascript
49
+ import vitePluginSmartbi from 'smartbi-toolkit/VitePluginSmartbi'
50
+
51
+ export default defineConfig({
52
+ plugins: [
53
+ vitePluginSmartbi({
54
+ name:'ext-test',
55
+ })
56
+ ],
57
+ })
58
+ ```
59
+ #### 参数说明
60
+ ```typescript
61
+ export type VitePluginSmartbiOptions = {
62
+ /**
63
+ * 插件名称
64
+ */
65
+ name: string
66
+ /**
67
+ * 插件别名
68
+ */
69
+ alias?: string
70
+ /**
71
+ * 插件描述
72
+ */
73
+ desc?: string
74
+ /**
75
+ * 优先级
76
+ */
77
+ priority?: number
78
+ /**
79
+ * 输出目录
80
+ */
81
+ output?: string
82
+ /**
83
+ * html重命名
84
+ */
85
+ indexRename?: string
86
+ /**
87
+ * vision到html中间的路径
88
+ */
89
+ appendPath?: string,
90
+ /**
91
+ * 插件版本
92
+ */
93
+ version?: string
94
+ };
95
+ ```
96
+
97
+
98
+ ### 在smartbi-toolkit/xxxxService中,实现你官方文档定义的接口
99
+
100
+ * 代码大部分由AI通过官方文档生成,基本和官方保持一致,部分ts类型等可能存在错误
101
+ * 如遇到接口不可用,可以尝试使用smartbi()方法调用,如果依旧不可以,请查看官方文档,官方文档内也有相当大的一部分方法不可以
102
+ * 大部分接口均由AI通过官方文档生成JsDoc
103
+ * 官方文档https://wiki.smartbi.com.cn/api/javaapi/index.html
104
+
105
+
106
+
107
+
108
+ ### todo 开发中功能,后续实现
109
+ 1. 其他服务接口
110
+ * Smartbi-SDK.jar中包含的,但官方文档没有的接口
111
+ * 其他可通过rmi调用的接口
112
+ 2. TS类型优化
113
+ * TS类型没有完善,部分通过AI生成,后续需要从SDK中提取完整的类型信息
114
+ 3. 封装参数
115
+ * 目前参数封装为数组,后续需要封装为对象
116
+
117
+
package/package.json CHANGED
@@ -1,35 +1,159 @@
1
1
  {
2
2
  "name": "smartbi-toolkit",
3
3
  "private": false,
4
- "version": "1.0.1",
4
+ "version": "1.1.2",
5
+ "keys": [
6
+ "smartbi",
7
+ "扩展包",
8
+ "ext",
9
+ "typescript",
10
+ "smartbi-toolkit"
11
+ ],
5
12
  "type": "module",
6
- "module": "./dist/SmartbiToolbox.es.js",
13
+ "module": "./dist/index.js",
7
14
  "types": "./dist/index.d.ts",
15
+ "description": "SmartBI 非官方JS sdk和ext构建工具",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "https://github.com/StillAlexLiu/smartbi-toolkit.git"
19
+ },
8
20
  "exports": {
9
21
  ".": {
10
- "import": "./dist/SmartbiToolbox.es.js",
22
+ "import": "./dist/index.js",
11
23
  "types": "./dist/index.d.ts"
12
24
  },
25
+ "./VitePluginSmartbi": {
26
+ "import": "./dist/vite-plugin-smartbi/index.js",
27
+ "types": "./dist/vite-plugin-smartbi/index.d.ts"
28
+ },
29
+ "./AnalysisReportService": {
30
+ "import": "./dist/methods/AnalysisReportService.js",
31
+ "types": "./dist/methods/AnalysisReportService.d.ts"
32
+ },
33
+ "./BusinessThemeService": {
34
+ "import": "./dist/methods/BusinessThemeService.js",
35
+ "types": "./dist/methods/BusinessThemeService.d.ts"
36
+ },
37
+ "./BusinessViewService": {
38
+ "import": "./dist/methods/BusinessViewService.js",
39
+ "types": "./dist/methods/BusinessViewService.d.ts"
40
+ },
13
41
  "./CatalogService": {
14
- "import": "./dist/CatalogService.es.js",
42
+ "import": "./dist/methods/CatalogService.js",
15
43
  "types": "./dist/methods/CatalogService.d.ts"
44
+ },
45
+ "./ClientCombinedReportService": {
46
+ "import": "./dist/methods/ClientCombinedReportService.js",
47
+ "types": "./dist/methods/ClientCombinedReportService.d.ts"
48
+ },
49
+ "./ClientInsightService": {
50
+ "import": "./dist/methods/ClientInsightService.js",
51
+ "types": "./dist/methods/ClientInsightService.d.ts"
52
+ },
53
+ "./ClientReportService": {
54
+ "import": "./dist/methods/ClientReportService.js",
55
+ "types": "./dist/methods/ClientReportService.d.ts"
56
+ },
57
+ "./CombinedReportService": {
58
+ "import": "./dist/methods/CombinedReportService.js",
59
+ "types": "./dist/methods/CombinedReportService.d.ts"
60
+ },
61
+ "./DataSourceService": {
62
+ "import": "./dist/methods/DataSourceService.js",
63
+ "types": "./dist/methods/DataSourceService.d.ts"
64
+ },
65
+ "./GraphicReportService": {
66
+ "import": "./dist/methods/GraphicReportService.js",
67
+ "types": "./dist/methods/GraphicReportService.d.ts"
68
+ },
69
+ "./InsightReport": {
70
+ "import": "./dist/methods/InsightReport.js",
71
+ "types": "./dist/methods/InsightReport.d.ts"
72
+ },
73
+ "./MetadataService": {
74
+ "import": "./dist/methods/MetadataService.js",
75
+ "types": "./dist/methods/MetadataService.d.ts"
76
+ },
77
+ "./OfficeReport": {
78
+ "import": "./dist/methods/OfficeReport.js",
79
+ "types": "./dist/methods/OfficeReport.d.ts"
80
+ },
81
+ "./OfficeReportService": {
82
+ "import": "./dist/methods/OfficeReportService.js",
83
+ "types": "./dist/methods/OfficeReportService.d.ts"
84
+ },
85
+ "./OltpMetadataService": {
86
+ "import": "./dist/methods/OltpMetadataService.js",
87
+ "types": "./dist/methods/OltpMetadataService.d.ts"
88
+ },
89
+ "./ParameterService": {
90
+ "import": "./dist/methods/ParameterService.js",
91
+ "types": "./dist/methods/ParameterService.d.ts"
92
+ },
93
+ "./PoolService": {
94
+ "import": "./dist/methods/PoolService.js",
95
+ "types": "./dist/methods/PoolService.d.ts"
96
+ },
97
+ "./PortalService": {
98
+ "import": "./dist/methods/PortalService.js",
99
+ "types": "./dist/methods/PortalService.d.ts"
100
+ },
101
+ "./Report": {
102
+ "import": "./dist/methods/Report.js",
103
+ "types": "./dist/methods/Report.d.ts"
104
+ },
105
+ "./SSReport": {
106
+ "import": "./dist/methods/SSReport.js",
107
+ "types": "./dist/methods/SSReport.d.ts"
108
+ },
109
+ "./ScheduleTaskService": {
110
+ "import": "./dist/methods/ScheduleTaskService.js",
111
+ "types": "./dist/methods/ScheduleTaskService.d.ts"
112
+ },
113
+ "./SimpleReportService": {
114
+ "import": "./dist/methods/SimpleReportService.js",
115
+ "types": "./dist/methods/SimpleReportService.d.ts"
116
+ },
117
+ "./SpreadSheetReportService": {
118
+ "import": "./dist/methods/SpreadSheetReportService.js",
119
+ "types": "./dist/methods/SpreadSheetReportService.d.ts"
120
+ },
121
+ "./SystemConfigService": {
122
+ "import": "./dist/methods/SystemConfigService.js",
123
+ "types": "./dist/methods/SystemConfigService.d.ts"
124
+ },
125
+ "./TimeConsuming": {
126
+ "import": "./dist/methods/TimeConsuming.js",
127
+ "types": "./dist/methods/TimeConsuming.d.ts"
128
+ },
129
+ "./TimeConsumingService": {
130
+ "import": "./dist/methods/TimeConsumingService.js",
131
+ "types": "./dist/methods/TimeConsumingService.d.ts"
132
+ },
133
+ "./UserManagerService": {
134
+ "import": "./dist/methods/UserManagerService.js",
135
+ "types": "./dist/methods/UserManagerService.d.ts"
16
136
  }
17
137
  },
18
138
  "scripts": {
19
- "dev": "vite",
20
- "b": "tsc",
21
- "build": "tsc && vite build",
22
- "preview": "vite preview"
139
+ "build": "tsc"
23
140
  },
24
141
  "files": [
25
142
  "dist"
26
143
  ],
27
144
  "devDependencies": {
145
+ "@types/fs-extra": "^11.0.4",
146
+ "@types/node": "^25.0.10",
28
147
  "typescript": "~5.9.3",
29
- "vite": "8.0.0-beta.8",
30
- "vite-plugin-dts": "^4.5.4"
148
+ "vite": "8.0.0-beta.9"
149
+ },
150
+ "peerDependencies": {
151
+ "axios": "^1.3.6",
152
+ "chalk": "^5.2.0"
31
153
  },
32
154
  "dependencies": {
33
- "axios": "^1.13.2"
155
+ "axios": "^1.13.2",
156
+ "chalk": "^5.6.2",
157
+ "fs-extra": "^11.3.3"
34
158
  }
35
159
  }
@@ -1,112 +0,0 @@
1
- import { smartbi } from "./SmartbiToolbox.es.js";
2
- const AccessType = {
3
- REF: "REF",
4
- READ: "READ",
5
- WRITE: "WRITE"
6
- }, CatalogElementType = {
7
- FOLDER: "FOLDER",
8
- SIMPLE_REPORT: "SIMPLE_REPORT",
9
- ANALYSIS_REPORT: "ANALYSIS_REPORT",
10
- COMBINED_QUERY: "COMBINED_QUERY",
11
- INSIGHT: "INSIGHT",
12
- OLAP_REPORT: "OLAP_REPORT",
13
- DASHBOARD: "DASHBOARD",
14
- SMARTBIX_PAGE: "SMARTBIX_PAGE",
15
- DATASET: "DATASET",
16
- VISUAL: "VISUAL",
17
- SQL: "SQL",
18
- PROCEDURE: "PROCEDURE",
19
- NATIVE_SQL: "NATIVE_SQL",
20
- JAVA: "JAVA",
21
- SMARTBIX_DATASET: "SMARTBIX_DATASET",
22
- AUGMENTED_DATASET: "AUGMENTED_DATASET",
23
- BUSINESS_VIEW: "BUSINESS_VIEW",
24
- BUSINESS_SUBJECT: "BUSINESS_SUBJECT",
25
- BUSINESS_QUERY: "BUSINESS_QUERY",
26
- SPREADSHEET_REPORT: "SPREADSHEET_REPORT",
27
- WEB_SPREADSHEET_REPORT: "WEB_SPREADSHEET_REPORT",
28
- DATA_PROCESS: "SMARTBI_DATAPROCESS",
29
- ETL_AUTOMATION: "ETL_AUTOMATION",
30
- JOB_FLOW: "JOB_FLOW",
31
- DATA_MINING: "SMARTBI_MINING",
32
- URL_LINK: "URL",
33
- EXCEL_IMPORT_TEMPLATE: "excelimport",
34
- TXT_QUERY_OBJECT: "TXTQUERYOBJECT",
35
- TXT_DATA_SOURCE: "TXTDATASOURCE",
36
- SCHEMA: "SCHEMA",
37
- OLD_DATASET: "OLD_DATASET"
38
- }, PermissionType = {
39
- REF: "REF",
40
- READ: "READ",
41
- WRITE: "WRITE"
42
- }, PermissionDescendType = {
43
- ALL: "ALL",
44
- NONE: "NONE",
45
- READ_WRITE: "READ_WRITE"
46
- }, isCatalogElementAccessible = (y, b) => smartbi("CatalogService", "isCatalogElementAccessible", [y, b]), getRootElements = () => smartbi("CatalogService", "getRootElements", []), getChildElements = (y) => smartbi("CatalogService", "getChildElements", [y]), createFolder = (y, b, x, S, C, w) => smartbi("CatalogService", "createFolder", [
47
- y,
48
- b,
49
- x,
50
- S,
51
- C,
52
- w
53
- ]), createFolderById = (y, b, x, S, C, w, T) => smartbi("CatalogService", "createFolderById", [
54
- y,
55
- b,
56
- x,
57
- S,
58
- C,
59
- w,
60
- T
61
- ]), getCatalogElementById = (y) => smartbi("CatalogService", "getCatalogElementById", [y]), getCatalogElementByType = (y) => smartbi("CatalogService", "getCatalogElementByType", [y]), getChildElementsByTypes = (y, b) => smartbi("CatalogService", "getChildElementsByTypes", [y, b.toString()]), getAssignedPermissions = (y) => smartbi("CatalogService", "getAssignedPermissions", [y]), getInheritedPermissions = (y) => smartbi("CatalogService", "getInheritedPermissions", [y]), deleteCatalogElement = (y) => smartbi("CatalogService", "deleteCatalogElement", [y]), searchCatalogElementLikeAlias = (y, b) => smartbi("CatalogService", "searchCatalogElementLikeAlias", [y, b]), setAssignedPermissionByGroup = (y, b, x, S, C, w) => smartbi("CatalogService", "setAssignedPermissionByGroup", [
62
- y,
63
- b,
64
- x,
65
- S,
66
- C,
67
- w
68
- ]), setAssignedPermissionByRole = (y, b, x, S, C) => smartbi("CatalogService", "setAssignedPermissionByRole", [
69
- y,
70
- b,
71
- x,
72
- S,
73
- C
74
- ]), setAssignedPermissionByUser = (y, b, x, S, C) => smartbi("CatalogService", "setAssignedPermissionByUser", [
75
- y,
76
- b,
77
- x,
78
- S,
79
- C
80
- ]), updateCatalogElementImage = (y, b) => smartbi("CatalogService", "updateCatalogElementImage", [y, b]), updateCatalogNode = (y, b, x) => smartbi("CatalogService", "updateCatalogNode", [
81
- y,
82
- b,
83
- x
84
- ]), createURLLink = (y, b, x, S, C, w) => smartbi("CatalogService", "createURLLink", [
85
- y,
86
- b,
87
- x,
88
- S,
89
- C,
90
- w
91
- ]), updateURLLink = (y, b, x, S, C) => smartbi("CatalogService", "updateURLLink", [
92
- y,
93
- b,
94
- x,
95
- S,
96
- C
97
- ]), copyAndPasteReturnNewId = (y, b, x, S, C) => smartbi("CatalogService", "copyAndPasteReturnNewId", [
98
- y,
99
- b,
100
- x,
101
- S,
102
- C
103
- ]), createCatalogElement = (y, b, x, S, C, w, T) => smartbi("CatalogService", "createCatalogElement", [
104
- y,
105
- b,
106
- x,
107
- S,
108
- C,
109
- w,
110
- T
111
- ]);
112
- export { AccessType, CatalogElementType, PermissionDescendType, PermissionType, copyAndPasteReturnNewId, createCatalogElement, createFolder, createFolderById, createURLLink, deleteCatalogElement, getAssignedPermissions, getCatalogElementById, getCatalogElementByType, getChildElements, getChildElementsByTypes, getInheritedPermissions, getRootElements, isCatalogElementAccessible, searchCatalogElementLikeAlias, setAssignedPermissionByGroup, setAssignedPermissionByRole, setAssignedPermissionByUser, updateCatalogElementImage, updateCatalogNode, updateURLLink };
@@ -1,51 +0,0 @@
1
- import axios from "axios";
2
- var __smartbi_env = {
3
- username: "",
4
- password: "",
5
- smartbiPath: "/smartbi"
6
- };
7
- const setSmartbiEnv = ({ path: e = "/smartbi", dev: r, noop: i = 3e3 }) => {
8
- console.log(e, r, i), __smartbi_env.username = r?.username || "", __smartbi_env.password = r?.password || "", r && console.log("请勿将账号信息直接赋值到username和password中,避免暴露账号密码,如需要,可考虑从环境变量.env文件中获取");
9
- }, { emit, on, handler, setStatus } = (() => {
10
- let e = /* @__PURE__ */ new Set(), n = "offline";
11
- return {
12
- setStatus(e) {
13
- n = e;
14
- },
15
- emit() {
16
- e.forEach((e) => {
17
- e();
18
- }), e.clear();
19
- },
20
- on(n) {
21
- e.add(n);
22
- },
23
- handler(e) {
24
- return new Promise((r) => {
25
- e ? n === "offline" ? (n = "pending", login().then(() => {
26
- emit(), r();
27
- })) : n === "online" ? r() : n === "pending" && on(() => {
28
- r();
29
- }) : r();
30
- });
31
- }
32
- };
33
- })(), smartbi = (r, i, a, o = !0) => new Promise((s, c) => {
34
- handler(o).then(() => axios.post(`${__smartbi_env.smartbiPath}/vision/RMIServlet`, {
35
- className: r,
36
- methodName: i,
37
- params: JSON.stringify(a)
38
- }, { headers: {
39
- "Content-Type": "application/x-www-form-urlencoded",
40
- "X-Requested-With": "XMLHttpRequest"
41
- } })).then((e) => {
42
- e.data.retCode === 0 ? s(e.data.result) : (console.error("smartbi返回状态错误"), console.error(e.data.stackTrace), c(Error(e.data.stackTrace)));
43
- }).catch((e) => {
44
- c(e);
45
- });
46
- }), login = (e) => new Promise((r) => {
47
- smartbi("UserService", "login", [e?.username || __smartbi_env.username, e?.password || __smartbi_env.password], !1).then((e) => {
48
- setStatus("online"), r(e);
49
- });
50
- });
51
- export { emit, handler, login, on, setSmartbiEnv, setStatus, smartbi };
package/dist/index.d.ts DELETED
@@ -1,22 +0,0 @@
1
- export type SmartbiDev = {
2
- username: string;
3
- password: string;
4
- };
5
- export declare const setSmartbiEnv: ({ path, dev, noop, }: {
6
- path?: "/smartbi" | "" | string;
7
- dev?: SmartbiDev;
8
- noop?: number;
9
- }) => void;
10
- type Status = 'pending' | 'online' | 'offline';
11
- type PostStack = () => void;
12
- export declare const emit: () => void, on: (call: PostStack) => void, handler: (requireLogin: boolean) => Promise<void>, setStatus: (value: Status) => void;
13
- export declare const smartbi: <T>(className: string, methodName: string, params: Array<string | number | boolean | null | undefined>, requireLogin?: boolean) => Promise<T>;
14
- /**
15
- * 登录smartbi服务
16
- */
17
- export declare const login: (form?: {
18
- username: string;
19
- password: string;
20
- }) => Promise<unknown>;
21
- export {};
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,UAAU,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CACpB,CAAA;AASD,eAAO,MAAM,aAAa,GAAI,sBAIG;IAC7B,IAAI,CAAC,EAAE,UAAU,GAAG,EAAE,GAAG,MAAM,CAAC;IAChC,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,SAOA,CAAA;AACD,KAAK,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;AAC9C,KAAK,SAAS,GAAG,MAAM,IAAI,CAAA;AAwC3B,eAAO,MAAO,IAAI,cAAE,EAAE,SA1BL,SAAS,WA0BF,OAAO,iBAvBD,OAAO,KAAG,OAAO,CAAC,IAAI,CAAC,EAuBpB,SAAS,UAnCjB,MAAM,SAmC0B,CAAA;AACzD,eAAO,MAAM,OAAO,GAAI,CAAC,EACrB,WAAW,MAAM,EACjB,YAAY,MAAM,EAClB,QAAQ,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,EAC3D,eAAc,OAAc,KAC7B,OAAO,CAAC,CAAC,CA4BX,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,KAAK,GAAI,OAAO;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAA;CACnB,qBAOA,CAAA"}
package/dist/main.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=main.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
@@ -1,270 +0,0 @@
1
- export interface ICatalogElement {
2
- id: string;
3
- name: string;
4
- alias: string;
5
- description?: string;
6
- type: string;
7
- parentId?: string;
8
- children?: ICatalogElement[];
9
- createTime?: Date;
10
- updateTime?: Date;
11
- [key: string]: any;
12
- }
13
- export interface IResourcePermission {
14
- resourceId: string;
15
- permissions: string[];
16
- grantedBy: string;
17
- grantTime: Date;
18
- [key: string]: any;
19
- }
20
- export interface IResourcePermissionItem {
21
- itemId: string;
22
- itemName: string;
23
- permissionType: string;
24
- inherited: boolean;
25
- [key: string]: any;
26
- }
27
- export interface ICatalogSearchResult {
28
- id: string;
29
- name: string;
30
- alias: string;
31
- type: string;
32
- parentId: string;
33
- score: number;
34
- [key: string]: any;
35
- }
36
- export type AccessType = 'REF' | 'READ' | 'WRITE';
37
- export declare const AccessType: {
38
- REF: "REF";
39
- READ: "READ";
40
- WRITE: "WRITE";
41
- };
42
- export type CatalogElementType = 'FOLDER' | 'SIMPLE_REPORT' | 'ANALYSIS_REPORT' | 'COMBINED_QUERY' | 'INSIGHT' | 'OLAP_REPORT' | 'DASHBOARD' | 'SMARTBIX_PAGE' | 'DATASET' | 'VISUAL' | 'SQL' | 'PROCEDURE' | 'NATIVE_SQL' | 'JAVA' | 'SMARTBIX_DATASET' | 'AUGMENTED_DATASET' | 'BUSINESS_VIEW' | 'BUSINESS_SUBJECT' | 'BUSINESS_QUERY' | 'SPREADSHEET_REPORT' | 'WEB_SPREADSHEET_REPORT' | 'SMARTBI_DATAPROCESS' | 'ETL_AUTOMATION' | 'JOB_FLOW' | 'SMARTBI_MINING' | 'URL' | 'excelimport' | 'TXTQUERYOBJECT' | 'TXTDATASOURCE' | 'SCHEMA' | 'OLD_DATASET';
43
- export declare const CatalogElementType: {
44
- FOLDER: "FOLDER";
45
- SIMPLE_REPORT: "SIMPLE_REPORT";
46
- ANALYSIS_REPORT: "ANALYSIS_REPORT";
47
- COMBINED_QUERY: "COMBINED_QUERY";
48
- INSIGHT: "INSIGHT";
49
- OLAP_REPORT: "OLAP_REPORT";
50
- DASHBOARD: "DASHBOARD";
51
- SMARTBIX_PAGE: "SMARTBIX_PAGE";
52
- DATASET: "DATASET";
53
- VISUAL: "VISUAL";
54
- SQL: "SQL";
55
- PROCEDURE: "PROCEDURE";
56
- NATIVE_SQL: "NATIVE_SQL";
57
- JAVA: "JAVA";
58
- SMARTBIX_DATASET: "SMARTBIX_DATASET";
59
- AUGMENTED_DATASET: "AUGMENTED_DATASET";
60
- BUSINESS_VIEW: "BUSINESS_VIEW";
61
- BUSINESS_SUBJECT: "BUSINESS_SUBJECT";
62
- BUSINESS_QUERY: "BUSINESS_QUERY";
63
- SPREADSHEET_REPORT: "SPREADSHEET_REPORT";
64
- WEB_SPREADSHEET_REPORT: "WEB_SPREADSHEET_REPORT";
65
- DATA_PROCESS: "SMARTBI_DATAPROCESS";
66
- ETL_AUTOMATION: "ETL_AUTOMATION";
67
- JOB_FLOW: "JOB_FLOW";
68
- DATA_MINING: "SMARTBI_MINING";
69
- URL_LINK: "URL";
70
- EXCEL_IMPORT_TEMPLATE: "excelimport";
71
- TXT_QUERY_OBJECT: "TXTQUERYOBJECT";
72
- TXT_DATA_SOURCE: "TXTDATASOURCE";
73
- SCHEMA: "SCHEMA";
74
- OLD_DATASET: "OLD_DATASET";
75
- };
76
- export type PermissionType = 'REF' | 'READ' | 'WRITE';
77
- export declare const PermissionType: {
78
- REF: "REF";
79
- READ: "READ";
80
- WRITE: "WRITE";
81
- };
82
- export type PermissionDescendType = 'ALL' | 'NONE' | 'READ_WRITE';
83
- export declare const PermissionDescendType: {
84
- ALL: "ALL";
85
- NONE: "NONE";
86
- READ_WRITE: "READ_WRITE";
87
- };
88
- export type HiddenInBrowse = boolean;
89
- /**
90
- * 判断某个资源是否可访问。
91
- * 参数:
92
- * elementId - 资源ID
93
- * type - 访问类型:
94
- * 1.引用权限:REF
95
- * 2.查看权限:READ
96
- * 3.编辑权限:WRITE
97
- * @param elementId 资源ID
98
- * @param type 访问类型
99
- * @returns 返回是否有权限的布尔值
100
- */
101
- export declare const isCatalogElementAccessible: (elementId: string, type: AccessType) => Promise<boolean>;
102
- /**
103
- * 获取资源树的顶层节点列表
104
- * @returns 返回顶层节点列表,节点类型为ICatalogElement
105
- */
106
- export declare const getRootElements: () => Promise<ICatalogElement[]>;
107
- /**
108
- * 获得指定节点的子节点列表
109
- * @param nodeId 指定节点ID
110
- * @returns 返回子节点列表,节点类型为ICatalogElement
111
- */
112
- export declare const getChildElements: (nodeId: string) => Promise<ICatalogElement[]>;
113
- /**
114
- * 创建目录
115
- * @param parentNodeId 父目录ID
116
- * @param name 目录名称
117
- * @param alias 目录别名
118
- * @param desc 目录描述
119
- * @param type 目录类型,此项可为空,系统会自动根据父目录的类型进行设置
120
- * @param hiddenInBrowse 是否在浏览模块中隐藏此目录
121
- * @returns 返回创建的目录对象,类型为ICatalogElement
122
- */
123
- export declare const createFolder: (parentNodeId: string, name: string, alias: string, desc: string, type: CatalogElementType | string, hiddenInBrowse: HiddenInBrowse) => Promise<ICatalogElement>;
124
- /**
125
- * 通过ID创建目录
126
- * @param parentNodeId 父目录ID
127
- * @param id 目录ID
128
- * @param name 目录名称
129
- * @param alias 目录别名
130
- * @param desc 目录描述
131
- * @param type 目录类型,此项可为空,系统会自动根据父目录的类型进行设置
132
- * @param hiddenInBrowse 是否在浏览模块中隐藏此目录
133
- * @returns 返回创建的目录对象,类型为ICatalogElement
134
- */
135
- export declare const createFolderById: (parentNodeId: string, id: string, name: string, alias: string, desc: string, type: CatalogElementType | string, hiddenInBrowse: HiddenInBrowse) => Promise<ICatalogElement>;
136
- /**
137
- * 通过ID访问资源
138
- * @param elementId 资源ID
139
- * @returns 返回资源对象,类型为ICatalogElement
140
- */
141
- export declare const getCatalogElementById: (elementId: string) => Promise<ICatalogElement>;
142
- /**
143
- * 通过类型获取结点
144
- * @param type 节点类型
145
- * @returns 返回指定类型的节点列表,节点类型为ICatalogElement
146
- */
147
- export declare const getCatalogElementByType: (type: CatalogElementType | string) => Promise<ICatalogElement[]>;
148
- /**
149
- * 获取目录下指定类型的子元素
150
- * @param parentNodeId 父节点ID
151
- * @param types 要获取的子元素类型数组
152
- * @returns 返回指定类型的子元素列表,节点类型为ICatalogElement
153
- */
154
- export declare const getChildElementsByTypes: (parentNodeId: string, types: (CatalogElementType | string)[]) => Promise<ICatalogElement[]>;
155
- /**
156
- * 获取资源直接被授予的权限信息
157
- * @param resId 资源ID
158
- * @returns 返回资源直接被授予的权限信息,类型为IResourcePermission
159
- */
160
- export declare const getAssignedPermissions: (resId: string) => Promise<IResourcePermission>;
161
- /**
162
- * 获取资源继承的权限信息
163
- * @param resId 资源ID
164
- * @returns 返回资源继承的权限信息列表,类型为IResourcePermissionItem[]
165
- */
166
- export declare const getInheritedPermissions: (resId: string) => Promise<IResourcePermissionItem[]>;
167
- /**
168
- * 通过ID删除资源
169
- * @param id 资源ID
170
- * @returns 无返回值
171
- */
172
- export declare const deleteCatalogElement: (id: string) => Promise<void>;
173
- /**
174
- * 根据别名或名称模糊查询资源信息
175
- * @param alias 别名或名称关键字
176
- * @param purview 权限范围
177
- * @returns 返回搜索结果列表,类型为ICatalogSearchResult[]
178
- */
179
- export declare const searchCatalogElementLikeAlias: (alias: string, purview: string) => Promise<ICatalogSearchResult[]>;
180
- /**
181
- * 设置该资源的组权限
182
- * @param elementId 资源ID
183
- * @param groupId 组ID
184
- * @param type 权限类型
185
- * @param inherited 是否继承
186
- * @param permissionDescendType 权限下降类型
187
- * @param isGroupDescend 是否组下降
188
- * @returns 无返回值
189
- */
190
- export declare const setAssignedPermissionByGroup: (elementId: string, groupId: string, type: PermissionType, inherited: boolean, permissionDescendType: PermissionDescendType, isGroupDescend: boolean) => Promise<void>;
191
- /**
192
- * 设置该资源的角色权限
193
- * @param elementId 资源ID
194
- * @param roleId 角色ID
195
- * @param type 权限类型
196
- * @param inherited 是否继承
197
- * @param permissionDescendType 权限下降类型
198
- * @returns 无返回值
199
- */
200
- export declare const setAssignedPermissionByRole: (elementId: string, roleId: string, type: PermissionType, inherited: boolean, permissionDescendType: PermissionDescendType) => Promise<void>;
201
- /**
202
- * 设置该资源的用户权限
203
- * @param elementId 资源ID
204
- * @param userId 用户ID
205
- * @param type 权限类型
206
- * @param inherited 是否继承
207
- * @param permissionDescendType 权限下降类型
208
- * @returns 无返回值
209
- */
210
- export declare const setAssignedPermissionByUser: (elementId: string, userId: string, type: PermissionType, inherited: boolean, permissionDescendType: PermissionDescendType) => Promise<void>;
211
- /**
212
- * 更换资源节点的图片
213
- * @param id 资源ID
214
- * @param image 图片路径或图片数据
215
- * @returns 无返回值
216
- */
217
- export declare const updateCatalogElementImage: (id: string, image: string) => Promise<void>;
218
- /**
219
- * 根据ID修改资源信息
220
- * @param id 资源ID
221
- * @param jsonNodeConfig JSON节点配置
222
- * @param wholeExtended 完整扩展信息
223
- * @returns 无返回值
224
- */
225
- export declare const updateCatalogNode: (id: string, jsonNodeConfig: string, wholeExtended: string) => Promise<void>;
226
- /**
227
- * 创建WEB链接
228
- * @param parentFolderId 父文件夹ID
229
- * @param urlName URL名称
230
- * @param urlAlias URL别名
231
- * @param urlDesc URL描述
232
- * @param url URL地址
233
- * @param setting 设置参数
234
- * @returns 返回新创建的URL链接ID
235
- */
236
- export declare const createURLLink: (parentFolderId: string, urlName: string, urlAlias: string, urlDesc: string, url: string, setting: string) => Promise<string>;
237
- /**
238
- * 更新WEB链接
239
- * @param urlID URL ID
240
- * @param urlAlias URL别名
241
- * @param urlDesc URL描述
242
- * @param url URL地址
243
- * @param setting 设置参数
244
- * @returns 无返回值
245
- */
246
- export declare const updateURLLink: (urlID: string, urlAlias: string, urlDesc: string, url: string, setting: string) => Promise<void>;
247
- /**
248
- * 复制粘贴并返回新ID
249
- * @param toId 目标ID
250
- * @param srcId 源ID
251
- * @param name 名称
252
- * @param alias 别名
253
- * @param desc 描述
254
- * @returns 返回新创建元素的ID
255
- */
256
- export declare const copyAndPasteReturnNewId: (toId: string, srcId: string, name: string, alias: string, desc: string) => Promise<string>;
257
- /**
258
- * 创建资源树结点
259
- * 注意:此方法是单纯新建一个树结点,调用此方法前,必须存在此结点类型的实体资源.
260
- * @param parentId 父ID
261
- * @param id ID
262
- * @param name 名称
263
- * @param alias 别名
264
- * @param desc 描述
265
- * @param order 顺序
266
- * @param type 类型
267
- * @returns 返回创建的资源节点,类型为ICatalogElement
268
- */
269
- export declare const createCatalogElement: (parentId: string, id: string, name: string, alias: string, desc: string, order: number, type: CatalogElementType | string) => Promise<ICatalogElement>;
270
- //# sourceMappingURL=CatalogService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CatalogService.d.ts","sourceRoot":"","sources":["../../src/methods/CatalogService.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,eAAe;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ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