@@ -4,12 +4,24 @@ import { Server } from "../../../utils/registryRoutersV2";
4
4
import { Type } from "@sinclair/typebox" ;
5
5
import { successJSON } from "../internal/utils/response-json" ;
6
6
7
+ import { configHash } from "../../../utils/ParseConfig" ;
7
8
import {
8
- Server as ServerConfig , WeChat , Github , Google , Apple , AgoraLogin ,
9
- PhoneSMS , Whiteboard , Agora , CloudStorage
9
+ Server as ServerConfig ,
10
+ WeChat ,
11
+ Github ,
12
+ Google ,
13
+ Apple ,
14
+ AgoraLogin ,
15
+ PhoneSMS ,
16
+ Whiteboard ,
17
+ Agora ,
18
+ CloudStorage ,
19
+ StorageService ,
20
+ Censorship ,
10
21
} from "../../../constants/Config" ;
11
22
12
23
type regionConfigsResponseSchema = {
24
+ hash : string ;
13
25
login : {
14
26
wechatWeb : boolean ;
15
27
wechatMobile : boolean ;
@@ -19,29 +31,49 @@ type regionConfigsResponseSchema = {
19
31
agora : boolean ;
20
32
sms : boolean ;
21
33
smsForce : boolean ;
22
- } ,
34
+ } ;
23
35
server : {
24
36
region : string ;
25
37
regionCode : number ;
26
38
env : string ;
27
- } ,
39
+ } ;
28
40
whiteboard : {
41
+ appId : string ;
29
42
convertRegion : string ;
30
- } ,
43
+ } ;
31
44
agora : {
45
+ clientId : string ;
46
+ appId : string ;
32
47
screenshot : boolean ;
33
48
messageNotification : boolean ;
34
- } ,
49
+ } ;
50
+ github : {
51
+ clientId : string ;
52
+ } ;
53
+ wechat : {
54
+ webAppId : string ;
55
+ mobileAppId : string ;
56
+ } ;
57
+ google : {
58
+ clientId : string ;
59
+ } ;
35
60
cloudStorage : {
36
61
singleFileSize : number ;
37
- totleSize : number ;
62
+ totalSize : number ;
38
63
allowFileSuffix : Array < String > ;
64
+ accessKey : string ;
65
+ } ;
66
+ censorship : {
67
+ video : boolean ;
68
+ voice : boolean ;
69
+ text : boolean ;
39
70
} ;
40
71
} ;
41
72
42
73
// export for unit test
43
74
export const regionConfigs = async ( ) : Promise < ResponseSuccess < regionConfigsResponseSchema > > => {
44
75
return successJSON ( {
76
+ hash : configHash ,
45
77
login : {
46
78
wechatWeb : WeChat . web . enable ,
47
79
wechatMobile : WeChat . mobile . enable ,
@@ -58,17 +90,36 @@ export const regionConfigs = async (): Promise<ResponseSuccess<regionConfigsResp
58
90
env : ServerConfig . env ,
59
91
} ,
60
92
whiteboard : {
61
- convertRegion : Whiteboard . convertRegion
93
+ appId : Whiteboard . appId ,
94
+ convertRegion : Whiteboard . convertRegion ,
62
95
} ,
63
96
agora : {
97
+ clientId : AgoraLogin . clientId ,
98
+ appId : Agora . appId ,
64
99
screenshot : Agora . screenshot . enable ,
65
100
messageNotification : Agora . messageNotification . enable ,
66
101
} ,
102
+ github : {
103
+ clientId : Github . clientId ,
104
+ } ,
105
+ wechat : {
106
+ webAppId : WeChat . web . appId ,
107
+ mobileAppId : WeChat . mobile . appId ,
108
+ } ,
109
+ google : {
110
+ clientId : Google . clientId ,
111
+ } ,
67
112
cloudStorage : {
68
113
singleFileSize : CloudStorage . singleFileSize ,
69
- totleSize : CloudStorage . totalSize ,
114
+ totalSize : CloudStorage . totalSize ,
70
115
allowFileSuffix : CloudStorage . allowFileSuffix ,
71
- }
116
+ accessKey : StorageService . oss . accessKey ,
117
+ } ,
118
+ censorship : {
119
+ video : Censorship . video . enable ,
120
+ voice : Censorship . voice . enable ,
121
+ text : Censorship . text . enable ,
122
+ } ,
72
123
} ) ;
73
124
} ;
74
125
0 commit comments