-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[INT-18028] docs(cli): Bring over paging cursor doc changes added in visual-builder repo #701
Conversation
@@ -1644,7 +1644,7 @@ <h3 id="oauth2">OAuth2</h3> | |||
<div class="row-height"> | |||
<div class="col-md-5 col-sm-12 col-height docs-primary"> | |||
<p>For OAuth2, <code>authentication.oauth2Config.authorizeUrl</code>, <code>authentication.oauth2Config.getAccessToken</code>, and <code>authentication.oauth2Config.refreshAccessToken</code> have fields like <code>redirect_uri</code> and <code>state</code> in <code>bundle.inputData</code>. After the code is exchanged for an access token and/or refresh token, those tokens are stored in <code>bundle.authData</code> for the connection.</p><p>Also, <code>authentication.oauth2Config.getAccessToken</code> has access to the additional return values in <code>rawRequest</code> and <code>cleanedRequest</code> should you need to extract other values (for example, from the query string).</p><p>If you define <code>fields</code> to collect additional details from the user, please note that <code>client_id</code> and <code>client_secret</code> are reserved keys and cannot be used as keys for input form fields.</p><blockquote> | |||
<p>Note: The OAuth2 <code>state</code> param is a <a href="https://auth0.com/docs/secure/attack-protection/state-parameters">standard security feature</a> that helps ensure that authorization requests are only coming from your servers. Most OAuth clients have support for this and will send back the <code>state</code> query param that the user brings to your app. The Zapier Platform performs this check and this required field cannot be disabled. The state parameter is automatically generated by Zapier in the background, and can be accessed at <code>bundle.inputData.state</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE formatter removed extra space at the end (in the source .md
file)
@@ -2890,7 +2890,7 @@ <h3 id="zrequesturl-options"><code>z.request([url], options)</code></h3> | |||
</div><div class="row"> | |||
<div class="row-height"> | |||
<div class="col-md-5 col-sm-12 col-height docs-primary"> | |||
<p><code>z.request([url], options)</code> is a promise based HTTP client with some Zapier-specific goodies. See <a href="#making-http-requests">Making HTTP Requests</a>. <code>z.request()</code> will <a href="https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding">percent-encode</a> non-ascii characters and these reserved characters: <code>:$/?#[]@$&+,;=^@`\</code>. Use <a href="https://github.com/zapier/zapier-platform/blob/main/packages/schema/docs/build/schema.md#requestschema"><code>skipEncodingChars</code></a> to modify this behaviour. </p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE formatter removed extra space at the end (in the source .md
file)
@@ -5488,54 +5488,32 @@ <h3 id="whats-the-deal-with-pagination-when-is-it-used-and-how-does-it-work">Wha | |||
<p>If your API uses cursor-based paging instead of an offset, you can use <code>z.cursor.get</code> and <code>z.cursor.set</code>:</p> | |||
</div> | |||
<div class="col-md-7 col-sm-12 col-height docs-code"> | |||
<pre><code class="lang-js"><span class="hljs-comment">// the perform method of our trigger</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-generated HTML changes from the actual .md
change. This will affect this website: https://zapier.github.io/zapier-platform/#paging
@@ -452,7 +452,7 @@ Also, `authentication.oauth2Config.getAccessToken` has access to the additional | |||
|
|||
If you define `fields` to collect additional details from the user, please note that `client_id` and `client_secret` are reserved keys and cannot be used as keys for input form fields. | |||
|
|||
> Note: The OAuth2 `state` param is a [standard security feature](https://auth0.com/docs/secure/attack-protection/state-parameters) that helps ensure that authorization requests are only coming from your servers. Most OAuth clients have support for this and will send back the `state` query param that the user brings to your app. The Zapier Platform performs this check and this required field cannot be disabled. The state parameter is automatically generated by Zapier in the background, and can be accessed at `bundle.inputData.state`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE formatter removed extra space at the end
@@ -815,7 +815,7 @@ We provide several methods off of the `z` object, which is provided as the first | |||
|
|||
### `z.request([url], options)` | |||
|
|||
`z.request([url], options)` is a promise based HTTP client with some Zapier-specific goodies. See [Making HTTP Requests](#making-http-requests). `z.request()` will [percent-encode](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding) non-ascii characters and these reserved characters: ``:$/?#[]@$&+,;=^@`\``. Use [`skipEncodingChars`](https://github.com/zapier/zapier-platform/blob/main/packages/schema/docs/build/schema.md#requestschema) to modify this behaviour. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IDE formatter removed extra space at the end
@@ -2018,7 +2018,7 @@ If your API uses cursor-based paging instead of an offset, you can use `z.cursor | |||
[insert-file:./snippets/paging-cursor.js] | |||
``` | |||
|
|||
Cursors are stored per-zap and last about an hour. Per the above, make sure to only include the cursor if `bundle.meta.page !== 0`, so you don't accidentally reuse a cursor from a previous poll. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1,51 +1,29 @@ | |||
// the perform method of our trigger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR bring over the changes made in zapier/visual-builder#506.
The source of truth for the file
cli-docs.md
file modified in that PR is theREADME-source.md
file from this repo.I also updated the "Syncing CLI Docs" Coda page with the proper new location of the destination files (they were changed recently after some doc reorganization)
Slack thread for context: https://zapier.slack.com/archives/C053ZLBM4SV/p1694592622592349?thread_ts=1692208798.962019&cid=C053ZLBM4SV