Skip to content

Commit c155080

Browse files
committed
add fields to resource url list
1 parent 861f7fe commit c155080

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

src/tools/apify-properties.ts

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import type { ISchemaProperties } from '../types.js';
22

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+
36
/**
47
* Adds resource picker schema structure to array properties with editor === 'resourcePicker'.
58
* The resource picker allows users to select resources from their Apify account.
@@ -43,9 +46,6 @@ export function addKeyValueProperties(property: ISchemaProperties): ISchemaPrope
4346
};
4447
}
4548

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-
4949
/**
5050
* Adds globs schema structure to array properties with editor === 'globs'.
5151
*/
@@ -81,6 +81,7 @@ export function addGlobsProperties(property: ISchemaProperties): ISchemaProperti
8181
'CONNECT',
8282
'TRACE',
8383
],
84+
default: 'GET',
8485
},
8586
payload: {
8687
type: 'string',
@@ -140,6 +141,7 @@ export function addPseudoUrlsProperties(property: ISchemaProperties): ISchemaPro
140141
'CONNECT',
141142
'TRACE',
142143
],
144+
default: 'GET',
143145
},
144146
payload: {
145147
type: 'string',
@@ -228,6 +230,40 @@ export function addRequestListSourcesProperties(property: ISchemaProperties): IS
228230
type: 'string',
229231
description: 'URL of the request list source',
230232
},
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+
},
231267
},
232268
},
233269
};

0 commit comments

Comments
 (0)