@@ -57,13 +57,15 @@ source:
5757
5858## Inputs
5959
60- | Key | Value | Example | Description | Required? |
61- |:----------------|:---------|:---------------------------------------|:------------------------------------------------------------------------------------------------|:----------|
62- | ` request` | `Object` | see [Request](#request) | The configuration for constructing and sending HTTP request. | ✅ |
63- | `success_codes` | `[]int` | `[200]` | The list of status codes that would be considered as a successful response. Default is `[200]`. | ✘ |
64- | `concurrency` | `int` | `5` | Number of concurrent child requests to execute. Default is `5` | ✘ |
65- | `script.engine` | `string` | `tengo` | Script engine. Only `"tengo"` is supported currently | ✅ |
66- | `script.source` | `string` | see [Worked Example](#worked-example). | [Tengo][tengo] script used to map the response into 0 or more assets. | ✅ |
60+ | Key | Value | Example | Description | Required? |
61+ |:---------------------------|:---------|:---------------------------------------|:------------------------------------------------------------------------------------------------|:----------|
62+ | ` request` | `Object` | see [Request](#request) | The configuration for constructing and sending HTTP request. | ✅ |
63+ | `success_codes` | `[]int` | `[200]` | The list of status codes that would be considered as a successful response. Default is `[200]`. | ✘ |
64+ | `concurrency` | `int` | `5` | Number of concurrent child requests to execute. Default is `5` | ✘ |
65+ | `script.engine` | `string` | `tengo` | Script engine. Only `"tengo"` is supported currently | ✅ |
66+ | `script.source` | `string` | see [Worked Example](#worked-example). | [Tengo][tengo] script used to map the response into 0 or more assets. | ✅ |
67+ | `script.max_allocs` | `int` | 10000 | The max number of object allocations allowed during the script run time. Default is `5000`. | ✘ |
68+ | `script.max_const_objects` | `int` | 1000 | The maximum number of constant objects in the compiled script. Default is `500`. | ✘ |
6769
6870# ## Request
6971
@@ -92,6 +94,29 @@ source:
9294
9395# ## Script Globals
9496
97+ - [`recipe_scope`](#recipe_scope)
98+ - [`response`](#response)
99+ - [`new_asset(string) : Asset`](#new_assetstring-asset)
100+ - [`emit(Asset)`](#emitasset)
101+ - [`execute_request(...requests) : []Response`](#executerequestrequests-response)
102+ - [`exit`](#exit)
103+
104+ # ### `recipe_scope`
105+
106+ The value of the scope specified in the recipe (string).
107+
108+ With the following example recipe :
109+
110+ ` ` ` yaml
111+ source:
112+ scope: integration
113+ type: http
114+ config:
115+ #...
116+ ` ` `
117+
118+ The value of `recipe_scope` will be `integration`.
119+
95120# ### `response`
96121
97122HTTP response received with the `status_code`, `header` and `body`. Ex :
@@ -150,7 +175,7 @@ asset.data.full_name = "Daiyamondo Jozu"
150175Takes an asset and emits the asset that can then be consumed by the
151176processor/sink.
152177
153- # ### `execute_request(...requests)`
178+ # ### `execute_request(...requests): []Response `
154179
155180Takes 1 or more requests and executes the requests with the concurrency defined
156181in the recipe. The results are returned as an array. Each item in the array can
@@ -315,8 +340,8 @@ source:
315340 }
316341` ` `
317342
318- This would emit a 'User' asset for each user object in `response.data`. Note
319- that the response headers can be accessed under `response.header` and can be
343+ This would emit a 'User' asset for each user object in `response.data`. Note
344+ that the response headers can be accessed under `response.header` and can be
320345used as needed.
321346
322347# # Caveats
0 commit comments