diff --git a/docs/index.html b/docs/index.html index cc8cc0659..59ea2a93b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -3163,7 +3163,7 @@
z.generateCallbackUrl()
We recommend using
-bundle.meta.isLoadingSample
to determine if the execution is happening in the foreground (IE: during Zap setup) as usingz.generateCallbackUrl()
can be inappropriate given the disconnect. Instead, wait for the long running request without generating a callback, or if you must, return stubbed data.
And finally, in a performResume
to handle the final step which will receive three bundle properties:
By default the payload POST
ed to the callback URL will augment the data returned from the initial perform
to compose the final value.
If you need to customize what the final value should be you can define a performResume
method that receives three bundle properties:
bundle.outputData
is {"hello": "world"}
, the data returned from the initial perform
bundle.cleanedRequest
is {"foo": "bar"}
, the payload from the callback URLbundle.rawRequest
is the full request object corresponding to bundle.cleanedRequest
z.generateCallbackUrl()
const performResume = async (z, bundle) => {
// this will give a final value of: {"hello": "world", "foo": "bar"}
+ // which is the default behavior when a custom `performResume` is not
+ // defined.
return { ...bundle.outputData, ...bundle.cleanedRequest };
};
diff --git a/packages/cli/README-source.md b/packages/cli/README-source.md
index 8c0e65411..f4802ad1d 100644
--- a/packages/cli/README-source.md
+++ b/packages/cli/README-source.md
@@ -947,7 +947,9 @@ Content-Type: application/json
```
> We recommend using `bundle.meta.isLoadingSample` to determine if the execution is happening in the foreground (IE: during Zap setup) as using `z.generateCallbackUrl()` can be inappropriate given the disconnect. Instead, wait for the long running request without generating a callback, or if you must, return stubbed data.
-And finally, in a `performResume` to handle the final step which will receive three bundle properties:
+By default the payload `POST`ed to the callback URL will augment the data returned from the initial `perform` to compose the final value.
+
+If you need to customize what the final value should be you can define a `performResume` method that receives three bundle properties:
* `bundle.outputData` is `{"hello": "world"}`, the data returned from the initial `perform`
* `bundle.cleanedRequest` is `{"foo": "bar"}`, the payload from the callback URL
@@ -956,6 +958,8 @@ And finally, in a `performResume` to handle the final step which will receive th
```js
const performResume = async (z, bundle) => {
// this will give a final value of: {"hello": "world", "foo": "bar"}
+ // which is the default behavior when a custom `performResume` is not
+ // defined.
return { ...bundle.outputData, ...bundle.cleanedRequest };
};
```
diff --git a/packages/cli/README.md b/packages/cli/README.md
index 7ddf3ac07..46f6e9fa5 100644
--- a/packages/cli/README.md
+++ b/packages/cli/README.md
@@ -1922,7 +1922,9 @@ Content-Type: application/json
```
> We recommend using `bundle.meta.isLoadingSample` to determine if the execution is happening in the foreground (IE: during Zap setup) as using `z.generateCallbackUrl()` can be inappropriate given the disconnect. Instead, wait for the long running request without generating a callback, or if you must, return stubbed data.
-And finally, in a `performResume` to handle the final step which will receive three bundle properties:
+By default the payload `POST`ed to the callback URL will augment the data returned from the initial `perform` to compose the final value.
+
+If you need to customize what the final value should be you can define a `performResume` method that receives three bundle properties:
* `bundle.outputData` is `{"hello": "world"}`, the data returned from the initial `perform`
* `bundle.cleanedRequest` is `{"foo": "bar"}`, the payload from the callback URL
@@ -1931,6 +1933,8 @@ And finally, in a `performResume` to handle the final step which will receive th
```js
const performResume = async (z, bundle) => {
// this will give a final value of: {"hello": "world", "foo": "bar"}
+ // which is the default behavior when a custom `performResume` is not
+ // defined.
return { ...bundle.outputData, ...bundle.cleanedRequest };
};
```
diff --git a/packages/cli/docs/index.html b/packages/cli/docs/index.html
index cc8cc0659..59ea2a93b 100644
--- a/packages/cli/docs/index.html
+++ b/packages/cli/docs/index.html
@@ -3163,7 +3163,7 @@ z.generateCallbackUrl()
We recommend using
-bundle.meta.isLoadingSample
to determine if the execution is happening in the foreground (IE: during Zap setup) as usingz.generateCallbackUrl()
can be inappropriate given the disconnect. Instead, wait for the long running request without generating a callback, or if you must, return stubbed data.
And finally, in a performResume
to handle the final step which will receive three bundle properties:
By default the payload POST
ed to the callback URL will augment the data returned from the initial perform
to compose the final value.
If you need to customize what the final value should be you can define a performResume
method that receives three bundle properties:
bundle.outputData
is {"hello": "world"}
, the data returned from the initial perform
bundle.cleanedRequest
is {"foo": "bar"}
, the payload from the callback URLbundle.rawRequest
is the full request object corresponding to bundle.cleanedRequest
z.generateCallbackUrl()
const performResume = async (z, bundle) => {
// this will give a final value of: {"hello": "world", "foo": "bar"}
+ // which is the default behavior when a custom `performResume` is not
+ // defined.
return { ...bundle.outputData, ...bundle.cleanedRequest };
};