@choiceform/os-client-core 3.4.4 → 3.4.8
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/changelog.md +32 -0
- package/dist/core.js +1 -1
- package/dist/web-core.js +1 -1
- package/index.d.ts +37 -28
- package/package.json +5 -4
package/index.d.ts
CHANGED
|
@@ -237,16 +237,14 @@ interface CFEnvUi {
|
|
|
237
237
|
initNodeTemplate?(
|
|
238
238
|
template: CFNodeTemplate,
|
|
239
239
|
state: CFSurveyState,
|
|
240
|
-
loop: ICFLoop
|
|
241
240
|
): Promise<CFNodeTemplate>;
|
|
242
241
|
/**
|
|
243
|
-
*
|
|
242
|
+
* 预加载当前问卷所有使用到的额UI动态插件的方法
|
|
244
243
|
* 只有实现了动态模板机制的答题端需要配置这个方法
|
|
245
244
|
* 如果不配置则什么都不做
|
|
246
|
-
* @param theme 主题
|
|
247
245
|
* @param templates 模板列表
|
|
248
246
|
*/
|
|
249
|
-
|
|
247
|
+
loadUiEntryTemplates?(templates: string[]): Promise<void>;
|
|
250
248
|
}
|
|
251
249
|
|
|
252
250
|
/**
|
|
@@ -382,6 +380,13 @@ interface CFEnvNetWork {
|
|
|
382
380
|
* 默认行为:什么也不做
|
|
383
381
|
*/
|
|
384
382
|
closeSocket?(): void;
|
|
383
|
+
/**
|
|
384
|
+
* 推动socket消息的方法
|
|
385
|
+
* 默认行为:什么也不做
|
|
386
|
+
* @param message 消息名
|
|
387
|
+
* @param payload 附带的数据
|
|
388
|
+
*/
|
|
389
|
+
pushSocket?(message:string, payload: object): void;
|
|
385
390
|
}
|
|
386
391
|
/**
|
|
387
392
|
* 授权相关的配置,不同的运行平台有不同的账户系统,所以授权方式也不一样。
|
|
@@ -603,10 +608,6 @@ interface CFEnvOptions {
|
|
|
603
608
|
* 服务配置信息
|
|
604
609
|
*/
|
|
605
610
|
interface CFHostConfig {
|
|
606
|
-
/**
|
|
607
|
-
* 错误统计服务key
|
|
608
|
-
*/
|
|
609
|
-
readonly sentryKey: string;
|
|
610
611
|
/**
|
|
611
612
|
* 操作记录接口地址
|
|
612
613
|
*/
|
|
@@ -739,6 +740,12 @@ interface CFSetupOptions {
|
|
|
739
740
|
* @param message 错误内容
|
|
740
741
|
*/
|
|
741
742
|
error(message: string): void;
|
|
743
|
+
/**
|
|
744
|
+
* 上传日志的方法,核心包运行时会生成一些有利于追踪已知错误的日志,希望能通过这个方法上传。
|
|
745
|
+
* 如果不设置则不会上传错误。而是在控制台打印出来
|
|
746
|
+
* @param message
|
|
747
|
+
*/
|
|
748
|
+
uploadLog?(message: string, level?: 'log' | 'error'):void;
|
|
742
749
|
/**
|
|
743
750
|
* 如果在单页模式中有很多题目,进行作答后点击下一题,其中某道题目的答案不满足要求,
|
|
744
751
|
* 这时候可能这道题目不再滚动条所在的可见范围内,
|
|
@@ -799,9 +806,9 @@ interface CFSetupOptions {
|
|
|
799
806
|
* 自定义中断回调方法
|
|
800
807
|
* 当核心包中运行发生异常,或者需要去往外部程序时,会中断答题流程,同时触发调用这个方法
|
|
801
808
|
* 客户端中可以配置该方法来在此时机做一些自定义的事情。
|
|
802
|
-
*
|
|
809
|
+
* 默认行为:总是会在方法被调用的一秒内压制系统消息
|
|
803
810
|
*/
|
|
804
|
-
customAbort?(
|
|
811
|
+
customAbort?(): void;
|
|
805
812
|
/**
|
|
806
813
|
* 自定义的去往开始页面方法,只有使用web核心包是需要关注这个方法
|
|
807
814
|
*
|
|
@@ -1053,19 +1060,19 @@ interface CFCore extends CFSetupOptions {
|
|
|
1053
1060
|
* 多次调用,只有第一次会发送请求
|
|
1054
1061
|
* 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
|
|
1055
1062
|
*/
|
|
1056
|
-
fetchStartState(): Promise<CFStartState>;
|
|
1063
|
+
fetchStartState(): Promise<CFStartState | null>;
|
|
1057
1064
|
/**
|
|
1058
1065
|
* 获取答题也数据的方法
|
|
1059
1066
|
* 多次调用,只有第一次会发送请求
|
|
1060
1067
|
* 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
|
|
1061
1068
|
*/
|
|
1062
|
-
fetchSurveyState(): Promise<CFSurveyState>;
|
|
1069
|
+
fetchSurveyState(): Promise<CFSurveyState | null>;
|
|
1063
1070
|
/**
|
|
1064
1071
|
* 获取奖励页面数据的方法
|
|
1065
1072
|
* 多次调用,只有第一次会发送请求
|
|
1066
1073
|
* 请求的数据会放到缓存中,后面几次获得的都是返回的缓存数据
|
|
1067
1074
|
*/
|
|
1068
|
-
fetchRewardState(): Promise<CFRewardState>;
|
|
1075
|
+
fetchRewardState(): Promise<CFRewardState | null>;
|
|
1069
1076
|
/**
|
|
1070
1077
|
* 获取主题
|
|
1071
1078
|
*/
|
|
@@ -3144,12 +3151,7 @@ type ShouldSetDefault<T> = Required<Pick<T, OptionalKeys<T>>>;
|
|
|
3144
3151
|
* 动态UI组件类型
|
|
3145
3152
|
*/
|
|
3146
3153
|
interface CFUiComponent {
|
|
3147
|
-
|
|
3148
|
-
* 样式对象
|
|
3149
|
-
*/
|
|
3150
|
-
style: {
|
|
3151
|
-
toString(): string;
|
|
3152
|
-
};
|
|
3154
|
+
|
|
3153
3155
|
}
|
|
3154
3156
|
|
|
3155
3157
|
/**
|
|
@@ -5802,10 +5804,6 @@ interface CFQuestion extends ICFNode, ICFTypeInfo {
|
|
|
5802
5804
|
* 前一道题
|
|
5803
5805
|
*/
|
|
5804
5806
|
readonly prev: CFQuestion;
|
|
5805
|
-
/**
|
|
5806
|
-
* 后一道题
|
|
5807
|
-
*/
|
|
5808
|
-
readonly next: CFQuestion;
|
|
5809
5807
|
/**
|
|
5810
5808
|
* 编号,该题的唯一代号
|
|
5811
5809
|
* 如果有该属性,UI要渲染
|
|
@@ -6922,7 +6920,6 @@ interface ICFParsedSmallPayload {
|
|
|
6922
6920
|
readonly varStyles: CFVarStyleGroup;
|
|
6923
6921
|
readonly langs: ICFLang[];
|
|
6924
6922
|
readonly language: string;
|
|
6925
|
-
readonly langStore: any;
|
|
6926
6923
|
readonly langTable: CFLangTableItem[];
|
|
6927
6924
|
readonly langResume: boolean;
|
|
6928
6925
|
readonly testCases: ICFTestCase[];
|
|
@@ -7680,6 +7677,10 @@ interface ICFStartMiniState extends ICFCustomLogo {
|
|
|
7680
7677
|
* 挂载的自动提示数据
|
|
7681
7678
|
*/
|
|
7682
7679
|
readonly autoCpltGroups: ICFAutoCpltGroup[];
|
|
7680
|
+
/**
|
|
7681
|
+
* 自带的多语言翻译包,可以不需要请求大翻译包就实现开始页面的语言切换。
|
|
7682
|
+
*/
|
|
7683
|
+
readonly i18n?: any;
|
|
7683
7684
|
/**
|
|
7684
7685
|
* @ignore
|
|
7685
7686
|
* 自定义logo的图片内容
|
|
@@ -7728,6 +7729,14 @@ interface ICFStartMiniState extends ICFCustomLogo {
|
|
|
7728
7729
|
*/
|
|
7729
7730
|
interface CFStartState extends ICFTranMiniState, ICFStartMiniIntro, CFStateBase, ICFCustomLogo {
|
|
7730
7731
|
readonly core?: CFCore;
|
|
7732
|
+
/**
|
|
7733
|
+
* 开始节点的类型
|
|
7734
|
+
*/
|
|
7735
|
+
readonly type: NODE_TYPE;
|
|
7736
|
+
/**
|
|
7737
|
+
* 开始节点的名称
|
|
7738
|
+
*/
|
|
7739
|
+
readonly nodeName:string;
|
|
7731
7740
|
/**
|
|
7732
7741
|
* 开始节点的布局设置
|
|
7733
7742
|
*/
|
|
@@ -8001,10 +8010,6 @@ interface CFSurveyState
|
|
|
8001
8010
|
* @ignore
|
|
8002
8011
|
*/
|
|
8003
8012
|
readonly refreshing: boolean;
|
|
8004
|
-
/**
|
|
8005
|
-
* @ignore
|
|
8006
|
-
*/
|
|
8007
|
-
readonly needRegions: boolean;
|
|
8008
8013
|
/**
|
|
8009
8014
|
* @ignore
|
|
8010
8015
|
*/
|
|
@@ -9823,6 +9828,10 @@ interface ICFVarRaw {
|
|
|
9823
9828
|
readonly name?: string;
|
|
9824
9829
|
readonly uuid: string;
|
|
9825
9830
|
readonly request?: ICFRequest;
|
|
9831
|
+
/**
|
|
9832
|
+
* 自带的语言包,为开始页面使用的时候可以自行翻译,而无需去加载翻译大包
|
|
9833
|
+
*/
|
|
9834
|
+
readonly i18n?:any;
|
|
9826
9835
|
}
|
|
9827
9836
|
|
|
9828
9837
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@choiceform/os-client-core",
|
|
3
|
-
"version": "3.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.4.8",
|
|
4
|
+
"description": "choiceform survey client core",
|
|
5
5
|
"main": "./dist/core.js",
|
|
6
6
|
"repository": "https://github.com/choice-form/os-client-core",
|
|
7
7
|
"author": "fenyiwudian <laiq@cform.io>",
|
|
@@ -42,10 +42,11 @@
|
|
|
42
42
|
"@babel/preset-env": "^7.10.4",
|
|
43
43
|
"@babel/runtime": "^7.12.1",
|
|
44
44
|
"@types/node-fetch": "^2.5.8",
|
|
45
|
+
"@types/phoenix": "^1.5.3",
|
|
45
46
|
"@typescript-eslint/eslint-plugin": "^4.31.0",
|
|
46
47
|
"@typescript-eslint/parser": "^4.31.0",
|
|
47
48
|
"babel-loader": "^8.1.0",
|
|
48
|
-
"cf-auto": "^1.
|
|
49
|
+
"cf-auto": "^1.96.0",
|
|
49
50
|
"chokidar": "^3.0.2",
|
|
50
51
|
"clean-webpack-plugin": "^3.0.0",
|
|
51
52
|
"copy-webpack-plugin": "^6.0.3",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"messageformat": "^2.3.0",
|
|
61
62
|
"node-fetch": "^2.6.1",
|
|
62
63
|
"pako": "^1.0.10",
|
|
63
|
-
"phoenix": "^1.
|
|
64
|
+
"phoenix": "^1.6.2",
|
|
64
65
|
"prettier": "^2.3.2",
|
|
65
66
|
"typedoc": "^0.15.0",
|
|
66
67
|
"ua-parser-js": "^0.7.20"
|