@tinywork/glass 0.0.28 → 0.0.30

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +30 -1
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -80,14 +80,43 @@ export interface IGlassContext {
80
80
  success: boolean;
81
81
  message?: string;
82
82
  }>;
83
- saveDoc: (doc: DocSchema) => Promise<{
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
+ contentType?: string;
112
+ example?: string;
113
+ name?: string;
114
+ statusCode?: number;
115
+ status?: boolean;
116
+ }[]) => Promise<{
117
+ success: boolean;
118
+ message?: string;
119
+ }>;
91
120
  registerMenu: (id: string, options: MenuItemConstructorOptions) => void;
92
121
  unregisterMenu: (id: string) => void;
93
122
  getSession: (id: string, isPersist?: boolean) => Session;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinywork/glass",
3
- "version": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [