Skip to content

Commit 1dfa33e

Browse files
author
Jake Champion
committed
docs: update reference docs folder
1 parent 9a9d98e commit 1dfa33e

File tree

118 files changed

+1080
-908
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+1080
-908
lines changed

docs-app/fastly.toml

Lines changed: 524 additions & 492 deletions
Large diffs are not rendered by default.

reference-docs/v0.5.14/assets/highlight.css

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@
2323
--dark-hl-10: #C586C0;
2424
--light-hl-11: #000000FF;
2525
--dark-hl-11: #D4D4D4;
26-
--light-hl-12: #267F99;
27-
--dark-hl-12: #4EC9B0;
26+
--light-hl-12: #098658;
27+
--dark-hl-12: #B5CEA8;
28+
--light-hl-13: #267F99;
29+
--dark-hl-13: #4EC9B0;
2830
--light-code-background: #FFFFFF;
2931
--dark-code-background: #1E1E1E;
3032
}
@@ -43,6 +45,7 @@
4345
--hl-10: var(--light-hl-10);
4446
--hl-11: var(--light-hl-11);
4547
--hl-12: var(--light-hl-12);
48+
--hl-13: var(--light-hl-13);
4649
--code-background: var(--light-code-background);
4750
} }
4851

@@ -60,6 +63,7 @@
6063
--hl-10: var(--dark-hl-10);
6164
--hl-11: var(--dark-hl-11);
6265
--hl-12: var(--dark-hl-12);
66+
--hl-13: var(--dark-hl-13);
6367
--code-background: var(--dark-code-background);
6468
} }
6569

@@ -77,6 +81,7 @@
7781
--hl-10: var(--light-hl-10);
7882
--hl-11: var(--light-hl-11);
7983
--hl-12: var(--light-hl-12);
84+
--hl-13: var(--light-hl-13);
8085
--code-background: var(--light-code-background);
8186
}
8287

@@ -94,6 +99,7 @@
9499
--hl-10: var(--dark-hl-10);
95100
--hl-11: var(--dark-hl-11);
96101
--hl-12: var(--dark-hl-12);
102+
--hl-13: var(--dark-hl-13);
97103
--code-background: var(--dark-code-background);
98104
}
99105

@@ -110,4 +116,5 @@
110116
.hl-10 { color: var(--hl-10); }
111117
.hl-11 { color: var(--hl-11); }
112118
.hl-12 { color: var(--hl-12); }
119+
.hl-13 { color: var(--hl-13); }
113120
pre, code { background: var(--code-background); }

reference-docs/v0.5.14/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

reference-docs/v0.5.14/classes/fastly_backend.Backend.html

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,33 @@
1717
<li><a href="fastly_backend.Backend.html">Backend</a></li></ul>
1818
<h1>Class Backend</h1></div>
1919
<section class="tsd-panel tsd-comment">
20-
<div class="tsd-comment tsd-typography"><p>Class for creating new <a href="https://developer.fastly.com/reference/api/services/backend/">Fastly Backends</a>.</p>
20+
<div class="tsd-comment tsd-typography"><p>Class for dynamically creating new <a href="https://developer.fastly.com/reference/api/services/backend/">Fastly Backends</a>.</p>
21+
22+
<h3>Note</h3><p>This feature is in disabled by default for Fastly Services. Please contact <a href="https://support.fastly.com/hc/en-us/requests/new?ticket_form_id=360000269711">Fastly Support</a> to request the feature be enabled on the Fastly Services which require Dynamic Backends.</p>
23+
<p>By default, Dynamic Backends are disabled within a JavaScript application as it can be a potential
24+
avenue for third-party JavaScript code to send requests, potentially including sensitive/secret data,
25+
off to destinations that the JavaScript project was not intending, which could be a security issue.</p>
26+
<p>To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via:</p>
27+
<pre><code class="language-js"><span class="hl-10">import</span><span class="hl-4"> { </span><span class="hl-8">allowDynamicBackends</span><span class="hl-4"> } </span><span class="hl-10">from</span><span class="hl-4"> </span><span class="hl-5">&quot;fastly:experimental&quot;</span><span class="hl-4">;</span><br/><span class="hl-7">allowDynamicBackends</span><span class="hl-4">(</span><span class="hl-6">true</span><span class="hl-4">);</span>
28+
</code></pre>
2129
<p><strong>Note</strong>: Can only be used when processing requests, not during build-time initialization.</p>
2230

