smartbi-toolkit 1.0.1

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,112 @@
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 };
@@ -0,0 +1,51 @@
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 };
@@ -0,0 +1,22 @@
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
@@ -0,0 +1 @@
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 ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=main.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":""}
@@ -0,0 +1,270 @@
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
@@ -0,0 +1 @@
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,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,UAAU,CAAC,EAAE,IAAI,CAAC;IAElB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,EAAE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M,EAAE,gBAAgB,MAAM,EAAE,eAAe,MAAM,KAAG,OAAO,CAAC,IAAI,CAEzG,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GACtB,gBAAgB,MAAM,EACtB,SAAS,MAAM,EACf,UAAU,MAAM,EAChB,SAAS,MAAM,EACf,KAAK,MAAM,EACX,SAAS,MAAM,KAChB,OAAO,CAAC,MAAM,CAEhB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GACtB,OAAO,MAAM,EACb,UAAU,MAAM,EAChB,SAAS,MAAM,EACf,KAAK,MAAM,EACX,SAAS,MAAM,KAChB,OAAO,CAAC,IAAI,CAEd,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAChC,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,MAAM,MAAM,KACb,OAAO,CAAC,MAAM,CAEhB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAC7B,UAAU,MAAM,EAChB,IAAI,MAAM,EACV,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,MAAM,kBAAkB,GAAG,MAAM,KAClC,OAAO,CAAC,eAAe,CAEzB,CAAA"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "smartbi-toolkit",
3
+ "private": false,
4
+ "version": "1.0.1",
5
+ "type": "module",
6
+ "module": "./dist/SmartbiToolbox.es.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/SmartbiToolbox.es.js",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./CatalogService": {
14
+ "import": "./dist/CatalogService.es.js",
15
+ "types": "./dist/methods/CatalogService.d.ts"
16
+ }
17
+ },
18
+ "scripts": {
19
+ "dev": "vite",
20
+ "b": "tsc",
21
+ "build": "tsc && vite build",
22
+ "preview": "vite preview"
23
+ },
24
+ "files": [
25
+ "dist"
26
+ ],
27
+ "devDependencies": {
28
+ "typescript": "~5.9.3",
29
+ "vite": "8.0.0-beta.8",
30
+ "vite-plugin-dts": "^4.5.4"
31
+ },
32
+ "dependencies": {
33
+ "axios": "^1.13.2"
34
+ }
35
+ }