@deepbounty/sdk 1.1.1 → 1.1.2
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 +38 -0
- package/dist/types/modules.d.ts +1 -0
- package/dist/types/tasks.d.ts +0 -2
- package/dist/types/workers.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -39,10 +39,48 @@ export interface ConfigAPI {
|
|
|
39
39
|
*/
|
|
40
40
|
getAllSettings(): Promise<ModuleSetting[]>;
|
|
41
41
|
}
|
|
42
|
+
export interface StorageAPI {
|
|
43
|
+
/**
|
|
44
|
+
* Execute a raw SQL query (SELECT)
|
|
45
|
+
* @param sql The SQL query to execute
|
|
46
|
+
* @param params Optional parameters for the query
|
|
47
|
+
* @returns All matching rows
|
|
48
|
+
*/
|
|
49
|
+
query<T = any>(sql: string, params?: any[]): T[];
|
|
50
|
+
/**
|
|
51
|
+
* Execute a raw SQL query and return the first row
|
|
52
|
+
* @param sql The SQL query to execute
|
|
53
|
+
* @param params Optional parameters for the query
|
|
54
|
+
* @returns The first matching row or undefined
|
|
55
|
+
*/
|
|
56
|
+
queryOne<T = any>(sql: string, params?: any[]): T | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Execute a raw SQL statement (INSERT, UPDATE, DELETE)
|
|
59
|
+
* @param sql The SQL statement to execute
|
|
60
|
+
* @param params Optional parameters for the statement
|
|
61
|
+
* @returns Information about the execution (changes, lastInsertRowid)
|
|
62
|
+
*/
|
|
63
|
+
execute(sql: string, params?: any[]): {
|
|
64
|
+
changes: number | bigint;
|
|
65
|
+
lastInsertRowid: number | bigint;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Helper method to create a table if it doesn't exist
|
|
69
|
+
* @param tableName The name of the table to create
|
|
70
|
+
* @param schema The schema definition for the table
|
|
71
|
+
*/
|
|
72
|
+
createTable(tableName: string, schema: string): void;
|
|
73
|
+
/**
|
|
74
|
+
* Helper method to drop a table
|
|
75
|
+
* @param tableName The name of the table to drop
|
|
76
|
+
*/
|
|
77
|
+
dropTable(tableName: string): void;
|
|
78
|
+
}
|
|
42
79
|
export interface ServerAPI {
|
|
43
80
|
version: string;
|
|
44
81
|
logger: Logger;
|
|
45
82
|
config: ConfigAPI;
|
|
83
|
+
storage: StorageAPI;
|
|
46
84
|
/**
|
|
47
85
|
* Register a task template that can be scheduled for all targets
|
|
48
86
|
* @param uniqueKey Unique identifier for this task within the module (e.g., "subdomain-scan")
|
package/dist/types/modules.d.ts
CHANGED
package/dist/types/tasks.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export interface TaskTemplate {
|
|
|
13
13
|
content: TaskContent;
|
|
14
14
|
interval: number;
|
|
15
15
|
active: boolean;
|
|
16
|
-
createdAt: Date;
|
|
17
16
|
}
|
|
18
17
|
export interface ScheduledTask {
|
|
19
18
|
id: number;
|
|
@@ -48,5 +47,4 @@ export interface TargetTaskOverride {
|
|
|
48
47
|
targetId: number;
|
|
49
48
|
taskTemplateId: number;
|
|
50
49
|
active: boolean;
|
|
51
|
-
createdAt: Date;
|
|
52
50
|
}
|
package/dist/types/workers.d.ts
CHANGED