23-
<h3>Example</h3><p>Construct a new backend with all properties set to their default values:</p>
24-
<pre><code class="language-js"><span class="hl-6">const</span><span class="hl-4"> </span><span class="hl-9">myBackend</span><span class="hl-4"> = </span><span class="hl-6">new</span><span class="hl-4"> </span><span class="hl-7">Backend</span><span class="hl-4">({ </span><span class="hl-8">name:</span><span class="hl-4"> </span><span class="hl-5">&#39;fastly&#39;</span><span class="hl-4">, </span><span class="hl-8">target:</span><span class="hl-4"> </span><span class="hl-5">&#39;www.fastly.com&#39;</span><span class="hl-4">});</span>
31+
<h3>Example</h3><p>In this example an implicit Dynamic Backend is created when making the fetch request to <a href="https://www.fastly.com/">https://www.fastly.com/</a> and the response is then returned to the client.</p>
32+
<p>View this example on <a href="https://fiddle.fastly.dev/fiddle/e5b6fa0e">Fiddle</a>.</p>
33+
<pre><code class="language-js"><span class="hl-0">/// </span><span class="hl-1">&lt;</span><span class="hl-2">reference</span><span class="hl-0"> </span><span class="hl-3">types</span><span class="hl-4">=</span><span class="hl-5">&quot;@fastly/js-compute&quot;</span><span class="hl-0"> </span><span class="hl-1">/&gt;</span><br/><span class="hl-10">import</span><span class="hl-4"> { </span><span class="hl-8">allowDynamicBackends</span><span class="hl-4"> } </span><span class="hl-10">from</span><span class="hl-4"> </span><span class="hl-5">&quot;fastly:experimental&quot;</span><span class="hl-4">;</span><br/><span class="hl-7">allowDynamicBackends</span><span class="hl-4">(</span><span class="hl-6">true</span><span class="hl-4">);</span><br/><span class="hl-6">async</span><span class="hl-4"> </span><span class="hl-6">function</span><span class="hl-4"> </span><span class="hl-7">app</span><span class="hl-4">() {</span><br/><span class="hl-4"> </span><span class="hl-0">// For any request, return the fastly homepage -- without defining a backend!</span><br/><span class="hl-4"> </span><span class="hl-10">return</span><span class="hl-4"> </span><span class="hl-7">fetch</span><span class="hl-4">(</span><span class="hl-5">&#39;https://www.fastly.com/&#39;</span><span class="hl-4">);</span><br/><span class="hl-4">}</span><br/><span class="hl-7">addEventListener</span><span class="hl-4">(</span><span class="hl-5">&quot;fetch&quot;</span><span class="hl-4">, </span><span class="hl-8">event</span><span class="hl-4"> </span><span class="hl-6">=&gt;</span><span class="hl-4"> </span><span class="hl-8">event</span><span class="hl-4">.</span><span class="hl-7">respondWith</span><span class="hl-4">(</span><span class="hl-7">app</span><span class="hl-4">(</span><span class="hl-8">event</span><span class="hl-4">)));</span>
34+
</code></pre>
35+
36+
<h3>Example</h3><p>In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client.</p>
37+
<p>View this example on <a href="https://fiddle.fastly.dev/fiddle/e0c26a33">Fiddle</a>.</p>
38+
<pre><code class="language-js"><span class="hl-0">/// </span><span class="hl-1">&lt;</span><span class="hl-2">reference</span><span class="hl-0"> </span><span class="hl-3">types</span><span class="hl-4">=</span><span class="hl-5">&quot;@fastly/js-compute&quot;</span><span class="hl-0"> </span><span class="hl-1">/&gt;</span><br/><span class="hl-10">import</span><span class="hl-4"> { </span><span class="hl-8">allowDynamicBackends</span><span class="hl-4"> } </span><span class="hl-10">from</span><span class="hl-4"> </span><span class="hl-5">&quot;fastly:experimental&quot;</span><span class="hl-4">;</span><br/><span class="hl-10">import</span><span class="hl-4"> { </span><span class="hl-8">Backend</span><span class="hl-4"> } </span><span class="hl-10">from</span><span class="hl-4"> </span><span class="hl-5">&quot;fastly:backend&quot;</span><span class="hl-4">;</span><br/><span class="hl-7">allowDynamicBackends</span><span class="hl-4">(</span><span class="hl-6">true</span><span class="hl-4">);</span><br/><span class="hl-6">async</span><span class="hl-4"> </span><span class="hl-6">function</span><span class="hl-4"> </span><span class="hl-7">app</span><span class="hl-4">() {</span><br/><span class="hl-4"> </span><span class="hl-0">// For any request, return the fastly homepage -- without defining a backend!</span><br/><span class="hl-4"> </span><span class="hl-6">const</span><span class="hl-4"> </span><span class="hl-9">backend</span><span class="hl-4"> = </span><span class="hl-6">new</span><span class="hl-4"> </span><span class="hl-7">Backend</span><span class="hl-4">({</span><br/><span class="hl-4"> </span><span class="hl-8">name:</span><span class="hl-4"> </span><span class="hl-5">&#39;fastly&#39;</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">target:</span><span class="hl-4"> </span><span class="hl-5">&#39;fastly.com&#39;</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">hostOverride:</span><span class="hl-4"> </span><span class="hl-5">&quot;www.fastly.com&quot;</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">connectTimeout:</span><span class="hl-4"> </span><span class="hl-12">1000</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">firstByteTimeout:</span><span class="hl-4"> </span><span class="hl-12">15000</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">betweenBytesTimeout:</span><span class="hl-4"> </span><span class="hl-12">10000</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">useSSL:</span><span class="hl-4"> </span><span class="hl-6">true</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">sslMinVersion:</span><span class="hl-4"> </span><span class="hl-12">1.3</span><span class="hl-4">,</span><br/><span class="hl-4"> </span><span class="hl-8">sslMaxVersion:</span><span class="hl-4"> </span><span class="hl-12">1.3</span><span class="hl-4">,</span><br/><span class="hl-4"> });</span><br/><span class="hl-4"> </span><span class="hl-10">return</span><span class="hl-4"> </span><span class="hl-7">fetch</span><span class="hl-4">(</span><span class="hl-5">&#39;https://www.fastly.com/&#39;</span><span class="hl-4">, {</span><br/><span class="hl-4"> </span><span class="hl-8">backend</span><span class="hl-4"> </span><span class="hl-0">// Here we are configuring this request to use the backend from above.</span><br/><span class="hl-4"> });</span><br/><span class="hl-4">}</span><br/><span class="hl-7">addEventListener</span><span class="hl-4">(</span><span class="hl-5">&quot;fetch&quot;</span><span class="hl-4">, </span><span class="hl-8">event</span><span class="hl-4"> </span><span class="hl-6">=&gt;</span><span class="hl-4"> </span><span class="hl-8">event</span><span class="hl-4">.</span><span class="hl-7">respondWith</span><span class="hl-4">(</span><span class="hl-7">app</span><span class="hl-4">(</span><span class="hl-8">event</span><span class="hl-4">)));</span>
2539
</code></pre>
2640
</div></section>
2741
<section class="tsd-panel tsd-hierarchy">
2842
<h4>Hierarchy</h4>
2943
<ul class="tsd-hierarchy">
3044
<li><span class="target">Backend</span></li></ul></section><aside class="tsd-sources">
3145
<ul>
32-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:backend.d.ts#L83">fastly:backend.d.ts:83</a></li></ul></aside>
46+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:backend.d.ts#L168">fastly:backend.d.ts:168</a></li></ul></aside>
3347
<section class="tsd-panel-group tsd-index-group">
3448
<section class="tsd-panel tsd-index-panel">
3549
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -50,7 +64,11 @@ <h3 class="tsd-anchor-link"><span>constructor</span><a href="#constructor" aria-
5064
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
5165
<li class="tsd-signature tsd-anchor-link" id="constructor.new_Backend">new <wbr/>Backend<span class="tsd-signature-symbol">(</span>configuration<span class="tsd-signature-symbol">: </span><a href="../interfaces/fastly_backend.BackendConfiguration.html" class="tsd-signature-type" data-tsd-kind="Interface">BackendConfiguration</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="fastly_backend.Backend.html" class="tsd-signature-type" data-tsd-kind="Class">Backend</a><a href="#constructor.new_Backend" aria-label="Permalink" class="tsd-anchor-icon"><svg class="icon icon-tabler icon-tabler-link" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><use href="#icon-anchor-a"></use><use href="#icon-anchor-b"></use><use href="#icon-anchor-c"></use></svg></a></li>
5266
<li class="tsd-description">
53-
<div class="tsd-comment tsd-typography"><p>Creates a new Backend object</p>
67+
<div class="tsd-comment tsd-typography"><p>Creates a new Backend instance</p>
68+
69+
<h3>Example</h3><p>Construct a new backend with all properties set to their default values:</p>
70+
<pre><code class="language-js"><span class="hl-6">const</span><span class="hl-4"> </span><span class="hl-9">myBackend</span><span class="hl-4"> = </span><span class="hl-6">new</span><span class="hl-4"> </span><span class="hl-7">Backend</span><span class="hl-4">({ </span><span class="hl-8">name:</span><span class="hl-4"> </span><span class="hl-5">&#39;fastly&#39;</span><span class="hl-4">, </span><span class="hl-8">target:</span><span class="hl-4"> </span><span class="hl-5">&#39;www.fastly.com&#39;</span><span class="hl-4">});</span>
71+
</code></pre>
5472
</div>
5573
<div class="tsd-parameters">
5674
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -59,7 +77,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
5977
<h5>configuration: <a href="../interfaces/fastly_backend.BackendConfiguration.html" class="tsd-signature-type" data-tsd-kind="Interface">BackendConfiguration</a></h5></li></ul></div>
6078
<h4 class="tsd-returns-title">Returns <a href="fastly_backend.Backend.html" class="tsd-signature-type" data-tsd-kind="Class">Backend</a></h4><aside class="tsd-sources">
6179
<ul>
62-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:backend.d.ts#L87">fastly:backend.d.ts:87</a></li></ul></aside></li></ul></section></section>
80+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:backend.d.ts#L178">fastly:backend.d.ts:178</a></li></ul></aside></li></ul></section></section>
6381
<section class="tsd-panel-group tsd-member-group">
6482
<h2>Methods</h2>
6583
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="toString" class="tsd-anchor"></a>
@@ -71,7 +89,7 @@ <h3 class="tsd-anchor-link"><span>to<wbr/>String</span><a href="#toString" aria-
7189
</div>
7290
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources">
7391
<ul>
74-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:backend.d.ts#L91">fastly:backend.d.ts:91</a></li></ul></aside></li></ul></section></section></div>
92+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:backend.d.ts#L182">fastly:backend.d.ts:182</a></li></ul></aside></li></ul></section></section></div>
7593
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
7694
<div class="tsd-navigation settings">
7795
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

reference-docs/v0.5.14/classes/fastly_config_store.ConfigStore.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h4>Hierarchy</h4>
2525
<ul class="tsd-hierarchy">
2626
<li><span class="target">ConfigStore</span></li></ul></section><aside class="tsd-sources">
2727
<ul>
28-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:config-store.d.ts#L8">fastly:config-store.d.ts:8</a></li></ul></aside>
28+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:config-store.d.ts#L8">fastly:config-store.d.ts:8</a></li></ul></aside>
2929
<section class="tsd-panel-group tsd-index-group">
3030
<section class="tsd-panel tsd-index-panel">
3131
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -55,7 +55,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
5555
<h5>name: <span class="tsd-signature-type">string</span></h5></li></ul></div>
5656
<h4 class="tsd-returns-title">Returns <a href="fastly_config_store.ConfigStore.html" class="tsd-signature-type" data-tsd-kind="Class">ConfigStore</a></h4><aside class="tsd-sources">
5757
<ul>
58-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:config-store.d.ts#L12">fastly:config-store.d.ts:12</a></li></ul></aside></li></ul></section></section>
58+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:config-store.d.ts#L12">fastly:config-store.d.ts:12</a></li></ul></aside></li></ul></section></section>
5959
<section class="tsd-panel-group tsd-member-group">
6060
<h2>Methods</h2>
6161
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="get" class="tsd-anchor"></a>
@@ -72,7 +72,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
7272
<h5>key: <span class="tsd-signature-type">string</span></h5></li></ul></div>
7373
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources">
7474
<ul>
75-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:config-store.d.ts#L16">fastly:config-store.d.ts:16</a></li></ul></aside></li></ul></section></section></div>
75+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:config-store.d.ts#L16">fastly:config-store.d.ts:16</a></li></ul></aside></li></ul></section></section></div>
7676
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
7777
<div class="tsd-navigation settings">
7878
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

reference-docs/v0.5.14/classes/fastly_dictionary.Dictionary.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h4>Hierarchy</h4>
2525
<ul class="tsd-hierarchy">
2626
<li><span class="target">Dictionary</span></li></ul></section><aside class="tsd-sources">
2727
<ul>
28-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:dictionary.d.ts#L7">fastly:dictionary.d.ts:7</a></li></ul></aside>
28+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:dictionary.d.ts#L7">fastly:dictionary.d.ts:7</a></li></ul></aside>
2929
<section class="tsd-panel-group tsd-index-group">
3030
<section class="tsd-panel tsd-index-panel">
3131
<details class="tsd-index-content tsd-index-accordion" open><summary class="tsd-accordion-summary tsd-index-summary">
@@ -55,7 +55,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
5555
<h5>name: <span class="tsd-signature-type">string</span></h5></li></ul></div>
5656
<h4 class="tsd-returns-title">Returns <a href="fastly_dictionary.Dictionary.html" class="tsd-signature-type" data-tsd-kind="Class">Dictionary</a></h4><aside class="tsd-sources">
5757
<ul>
58-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:dictionary.d.ts#L11">fastly:dictionary.d.ts:11</a></li></ul></aside></li></ul></section></section>
58+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:dictionary.d.ts#L11">fastly:dictionary.d.ts:11</a></li></ul></aside></li></ul></section></section>
5959
<section class="tsd-panel-group tsd-member-group">
6060
<h2>Methods</h2>
6161
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class"><a id="get" class="tsd-anchor"></a>
@@ -72,7 +72,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
7272
<h5>key: <span class="tsd-signature-type">string</span></h5></li></ul></div>
7373
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4><aside class="tsd-sources">
7474
<ul>
75-
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/97553d6/types/fastly:dictionary.d.ts#L15">fastly:dictionary.d.ts:15</a></li></ul></aside></li></ul></section></section></div>
75+
<li>Defined in <a href="https://github.com/fastly/js-compute-runtime/blob/9a9d98e/types/fastly:dictionary.d.ts#L15">fastly:dictionary.d.ts:15</a></li></ul></aside></li></ul></section></section></div>
7676
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
7777
<div class="tsd-navigation settings">
7878
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">

0 commit comments

Comments
 (0)