@tinywork/glass 0.0.6 → 0.0.7

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
@@ -4,6 +4,7 @@ import path from 'node:path';
4
4
  import http from 'node:http';
5
5
  import https from 'node:https';
6
6
  import axios from 'axios';
7
+ import { BrowserWindow } from 'electron';
7
8
  export type DocSchema = {
8
9
  apiId: string;
9
10
  groupId: string;
@@ -15,6 +16,7 @@ export type DocSchema = {
15
16
  modifier?: string;
16
17
  modifyTime?: string;
17
18
  status: boolean;
19
+ prefix?: string;
18
20
  };
19
21
  export type GroupSchema = {
20
22
  id: string;
@@ -23,8 +25,21 @@ export type GroupSchema = {
23
25
  desc?: string;
24
26
  origin?: string;
25
27
  prefix?: string;
28
+ code?: string;
26
29
  status: boolean;
27
30
  };
31
+ export type NetLog = {
32
+ body: any;
33
+ statusCode: number;
34
+ responseHeaders: string[][];
35
+ response: any;
36
+ uid: string;
37
+ url: string;
38
+ realUrl: string;
39
+ method: string;
40
+ requestHeaders: string[][];
41
+ query: string;
42
+ };
28
43
  export interface IGlassContext {
29
44
  getItem?: <T>(key: string) => Promise<T>;
30
45
  setItem?: <T>(key: string, value: T) => Promise<void>;
@@ -51,5 +66,18 @@ export interface IGlassExtension {
51
66
  uninstall?(context: IGlassContext): Promise<void>;
52
67
  onDocChange?(context: IGlassContext, doc: DocSchema | null, originDoc: DocSchema | null): Promise<boolean>;
53
68
  onGroupChange?(context: IGlassContext, group: GroupSchema | null, originGroup: GroupSchema | null): Promise<boolean>;
69
+ getDefaultRule?(docs: DocSchema[], log: NetLog, rule?: {
70
+ id: string;
71
+ mode: 'None';
72
+ } & Partial<{
73
+ name: string;
74
+ origin: string;
75
+ pathname: string;
76
+ params: {
77
+ key: string;
78
+ value?: string;
79
+ }[];
80
+ apiId: string;
81
+ }>): Promise<void>;
54
82
  }
55
- export { fs, path, http, https, axios };
83
+ export { fs, path, http, https, axios, BrowserWindow };
package/dist/index.js CHANGED
@@ -3,4 +3,5 @@ import path from 'node:path';
3
3
  import http from 'node:http';
4
4
  import https from 'node:https';
5
5
  import axios from 'axios';
6
- export { fs, path, http, https, axios };
6
+ import { BrowserWindow } from 'electron';
7
+ export { fs, path, http, https, axios, BrowserWindow };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinywork/glass",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [