@@ -4,12 +4,24 @@ import { Server } from "../../../utils/registryRoutersV2";
44import { Type } from "@sinclair/typebox" ;
55import { successJSON } from "../internal/utils/response-json" ;
66
7+ import { configHash } from "../../../utils/ParseConfig" ;
78import {
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 ,
1021} from "../../../constants/Config" ;
1122
1223type regionConfigsResponseSchema = {
24+ hash : string ;
1325 login : {
1426 wechatWeb : boolean ;
1527 wechatMobile : boolean ;
@@ -19,29 +31,49 @@ type regionConfigsResponseSchema = {
1931 agora : boolean ;
2032 sms : boolean ;
2133 smsForce : boolean ;
22- } ,
34+ } ;
2335 server : {
2436 region : string ;
2537 regionCode : number ;
2638 env : string ;
27- } ,
39+ } ;
2840 whiteboard : {
41+ appId : string ;
2942 convertRegion : string ;
30- } ,
43+ } ;
3144 agora : {
45+ clientId : string ;
46+ appId : string ;
3247 screenshot : boolean ;
3348 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+ } ;
3560 cloudStorage : {
3661 singleFileSize : number ;
37- totleSize : number ;
62+ totalSize : number ;
3863 allowFileSuffix : Array < String > ;
64+ accessKey : string ;
65+ } ;
66+ censorship : {
67+ video : boolean ;
68+ voice : boolean ;
69+ text : boolean ;
3970 } ;
4071} ;
4172
4273// export for unit test
4374export const regionConfigs = async ( ) : Promise < ResponseSuccess < regionConfigsResponseSchema > > => {
4475 return successJSON ( {
76+ hash : configHash ,
4577 login : {
4678 wechatWeb : WeChat . web . enable ,
4779 wechatMobile : WeChat . mobile . enable ,
@@ -58,17 +90,36 @@ export const regionConfigs = async (): Promise<ResponseSuccess<regionConfigsResp
5890 env : ServerConfig . env ,
5991 } ,
6092 whiteboard : {
61- convertRegion : Whiteboard . convertRegion
93+ appId : Whiteboard . appId ,
94+ convertRegion : Whiteboard . convertRegion ,
6295 } ,
6396 agora : {
97+ clientId : AgoraLogin . clientId ,
98+ appId : Agora . appId ,
6499 screenshot : Agora . screenshot . enable ,
65100 messageNotification : Agora . messageNotification . enable ,
66101 } ,
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+ } ,
67112 cloudStorage : {
68113 singleFileSize : CloudStorage . singleFileSize ,
69- totleSize : CloudStorage . totalSize ,
114+ totalSize : CloudStorage . totalSize ,
70115 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+ } ,
72123 } ) ;
73124} ;
74125
0 commit comments