@caido/sdk-workflow 0.0.1 → 0.36.0
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 +1 -1
- package/package.json +1 -1
- package/src/typing.d.ts +39 -6
package/README.md
CHANGED
package/package.json
CHANGED
package/src/typing.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare type Console = {
|
|
|
17
17
|
* Calling `to<FORMAT>` will try to convert the body to the desired format.
|
|
18
18
|
*/
|
|
19
19
|
export declare class Body {
|
|
20
|
+
constructor(data: string | Array<number> | Uint8Array);
|
|
20
21
|
/**
|
|
21
22
|
* Parse the body as a string.
|
|
22
23
|
*
|
|
@@ -48,15 +49,26 @@ export declare type Request = {
|
|
|
48
49
|
getMethod(): string;
|
|
49
50
|
getPath(): string;
|
|
50
51
|
getQuery(): string;
|
|
52
|
+
getHeaders(): Record<string, Array<string>>;
|
|
51
53
|
getHeader(name: string): Array<string> | undefined;
|
|
52
54
|
getBody(): Body | undefined;
|
|
53
55
|
toSpec(): RequestSpec;
|
|
54
56
|
};
|
|
55
57
|
|
|
58
|
+
type SetBodyOptions = {
|
|
59
|
+
/**
|
|
60
|
+
* Should update the Content-Type header.
|
|
61
|
+
*
|
|
62
|
+
* @default true
|
|
63
|
+
*/
|
|
64
|
+
updateContentLength: boolean;
|
|
65
|
+
};
|
|
66
|
+
|
|
56
67
|
/**
|
|
57
68
|
* A mutable Request not yet sent.
|
|
58
69
|
*/
|
|
59
70
|
export declare class RequestSpec {
|
|
71
|
+
constructor(url: string);
|
|
60
72
|
getHost(): string;
|
|
61
73
|
setHost(host: string): void;
|
|
62
74
|
getPort(): number;
|
|
@@ -69,10 +81,12 @@ export declare class RequestSpec {
|
|
|
69
81
|
setPath(path: string): void;
|
|
70
82
|
getQuery(): string;
|
|
71
83
|
setQuery(query: string): void;
|
|
84
|
+
getHeaders(): Record<string, Array<string>>;
|
|
72
85
|
getHeader(name: string): Array<string> | undefined;
|
|
73
86
|
setHeader(name: string, value: string): void;
|
|
87
|
+
removeHeader(name: string): void;
|
|
74
88
|
getBody(): Body | undefined;
|
|
75
|
-
setBody(body: Body | Bytes): void;
|
|
89
|
+
setBody(body: Body | Bytes, options?: SetBodyOptions): void;
|
|
76
90
|
}
|
|
77
91
|
|
|
78
92
|
/**
|
|
@@ -81,6 +95,7 @@ export declare class RequestSpec {
|
|
|
81
95
|
export declare type Response = {
|
|
82
96
|
getId(): ID;
|
|
83
97
|
getCode(): number;
|
|
98
|
+
getHeaders(): Record<string, Array<string>>;
|
|
84
99
|
getHeader(name: string): Array<string> | undefined;
|
|
85
100
|
getBody(): Body | undefined;
|
|
86
101
|
};
|
|
@@ -88,7 +103,7 @@ export declare type Response = {
|
|
|
88
103
|
/**
|
|
89
104
|
* An immutable saved Request and Response pair.
|
|
90
105
|
*/
|
|
91
|
-
export declare type
|
|
106
|
+
export declare type RequestResponse = {
|
|
92
107
|
request: Request;
|
|
93
108
|
response: Response;
|
|
94
109
|
};
|
|
@@ -106,7 +121,7 @@ export declare type RequestsSDK = {
|
|
|
106
121
|
*
|
|
107
122
|
* @example
|
|
108
123
|
* const spec = new RequestSpec("https://example.com");
|
|
109
|
-
* sdk.send(request)
|
|
124
|
+
* sdk.requests.send(request)
|
|
110
125
|
* .then((res) => {
|
|
111
126
|
* console.log(res.request.getId());
|
|
112
127
|
* console.log(res.response.getCode());
|
|
@@ -115,7 +130,17 @@ export declare type RequestsSDK = {
|
|
|
115
130
|
* console.error(err);
|
|
116
131
|
* });
|
|
117
132
|
*/
|
|
118
|
-
send(request: RequestSpec): Promise<
|
|
133
|
+
send(request: RequestSpec): Promise<RequestResponse>;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Checks if a request is in scope.
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* if (sdk.requests.inScope(request)) {
|
|
140
|
+
* console.log("In scope");
|
|
141
|
+
* }
|
|
142
|
+
*/
|
|
143
|
+
inScope(request: Request | RequestSpec): boolean;
|
|
119
144
|
};
|
|
120
145
|
|
|
121
146
|
/**
|
|
@@ -160,11 +185,19 @@ export declare type FindingsSDK = {
|
|
|
160
185
|
create(spec: FindingSpec): Promise<Finding>;
|
|
161
186
|
};
|
|
162
187
|
|
|
163
|
-
export declare type
|
|
188
|
+
export declare type HttpInput = {
|
|
164
189
|
request: Request | undefined;
|
|
165
190
|
response: Response | undefined;
|
|
166
191
|
};
|
|
167
|
-
|
|
192
|
+
/**
|
|
193
|
+
* @deprecated Use HttpInput instead.
|
|
194
|
+
*/
|
|
195
|
+
export declare type PassiveInput = HttpInput;
|
|
196
|
+
export declare type BytesInput = Array<number>;
|
|
197
|
+
/**
|
|
198
|
+
* @deprecated Use BytesInput instead.
|
|
199
|
+
*/
|
|
200
|
+
export declare type ConvertInput = BytesInput;
|
|
168
201
|
|
|
169
202
|
export declare type ID = string;
|
|
170
203
|
export declare type Data = Bytes;
|