fmode-ng 0.0.9 → 0.0.11
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/esm2020/lib/aigc/avatar/comp-avatar-talk/comp-avatar-talk.component.mjs +1 -1
- package/esm2020/lib/aigc/comp-markdown-preview/clipboard.service.mjs +10 -0
- package/esm2020/lib/aigc/comp-markdown-preview/markdown-parse.mjs +1 -1
- package/esm2020/lib/aigc/comp-markdown-preview/markdown-preview.component.mjs +1 -1
- package/esm2020/lib/aigc/index.mjs +1 -1
- package/esm2020/lib/aigc/service-fmai/service-chat/chat-class.mjs +1 -1
- package/esm2020/lib/aigc/service-fmai/service-chat/chat.service.mjs +1 -1
- package/esm2020/lib/aigc/service-fmai/service-imagine/imagine.service.mjs +1 -1
- package/esm2020/lib/aigc/voice/fmode-voice.service.mjs +1 -1
- package/esm2020/lib/platform/cross.service.mjs +1 -1
- package/esm2020/lib/storage/index.mjs +1 -1
- package/esm2020/lib/storage/service-upload/nova-upload.service.mjs +10 -0
- package/fesm2015/fmode-ng.mjs +1 -1
- package/fesm2015/fmode-ng.mjs.map +1 -1
- package/fesm2020/fmode-ng.mjs +1 -1
- package/fesm2020/fmode-ng.mjs.map +1 -1
- package/lib/aigc/avatar/comp-avatar-talk/comp-avatar-talk.component.d.ts +35 -14
- package/lib/aigc/comp-markdown-preview/clipboard.service.d.ts +14 -0
- package/lib/aigc/comp-markdown-preview/markdown-preview.component.d.ts +9 -0
- package/lib/aigc/index.d.ts +1 -0
- package/lib/aigc/service-fmai/service-chat/chat-class.d.ts +26 -7
- package/lib/aigc/service-fmai/service-chat/chat.service.d.ts +19 -1
- package/lib/aigc/service-fmai/service-imagine/imagine.service.d.ts +26 -5
- package/lib/aigc/voice/fmode-voice.service.d.ts +31 -0
- package/lib/platform/cross.service.d.ts +6 -1
- package/lib/storage/index.d.ts +1 -0
- package/lib/storage/service-hwobs/hwobs.service.d.ts +12 -0
- package/lib/storage/service-upload/nova-upload.service.d.ts +122 -0
- package/package.json +14 -8
|
@@ -1,18 +1,40 @@
|
|
|
1
1
|
import { AfterViewInit, ElementRef, OnDestroy } from '@angular/core';
|
|
2
2
|
import { FmodeVoiceService } from '../../voice';
|
|
3
|
+
import { ChatService } from '../../service-fmai/service-chat';
|
|
3
4
|
import { FmodeAvatarRoleComp } from '../interface-avatar-role';
|
|
4
|
-
import { Platform } from "@ionic/angular";
|
|
5
|
-
import { ActivatedRoute } from '@angular/router';
|
|
5
|
+
import { NavController, Platform } from "@ionic/angular";
|
|
6
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
6
7
|
import * as Parse from "parse";
|
|
7
8
|
import * as i0 from "@angular/core";
|
|
8
9
|
export declare class CompAvatarTalkComponent implements AfterViewInit, OnDestroy {
|
|
9
10
|
voiceServ: FmodeVoiceService;
|
|
10
11
|
private platform;
|
|
12
|
+
private router;
|
|
13
|
+
private navCtrl;
|
|
11
14
|
private route;
|
|
15
|
+
chatServ: ChatService;
|
|
12
16
|
avatarComp: FmodeAvatarRoleComp;
|
|
17
|
+
roleId: string;
|
|
13
18
|
avatarRole: Parse.Object;
|
|
14
|
-
|
|
19
|
+
/**
|
|
20
|
+
* 开始讲话方式:click点击开始/点击结束 press按住讲话/松开结束
|
|
21
|
+
* @default click
|
|
22
|
+
*/
|
|
23
|
+
talkMode: "click" | "press";
|
|
24
|
+
talkTips: string;
|
|
25
|
+
constructor(voiceServ: FmodeVoiceService, platform: Platform, router: Router, navCtrl: NavController, route: ActivatedRoute, chatServ: ChatService);
|
|
26
|
+
/**
|
|
27
|
+
* 初始化录音转录服务
|
|
28
|
+
* @desc
|
|
29
|
+
* 根据数字角色对话状态,设计语音转录各事件处理过程
|
|
30
|
+
* 嵌入提示音
|
|
31
|
+
* 嵌入动画
|
|
32
|
+
* 嵌入唤醒词切换逻辑
|
|
33
|
+
*/
|
|
34
|
+
initVoiceSevice(): void;
|
|
35
|
+
ngOnInit(): void;
|
|
15
36
|
ngOnDestroy(): void;
|
|
37
|
+
goBack(): void;
|
|
16
38
|
loadAvatarRole(roleId: any): Promise<void>;
|
|
17
39
|
player: HTMLAudioElement;
|
|
18
40
|
playMusic(action: any): void;
|
|
@@ -21,25 +43,24 @@ export declare class CompAvatarTalkComponent implements AfterViewInit, OnDestroy
|
|
|
21
43
|
listenDivChange(): void;
|
|
22
44
|
scrollToBottom(comp: ElementRef): void;
|
|
23
45
|
initAvatar(): Promise<void>;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
cancelTalk(): void;
|
|
28
|
-
stopTalkAndSend(event?: any): void;
|
|
46
|
+
/**
|
|
47
|
+
* AI响应内容
|
|
48
|
+
*/
|
|
29
49
|
aiResponseText: string;
|
|
50
|
+
/**
|
|
51
|
+
* 发送消息逻辑
|
|
52
|
+
*/
|
|
30
53
|
sendMessage(): void;
|
|
31
|
-
playRecord(): void;
|
|
32
|
-
playBuffers(): void;
|
|
33
54
|
/**
|
|
34
|
-
* ASR
|
|
55
|
+
* ASR - 唤醒词
|
|
35
56
|
*/
|
|
36
|
-
|
|
57
|
+
startASRAwake(): Promise<void>;
|
|
37
58
|
/**
|
|
38
|
-
* TTS
|
|
59
|
+
* TTS - 语音合成
|
|
39
60
|
*
|
|
40
61
|
*/
|
|
41
62
|
testTTS(sentence?: any): void;
|
|
42
63
|
testXunfeiTTS(): void;
|
|
43
64
|
static ɵfac: i0.ɵɵFactoryDeclaration<CompAvatarTalkComponent, never>;
|
|
44
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CompAvatarTalkComponent, "app-comp-avatar-talk", never, {}, {}, never, never, true, never>;
|
|
65
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CompAvatarTalkComponent, "app-comp-avatar-talk", never, { "talkMode": "talkMode"; }, {}, never, never, true, never>;
|
|
45
66
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ToastController } from '@ionic/angular';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* 剪贴板服务:支持H5、微信、移动端
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare class ClipboardService {
|
|
8
|
+
private toastCtrl;
|
|
9
|
+
constructor(toastCtrl: ToastController);
|
|
10
|
+
copyToClipboard(content: any): Promise<void>;
|
|
11
|
+
copySuccess(): Promise<void>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ClipboardService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ClipboardService>;
|
|
14
|
+
}
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { AfterViewInit, ElementRef, Renderer2 } from '@angular/core';
|
|
2
2
|
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Markdown 文档高级渲染组件
|
|
6
|
+
* @name fm-markdown-preview
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
4
9
|
export declare class MarkdownPreviewComponent implements AfterViewInit {
|
|
5
10
|
private domSan;
|
|
6
11
|
private renderer;
|
|
7
12
|
content: string;
|
|
8
13
|
safeHTML: SafeHtml;
|
|
9
14
|
mdContent: ElementRef;
|
|
15
|
+
/**
|
|
16
|
+
* 是否开启MD渲染,默认开启
|
|
17
|
+
* @default true
|
|
18
|
+
*/
|
|
10
19
|
render: boolean;
|
|
11
20
|
constructor(domSan: DomSanitizer, renderer: Renderer2);
|
|
12
21
|
ngAfterViewInit(): void;
|
package/lib/aigc/index.d.ts
CHANGED
|
@@ -3,5 +3,6 @@ export * from "./service-fmai/service-imagine";
|
|
|
3
3
|
export * from "./service-fmai/service-chat";
|
|
4
4
|
export * from "./comp-markdown-preview/markdown-preview.module";
|
|
5
5
|
export * from "./comp-markdown-preview/markdown-preview.component";
|
|
6
|
+
export * from "./comp-markdown-preview/clipboard.service";
|
|
6
7
|
export * from "./voice";
|
|
7
8
|
export * from "./avatar";
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Observable } from "rxjs";
|
|
3
2
|
import * as Parse from "parse";
|
|
4
3
|
export interface FmodeChatMessage {
|
|
5
4
|
role: string;
|
|
6
5
|
content: string;
|
|
6
|
+
hidden?: boolean;
|
|
7
7
|
createdAt?: Date;
|
|
8
8
|
complete?: boolean;
|
|
9
9
|
/**AI回复消息字段 */
|
|
10
10
|
cid?: string;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* FmodeChat 聊天对话类
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
12
16
|
export declare class FmodeChat {
|
|
13
17
|
title: string;
|
|
14
18
|
sessionId: string;
|
|
@@ -16,9 +20,13 @@ export declare class FmodeChat {
|
|
|
16
20
|
chatSession: Parse.Object;
|
|
17
21
|
role: any;
|
|
18
22
|
messageList: FmodeChatMessage[];
|
|
19
|
-
|
|
23
|
+
chatServ: any;
|
|
24
|
+
userInput: string;
|
|
25
|
+
constructor(sessionId: string, role?: Parse.Object, chatSession?: Parse.Object, chatServ?: any);
|
|
26
|
+
addRolePrompt(): void;
|
|
20
27
|
sendMessage(message?: string): void;
|
|
21
28
|
saveChatSession(): Promise<void>;
|
|
29
|
+
getInviteUrl(url: any): any;
|
|
22
30
|
genTitle(): string;
|
|
23
31
|
fixMessageList(messages: FmodeChatMessage[]): {
|
|
24
32
|
role: string;
|
|
@@ -26,18 +34,29 @@ export declare class FmodeChat {
|
|
|
26
34
|
}[];
|
|
27
35
|
nowStr(): string;
|
|
28
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* FmodeChatCompletion 文本补全类
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
29
41
|
export declare class FmodeChatCompletion {
|
|
30
42
|
indexOfList: number;
|
|
43
|
+
model: string;
|
|
31
44
|
messages: FmodeChatMessage[];
|
|
32
45
|
content: string;
|
|
33
46
|
contentBuffer: string[];
|
|
34
|
-
contentPusher:
|
|
47
|
+
contentPusher: any;
|
|
35
48
|
isCompleted: boolean;
|
|
36
|
-
constructor(messages: FmodeChatMessage[]
|
|
49
|
+
constructor(messages: FmodeChatMessage[], options?: {
|
|
50
|
+
model?: string;
|
|
51
|
+
});
|
|
37
52
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @param isDirect 是否不等待逐字获取,直接完成内容推送
|
|
53
|
+
* @param options
|
|
54
|
+
* @param options.isDirect 是否不等待逐字获取,直接完成内容推送
|
|
55
|
+
* @param options.intTime 是否不等待逐字获取,直接完成内容推送
|
|
40
56
|
* @returns
|
|
41
57
|
*/
|
|
42
|
-
sendCompletion(
|
|
58
|
+
sendCompletion(options?: {
|
|
59
|
+
isDirect?: boolean;
|
|
60
|
+
intTime?: number;
|
|
61
|
+
}): Observable<FmodeChatMessage>;
|
|
43
62
|
}
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
import { Router } from '@angular/router';
|
|
2
2
|
import { FmodeChat } from './chat-class';
|
|
3
|
+
import * as Parse from "parse";
|
|
3
4
|
import { NovaCloudService } from '../../../nova-cloud';
|
|
5
|
+
import { AlertController, NavController, Platform } from '@ionic/angular';
|
|
6
|
+
import { CrossService } from '../../../platform';
|
|
4
7
|
import * as i0 from "@angular/core";
|
|
5
8
|
export declare class ChatService {
|
|
6
9
|
private router;
|
|
7
10
|
private ncloud;
|
|
11
|
+
private platform;
|
|
12
|
+
private alertCtrl;
|
|
13
|
+
private navCtrl;
|
|
14
|
+
private cross;
|
|
8
15
|
chatMap: {
|
|
9
16
|
[key: string]: FmodeChat;
|
|
10
17
|
};
|
|
11
|
-
|
|
18
|
+
isCapacitor: boolean;
|
|
19
|
+
constructor(router: Router, ncloud: NovaCloudService, platform: Platform, alertCtrl: AlertController, navCtrl: NavController, cross: CrossService);
|
|
20
|
+
modelList: Array<Parse.Object>;
|
|
21
|
+
currentModel: Parse.Object;
|
|
22
|
+
loadModelList(model?: Parse.Object): Promise<void>;
|
|
23
|
+
platformMap: {
|
|
24
|
+
pc: string;
|
|
25
|
+
mobile: string;
|
|
26
|
+
};
|
|
27
|
+
doButtonAction(button: any): Promise<void>;
|
|
12
28
|
initChatMap(sessionId: any): Promise<FmodeChat>;
|
|
13
29
|
chatList: Array<any>;
|
|
14
30
|
getChatSession(): Promise<void>;
|
|
@@ -17,10 +33,12 @@ export declare class ChatService {
|
|
|
17
33
|
* 重建新对话窗口
|
|
18
34
|
*/
|
|
19
35
|
createChatPanel(role?: any, chat?: any): void;
|
|
36
|
+
createNewRoleChat(roleId: any): Promise<FmodeChat>;
|
|
20
37
|
restoreChatPanel(options?: {
|
|
21
38
|
rid: string;
|
|
22
39
|
sid: string;
|
|
23
40
|
}): Promise<void>;
|
|
41
|
+
callRole(role: any): Promise<void>;
|
|
24
42
|
static ɵfac: i0.ɵɵFactoryDeclaration<ChatService, never>;
|
|
25
43
|
static ɵprov: i0.ɵɵInjectableDeclaration<ChatService>;
|
|
26
44
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import { NovaCloudService } from '../../../nova-cloud/nova-cloud.service';
|
|
3
3
|
import * as Parse from "parse";
|
|
4
|
+
import { NovaUploadService } from '../../../storage/service-upload/nova-upload.service';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* DalleOptions 绘画参数接口
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
5
10
|
export interface DalleOptions {
|
|
6
11
|
prompt: string;
|
|
7
12
|
quality?: null | "hd";
|
|
@@ -32,14 +37,24 @@ export interface StableDiffusionOptions {
|
|
|
32
37
|
units?: ControlnetUnits[];
|
|
33
38
|
};
|
|
34
39
|
}
|
|
35
|
-
|
|
40
|
+
/**
|
|
41
|
+
* imgOptions 图像配置参数
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export interface imgOptions {
|
|
36
45
|
removeBackground?: boolean;
|
|
37
|
-
|
|
46
|
+
redrawBackground?: boolean;
|
|
47
|
+
mainObjectType?: "human" | "general";
|
|
38
48
|
facePreservation?: boolean;
|
|
39
49
|
facePreservationCount?: number;
|
|
40
50
|
genderDetect?: boolean;
|
|
41
51
|
}
|
|
42
|
-
|
|
52
|
+
/**
|
|
53
|
+
* ControlnetUnits 控制网络单元
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export interface ControlnetUnits {
|
|
57
|
+
isOpen?: boolean;
|
|
43
58
|
type?: string;
|
|
44
59
|
preprocess?: boolean;
|
|
45
60
|
image?: string;
|
|
@@ -49,14 +64,19 @@ interface ControlnetUnits {
|
|
|
49
64
|
controlEnd?: number;
|
|
50
65
|
paramsA?: number;
|
|
51
66
|
paramsB?: number;
|
|
67
|
+
controlArray?: any[];
|
|
52
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* ImagineService AI绘画服务
|
|
71
|
+
*/
|
|
53
72
|
export declare class ImagineService {
|
|
54
73
|
private http;
|
|
55
74
|
private ncloud;
|
|
75
|
+
private uploadServ;
|
|
56
76
|
/**
|
|
57
77
|
* 图片生成接口主机地址
|
|
58
78
|
*/
|
|
59
|
-
constructor(http: HttpClient, ncloud: NovaCloudService);
|
|
79
|
+
constructor(http: HttpClient, ncloud: NovaCloudService, uploadServ: NovaUploadService);
|
|
60
80
|
/**
|
|
61
81
|
* DALL-E-3 图片生成函数
|
|
62
82
|
* @description
|
|
@@ -72,6 +92,7 @@ export declare class ImagineService {
|
|
|
72
92
|
*/
|
|
73
93
|
drawDalle(options: DalleOptions): Promise<any>;
|
|
74
94
|
priceDalle(options: DalleOptions): any;
|
|
95
|
+
priceStableDiffusion(options: StableDiffusionOptions): number;
|
|
75
96
|
b64DataToBase64Image(b64_json: any): void;
|
|
76
97
|
/**
|
|
77
98
|
* Huashi6专用绘图函数
|
|
@@ -96,7 +117,7 @@ export declare class ImagineService {
|
|
|
96
117
|
myWorkList: Array<Parse.Object>;
|
|
97
118
|
getMyWorkQuery(): Parse.Query<Parse.Object<Parse.Attributes>>;
|
|
98
119
|
getWorkQuery(): Parse.Query<Parse.Object<Parse.Attributes>>;
|
|
120
|
+
getimg(): Promise<string>;
|
|
99
121
|
static ɵfac: i0.ɵɵFactoryDeclaration<ImagineService, never>;
|
|
100
122
|
static ɵprov: i0.ɵɵInjectableDeclaration<ImagineService>;
|
|
101
123
|
}
|
|
102
|
-
export {};
|
|
@@ -20,6 +20,34 @@ export declare class FmodeVoiceService {
|
|
|
20
20
|
*/
|
|
21
21
|
webSpeech: typeof WebSpeech;
|
|
22
22
|
constructor(platform: Platform, diagnostic: Diagnostic);
|
|
23
|
+
/**
|
|
24
|
+
* 用户操作:录音按钮快捷触发操作
|
|
25
|
+
*/
|
|
26
|
+
toggleRecord(): void;
|
|
27
|
+
/**
|
|
28
|
+
* 用户操作:完成录音,并处理转录结果
|
|
29
|
+
*/
|
|
30
|
+
finishTalk(): void;
|
|
31
|
+
onBeforeFinishTalk: Function;
|
|
32
|
+
onAfterFinishTalk: Function;
|
|
33
|
+
/**
|
|
34
|
+
* 用户操作:开始讲话,实时转录语言
|
|
35
|
+
*/
|
|
36
|
+
startTalk(evnet?: any): Promise<void>;
|
|
37
|
+
onBeforeStartTalk: Function;
|
|
38
|
+
onAfterStartTalk: Function;
|
|
39
|
+
/**
|
|
40
|
+
* 用户操作:取消讲话,且不发送结果
|
|
41
|
+
*/
|
|
42
|
+
cancelTalk(): void;
|
|
43
|
+
/**
|
|
44
|
+
* 操作回调
|
|
45
|
+
*/
|
|
46
|
+
onBeforeCancelTalk: Function;
|
|
47
|
+
onAfterCancelTalk: Function;
|
|
48
|
+
/**
|
|
49
|
+
* 程序逻辑
|
|
50
|
+
*/
|
|
23
51
|
recordStart(): Promise<void>;
|
|
24
52
|
recordStop(): void;
|
|
25
53
|
recordPcmBlob: Blob;
|
|
@@ -51,6 +79,9 @@ export declare class FmodeVoiceService {
|
|
|
51
79
|
API_KEY: string;
|
|
52
80
|
getWebSocketUrl(): string;
|
|
53
81
|
toBase64(buffer: any): string;
|
|
82
|
+
/**
|
|
83
|
+
* 倒计时:最长支持60秒实时语音转录,如果持续7-10秒无声音,服务端将自动CLOSE链接
|
|
84
|
+
*/
|
|
54
85
|
countdown(): void;
|
|
55
86
|
changeBtnStatus(status: any): void;
|
|
56
87
|
renderResult(resultData: any): void;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { ModalController, NavController, Platform } from '@ionic/angular';
|
|
1
2
|
import * as i0 from "@angular/core";
|
|
2
3
|
export declare class CrossService {
|
|
4
|
+
private platform;
|
|
5
|
+
private modalCtrl;
|
|
6
|
+
private navCtrl;
|
|
3
7
|
mobileWidth: number;
|
|
4
8
|
clientWidth: number;
|
|
5
9
|
leftMenuMode: string;
|
|
6
10
|
navMenuType: string;
|
|
7
11
|
fixInterval: any;
|
|
8
|
-
constructor();
|
|
12
|
+
constructor(platform: Platform, modalCtrl: ModalController, navCtrl: NavController);
|
|
13
|
+
dismisModalTop(event?: Event): Promise<void>;
|
|
9
14
|
updateWidth(): void;
|
|
10
15
|
onResizeScreen(ev?: any): void;
|
|
11
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<CrossService, never>;
|
package/lib/storage/index.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import ObsClient from "esdk-obs-browserjs";
|
|
2
2
|
import * as Parse from "parse";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* HwobsDir 华为OBS目录接口
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
4
8
|
export interface HwobsDir {
|
|
5
9
|
Prefix: string;
|
|
6
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* HwobsDir 华为OBS文件接口
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
7
15
|
export interface HwobsFile {
|
|
8
16
|
ETag: "\"f0ec968fe51ab48348307e06476122eb\"";
|
|
9
17
|
Key: string;
|
|
@@ -12,6 +20,10 @@ export interface HwobsFile {
|
|
|
12
20
|
Size: string;
|
|
13
21
|
StorageClass: string;
|
|
14
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* HwobsService 华为OBS文件服务
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
15
27
|
export declare class HwobsService {
|
|
16
28
|
obsClient: ObsClient;
|
|
17
29
|
bucketName: string;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Platform } from '@ionic/angular';
|
|
2
|
+
import * as Parse from "parse";
|
|
3
|
+
import { Diagnostic } from '@awesome-cordova-plugins/diagnostic/ngx';
|
|
4
|
+
/**
|
|
5
|
+
* MediaCapture插件
|
|
6
|
+
* @private
|
|
7
|
+
* @description
|
|
8
|
+
* 依赖:File
|
|
9
|
+
* npm i -S cordova-plugin-file @awesome-cordova-plugins/file
|
|
10
|
+
*/
|
|
11
|
+
import { MediaFile } from "@awesome-cordova-plugins/media-capture";
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
/**
|
|
14
|
+
* NovaFile 文件类型
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export interface NovaFile {
|
|
18
|
+
key: string;
|
|
19
|
+
url: string;
|
|
20
|
+
name: string;
|
|
21
|
+
type: string;
|
|
22
|
+
size: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* NovaUploadService 上传服务
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export declare class NovaUploadService {
|
|
29
|
+
private platform;
|
|
30
|
+
private diagnostic;
|
|
31
|
+
company: string;
|
|
32
|
+
uptoken: string;
|
|
33
|
+
qiniuConf: any;
|
|
34
|
+
domain: string;
|
|
35
|
+
constructor(platform: Platform, diagnostic: Diagnostic);
|
|
36
|
+
/**
|
|
37
|
+
* 全端通用上传方法
|
|
38
|
+
* @params file:File 待上传文件
|
|
39
|
+
* @params onProgress:Function 上传进度回调函数
|
|
40
|
+
* @returns
|
|
41
|
+
* progressData {
|
|
42
|
+
"total": {
|
|
43
|
+
"size": 8491,
|
|
44
|
+
"loaded": 8490,
|
|
45
|
+
"percent": 99.98822282416675
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
* novafileData {
|
|
49
|
+
"hash": "FoYHjpyTif1t8uOMv6N6sVIeGTvq",
|
|
50
|
+
"key": "E4KpGvTEto/20230901/053605467.jpg",
|
|
51
|
+
"url": "https://file-cloud.fmode.cn/E4KpGvTEto/20230901/053605467.jpg",
|
|
52
|
+
"name": "20230901173605.jpg",
|
|
53
|
+
"type": "image/jpg",
|
|
54
|
+
"size": 7853
|
|
55
|
+
}
|
|
56
|
+
*/
|
|
57
|
+
upload(file: File, onProgress?: Function): Promise<NovaFile>;
|
|
58
|
+
/**
|
|
59
|
+
* 移动端上传专用方法
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
isCapacitor(): boolean;
|
|
63
|
+
requestPermission(): Promise<void>;
|
|
64
|
+
requestStoagePermission(): Promise<void>;
|
|
65
|
+
requestCameraPermission(): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* 上传Token获取方法
|
|
68
|
+
* @returns
|
|
69
|
+
*/
|
|
70
|
+
getUptoken(refresh?: boolean): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* 生成文件上传Key值:<公司id>/<yyyymmdd>/<file.id><hhMMss>.<ext>
|
|
73
|
+
* @desc 用于对象存储含全路径的文件名称
|
|
74
|
+
*/
|
|
75
|
+
genFileKey(file: {
|
|
76
|
+
id: string;
|
|
77
|
+
name: string;
|
|
78
|
+
}, company?: any): string;
|
|
79
|
+
/**
|
|
80
|
+
* 获取当前登录用户公司ID
|
|
81
|
+
* @returns 公司ID
|
|
82
|
+
*/
|
|
83
|
+
getCompanyId(): string;
|
|
84
|
+
qiniuDomain: string;
|
|
85
|
+
queryDomain(): Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* 保存上传信息至附件表 Attachment
|
|
88
|
+
* @param file 附件信息
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
saveAttachment(file: NovaFile | {
|
|
92
|
+
url: string;
|
|
93
|
+
size: string;
|
|
94
|
+
name: string;
|
|
95
|
+
type: string;
|
|
96
|
+
}, domain: any, cateId?: any, company?: any): Promise<Parse.Object>;
|
|
97
|
+
/**
|
|
98
|
+
* 录像并上传
|
|
99
|
+
*/
|
|
100
|
+
captureVideo(conf: any): Promise<any>;
|
|
101
|
+
cameraCaptureVideoFile(): Promise<MediaFile | any | null>;
|
|
102
|
+
getMediaFileDataString(mediafile: any): Promise<Blob>;
|
|
103
|
+
/**
|
|
104
|
+
* 拍照并上传
|
|
105
|
+
* @returns -- {hash?:string,url:string,name:string,size:number,key:stirng}
|
|
106
|
+
*/
|
|
107
|
+
takePicture(conf: any): Promise<any>;
|
|
108
|
+
cameraTakePictureDataUrl(): Promise<import("@capacitor/camera").Photo>;
|
|
109
|
+
maxSize: number;
|
|
110
|
+
/**
|
|
111
|
+
* 七牛上传函数:无需前端组件
|
|
112
|
+
* @param imageBlob: Blob
|
|
113
|
+
* @param format: string
|
|
114
|
+
*/
|
|
115
|
+
saveQiniuImageFile(imageBlob: Blob, format: string, company?: string, onProgress?: Function): Promise<NovaFile | any>;
|
|
116
|
+
saveQiniuMediaFile(mediafile: any, fileBlob: Blob, company?: string, onProgress?: Function): Promise<NovaFile | any>;
|
|
117
|
+
base64ToBlobType(string: any, type: any): Promise<Blob>;
|
|
118
|
+
base64ToBlob(base64Img: string): Promise<Blob>;
|
|
119
|
+
fileToBlob(file: File): Blob;
|
|
120
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NovaUploadService, never>;
|
|
121
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NovaUploadService>;
|
|
122
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fmode-ng",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"author": "未来全栈",
|
|
5
5
|
"license": "COPYRIGHT © 未来飞马 未来全栈 www.fmode.cn All RIGHTS RESERVED",
|
|
6
6
|
"peerDependencies": {
|
|
7
|
-
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
8
|
-
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
9
|
-
"@angular/forms": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
10
|
-
"@angular/animations": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
11
|
-
"ng-zorro-antd": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
12
|
-
"parse": "^
|
|
7
|
+
"@angular/common": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
8
|
+
"@angular/core": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
9
|
+
"@angular/forms": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
10
|
+
"@angular/animations": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
11
|
+
"ng-zorro-antd": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
12
|
+
"parse": "^5.0.0",
|
|
13
|
+
"@types/parse": "^3.0.9",
|
|
13
14
|
"@ionic/angular": "^6.0.0 || ^7.0.0",
|
|
14
15
|
"qiniu-js": "^3.4.1",
|
|
15
16
|
"recorder-core": "^1.2.23070100",
|
|
@@ -25,7 +26,12 @@
|
|
|
25
26
|
"markdown-it-ruby": "^0.1.1",
|
|
26
27
|
"markdown-it-sub": "^1.0.0",
|
|
27
28
|
"markdown-it-sup": "^1.0.0",
|
|
28
|
-
"esdk-obs-browserjs": "^3.23.5"
|
|
29
|
+
"esdk-obs-browserjs": "^3.23.5",
|
|
30
|
+
"plantuml-encoder": "^1.4.0",
|
|
31
|
+
"jquery": "^3.7.1",
|
|
32
|
+
"@awesome-cordova-plugins/diagnostic": "~6.6.0",
|
|
33
|
+
"@babylonjs/core": "^7.2.1",
|
|
34
|
+
"@babylonjs/loaders": "~7.2.1"
|
|
29
35
|
},
|
|
30
36
|
"dependencies": {
|
|
31
37
|
"tslib": "^2.3.0"
|