smartbi-toolkit 1.1.3 → 1.1.4

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.
Files changed (61) hide show
  1. package/dist/index.d.ts +30 -0
  2. package/dist/index.js +141 -0
  3. package/dist/methods/AnalysisReportService.d.ts +93 -0
  4. package/dist/methods/AnalysisReportService.js +126 -0
  5. package/dist/methods/BusinessThemeService.d.ts +8 -0
  6. package/dist/methods/BusinessThemeService.js +11 -0
  7. package/dist/methods/BusinessViewService.d.ts +94 -0
  8. package/dist/methods/BusinessViewService.js +120 -0
  9. package/dist/methods/CatalogService.d.ts +188 -0
  10. package/dist/methods/CatalogService.js +230 -0
  11. package/dist/methods/ClientCombinedReportService.d.ts +63 -0
  12. package/dist/methods/ClientCombinedReportService.js +82 -0
  13. package/dist/methods/ClientInsightService.d.ts +83 -0
  14. package/dist/methods/ClientInsightService.js +107 -0
  15. package/dist/methods/ClientReportService.d.ts +162 -0
  16. package/dist/methods/ClientReportService.js +206 -0
  17. package/dist/methods/CombinedReportService.d.ts +7 -0
  18. package/dist/methods/CombinedReportService.js +10 -0
  19. package/dist/methods/DataSourceService.d.ts +178 -0
  20. package/dist/methods/DataSourceService.js +220 -0
  21. package/dist/methods/GraphicReportService.d.ts +7 -0
  22. package/dist/methods/GraphicReportService.js +10 -0
  23. package/dist/methods/InsightReport.d.ts +71 -0
  24. package/dist/methods/InsightReport.js +98 -0
  25. package/dist/methods/MetadataService.d.ts +37 -0
  26. package/dist/methods/MetadataService.js +47 -0
  27. package/dist/methods/OfficeReport.d.ts +49 -0
  28. package/dist/methods/OfficeReport.js +65 -0
  29. package/dist/methods/OfficeReportService.d.ts +36 -0
  30. package/dist/methods/OfficeReportService.js +46 -0
  31. package/dist/methods/OltpMetadataService.d.ts +19 -0
  32. package/dist/methods/OltpMetadataService.js +25 -0
  33. package/dist/methods/ParameterService.d.ts +12 -0
  34. package/dist/methods/ParameterService.js +18 -0
  35. package/dist/methods/PoolService.d.ts +11 -0
  36. package/dist/methods/PoolService.js +17 -0
  37. package/dist/methods/PortalService.d.ts +66 -0
  38. package/dist/methods/PortalService.js +89 -0
  39. package/dist/methods/Report.d.ts +178 -0
  40. package/dist/methods/Report.js +230 -0
  41. package/dist/methods/SSReport.d.ts +86 -0
  42. package/dist/methods/SSReport.js +114 -0
  43. package/dist/methods/ScheduleTaskService.d.ts +12 -0
  44. package/dist/methods/ScheduleTaskService.js +18 -0
  45. package/dist/methods/SimpleReportService.d.ts +12 -0
  46. package/dist/methods/SimpleReportService.js +18 -0
  47. package/dist/methods/SpreadSheetReportService.d.ts +43 -0
  48. package/dist/methods/SpreadSheetReportService.js +55 -0
  49. package/dist/methods/SystemConfigService.d.ts +17 -0
  50. package/dist/methods/SystemConfigService.js +23 -0
  51. package/dist/methods/TimeConsuming.d.ts +6 -0
  52. package/dist/methods/TimeConsuming.js +9 -0
  53. package/dist/methods/TimeConsumingService.d.ts +5 -0
  54. package/dist/methods/TimeConsumingService.js +9 -0
  55. package/dist/methods/UserManagerService.d.ts +236 -0
  56. package/dist/methods/UserManagerService.js +312 -0
  57. package/dist/types.d.ts +412 -0
  58. package/dist/types.js +61 -0
  59. package/dist/vite-plugin-smartbi/index.d.ts +36 -0
  60. package/dist/vite-plugin-smartbi/index.js +107 -0
  61. package/package.json +1 -1
