@xiaou66/picture-types 0.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.
- package/dist/Common.d.ts +7 -0
- package/dist/File.d.ts +82 -0
- package/dist/Flow.d.ts +98 -0
- package/dist/Plugin.d.ts +54 -0
- package/dist/Storage.d.ts +128 -0
- package/dist/Store.d.ts +104 -0
- package/dist/index.cjs.js +0 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.es.js +0 -0
- package/package.json +38 -0
package/dist/Common.d.ts
ADDED
package/dist/File.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type FileUpdateDataType = 'file' | 'filePath' | 'base64';
|
|
2
|
+
export interface FileUploadItem {
|
|
3
|
+
dataType: FileUpdateDataType;
|
|
4
|
+
content: File | string;
|
|
5
|
+
}
|
|
6
|
+
export interface FileUpdateInfoItem {
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* 文件路径
|
|
10
|
+
*/
|
|
11
|
+
filePath: string;
|
|
12
|
+
/**
|
|
13
|
+
* 放 base64 的
|
|
14
|
+
*/
|
|
15
|
+
content?: string;
|
|
16
|
+
/**
|
|
17
|
+
* 文件名称
|
|
18
|
+
*/
|
|
19
|
+
fileName: string;
|
|
20
|
+
/**
|
|
21
|
+
* 文件后缀
|
|
22
|
+
*/
|
|
23
|
+
fileSuffix: string;
|
|
24
|
+
/**
|
|
25
|
+
* 是否临时文件, 即 base64 文件
|
|
26
|
+
*/
|
|
27
|
+
tempFile?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 文件大小
|
|
30
|
+
*/
|
|
31
|
+
fileSize: number;
|
|
32
|
+
/**
|
|
33
|
+
* 场景名称
|
|
34
|
+
*/
|
|
35
|
+
sceneName?: string;
|
|
36
|
+
/**
|
|
37
|
+
* 上传方式
|
|
38
|
+
*/
|
|
39
|
+
uploadWay: string | string[];
|
|
40
|
+
/**
|
|
41
|
+
* 上传状态
|
|
42
|
+
*/
|
|
43
|
+
uploadStatus: 'waiting' | 'uploading' | 'failed';
|
|
44
|
+
/**
|
|
45
|
+
* 进度
|
|
46
|
+
*/
|
|
47
|
+
progress?: number;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 文件库信息
|
|
51
|
+
*/
|
|
52
|
+
export interface FileLibraryInfo {
|
|
53
|
+
/**
|
|
54
|
+
* 文件名称
|
|
55
|
+
*/
|
|
56
|
+
fileName: string;
|
|
57
|
+
/**
|
|
58
|
+
* 文件后缀
|
|
59
|
+
*/
|
|
60
|
+
fileSuffix: string;
|
|
61
|
+
/**
|
|
62
|
+
* 文件大小
|
|
63
|
+
*/
|
|
64
|
+
fileSize: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 文件上传信息
|
|
68
|
+
*/
|
|
69
|
+
export interface FileUploadInfo {
|
|
70
|
+
/**
|
|
71
|
+
* 存储源 id
|
|
72
|
+
*/
|
|
73
|
+
storageId: string;
|
|
74
|
+
/**
|
|
75
|
+
* URL
|
|
76
|
+
*/
|
|
77
|
+
url: string;
|
|
78
|
+
/**
|
|
79
|
+
* 额外数据
|
|
80
|
+
*/
|
|
81
|
+
extra: any;
|
|
82
|
+
}
|
package/dist/Flow.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { AsyncComponentLoader } from 'vue';
|
|
2
|
+
import { PlugInfo } from './Plugin';
|
|
3
|
+
import { FileUpdateInfoItem } from './File';
|
|
4
|
+
import { FileLibraryItem, SceneInfoItem } from './Store';
|
|
5
|
+
/**
|
|
6
|
+
* 流程节点
|
|
7
|
+
*/
|
|
8
|
+
export interface IFlowNode<T = any> {
|
|
9
|
+
id: string;
|
|
10
|
+
nodeCode: string;
|
|
11
|
+
nodeData: T | Record<string, any>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 流程项
|
|
15
|
+
*/
|
|
16
|
+
export interface IFlowItem {
|
|
17
|
+
id: string;
|
|
18
|
+
nodeList: IFlowNode[];
|
|
19
|
+
createAt: number;
|
|
20
|
+
updateAt: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 保存流程项
|
|
24
|
+
*/
|
|
25
|
+
export type SaveFlowItem = Omit<IFlowItem, 'createAt' | 'updateAt' | 'id' | 'sort'> & {
|
|
26
|
+
id?: string;
|
|
27
|
+
createAt?: number;
|
|
28
|
+
updateAt?: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* 流程节点信息
|
|
32
|
+
*/
|
|
33
|
+
export interface IFlowNodeInfo {
|
|
34
|
+
code: string;
|
|
35
|
+
title: string;
|
|
36
|
+
group: '触发' | '通用' | '完成';
|
|
37
|
+
nodeType: 'trigger' | 'common';
|
|
38
|
+
end?: boolean;
|
|
39
|
+
desc?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* 流程节点配置
|
|
43
|
+
*/
|
|
44
|
+
export interface IFlowNodeConfig {
|
|
45
|
+
info: IFlowNodeInfo;
|
|
46
|
+
nodeComponent: AsyncComponentLoader;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 流程提供者
|
|
50
|
+
*/
|
|
51
|
+
export interface FlowProvide {
|
|
52
|
+
removeNode: (id: string) => void;
|
|
53
|
+
updateNodeField: (id: string, field: string, value: any) => void;
|
|
54
|
+
updateNode: (id: string, nodeData: Record<string, any>) => void;
|
|
55
|
+
createNode: (node: IFlowNodeConfig) => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* 流程节点插件信息
|
|
59
|
+
*/
|
|
60
|
+
export interface FlowNodePlugInfo extends PlugInfo {
|
|
61
|
+
/**
|
|
62
|
+
* 插件分组
|
|
63
|
+
*/
|
|
64
|
+
pluginGroup: 'image' | 'music' | 'video' | 'other' | 'trigger' | 'common' | 'finish';
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 流程节点插件
|
|
68
|
+
*/
|
|
69
|
+
export interface FlowNodePlugIn {
|
|
70
|
+
/**
|
|
71
|
+
* 无需配置可以直接使用
|
|
72
|
+
*/
|
|
73
|
+
noConfig?: boolean;
|
|
74
|
+
pluginInfo: FlowNodePlugInfo;
|
|
75
|
+
/**
|
|
76
|
+
* 自定义配置 UI
|
|
77
|
+
*/
|
|
78
|
+
uiConfigComponent?: AsyncComponentLoader;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 流程上下文
|
|
82
|
+
*/
|
|
83
|
+
export interface IFlowContext {
|
|
84
|
+
uploadFile: FileUpdateInfoItem;
|
|
85
|
+
fileLibrary: FileLibraryItem;
|
|
86
|
+
sceneInfo: SceneInfoItem;
|
|
87
|
+
context?: Record<string, any>;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 流程节点动作
|
|
91
|
+
*/
|
|
92
|
+
export interface IFlowNodeActions<T> {
|
|
93
|
+
code: string;
|
|
94
|
+
execute?: (flow: IFlowItem, flowData: IFlowNode<T>, data: IFlowContext) => Promise<void>;
|
|
95
|
+
onSaveData?: (flow: IFlowItem, flowData: IFlowNode<T>) => void;
|
|
96
|
+
onDestroy?: (flow: IFlowItem, flowData: IFlowNode<T>) => void;
|
|
97
|
+
adjustData?: (flow: IFlowItem, flowData: IFlowNode<T>) => Promise<boolean>;
|
|
98
|
+
}
|
package/dist/Plugin.d.ts
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件核心类型定义
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 插件类型
|
|
6
|
+
*/
|
|
7
|
+
export type PluginType = 'storage' | 'flowNode';
|
|
8
|
+
/**
|
|
9
|
+
* 插件信息
|
|
10
|
+
*/
|
|
11
|
+
export interface PlugInfo {
|
|
12
|
+
/**
|
|
13
|
+
* 插件 code 全局唯一
|
|
14
|
+
*/
|
|
15
|
+
pluginCode: string;
|
|
16
|
+
/**
|
|
17
|
+
* 插件名称
|
|
18
|
+
*/
|
|
19
|
+
pluginName: string;
|
|
20
|
+
/**
|
|
21
|
+
* 插件版本
|
|
22
|
+
*/
|
|
23
|
+
pluginVersion: string;
|
|
24
|
+
/**
|
|
25
|
+
* 插件作者
|
|
26
|
+
*/
|
|
27
|
+
pluginAuthor: string;
|
|
28
|
+
/**
|
|
29
|
+
* 插件描述
|
|
30
|
+
*/
|
|
31
|
+
pluginDesc: string;
|
|
32
|
+
/**
|
|
33
|
+
* 插件类型
|
|
34
|
+
*/
|
|
35
|
+
pluginType: PluginType;
|
|
36
|
+
/**
|
|
37
|
+
* 插件 logo
|
|
38
|
+
*/
|
|
39
|
+
pluginLogo: string;
|
|
40
|
+
/**
|
|
41
|
+
* 插件分组
|
|
42
|
+
*/
|
|
43
|
+
pluginGroup: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 插件配置
|
|
47
|
+
*/
|
|
48
|
+
export interface PlugInConfig<T extends PlugInfo = PlugInfo> {
|
|
49
|
+
/**
|
|
50
|
+
* 无需配置可以直接使用
|
|
51
|
+
*/
|
|
52
|
+
noConfig?: boolean;
|
|
53
|
+
pluginInfo: T;
|
|
54
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { AsyncComponentLoader, AsyncComponentOptions } from 'vue';
|
|
2
|
+
import { PlugInfo, PlugInConfig } from './Plugin';
|
|
3
|
+
/**
|
|
4
|
+
* 上传文件结果
|
|
5
|
+
*/
|
|
6
|
+
export interface IUploadFileResult<E = any> {
|
|
7
|
+
/**
|
|
8
|
+
* 上传后文件访问地址
|
|
9
|
+
*/
|
|
10
|
+
url: string;
|
|
11
|
+
/**
|
|
12
|
+
* 缩略图地址
|
|
13
|
+
*/
|
|
14
|
+
thumbnailUrl?: string;
|
|
15
|
+
/**
|
|
16
|
+
* 额外数据
|
|
17
|
+
*/
|
|
18
|
+
extra?: E;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 上传文件参数
|
|
22
|
+
*/
|
|
23
|
+
export interface IUploadFileParams {
|
|
24
|
+
/**
|
|
25
|
+
* 上传 id
|
|
26
|
+
*/
|
|
27
|
+
readonly id: string;
|
|
28
|
+
/**
|
|
29
|
+
* 配置 id
|
|
30
|
+
*/
|
|
31
|
+
readonly storageId: string;
|
|
32
|
+
/**
|
|
33
|
+
* 配置名称
|
|
34
|
+
*/
|
|
35
|
+
readonly sceneName: string;
|
|
36
|
+
/**
|
|
37
|
+
* 文件路径
|
|
38
|
+
*/
|
|
39
|
+
readonly filePath: string;
|
|
40
|
+
/**
|
|
41
|
+
* 全文件名称
|
|
42
|
+
*/
|
|
43
|
+
readonly allFileName: string;
|
|
44
|
+
/**
|
|
45
|
+
* 文件名称
|
|
46
|
+
*/
|
|
47
|
+
readonly fileName: string;
|
|
48
|
+
/**
|
|
49
|
+
* 文件后缀
|
|
50
|
+
*/
|
|
51
|
+
readonly suffix: string;
|
|
52
|
+
/**
|
|
53
|
+
* 文件大小
|
|
54
|
+
*/
|
|
55
|
+
readonly fileSize: number;
|
|
56
|
+
/**
|
|
57
|
+
* 文件
|
|
58
|
+
*/
|
|
59
|
+
readonly file?: File;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* 删除文件参数
|
|
63
|
+
*/
|
|
64
|
+
export interface IDeleteFileParams<E = any> {
|
|
65
|
+
storageId: string;
|
|
66
|
+
/**
|
|
67
|
+
* 额外数据
|
|
68
|
+
*/
|
|
69
|
+
extra?: E;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* 上传文件选项
|
|
73
|
+
*/
|
|
74
|
+
export interface UploadFileOptions {
|
|
75
|
+
onProgress?: (progress: number) => void;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 存储 UI 表单元素
|
|
79
|
+
*/
|
|
80
|
+
export interface StorageUIFormElement {
|
|
81
|
+
type: 'input' | 'input-format' | 'radio-group' | 'switch' | 'input-button' | 'select' | 'custom';
|
|
82
|
+
customComponent?: AsyncComponentLoader | AsyncComponentOptions;
|
|
83
|
+
formItem: {
|
|
84
|
+
rules?: Record<string, any>;
|
|
85
|
+
field: string;
|
|
86
|
+
label: string;
|
|
87
|
+
[key: string]: any;
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* 元素属性值
|
|
91
|
+
*/
|
|
92
|
+
elementProperty: Record<string, any>;
|
|
93
|
+
/**
|
|
94
|
+
* 元素事件
|
|
95
|
+
*/
|
|
96
|
+
elementEvent?: Record<string, any>;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* 存储 UI 配置
|
|
100
|
+
*/
|
|
101
|
+
export interface StorageUIConfig {
|
|
102
|
+
/**
|
|
103
|
+
* 提示
|
|
104
|
+
*/
|
|
105
|
+
tips: string;
|
|
106
|
+
/**
|
|
107
|
+
* 表单
|
|
108
|
+
*/
|
|
109
|
+
forms: StorageUIFormElement[];
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 存储插件信息
|
|
113
|
+
*/
|
|
114
|
+
export interface StoragePlugInfo extends PlugInfo {
|
|
115
|
+
/**
|
|
116
|
+
* 插件分组
|
|
117
|
+
*/
|
|
118
|
+
pluginGroup: 'cloudVendor' | 'self' | 'other';
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 存储插件配置
|
|
122
|
+
*/
|
|
123
|
+
export interface StoragePlugInConfig extends PlugInConfig<StoragePlugInfo> {
|
|
124
|
+
/**
|
|
125
|
+
* 配置 ui
|
|
126
|
+
*/
|
|
127
|
+
uiConfig?: StorageUIConfig;
|
|
128
|
+
}
|
package/dist/Store.d.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { FileLibraryInfo, FileUploadInfo } from './File';
|
|
2
|
+
/**
|
|
3
|
+
* 文件盒子目录
|
|
4
|
+
*/
|
|
5
|
+
export interface FileBoxCatalog {
|
|
6
|
+
total: number;
|
|
7
|
+
docIds: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 文件盒子信息项
|
|
11
|
+
*/
|
|
12
|
+
export interface FileBoxInfoItem {
|
|
13
|
+
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* 文件盒子名称
|
|
16
|
+
*/
|
|
17
|
+
fileBoxName: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 场景信息项
|
|
21
|
+
*/
|
|
22
|
+
export interface SceneInfoItem {
|
|
23
|
+
id: string;
|
|
24
|
+
/**
|
|
25
|
+
* 场景名称
|
|
26
|
+
*/
|
|
27
|
+
sceneName: string;
|
|
28
|
+
/**
|
|
29
|
+
* 是否启用
|
|
30
|
+
*/
|
|
31
|
+
enable: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 场景详情项
|
|
35
|
+
*/
|
|
36
|
+
export interface SceneDetailItem {
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* 收集盒子
|
|
40
|
+
*/
|
|
41
|
+
fileBoxId: string;
|
|
42
|
+
/**
|
|
43
|
+
* 存储源
|
|
44
|
+
*/
|
|
45
|
+
storageSourceIds: string[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 存储源项
|
|
49
|
+
*/
|
|
50
|
+
export interface StorageSourceItem {
|
|
51
|
+
id: string;
|
|
52
|
+
storageName: string;
|
|
53
|
+
/**
|
|
54
|
+
* 存储插件 code
|
|
55
|
+
*/
|
|
56
|
+
storagePluginCode: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 文件库项
|
|
60
|
+
*/
|
|
61
|
+
export interface FileLibraryItem {
|
|
62
|
+
/**
|
|
63
|
+
* id
|
|
64
|
+
*/
|
|
65
|
+
id: string;
|
|
66
|
+
/**
|
|
67
|
+
* 分组 id
|
|
68
|
+
*/
|
|
69
|
+
fileBoxId: string;
|
|
70
|
+
/**
|
|
71
|
+
* 文件保存实际的 docId
|
|
72
|
+
*/
|
|
73
|
+
fileFileBoxDocId?: string;
|
|
74
|
+
/**
|
|
75
|
+
* 场景 id
|
|
76
|
+
*/
|
|
77
|
+
sceneId: string;
|
|
78
|
+
/**
|
|
79
|
+
* 上传文件信息
|
|
80
|
+
*/
|
|
81
|
+
fileUploadInfoList: FileUploadInfo[];
|
|
82
|
+
/**
|
|
83
|
+
* 文件信息
|
|
84
|
+
*/
|
|
85
|
+
fileInfo: FileLibraryInfo;
|
|
86
|
+
/**
|
|
87
|
+
* 标签分组 id
|
|
88
|
+
*/
|
|
89
|
+
tags?: string[];
|
|
90
|
+
/**
|
|
91
|
+
* 创建时间
|
|
92
|
+
*/
|
|
93
|
+
createTime: number;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* URL 格式化数据
|
|
97
|
+
*/
|
|
98
|
+
export interface IFormatUrlData {
|
|
99
|
+
id: string;
|
|
100
|
+
displayName: string;
|
|
101
|
+
format: string;
|
|
102
|
+
enable: boolean;
|
|
103
|
+
disableDelete?: boolean;
|
|
104
|
+
}
|
|
File without changes
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xiaou66/picture-types",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Picture bed plugin system",
|
|
5
|
+
"main": "./dist/index.cjs.js",
|
|
6
|
+
"module": "./dist/index.es.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "vite build",
|
|
16
|
+
"dev": "vite",
|
|
17
|
+
"prepare": "npm run build",
|
|
18
|
+
"publish": "npm publish"
|
|
19
|
+
},
|
|
20
|
+
"author": "xiaou",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"typescript": "^5.0.0",
|
|
24
|
+
"vite": "npm:rolldown-vite@^7.2.11",
|
|
25
|
+
"vite-plugin-dts": "^4.5.0",
|
|
26
|
+
"vue": "^3.5.18"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"vue": "^3.0.0"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.es.js",
|
|
35
|
+
"require": "./dist/index.cjs.js"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|