@deepbounty/sdk 1.0.2 → 1.0.4
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/README.md +4 -9
- package/dist/index.d.ts +5 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/modules.d.ts +11 -7
- package/dist/types/tasks.d.ts +10 -4
- package/dist/types/tools.d.ts +8 -0
- package/dist/types/tools.js +1 -0
- package/dist/types/workers.d.ts +3 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,13 +8,8 @@ The official SDK for developing modules for the DeepBounty project.
|
|
|
8
8
|
npm install @deepbounty/sdk
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 📤 Publish
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
2. Publish to npm:
|
|
18
|
-
```bash
|
|
19
|
-
npm publish --access public
|
|
20
|
-
```
|
|
13
|
+
```bash
|
|
14
|
+
npm publish --access public
|
|
15
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleSetting } from "./types";
|
|
1
|
+
import { ModuleSetting, TaskContent, TaskResult } from "./types";
|
|
2
2
|
export interface Logger {
|
|
3
3
|
info: (...args: any[]) => void;
|
|
4
4
|
warn: (...args: any[]) => void;
|
|
@@ -13,10 +13,14 @@ export interface ConfigAPI {
|
|
|
13
13
|
setSetting(name: string, value: any): Promise<void>;
|
|
14
14
|
getAllSettings(): Promise<ModuleSetting[]>;
|
|
15
15
|
}
|
|
16
|
+
export interface TasksAPI {
|
|
17
|
+
submit(taskContent: TaskContent): Promise<TaskResult>;
|
|
18
|
+
}
|
|
16
19
|
export interface ServerAPI {
|
|
17
20
|
version: string;
|
|
18
21
|
logger: Logger;
|
|
19
22
|
config: ConfigAPI;
|
|
23
|
+
tasks: TasksAPI;
|
|
20
24
|
}
|
|
21
25
|
export interface PluginLifecycle {
|
|
22
26
|
run?(api: ServerAPI): Promise<void> | void;
|
package/dist/types/index.d.ts
CHANGED
package/dist/types/index.js
CHANGED
package/dist/types/modules.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { Tool } from "./tools";
|
|
2
|
+
export interface Module {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
version: string;
|
|
6
|
+
entry: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
settings?: ModuleSetting[];
|
|
9
|
+
tools?: Tool[];
|
|
10
|
+
}
|
|
1
11
|
export interface ModuleSetting {
|
|
2
12
|
name: string;
|
|
3
13
|
type: "checkbox" | "text" | "select" | "info";
|
|
@@ -6,13 +16,7 @@ export interface ModuleSetting {
|
|
|
6
16
|
value?: string | boolean;
|
|
7
17
|
options?: string[];
|
|
8
18
|
}
|
|
9
|
-
export interface Module {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
version: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
settings?: ModuleSetting[];
|
|
15
|
-
}
|
|
16
19
|
export interface LoadedModule extends Module {
|
|
17
20
|
run: () => Promise<any>;
|
|
21
|
+
tools?: Tool[];
|
|
18
22
|
}
|
package/dist/types/tasks.d.ts
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { Tool } from "./tools";
|
|
2
|
+
export interface TaskContent {
|
|
3
|
+
commands: string[];
|
|
4
|
+
tools: string[];
|
|
5
|
+
}
|
|
6
|
+
export interface Task extends TaskContent {
|
|
2
7
|
id: number;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
requiredTools?: Tool[];
|
|
9
|
+
}
|
|
10
|
+
export interface ServerTask extends Task {
|
|
11
|
+
workerId?: number;
|
|
6
12
|
status: "pending" | "running" | "completed" | "failed";
|
|
7
13
|
createdAt: Date;
|
|
8
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/workers.d.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ServerTask } from "./tasks";
|
|
2
|
+
import { Tool } from "./tools";
|
|
2
3
|
export interface Worker {
|
|
3
4
|
id: number;
|
|
4
|
-
currentTasks:
|
|
5
|
+
currentTasks: ServerTask[];
|
|
5
6
|
availableTools: Tool[];
|
|
6
7
|
loadFactor: number;
|
|
7
8
|
}
|
|
8
|
-
export interface Tool {
|
|
9
|
-
name: string;
|
|
10
|
-
downloadUrl: string;
|
|
11
|
-
version: string;
|
|
12
|
-
description?: string;
|
|
13
|
-
}
|