@tinywork/glass 0.0.47 → 0.0.49
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 +11 -7
- package/dist/index.js +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,12 @@ import axios from "axios";
|
|
|
8
8
|
import qs from "qs";
|
|
9
9
|
import { BrowserWindow, type MenuItemConstructorOptions, type Session } from "electron";
|
|
10
10
|
/** 1-新增,2-修改,3-删除 */
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export declare enum Operation {
|
|
12
|
+
ADD = 1,
|
|
13
|
+
MODIFY = 2,
|
|
14
|
+
DELETE = 3
|
|
15
|
+
}
|
|
16
|
+
export type ResourceType = "Fetch/XHR" | "JS" | "CSS" | "Img" | "Media" | "Font" | "Doc" | "WS" | "Wasm" | "Other";
|
|
13
17
|
export type JSONPropertySchema = {
|
|
14
18
|
type: string;
|
|
15
19
|
description?: string;
|
|
@@ -311,9 +315,9 @@ export interface IGlassExtension {
|
|
|
311
315
|
}[];
|
|
312
316
|
}): Promise<void>;
|
|
313
317
|
/** 远程服务同步数据至本机 */
|
|
314
|
-
onSyncDownload?(context: IGlassContext, operation: Operation, params: SyncDataParams): Promise<void>;
|
|
318
|
+
onSyncDownload?(context: IGlassContext, operation: Operation, params: SyncDataParams, orgId?: string | null): Promise<void>;
|
|
315
319
|
/** 本机变更同步数据至远程服务 */
|
|
316
|
-
onSyncUpload?(context: IGlassContext, operation: Operation, params: SyncDataParams): Promise<void>;
|
|
320
|
+
onSyncUpload?(context: IGlassContext, operation: Operation, params: SyncDataParams, orgId?: string | null): Promise<void>;
|
|
317
321
|
/** 在postMessage到页面之前 */
|
|
318
322
|
onMessagePost?(context: IGlassContext, message: Partial<NetLog>): Promise<void>;
|
|
319
323
|
onResponse?(context: IGlassContext, params: {
|
|
@@ -323,10 +327,10 @@ export interface IGlassExtension {
|
|
|
323
327
|
}): Promise<void>;
|
|
324
328
|
deactivate?(context: IGlassContext): Promise<void>;
|
|
325
329
|
uninstall?(context: IGlassContext): Promise<void>;
|
|
326
|
-
onDocChange?(context: IGlassContext, doc: DocFullSchema | null, originDoc: DocFullSchema | null): Promise<boolean>;
|
|
330
|
+
onDocChange?(context: IGlassContext, doc: DocFullSchema | null, originDoc: DocFullSchema | null, orgId?: string | null): Promise<boolean>;
|
|
331
|
+
onGroupChange?(context: IGlassContext, group: GroupSchema | null, originGroup: GroupSchema | null, orgId?: string | null): Promise<boolean>;
|
|
327
332
|
/** glass cli拉取接口文档 */
|
|
328
|
-
onDocCliUpdate?(context: IGlassContext, id: string): Promise<void>;
|
|
329
|
-
onGroupChange?(context: IGlassContext, group: GroupSchema | null, originGroup: GroupSchema | null): Promise<boolean>;
|
|
333
|
+
onDocCliUpdate?(context: IGlassContext, id: string, orgId?: string | null): Promise<void>;
|
|
330
334
|
/** 右键请求日志 */
|
|
331
335
|
onContextMenu?(context: IGlassContext, params: ContextMenuParams, menus?: MenuItemConstructorOptions[]): Promise<void>;
|
|
332
336
|
getDefaultRule?(context: IGlassContext, docs: DocSchema[], log: NetLog, rule?: {
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,13 @@ import crypto from "node:crypto";
|
|
|
6
6
|
import axios from "axios";
|
|
7
7
|
import qs from "qs";
|
|
8
8
|
import { BrowserWindow, shell, clipboard, } from "electron";
|
|
9
|
+
/** 1-新增,2-修改,3-删除 */
|
|
10
|
+
export var Operation;
|
|
11
|
+
(function (Operation) {
|
|
12
|
+
Operation[Operation["ADD"] = 1] = "ADD";
|
|
13
|
+
Operation[Operation["MODIFY"] = 2] = "MODIFY";
|
|
14
|
+
Operation[Operation["DELETE"] = 3] = "DELETE";
|
|
15
|
+
})(Operation || (Operation = {}));
|
|
9
16
|
const writeText = clipboard.writeText;
|
|
10
17
|
const openExternal = shell.openExternal;
|
|
11
18
|
export { fs, qs, path, http, https, axios, crypto, BrowserWindow, openExternal, writeText, };
|