package/dist/types.js ADDED
@@ -0,0 +1,61 @@
1
+ export const PropertyName = {
2
+ ALIAS: 'alias',
3
+ DESC: 'desc',
4
+ DATA_TYPE: 'dataType',
5
+ DATA_FORMAT: 'dataFormat',
6
+ ORDER_BY: 'orderby',
7
+ TRANSFORM_RULE: 'transformRule'
8
+ };
9
+ export const BusinessViewType = {
10
+ RAW_SQL_QUERY: 'RAW_SQL_QUERY',
11
+ VISUAL_QUERY: 'VISUAL_QUERY',
12
+ SQL_QUERY: 'SQL_QUERY'
13
+ };
14
+ export const AccessType = {
15
+ REF: 'REF', // 引用权限
16
+ READ: 'READ', // 查看权限
17
+ WRITE: 'WRITE' // 编辑权限
18
+ };
19
+ // CatalogElementType 常量对象
20
+ export const CatalogElementType = {
21
+ // 文件夹类型
22
+ FOLDER: 'FOLDER',
23
+ // 报表类型
24
+ SIMPLE_REPORT: 'SIMPLE_REPORT', // 简单报表
25
+ ANALYSIS_REPORT: 'ANALYSIS_REPORT', // 分析报表
26
+ COMBINED_QUERY: 'COMBINED_QUERY', // 即席查询
27
+ INSIGHT: 'INSIGHT', // 透视分析
28
+ OLAP_REPORT: 'OLAP_REPORT', // 多维分析
29
+ // 仪表盘类型
30
+ DASHBOARD: 'DASHBOARD', // 传统仪表盘
31
+ SMARTBIX_PAGE: 'SMARTBIX_PAGE', // 交互式仪表盘
32
+ // 数据集类型
33
+ DATASET: 'DATASET', // 通用数据集
34
+ VISUAL: 'VISUAL', // 可视化数据集
35
+ SQL: 'SQL', // SQL数据集
36
+ PROCEDURE: 'PROCEDURE', // 存储过程数据集
37
+ NATIVE_SQL: 'NATIVE_SQL', // 原生SQL数据集
38
+ JAVA: 'JAVA', // JAVA数据集
39
+ SMARTBIX_DATASET: 'SMARTBIX_DATASET', // 自助数据集
40
+ AUGMENTED_DATASET: 'AUGMENTED_DATASET', // 数据模型
41
+ // 业务对象类型
42
+ BUSINESS_VIEW: 'BUSINESS_VIEW', // 业务视图
43
+ BUSINESS_SUBJECT: 'BUSINESS_SUBJECT', // 业务主题
44
+ BUSINESS_QUERY: 'BUSINESS_QUERY', // 业务查询
45
+ // 电子表格类型
46
+ SPREADSHEET_REPORT: 'SPREADSHEET_REPORT', // 电子表格报表
47
+ WEB_SPREADSHEET_REPORT: 'WEB_SPREADSHEET_REPORT', // WEB电子表格
48
+ // 数据处理类型
49
+ DATA_PROCESS: 'SMARTBI_DATAPROCESS', // 自助ETL
50
+ ETL_AUTOMATION: 'ETL_AUTOMATION', // ETL自动化
51
+ JOB_FLOW: 'JOB_FLOW', // 作业流
52
+ DATA_MINING: 'SMARTBI_MINING', // 数据挖掘
53
+ // 其他类型
54
+ URL_LINK: 'URL', // WEB链接
55
+ EXCEL_IMPORT_TEMPLATE: 'excelimport', // Excel导入模板
56
+ TXT_QUERY_OBJECT: 'TXTQUERYOBJECT', // 查询对象
57
+ TXT_DATA_SOURCE: 'TXTDATASOURCE', // 数据源
58
+ SCHEMA: 'SCHEMA', // 模式
59
+ // 旧版类型
60
+ OLD_DATASET: 'OLD_DATASET' // 旧数据集
61
+ };
@@ -0,0 +1,36 @@
1
+ import type { PluginOption } from 'vite';
2
+ export type VitePluginSmartbiOptions = {
3
+ /**
4
+ * 插件名称
5
+ */
6
+ name: string;
7
+ /**
8
+ * 插件名称
9
+ */
10
+ alias?: string;
11
+ /**
12
+ * 插件描述
13
+ */
14
+ desc?: string;
15
+ /**
16
+ * 优先级
17
+ */
18
+ priority?: number;
19
+ /**
20
+ * 输出目录
21
+ */
22
+ output?: string;
23
+ /**
24
+ * html重命名
25
+ */
26
+ indexRename?: string;
27
+ /**
28
+ * vision到html中间的路径
29
+ */
30
+ appendPath?: string;
31
+ /**
32
+ * 插件版本
33
+ */
34
+ version?: string;
35
+ };
36
+ export default function VitePluginSmartbi(config: VitePluginSmartbiOptions): PluginOption;
@@ -0,0 +1,107 @@
1
+ import chalk from 'chalk';
2
+ import { resolve, } from "node:path";
3
+ import { remove, copy, mkdirp, } from 'fs-extra';
4
+ import { exec } from "node:child_process";
5
+ const info = chalk.hex('#00dd66'); // Orange color
6
+ const configExtension = ({ name, alias, desc, priority, version, }) => {
7
+ const web = `<web-app/>`;
8
+ const portlet = `<?xml version="1.0" encoding="UTF-8"?>
9
+ <portlet-app>
10
+ </portlet-app>
11
+ `;
12
+ const extension = `<?xml version="1.0" encoding="UTF-8"?>
13
+ <!DOCTYPE extension SYSTEM "extension.dtd">
14
+ <extension name="${name}" alias="${alias || name}" desc="${desc || name}" :priority="${priority || 100}" version="${version || '1.0'}">
15
+ <enable-jsp-processor />
16
+ </extension>
17
+ `;
18
+ const applicationContext = `<?xml version="1.0" encoding="UTF-8"?>
19
+ <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
20
+ <beans>
21
+ <bean id="framework" class="smartbi.framework.Framework" factory-method="getInstance">
22
+ <property name="modules">
23
+ <map>
24
+ </map>
25
+ </property>
26
+ </bean>
27
+ <bean id="rmi" class="smartbi.framework.rmi.RMIModule" factory-method="getInstance">
28
+ <property name="modules">
29
+ <map>
30
+ </map>
31
+ </property>
32
+ </bean>
33
+ </beans>
34
+ `;
35
+ const build = `<?xml version="1.0" encoding="UTF-8"?>
36
+ <project name="${name}" default="dist">
37
+ <target name="dist" >
38
+ <tstamp>
39
+ <format property="today" pattern="yyyy-MM-dd HH:mm:ss"/>
40
+ </tstamp>
41
+ <echo file="\${basedir}/source/META-INF/version.txt" message="\${today}"/>
42
+
43
+ <jar destfile="\${basedir}/${name}.ext" duplicate="preserve">
44
+ <fileset dir="\${basedir}/source"/>
45
+ </jar>
46
+ </target>
47
+ </project>
48
+ `;
49
+ return {
50
+ web, applicationContext, extension, portlet,
51
+ build
52
+ };
53
+ };
54
+ export default function VitePluginSmartbi(config) {
55
+ const { output = 'smartbi-ext', appendPath } = config;
56
+ return {
57
+ name: "vite-plugin-smartbi",
58
+ apply: "build",
59
+ enforce: "post",
60
+ writeBundle(options, _bundle) {
61
+ this.info("开始打包");
62
+ console.log(info("开始打包"));
63
+ const { writeFile } = this.fs;
64
+ const outputDir = options.dir;
65
+ const extDir = resolve(resolve(outputDir, '..'), output);
66
+ const sourceDir = resolve(extDir, 'source');
67
+ const metaInfDir = resolve(sourceDir, 'META-INF');
68
+ const webInfDir = resolve(sourceDir, 'WEB-INF');
69
+ let visionDir = resolve(sourceDir, 'vision');
70
+ if (appendPath) {
71
+ visionDir = resolve(visionDir, appendPath);
72
+ }
73
+ const { applicationContext, extension, portlet, web, build } = configExtension(config);
74
+ console.log(build);
75
+ remove(extDir)
76
+ .then(() => mkdirp(sourceDir))
77
+ .then(() => mkdirp(metaInfDir))
78
+ .then(() => mkdirp(webInfDir))
79
+ .then(() => mkdirp(visionDir))
80
+ .then(() => writeFile(webInfDir + "/web.xml", web))
81
+ .then(() => writeFile(metaInfDir + "/applicationContext.xml", applicationContext))
82
+ .then(() => writeFile(metaInfDir + "/extension.xml", extension))
83
+ .then(() => writeFile(metaInfDir + "/portlet.xml", portlet))
84
+ .then(() => writeFile(extDir + "/build.xml", build))
85
+ .then(() => {
86
+ console.log(info("ext基础文件复制成功"));
87
+ copy(outputDir, visionDir).then(() => {
88
+ console.log(info("ext资源文件复制成功"));
89
+ exec('ant', { cwd: extDir }, (err, stdout, stderr) => {
90
+ remove(extDir + "/build.xml").then(() => {
91
+ if (err) {
92
+ console.log(info(err));
93
+ console.log(info("打包失败"));
94
+ console.log(info("请检查是否有ant环境,搜索Apache Ant部署环境"));
95
+ this.error(stderr);
96
+ }
97
+ else {
98
+ console.log(info(stdout));
99
+ console.log(info("ext构建完成"));
100
+ }
101
+ });
102
+ });
103
+ });
104
+ });
105
+ },
106
+ };
107
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "smartbi-toolkit",
3
3
  "private": false,
4
- "version": "1.1.3",
4
+ "version": "1.1.4",
5
5
  "keys": [
6
6
  "smartbi",
7
7
  "扩展包",