@tinywork/glass 0.0.27 → 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.
Files changed (2) hide show
  1. package/dist/index.d.ts +27 -1
  2. 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) => 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
+ 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;
@@ -103,6 +128,7 @@ export interface IGlassContext {
103
128
  }) => Promise<void>;
104
129
  showProgress: () => IProgress;
105
130
  transformDocToJsonSchema: (doc: DocFullSchema) => JSONSchema;
131
+ genDataFromDocSchema: (doc: DocFullSchema) => Record<string, any>;
106
132
  postMessage: (message: Partial<NetLog>) => Promise<void>;
107
133
  }
108
134
  export interface IGlassExtension {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinywork/glass",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [