Skip to content

Commit

Permalink
chore: upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
cmorten committed Jan 28, 2024
1 parent 8c02151 commit c6526bd
Show file tree
Hide file tree
Showing 22 changed files with 104 additions and 95 deletions.
3 changes: 3 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# ChangeLog

For the latest changes, please refer to the
[releases page](https://github.com/cmorten/oak-http-proxy/releases).

## [2.1.0] - 29-08-2022

- feat: support Deno `1.25.0` and std `0.153.0`
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Use Node.js 12
- name: Use Node.js 20
uses: actions/setup-node@v1
with:
node-version: 12
node-version: 20
- name: Install deps
run: make deps
- name: Use Deno
uses: denolib/setup-deno@v2
with:
deno-version: 1.25.0
deno-version: 1.40.2
- run: make typedoc
- run: make ci
- name: Publish Updated Type Docs
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: publish typedocs
push_options: --force
push_options: --force
2 changes: 1 addition & 1 deletion .github/workflows/publish-egg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: denolib/setup-deno@v2
with:
deno-version: 1.25.0
deno-version: 1.40.2
- run: deno install -A -f --unstable -n eggs https://x.nest.land/[email protected]/eggs.ts
- run: |
export PATH="/home/runner/.deno/bin:$PATH"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
deno-version: [1.25.0]
deno-version: [1.40.2]

runs-on: ${{ matrix.os }}

Expand All @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: [windows-latest]
deno-version: [1.25.0]
deno-version: [1.40.2]

runs-on: ${{ matrix.os }}

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ci:
@make test

deps:
@npm install -g typescript [email protected]
@npm install -g typescript@4 [email protected]

doc:
@deno doc ./mod.ts
Expand All @@ -23,7 +23,7 @@ fmt-check:
@deno fmt --check ${FILES_TO_FORMAT}

lint:
@deno lint --unstable ${FILES_TO_FORMAT}
@deno lint ${FILES_TO_FORMAT}

precommit:
@make typedoc
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Proxy middleware for Deno Oak HTTP servers.
</p>

```ts
import { proxy } from "https://deno.land/x/oak_http_proxy@2.1.0/mod.ts";
import { proxy } from "https://deno.land/x/oak_http_proxy@2.2.0/mod.ts";
import { Application } from "https://deno.land/x/[email protected]/mod.ts";

const app = new Application();
Expand All @@ -32,13 +32,13 @@ Before importing, [download and install Deno](https://deno.land/#installation).
You can then import oak-http-proxy straight into your project:

```ts
import { proxy } from "https://deno.land/x/oak_http_proxy@2.1.0/mod.ts";
import { proxy } from "https://deno.land/x/oak_http_proxy@2.2.0/mod.ts";
```

oak-http-proxy is also available on [nest.land](https://nest.land/package/oak-http-proxy), a package registry for Deno on the Blockchain.

```ts
import { proxy } from "https://x.nest.land/oak-http-proxy@2.1.0/mod.ts";
import { proxy } from "https://x.nest.land/oak-http-proxy@2.2.0/mod.ts";
```

## Docs
Expand All @@ -59,7 +59,10 @@ router.get("/string", proxy("http://google.com"));

router.get("/url", proxy(new URL("http://google.com")));

router.get("/function", proxy((ctx) => new URL("http://google.com")));
router.get(
"/function",
proxy((ctx) => new URL("http://google.com"))
);
```

Note: Unmatched path segments of the incoming request url _are not_ transferred to the outbound proxy URL. For dynamic proxy urls use the function form.
Expand Down Expand Up @@ -241,7 +244,7 @@ app.use(
return;
}
default: {
ctx.throw(err)
ctx.throw(err);
}
}
},
Expand Down
24 changes: 12 additions & 12 deletions deps.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
export { STATUS_TEXT } from "https://deno.land/std@0.153.0/http/http_status.ts";
export { createState } from "https://deno.land/x/opineHttpProxy@3.0.2/src/createState.ts";
export { STATUS_TEXT } from "https://deno.land/std@0.213.0/http/status.ts";
export { createState } from "https://deno.land/x/opineHttpProxy@3.1.0/src/createState.ts";
export type {
ProxyState,
ProxyUrlFunction,
} from "https://deno.land/x/opineHttpProxy@3.0.2/src/createState.ts";
export type { ProxyOptions } from "https://deno.land/x/opineHttpProxy@3.0.2/src/resolveOptions.ts";
export { isUnset } from "https://deno.land/x/opineHttpProxy@3.0.2/src/isUnset.ts";
export { decorateProxyReqUrl } from "https://deno.land/x/opineHttpProxy@3.0.2/src/steps/decorateProxyReqUrl.ts";
export { decorateProxyReqInit } from "https://deno.land/x/opineHttpProxy@3.0.2/src/steps/decorateProxyReqInit.ts";
export { prepareProxyReq } from "https://deno.land/x/opineHttpProxy@3.0.2/src/steps/prepareProxyReq.ts";
export { sendProxyReq } from "https://deno.land/x/opineHttpProxy@3.0.2/src/steps/sendProxyReq.ts";
export { filterProxyRes } from "https://deno.land/x/opineHttpProxy@3.0.2/src/steps/filterProxyRes.ts";
export { decorateSrcResHeaders } from "https://deno.land/x/opineHttpProxy@3.0.2/src/steps/decorateSrcResHeaders.ts";
export { decorateSrcRes } from "https://deno.land/x/opineHttpProxy@3.0.2/src/steps/decorateSrcRes.ts";
} from "https://deno.land/x/opineHttpProxy@3.1.0/src/createState.ts";
export type { ProxyOptions } from "https://deno.land/x/opineHttpProxy@3.1.0/src/resolveOptions.ts";
export { isUnset } from "https://deno.land/x/opineHttpProxy@3.1.0/src/isUnset.ts";
export { decorateProxyReqUrl } from "https://deno.land/x/opineHttpProxy@3.1.0/src/steps/decorateProxyReqUrl.ts";
export { decorateProxyReqInit } from "https://deno.land/x/opineHttpProxy@3.1.0/src/steps/decorateProxyReqInit.ts";
export { prepareProxyReq } from "https://deno.land/x/opineHttpProxy@3.1.0/src/steps/prepareProxyReq.ts";
export { sendProxyReq } from "https://deno.land/x/opineHttpProxy@3.1.0/src/steps/sendProxyReq.ts";
export { filterProxyRes } from "https://deno.land/x/opineHttpProxy@3.1.0/src/steps/filterProxyRes.ts";
export { decorateSrcResHeaders } from "https://deno.land/x/opineHttpProxy@3.1.0/src/steps/decorateSrcResHeaders.ts";
export { decorateSrcRes } from "https://deno.land/x/opineHttpProxy@3.1.0/src/steps/decorateSrcRes.ts";
13 changes: 8 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h1>oak-http-proxy</h1>
<a href="https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/oak_http_proxy/mod.ts"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fupdates%2Fx%2Foak_http_proxy%2Fmod.ts" alt="oak-http-proxy dependency outdatedness" /></a>
<a href="https://deno-visualizer.danopia.net/dependencies-of/https/deno.land/x/oak_http_proxy/mod.ts"><img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fdeno-visualizer.danopia.net%2Fshields%2Fcache-size%2Fx%2Foak_http_proxy%2Fmod.ts" alt="oak-http-proxy cached size" /></a>
</p>
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { proxy } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/oak_http_proxy@2.1.0/mod.ts&quot;</span>;
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { proxy } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/oak_http_proxy@2.2.0/mod.ts&quot;</span>;
<span class="hljs-keyword">import</span> { Application } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/[email protected]/mod.ts&quot;</span>;

<span class="hljs-keyword">const</span> app = <span class="hljs-keyword">new</span> Application();
Expand All @@ -89,10 +89,10 @@ <h2>Installation</h2>
<p>This is a <a href="https://deno.land/">Deno</a> module available to import direct from this repo and via the <a href="https://deno.land/x">Deno Registry</a>.</p>
<p>Before importing, <a href="https://deno.land/#installation">download and install Deno</a>.</p>
<p>You can then import oak-http-proxy straight into your project:</p>
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { proxy } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/oak_http_proxy@2.1.0/mod.ts&quot;</span>;
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { proxy } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://deno.land/x/oak_http_proxy@2.2.0/mod.ts&quot;</span>;
</code></pre>
<p>oak-http-proxy is also available on <a href="https://nest.land/package/oak-http-proxy">nest.land</a>, a package registry for Deno on the Blockchain.</p>
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { proxy } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://x.nest.land/oak-http-proxy@2.1.0/mod.ts&quot;</span>;
<pre><code class="language-ts"><span class="hljs-keyword">import</span> { proxy } <span class="hljs-keyword">from</span> <span class="hljs-string">&quot;https://x.nest.land/oak-http-proxy@2.2.0/mod.ts&quot;</span>;
</code></pre>
<a href="#docs" id="docs" style="color: inherit; text-decoration: none;">
<h2>Docs</h2>
Expand All @@ -114,7 +114,10 @@ <h3>URL</h3>

router.get(<span class="hljs-string">&quot;/url&quot;</span>, proxy(<span class="hljs-keyword">new</span> URL(<span class="hljs-string">&quot;http://google.com&quot;</span>)));

router.get(<span class="hljs-string">&quot;/function&quot;</span>, proxy(<span class="hljs-function">(<span class="hljs-params">ctx</span>) =&gt;</span> <span class="hljs-keyword">new</span> URL(<span class="hljs-string">&quot;http://google.com&quot;</span>)));
router.get(
<span class="hljs-string">&quot;/function&quot;</span>,
proxy(<span class="hljs-function">(<span class="hljs-params">ctx</span>) =&gt;</span> <span class="hljs-keyword">new</span> URL(<span class="hljs-string">&quot;http://google.com&quot;</span>))
);
</code></pre>
<p>Note: Unmatched path segments of the incoming request url <em>are not</em> transferred to the outbound proxy URL. For dynamic proxy urls use the function form.</p>
<a href="#proxy-options" id="proxy-options" style="color: inherit; text-decoration: none;">
Expand Down Expand Up @@ -268,7 +271,7 @@ <h3>proxyErrorHandler</h3>
<span class="hljs-keyword">return</span>;
}
<span class="hljs-attr">default</span>: {
ctx.throw(err)
ctx.throw(err);
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions docs/interfaces/_types_.proxyoptions.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h1>Interface ProxyOptions</h1>
<h3>Hierarchy</h3>
<ul class="tsd-hierarchy">
<li>
<span class="tsd-signature-type">BaseProxyOptions</span>
<span class="tsd-signature-type">any</span>
<ul class="tsd-hierarchy">
<li>
<span class="target">ProxyOptions</span>
Expand Down Expand Up @@ -101,7 +101,7 @@ <h3><span class="tsd-flag ts-flagOptional">Optional</span> req<wbr>Body<wbr>Limi
<div class="tsd-signature tsd-kind-icon">req<wbr>Body<wbr>Limit<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cmorten/oak-http-proxy/blob/4f4dbaf/src/types.ts#L9">types.ts:9</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/oak-http-proxy/blob/8c02151/src/types.ts#L9">types.ts:9</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/_proxy_.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ <h2>Functions</h2>
<a name="proxy" class="tsd-anchor"></a>
<h3>proxy</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">proxy<span class="tsd-signature-symbol">(</span>url<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">URL</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ProxyUrlFunction</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/_types_.proxyoptions.html" class="tsd-signature-type">ProxyOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_proxy_.html#proxy" class="tsd-signature-type">proxy</a></li>
<li class="tsd-signature tsd-kind-icon">proxy<span class="tsd-signature-symbol">(</span>url<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">URL</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ProxyUrlFunction</span>, options<span class="tsd-signature-symbol">?: </span><a href="../interfaces/_types_.proxyoptions.html" class="tsd-signature-type">ProxyOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">handleProxy</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cmorten/oak-http-proxy/blob/4f4dbaf/src/proxy.ts#L42">proxy.ts:42</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/oak-http-proxy/blob/8c02151/src/proxy.ts#L42">proxy.ts:42</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
Expand Down Expand Up @@ -119,7 +119,7 @@ <h5><span class="tsd-flag ts-flagDefault value">Default value</span> options: <a
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="_proxy_.html#proxy" class="tsd-signature-type">proxy</a></h4>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">handleProxy</span></h4>
<p>Oak proxy middleware</p>
</li>
</ul>
Expand Down
12 changes: 6 additions & 6 deletions docs/modules/_requestoptions_.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ <h3>create<wbr>Request<wbr>Init</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cmorten/oak-http-proxy/blob/4f4dbaf/src/requestOptions.ts#L60">requestOptions.ts:60</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/oak-http-proxy/blob/8c02151/src/requestOptions.ts#L60">requestOptions.ts:60</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -118,7 +118,7 @@ <h3>extend<wbr>Headers</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cmorten/oak-http-proxy/blob/4f4dbaf/src/requestOptions.ts#L26">requestOptions.ts:26</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/oak-http-proxy/blob/8c02151/src/requestOptions.ts#L26">requestOptions.ts:26</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -141,13 +141,13 @@ <h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Headers</
<a name="parseurl" class="tsd-anchor"></a>
<h3>parse<wbr>Url</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">parse<wbr>Url<span class="tsd-signature-symbol">(</span>state<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ProxyState</span>, ctx<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_requestoptions_.html#parseurl" class="tsd-signature-type">parseUrl</a></li>
<li class="tsd-signature tsd-kind-icon">parse<wbr>Url<span class="tsd-signature-symbol">(</span>state<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ProxyState</span>, ctx<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cmorten/oak-http-proxy/blob/4f4dbaf/src/requestOptions.ts#L4">requestOptions.ts:4</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/oak-http-proxy/blob/8c02151/src/requestOptions.ts#L4">requestOptions.ts:4</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -159,7 +159,7 @@ <h5>state: <span class="tsd-signature-type">ProxyState</span></h5>
<h5>ctx: <span class="tsd-signature-type">any</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="_requestoptions_.html#parseurl" class="tsd-signature-type">parseUrl</a></h4>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
</li>
</ul>
</section>
Expand All @@ -173,7 +173,7 @@ <h3>req<wbr>Headers</h3>
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cmorten/oak-http-proxy/blob/4f4dbaf/src/requestOptions.ts#L46">requestOptions.ts:46</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/oak-http-proxy/blob/8c02151/src/requestOptions.ts#L46">requestOptions.ts:46</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand Down
6 changes: 3 additions & 3 deletions docs/modules/_steps_buildproxyreqinit_.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ <h2>Functions</h2>
<a name="buildproxyreqinit" class="tsd-anchor"></a>
<h3>build<wbr>Proxy<wbr>Req<wbr>Init</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">build<wbr>Proxy<wbr>Req<wbr>Init<span class="tsd-signature-symbol">(</span>state<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ProxyState</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="_steps_buildproxyreqinit_.html#buildproxyreqinit" class="tsd-signature-type">buildProxyReqInit</a></li>
<li class="tsd-signature tsd-kind-icon">build<wbr>Proxy<wbr>Req<wbr>Init<span class="tsd-signature-symbol">(</span>state<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">ProxyState</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">any</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/cmorten/oak-http-proxy/blob/4f4dbaf/src/steps/buildProxyReqInit.ts#L4">steps/buildProxyReqInit.ts:4</a></li>
<li>Defined in <a href="https://github.com/asos-craigmorten/oak-http-proxy/blob/8c02151/src/steps/buildProxyReqInit.ts#L4">steps/buildProxyReqInit.ts:4</a></li>
</ul>
</aside>
<h4 class="tsd-parameters-title">Parameters</h4>
Expand All @@ -98,7 +98,7 @@ <h4 class="tsd-parameters-title">Parameters</h4>
<h5>state: <span class="tsd-signature-type">ProxyState</span></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <a href="_steps_buildproxyreqinit_.html#buildproxyreqinit" class="tsd-signature-type">buildProxyReqInit</a></h4>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">any</span></h4>
</li>
</ul>
</section>
Expand Down
Loading

0 comments on commit c6526bd

Please sign in to comment.