@tinywork/glass 0.0.42 → 0.0.44

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 CHANGED
@@ -50,9 +50,47 @@ export type GroupSchema = {
50
50
  code?: string;
51
51
  status: boolean;
52
52
  };
53
+ export type Project = {
54
+ id: string;
55
+ name: string;
56
+ desc?: string;
57
+ status: boolean;
58
+ actived?: boolean;
59
+ };
60
+ export type Version = {
61
+ id: string;
62
+ projectId: string;
63
+ name: string;
64
+ desc?: string;
65
+ status: boolean;
66
+ actived?: boolean;
67
+ };
53
68
  export type MockMode = 'None' | 'Local' | 'Advance';
54
69
  export type ActionMode = 'Modify' | 'Add' | 'Remove';
55
70
  export type ActionTarget = 'Origin';
71
+ export type ContextMenuType = 'log' | 'case' | 'group' | 'doc' | 'rule' | 'project' | 'version';
72
+ export type ContextMenuParams = {
73
+ type: 'log';
74
+ data: NetLog;
75
+ } | {
76
+ type: 'case';
77
+ data: Case;
78
+ } | {
79
+ type: 'group';
80
+ data: GroupSchema;
81
+ } | {
82
+ type: 'doc';
83
+ data: DocSchema;
84
+ } | {
85
+ type: 'rule';
86
+ data: RuleSchema;
87
+ } | {
88
+ type: 'project';
89
+ data: Project;
90
+ } | {
91
+ type: 'version';
92
+ data: Version;
93
+ };
56
94
  export type MockModelSchema = {
57
95
  id: string;
58
96
  ruleId?: string;
@@ -239,7 +277,7 @@ export interface IGlassExtension {
239
277
  onDocCliUpdate?(context: IGlassContext, id: string): Promise<void>;
240
278
  onGroupChange?(context: IGlassContext, group: GroupSchema | null, originGroup: GroupSchema | null): Promise<boolean>;
241
279
  /** 右键请求日志 */
242
- onNetLogContextMenu?(context: IGlassContext, log: NetLog, menus?: MenuItemConstructorOptions[]): Promise<void>;
280
+ onContextMenu?(context: IGlassContext, params: ContextMenuParams, menus?: MenuItemConstructorOptions[]): Promise<void>;
243
281
  getDefaultRule?(context: IGlassContext, docs: DocSchema[], log: NetLog, rule?: {
244
282
  id: string;
245
283
  mode: 'None';
@@ -256,4 +294,6 @@ export interface IGlassExtension {
256
294
  /** 根据doc或者log来初始化case */
257
295
  getDefaultCase?(context: IGlassContext, docs: DocSchema[], log?: NetLog, defaultCase?: Partial<Case>): Promise<void>;
258
296
  }
259
- export { fs, qs, path, http, https, axios, crypto, BrowserWindow, type Session, type MenuItemConstructorOptions, };
297
+ declare const writeText: (text: string, type?: "selection" | "clipboard") => void;
298
+ declare const openExternal: (url: string, options?: Electron.OpenExternalOptions) => Promise<void>;
299
+ export { fs, qs, path, http, https, axios, crypto, BrowserWindow, openExternal, writeText, type Session, type MenuItemConstructorOptions, };
package/dist/index.js CHANGED
@@ -5,5 +5,7 @@ import https from 'node:https';
5
5
  import crypto from 'node:crypto';
6
6
  import axios from 'axios';
7
7
  import qs from 'qs';
8
- import { BrowserWindow } from 'electron';
9
- export { fs, qs, path, http, https, axios, crypto, BrowserWindow, };
8
+ import { BrowserWindow, shell, clipboard, } from 'electron';
9
+ const writeText = clipboard.writeText;
10
+ const openExternal = shell.openExternal;
11
+ export { fs, qs, path, http, https, axios, crypto, BrowserWindow, openExternal, writeText, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinywork/glass",
3
- "version": "0.0.42",
3
+ "version": "0.0.44",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [