|
1 | 1 | import type { ISchemaProperties } from '../types.js'; |
2 | 2 |
|
| 3 | +const USER_DATA_DESCRIPTION = `User data object. A JSON object with custom user data that will be passed in the userData property of the Request object for each URL`; |
| 4 | +const HEADERS_DESCRIPTION = `Headers object. A JSON object whose properties and values contain HTTP headers that will sent with the request.`; |
| 5 | + |
3 | 6 | /** |
4 | 7 | * Adds resource picker schema structure to array properties with editor === 'resourcePicker'. |
5 | 8 | * The resource picker allows users to select resources from their Apify account. |
@@ -43,9 +46,6 @@ export function addKeyValueProperties(property: ISchemaProperties): ISchemaPrope |
43 | 46 | }; |
44 | 47 | } |
45 | 48 |
|
46 | | -const USER_DATA_DESCRIPTION = `User data object. A JSON object with custom user data that will be passed in the userData property of the Request object for each URL`; |
47 | | -const HEADERS_DESCRIPTION = `Headers object. A JSON object whose properties and values contain HTTP headers that will sent with the request.`; |
48 | | - |
49 | 49 | /** |
50 | 50 | * Adds globs schema structure to array properties with editor === 'globs'. |
51 | 51 | */ |
@@ -81,6 +81,7 @@ export function addGlobsProperties(property: ISchemaProperties): ISchemaProperti |
81 | 81 | 'CONNECT', |
82 | 82 | 'TRACE', |
83 | 83 | ], |
| 84 | + default: 'GET', |
84 | 85 | }, |
85 | 86 | payload: { |
86 | 87 | type: 'string', |
@@ -140,6 +141,7 @@ export function addPseudoUrlsProperties(property: ISchemaProperties): ISchemaPro |
140 | 141 | 'CONNECT', |
141 | 142 | 'TRACE', |
142 | 143 | ], |
| 144 | + default: 'GET', |
143 | 145 | }, |
144 | 146 | payload: { |
145 | 147 | type: 'string', |
@@ -228,6 +230,40 @@ export function addRequestListSourcesProperties(property: ISchemaProperties): IS |
228 | 230 | type: 'string', |
229 | 231 | description: 'URL of the request list source', |
230 | 232 | }, |
| 233 | + method: { |
| 234 | + title: 'HTTP Method', |
| 235 | + type: 'string', |
| 236 | + description: 'HTTP method for the request list source', |
| 237 | + enum: [ |
| 238 | + 'GET', |
| 239 | + 'POST', |
| 240 | + 'PUT', |
| 241 | + 'DELETE', |
| 242 | + 'PATCH', |
| 243 | + 'HEAD', |
| 244 | + 'OPTIONS', |
| 245 | + 'CONNECT', |
| 246 | + 'TRACE', |
| 247 | + ], |
| 248 | + default: 'GET', |
| 249 | + }, |
| 250 | + payload: { |
| 251 | + title: 'Payload', |
| 252 | + type: 'string', |
| 253 | + description: 'Payload for the request list source', |
| 254 | + }, |
| 255 | + userData: { |
| 256 | + type: 'object', |
| 257 | + title: 'User Data', |
| 258 | + description: USER_DATA_DESCRIPTION, |
| 259 | + properties: {}, |
| 260 | + }, |
| 261 | + headers: { |
| 262 | + type: 'object', |
| 263 | + title: 'Headers', |
| 264 | + description: HEADERS_DESCRIPTION, |
| 265 | + properties: {}, |
| 266 | + }, |
231 | 267 | }, |
232 | 268 | }, |
233 | 269 | }; |
|
0 commit comments