@tinywork/glass 0.0.28 → 0.0.29
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/index.d.ts +26 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -80,14 +80,39 @@ export interface IGlassContext {
|
|
|
80
80
|
success: boolean;
|
|
81
81
|
message?: string;
|
|
82
82
|
}>;
|
|
83
|
-
saveDoc: (doc: DocSchema
|
|
83
|
+
saveDoc: (doc: DocSchema, options?: {
|
|
84
|
+
/** 是否触发缓存更新 */
|
|
85
|
+
hooks?: boolean;
|
|
86
|
+
/** 是否根据文档自动生成rule规则 */
|
|
87
|
+
defaultRule?: Partial<{
|
|
88
|
+
name: string;
|
|
89
|
+
origin: string;
|
|
90
|
+
pathname: string;
|
|
91
|
+
params: {
|
|
92
|
+
key: string;
|
|
93
|
+
value?: string;
|
|
94
|
+
}[];
|
|
95
|
+
}>;
|
|
96
|
+
}) => Promise<{
|
|
84
97
|
success: boolean;
|
|
85
98
|
message?: string;
|
|
99
|
+
data?: {
|
|
100
|
+
apiId: string;
|
|
101
|
+
ruleId?: string;
|
|
102
|
+
};
|
|
86
103
|
}>;
|
|
87
104
|
saveDocs: (docs: DocSchema[]) => Promise<{
|
|
88
105
|
success: boolean;
|
|
89
106
|
message?: string;
|
|
90
107
|
}>;
|
|
108
|
+
/** 批量更新rule的本地数据 */
|
|
109
|
+
saveExamples: (ruleId: string, examples: {
|
|
110
|
+
id: string;
|
|
111
|
+
example: any;
|
|
112
|
+
}[]) => Promise<{
|
|
113
|
+
success: boolean;
|
|
114
|
+
message?: string;
|
|
115
|
+
}>;
|
|
91
116
|
registerMenu: (id: string, options: MenuItemConstructorOptions) => void;
|
|
92
117
|
unregisterMenu: (id: string) => void;
|
|
93
118
|
getSession: (id: string, isPersist?: boolean) => Session;
|