@zthun/webigail-web 2.4.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons.js +1 -1
- package/dist/assets/icons.svg +1 -1
- package/dist/assets/main.js +1 -1
- package/dist/assets/search.js +1 -1
- package/dist/assets/style.css +66 -21
- package/dist/classes/_zthun_webigail_http.ZHttpRequestBuilder.html +17 -17
- package/dist/classes/_zthun_webigail_http.ZHttpResultBuilder.html +7 -7
- package/dist/classes/_zthun_webigail_http.ZHttpService.html +3 -3
- package/dist/classes/_zthun_webigail_http.ZHttpServiceMock.html +4 -4
- package/dist/classes/_zthun_webigail_nest.ZHttpModule.html +3 -3
- package/dist/classes/_zthun_webigail_rest.ZRestfulService.html +11 -11
- package/dist/classes/_zthun_webigail_url.ZDataUrlBuilder.html +10 -10
- package/dist/classes/_zthun_webigail_url.ZUrlBuilder.html +35 -35
- package/dist/enums/_zthun_webigail_http.ZHttpCodeCategory.html +8 -8
- package/dist/enums/_zthun_webigail_http.ZHttpCodeClient.html +37 -37
- package/dist/enums/_zthun_webigail_http.ZHttpCodeInformationalResponse.html +7 -7
- package/dist/enums/_zthun_webigail_http.ZHttpCodeRedirection.html +12 -12
- package/dist/enums/_zthun_webigail_http.ZHttpCodeServer.html +14 -14
- package/dist/enums/_zthun_webigail_http.ZHttpCodeSeverity.html +7 -7
- package/dist/enums/_zthun_webigail_http.ZHttpCodeSuccess.html +13 -13
- package/dist/enums/_zthun_webigail_http.ZHttpMethod.html +10 -10
- package/dist/enums/_zthun_webigail_url.ZMimeTypeApplication.html +6 -6
- package/dist/enums/_zthun_webigail_url.ZMimeTypeImage.html +10 -10
- package/dist/enums/_zthun_webigail_url.ZMimeTypeText.html +10 -10
- package/dist/enums/_zthun_webigail_url.ZYouTubeApi.html +5 -5
- package/dist/functions/_zthun_webigail_http.fromContentType.html +2 -2
- package/dist/functions/_zthun_webigail_http.getHttpCodeCategory.html +2 -2
- package/dist/functions/_zthun_webigail_http.getHttpCodeDescription.html +2 -2
- package/dist/functions/_zthun_webigail_http.getHttpCodeName.html +2 -2
- package/dist/functions/_zthun_webigail_http.getHttpCodeSeverity.html +2 -2
- package/dist/functions/_zthun_webigail_http.isBodyInit.html +2 -2
- package/dist/functions/_zthun_webigail_http.toBodyInit.html +2 -2
- package/dist/hierarchy.html +1 -1
- package/dist/index.html +7 -6
- package/dist/interfaces/_zthun_webigail_http.IZHttpRequest.html +7 -7
- package/dist/interfaces/_zthun_webigail_http.IZHttpResult.html +5 -5
- package/dist/interfaces/_zthun_webigail_http.IZHttpService.html +3 -3
- package/dist/interfaces/_zthun_webigail_rest.IZRestfulCreate.html +3 -3
- package/dist/interfaces/_zthun_webigail_rest.IZRestfulDelete.html +3 -3
- package/dist/interfaces/_zthun_webigail_rest.IZRestfulGet.html +3 -3
- package/dist/interfaces/_zthun_webigail_rest.IZRestfulService.html +9 -9
- package/dist/interfaces/_zthun_webigail_rest.IZRestfulUpdate.html +3 -3
- package/dist/interfaces/_zthun_webigail_rest.IZRestfulUpsert.html +3 -3
- package/dist/interfaces/_zthun_webigail_url.IZDataUrlInfo.html +6 -6
- package/dist/interfaces/_zthun_webigail_url.IZUrlInfo.html +10 -10
- package/dist/modules/_zthun_webigail_http.html +14 -12
- package/dist/modules/_zthun_webigail_nest.html +6 -5
- package/dist/modules/_zthun_webigail_rest.html +5 -4
- package/dist/modules/_zthun_webigail_url.html +8 -7
- package/dist/modules.html +2 -0
- package/dist/types/_zthun_webigail_http.ZHttpCode.html +2 -2
- package/dist/types/_zthun_webigail_url.ZMimeType.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeClientDescriptions.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeClientNames.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeInformationalResponseDescriptions.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeInformationalResponseNames.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeRedirectionDescriptions.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeRedirectionNames.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeServerDescriptions.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeServerNames.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeSuccessDescriptions.html +2 -2
- package/dist/variables/_zthun_webigail_http.ZHttpCodeSuccessNames.html +2 -2
- package/dist/variables/_zthun_webigail_nest.ZHttpServiceToken.html +2 -2
- package/dist/variables/_zthun_webigail_url.ZSupportedMimeTypes.html +2 -2
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>IZRestfulUpsert | Webigail</title><meta name="description" content="Documentation for Webigail"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="icon" href="../webigail.svg" />
|
|
2
|
-
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Webigail</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../
|
|
2
|
+
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Webigail</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Webigail</a></li><li><a href="../modules/_zthun_webigail_rest.html">@zthun/webigail-rest</a></li><li><a href="_zthun_webigail_rest.IZRestfulUpsert.html">IZRestfulUpsert</a></li></ul><h1>Interface IZRestfulUpsert<T></h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>A restful service that can upsert resources.</p>
|
|
3
3
|
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">IZRestfulUpsert</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_zthun_webigail_rest.IZRestfulUpsert.html#T">T</a><span class="tsd-signature-symbol">></span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-call-signature" href="_zthun_webigail_rest.IZRestfulUpsert.html#upsert.upsert-1">upsert</a><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">body</span><span class="tsd-signature-symbol">: </span><a class="tsd-signature-type tsd-kind-type-parameter" href="_zthun_webigail_rest.IZRestfulUpsert.html#T">T</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_zthun_webigail_rest.IZRestfulUpsert.html#T">T</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div> <section class="tsd-panel"><h4>Type Parameters</h4><ul class="tsd-type-parameter-list"><li><span><a id="T" class="tsd-anchor"></a><span class="tsd-kind-type-parameter">T</span></span><div class="tsd-comment tsd-typography"><p>The type of resource being created/updated.</p>
|
|
4
|
-
</div><div class="tsd-comment tsd-typography"></div></li></ul></section> <section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a href="../hierarchy.html#@zthun/webigail-rest.IZRestfulUpsert">view full</a>)</h4><ul class="tsd-hierarchy"><li><span class="target">IZRestfulUpsert</span><ul class="tsd-hierarchy"><li><a href="_zthun_webigail_rest.IZRestfulService.html" class="tsd-signature-type tsd-kind-interface">IZRestfulService</a></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
4
|
+
</div><div class="tsd-comment tsd-typography"></div></li></ul></section> <section class="tsd-panel tsd-hierarchy"><h4>Hierarchy (<a href="../hierarchy.html#@zthun/webigail-rest.IZRestfulUpsert">view full</a>)</h4><ul class="tsd-hierarchy"><li><span class="target">IZRestfulUpsert</span><ul class="tsd-hierarchy"><li><a href="_zthun_webigail_rest.IZRestfulService.html" class="tsd-signature-type tsd-kind-interface">IZRestfulService</a></li></ul></li></ul></section><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-rest/src/service/restful-upsert.mts#L7">packages/webigail-rest/src/service/restful-upsert.mts:7</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Methods</h3><div class="tsd-index-list"><a href="_zthun_webigail_rest.IZRestfulUpsert.html#upsert" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>upsert</span></a>
|
|
5
5
|
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Methods"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Methods</h2></summary><section><section class="tsd-panel tsd-member"><a id="upsert" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>upsert</span><a href="#upsert" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><ul class="tsd-signatures"><li class="tsd-signature tsd-anchor-link"><a id="upsert.upsert-1" class="tsd-anchor"></a><span class="tsd-kind-call-signature">upsert</span><span class="tsd-signature-symbol">(</span><span class="tsd-kind-parameter">body</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_zthun_webigail_rest.IZRestfulUpsert.html#T">T</a><span class="tsd-signature-symbol">></span><a href="#upsert.upsert-1" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></li><li class="tsd-description"><div class="tsd-comment tsd-typography"><p>Creates a new entity or updates an existing entity.</p>
|
|
6
6
|
<p>This is determined by the body parameters on whether
|
|
7
7
|
or not an entity already exists.</p>
|
|
@@ -9,4 +9,4 @@ or not an entity already exists.</p>
|
|
|
9
9
|
</div><div class="tsd-parameters"><h4 class="tsd-parameters-title">Parameters</h4><ul class="tsd-parameter-list"><li><span><span class="tsd-kind-parameter">body</span>: <a class="tsd-signature-type tsd-kind-type-parameter" href="_zthun_webigail_rest.IZRestfulUpsert.html#T">T</a></span><div class="tsd-comment tsd-typography"><p>The post body that represents the resource to create
|
|
10
10
|
or update.</p>
|
|
11
11
|
</div><div class="tsd-comment tsd-typography"></div></li></ul></div><h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a class="tsd-signature-type tsd-kind-type-parameter" href="_zthun_webigail_rest.IZRestfulUpsert.html#T">T</a><span class="tsd-signature-symbol">></span></h4><p>The resource that was created or updated.</p>
|
|
12
|
-
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
12
|
+
<div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-rest/src/service/restful-upsert.mts#L23">packages/webigail-rest/src/service/restful-upsert.mts:23</a></li></ul></aside></li></ul></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Methods"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Methods</summary><div><a href="#upsert" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-2048"></use></svg><span>upsert</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>Webigail</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>IZDataUrlInfo | Webigail</title><meta name="description" content="Documentation for Webigail"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="icon" href="../webigail.svg" />
|
|
2
|
-
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Webigail</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">IZDataUrlInfo</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZDataUrlInfo.html#buffer">buffer</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">
|
|
2
|
+
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Webigail</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Webigail</a></li><li><a href="../modules/_zthun_webigail_url.html">@zthun/webigail-url</a></li><li><a href="_zthun_webigail_url.IZDataUrlInfo.html">IZDataUrlInfo</a></li></ul><h1>Interface IZDataUrlInfo</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Represents information about a data url.</p>
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">IZDataUrlInfo</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZDataUrlInfo.html#buffer">buffer</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Uint8Array</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZDataUrlInfo.html#encoding">encoding</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">"base64"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"utf8"</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZDataUrlInfo.html#mimeType">mimeType</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/data/data-url.mts#L8">data/data-url.mts:8</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="_zthun_webigail_url.IZDataUrlInfo.html#buffer" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>buffer</span></a>
|
|
4
4
|
<a href="_zthun_webigail_url.IZDataUrlInfo.html#encoding" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoding</span></a>
|
|
5
5
|
<a href="_zthun_webigail_url.IZDataUrlInfo.html#mimeType" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>mime<wbr/>Type</span></a>
|
|
6
|
-
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="buffer" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>buffer</span><a href="#buffer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">buffer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">
|
|
7
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
8
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
9
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
6
|
+
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="buffer" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>buffer</span><a href="#buffer" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">buffer</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">Uint8Array</span></div><div class="tsd-comment tsd-typography"><p>The raw data buffer.</p>
|
|
7
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/data/data-url.mts#L22">data/data-url.mts:22</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="encoding" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>encoding</span><a href="#encoding" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">encoding</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">"base64"</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"utf8"</span></div><div class="tsd-comment tsd-typography"><p>The output encoding.</p>
|
|
8
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/data/data-url.mts#L17">data/data-url.mts:17</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="mimeType" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>mime<wbr/>Type</span><a href="#mimeType" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">mime<wbr/>Type</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>The content information mime type.</p>
|
|
9
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/data/data-url.mts#L12">data/data-url.mts:12</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#buffer" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>buffer</span></a><a href="#encoding" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>encoding</span></a><a href="#mimeType" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>mime<wbr/>Type</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>Webigail</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>IZUrlInfo | Webigail</title><meta name="description" content="Documentation for Webigail"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="icon" href="../webigail.svg" />
|
|
2
|
-
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Webigail</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../
|
|
3
|
-
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">IZUrlInfo</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#hash">hash</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#hostname">hostname</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#params">params</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">key</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">val</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#password">password</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#path">path</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#port">port</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#protocol">protocol</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#username">username</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
2
|
+
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Webigail</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Webigail</a></li><li><a href="../modules/_zthun_webigail_url.html">@zthun/webigail-url</a></li><li><a href="_zthun_webigail_url.IZUrlInfo.html">IZUrlInfo</a></li></ul><h1>Interface IZUrlInfo</h1></div><section class="tsd-panel tsd-comment"><div class="tsd-comment tsd-typography"><p>Represents information about a url.</p>
|
|
3
|
+
</div><div class="tsd-comment tsd-typography"></div></section><div class="tsd-signature"><span class="tsd-signature-keyword">interface </span><span class="tsd-kind-interface">IZUrlInfo</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#hash">hash</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#hostname">hostname</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#params">params</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">key</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">val</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#password">password</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#path">path</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#port">port</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#protocol">protocol</a><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><a class="tsd-kind-property" href="_zthun_webigail_url.IZUrlInfo.html#username">username</a><span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L7">url/url.mts:7</a></li></ul></aside><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><details class="tsd-index-content tsd-accordion" open><summary class="tsd-accordion-summary tsd-index-summary"><h5 class="tsd-index-heading uppercase" role="button" aria-expanded="false" tabIndex="0"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-chevronSmall"></use></svg> Index</h5></summary><div class="tsd-accordion-details"><section class="tsd-index-section"><h3 class="tsd-index-heading">Properties</h3><div class="tsd-index-list"><a href="_zthun_webigail_url.IZUrlInfo.html#hash" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>hash?</span></a>
|
|
4
4
|
<a href="_zthun_webigail_url.IZUrlInfo.html#hostname" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>hostname</span></a>
|
|
5
5
|
<a href="_zthun_webigail_url.IZUrlInfo.html#params" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>params</span></a>
|
|
6
6
|
<a href="_zthun_webigail_url.IZUrlInfo.html#password" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>password?</span></a>
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
<a href="_zthun_webigail_url.IZUrlInfo.html#protocol" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>protocol</span></a>
|
|
10
10
|
<a href="_zthun_webigail_url.IZUrlInfo.html#username" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>username?</span></a>
|
|
11
11
|
</div></section></div></details></section></section><details class="tsd-panel-group tsd-member-group tsd-accordion" open><summary class="tsd-accordion-summary" data-key="section-Properties"><h2><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg> Properties</h2></summary><section><section class="tsd-panel tsd-member"><a id="hash" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code><span>hash</span><a href="#hash" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">hash</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>The client side hash route.</p>
|
|
12
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
13
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
14
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
15
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
12
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L44">url/url.mts:44</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="hostname" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>hostname</span><a href="#hostname" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">hostname</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>The host.</p>
|
|
13
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L26">url/url.mts:26</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="params" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>params</span><a href="#params" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">params</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span><span class="tsd-kind-property">key</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span> </span><span class="tsd-kind-property">val</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>The key value params.</p>
|
|
14
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L49">url/url.mts:49</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="password" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code><span>password</span><a href="#password" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">password</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>The password.</p>
|
|
15
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L21">url/url.mts:21</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="path" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>path</span><a href="#path" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">path</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">[]</span></div><div class="tsd-comment tsd-typography"><p>A list of current paths.</p>
|
|
16
16
|
<p>You can always get the full path using
|
|
17
17
|
path.join('/')</p>
|
|
18
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
19
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
20
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
21
|
-
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/
|
|
18
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L39">url/url.mts:39</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="port" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code><span>port</span><a href="#port" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">port</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">number</span></div><div class="tsd-comment tsd-typography"><p>The port number.</p>
|
|
19
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L31">url/url.mts:31</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="protocol" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><span>protocol</span><a href="#protocol" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">protocol</span><span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>The protocol for the url.</p>
|
|
20
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L11">url/url.mts:11</a></li></ul></aside></section><section class="tsd-panel tsd-member"><a id="username" class="tsd-anchor"></a><h3 class="tsd-anchor-link"><code class="tsd-tag">Optional</code><span>username</span><a href="#username" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h3><div class="tsd-signature"><span class="tsd-kind-property">username</span><span class="tsd-signature-symbol">?:</span> <span class="tsd-signature-type">string</span></div><div class="tsd-comment tsd-typography"><p>The username.</p>
|
|
21
|
+
</div><div class="tsd-comment tsd-typography"></div><aside class="tsd-sources"><ul><li>Defined in <a href="https://github.com/zthun/webigail/blob/2018b1ae6c4c7541da1052450896da8c16993859/packages/webigail-url/src/url/url.mts#L16">url/url.mts:16</a></li></ul></aside></section></section></details></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><details open class="tsd-accordion tsd-page-navigation-section"><summary class="tsd-accordion-summary" data-key="tsd-otp-Properties"><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Properties</summary><div><a href="#hash" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>hash</span></a><a href="#hostname" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>hostname</span></a><a href="#params" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>params</span></a><a href="#password" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>password</span></a><a href="#path" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>path</span></a><a href="#port" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>port</span></a><a href="#protocol" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>protocol</span></a><a href="#username" class=""><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1024"></use></svg><span>username</span></a></div></details></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>Webigail</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
<!DOCTYPE html><html class="default" lang="en"><head><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>@zthun/webigail-http | Webigail</title><meta name="description" content="Documentation for Webigail"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script defer src="../assets/main.js"></script><script async src="../assets/icons.js" id="tsd-icons-script"></script><script async src="../assets/search.js" id="tsd-search-script"></script><script async src="../assets/navigation.js" id="tsd-nav-script"></script><link rel="icon" href="../webigail.svg" />
|
|
2
|
-
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Webigail</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../
|
|
3
|
-
don't make it easy to do dependency
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
</head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os";document.body.style.display="none";setTimeout(() => app?app.showPage():document.body.style.removeProperty("display"),500)</script><header class="tsd-page-toolbar"><div class="tsd-toolbar-contents container"><div class="table-cell" id="tsd-search" data-base=".."><div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-search"></use></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div><div class="field"><div id="tsd-toolbar-links"></div></div><ul class="results"><li class="state loading">Preparing search index...</li><li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Webigail</a></div><div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><use href="../assets/icons.svg#icon-menu"></use></svg></a></div></div></header><div class="container container-main"><div class="col-content"><div class="tsd-page-title"><ul class="tsd-breadcrumb"><li><a href="../modules.html">Webigail</a></li><li><a href="_zthun_webigail_http.html">@zthun/webigail-http</a></li></ul><h1>Module @zthun/webigail-http</h1></div><section class="tsd-panel tsd-typography"><a id="md:webigail-http" class="tsd-anchor"></a><h1 class="tsd-anchor-link">Webigail Http<a href="#md:webigail-http" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h1><p>There's many libraries for invoking http requests such as axios, node-fetch, and
|
|
3
|
+
the built in fetch api. These work, but don't make it easy to do dependency
|
|
4
|
+
injection.</p>
|
|
5
|
+
<p>The webigail-http package uses an interface + class based approach to http
|
|
6
|
+
requests which makes dependency injection much easier.</p>
|
|
7
|
+
<a id="md:build-status" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Build Status<a href="#md:build-status" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p><a href="https://dl.circleci.com/status-badge/redirect/gh/zthun/webigail/tree/latest" target="_blank" class="external"><img src="https://dl.circleci.com/status-badge/img/gh/zthun/webigail/tree/latest.svg?style=shield" alt="CircleCI"></a></p>
|
|
7
8
|
<a id="md:usage" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Usage<a href="#md:usage" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>Webigail is built in TypeScript and it exports both ESM and CJS modules.</p>
|
|
8
9
|
<pre><code class="sh"><span class="hl-0"># NPM</span><br/><span class="hl-1">npm</span><span class="hl-2"> </span><span class="hl-3">install</span><span class="hl-2"> </span><span class="hl-3">@zthun/webigail-http</span><br/><span class="hl-0"># Yarn</span><br/><span class="hl-1">yarn</span><span class="hl-2"> </span><span class="hl-3">add</span><span class="hl-2"> </span><span class="hl-3">@zthun/webigail-http</span>
|
|
9
10
|
</code><button type="button">Copy</button></pre>
|
|
10
11
|
|
|
11
|
-
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">ZUrlBuilder</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3"
|
|
12
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">ZUrlBuilder</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"@zthun/webigail-url"</span><span class="hl-2">;</span><br/><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">IZHttpService</span><span class="hl-2">, </span><span class="hl-5">ZHttpRequestBuilder</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"@zthun/webigail-http"</span><span class="hl-2">;</span><br/><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">Product</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"../models/product"</span><span class="hl-2">;</span><br/><br/><span class="hl-4">export</span><span class="hl-2"> </span><span class="hl-6">class</span><span class="hl-2"> </span><span class="hl-7">ProductService</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">public</span><span class="hl-2"> </span><span class="hl-6">constructor</span><span class="hl-2">(</span><span class="hl-6">private</span><span class="hl-2"> </span><span class="hl-5">_http</span><span class="hl-2">: </span><span class="hl-7">IZHttpService</span><span class="hl-2">) {}</span><br/><br/><span class="hl-2"> </span><span class="hl-6">public</span><span class="hl-2"> </span><span class="hl-6">static</span><span class="hl-2"> </span><span class="hl-1">endpoint</span><span class="hl-2">(): </span><span class="hl-7">string</span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">url</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ZUrlBuilder</span><span class="hl-2">().</span><span class="hl-1">api</span><span class="hl-2">(</span><span class="hl-5">location</span><span class="hl-2">).</span><span class="hl-1">path</span><span class="hl-2">(</span><span class="hl-3">"users"</span><span class="hl-2">).</span><span class="hl-1">build</span><span class="hl-2">();</span><br/><span class="hl-2"> </span><span class="hl-4">return</span><span class="hl-2"> </span><span class="hl-5">url</span><span class="hl-2">;</span><br/><span class="hl-2"> }</span><br/><br/><span class="hl-2"> </span><span class="hl-6">public</span><span class="hl-2"> </span><span class="hl-1">list</span><span class="hl-2">(): </span><span class="hl-7">Promise</span><span class="hl-2"><</span><span class="hl-7">Product</span><span class="hl-2">> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">request</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ZHttpRequestBuilder</span><span class="hl-2">()</span><br/><span class="hl-2"> .</span><span class="hl-1">url</span><span class="hl-2">(</span><span class="hl-5">ProductService</span><span class="hl-2">.</span><span class="hl-1">endpoint</span><span class="hl-2">())</span><br/><span class="hl-2"> .</span><span class="hl-1">get</span><span class="hl-2">()</span><br/><span class="hl-2"> .</span><span class="hl-1">build</span><span class="hl-2">();</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> { </span><span class="hl-8">data</span><span class="hl-2"> } = </span><span class="hl-6">this</span><span class="hl-2">.</span><span class="hl-5">_http</span><span class="hl-2">.</span><span class="hl-1">request</span><span class="hl-2"><</span><span class="hl-7">Product</span><span class="hl-2">>(</span><span class="hl-5">request</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-4">return</span><span class="hl-2"> </span><span class="hl-5">data</span><span class="hl-2">;</span><br/><span class="hl-2"> }</span><br/><br/><span class="hl-2"> </span><span class="hl-6">public</span><span class="hl-2"> </span><span class="hl-1">create</span><span class="hl-2">(</span><span class="hl-5">product</span><span class="hl-2">: </span><span class="hl-7">Product</span><span class="hl-2">): </span><span class="hl-7">Promise</span><span class="hl-2"><</span><span class="hl-7">Product</span><span class="hl-2">> {</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">request</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ZHttpRequestBuilder</span><span class="hl-2">()</span><br/><span class="hl-2"> .</span><span class="hl-1">url</span><span class="hl-2">(</span><span class="hl-5">ProductService</span><span class="hl-2">.</span><span class="hl-1">endpoint</span><span class="hl-2">())</span><br/><span class="hl-2"> .</span><span class="hl-1">post</span><span class="hl-2">(</span><span class="hl-5">product</span><span class="hl-2">)</span><br/><span class="hl-2"> .</span><span class="hl-1">build</span><span class="hl-2">();</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> { </span><span class="hl-8">data</span><span class="hl-2"> } = </span><span class="hl-6">this</span><span class="hl-2">.</span><span class="hl-5">_http</span><span class="hl-2">.</span><span class="hl-1">request</span><span class="hl-2"><</span><span class="hl-7">Product</span><span class="hl-2">>(</span><span class="hl-5">request</span><span class="hl-2">);</span><br/><span class="hl-2"> </span><span class="hl-4">return</span><span class="hl-2"> </span><span class="hl-5">data</span><span class="hl-2">;</span><br/><span class="hl-2"> }</span><br/><span class="hl-2">}</span><br/><br/><span class="hl-0">// Somewhere at the root of your application.</span><br/><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">ZHttpService</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"@zthun/webigail-http"</span><span class="hl-2">;</span><br/><br/><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">product</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ProductService</span><span class="hl-2">(</span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ZHttpService</span><span class="hl-2">());</span>
|
|
12
13
|
</code><button type="button">Copy</button></pre>
|
|
13
14
|
|
|
14
|
-
<a id="md:testing" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Testing<a href="#md:testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>One challenge with dealing with http services and functions in tests is mocking
|
|
15
|
-
like get, post, but if you want to respond
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
<a id="md:testing" class="tsd-anchor"></a><h2 class="tsd-anchor-link">Testing<a href="#md:testing" aria-label="Permalink" class="tsd-anchor-icon"><svg viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-anchor"></use></svg></a></h2><p>One challenge with dealing with http services and functions in tests is mocking
|
|
16
|
+
API calls. You can override functions like get, post, but if you want to respond
|
|
17
|
+
to different URL invocations, then it can become a bit of a pain to do so.
|
|
18
|
+
Instead of having to create a mock and shuffle the http service implementations,
|
|
19
|
+
this package also includes a mock implementation of the http service.</p>
|
|
20
|
+
<pre><code class="ts"><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">createGuid</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"@zthun/helpful-fn"</span><span class="hl-2">;</span><br/><span class="hl-4">import</span><span class="hl-2"> { </span><span class="hl-5">ZHttpServiceMock</span><span class="hl-2"> } </span><span class="hl-4">from</span><span class="hl-2"> </span><span class="hl-3">"@zthun/webigail-http"</span><span class="hl-2">;</span><br/><br/><span class="hl-1">describe</span><span class="hl-2">(</span><span class="hl-3">"ProductService"</span><span class="hl-2">, () </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-6">let</span><span class="hl-2"> </span><span class="hl-5">http</span><span class="hl-2">: </span><span class="hl-7">ZHttpServiceMock</span><span class="hl-2">;</span><br/><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-1">createTestTarget</span><span class="hl-2"> = () </span><span class="hl-6">=></span><span class="hl-2"> </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ProductService</span><span class="hl-2">(</span><span class="hl-5">http</span><span class="hl-2">);</span><br/><br/><span class="hl-2"> </span><span class="hl-1">beforeEach</span><span class="hl-2">(() </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-5">http</span><span class="hl-2"> = </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ZHttpServiceMock</span><span class="hl-2">();</span><br/><br/><span class="hl-2"> </span><span class="hl-5">http</span><span class="hl-2">.</span><span class="hl-1">set</span><span class="hl-2">(</span><br/><span class="hl-2"> </span><span class="hl-5">ProductService</span><span class="hl-2">.</span><span class="hl-1">endpoint</span><span class="hl-2">(),</span><br/><span class="hl-2"> </span><span class="hl-5">ZHttpMethod</span><span class="hl-2">.</span><span class="hl-5">Get</span><span class="hl-2">,</span><br/><span class="hl-2"> </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ZHttpResultBuilder</span><span class="hl-2"><</span><span class="hl-7">User</span><span class="hl-2">>()</span><br/><span class="hl-2"> .</span><span class="hl-1">data</span><span class="hl-2">([</span><span class="hl-1">createMockExistingUser</span><span class="hl-2">(), </span><span class="hl-1">createMockExistingUser</span><span class="hl-2">()])</span><br/><span class="hl-2"> .</span><span class="hl-1">build</span><span class="hl-2">(),</span><br/><span class="hl-2"> );</span><br/><br/><span class="hl-2"> </span><span class="hl-5">http</span><span class="hl-2">.</span><span class="hl-1">set</span><span class="hl-2">(</span><span class="hl-5">ProductService</span><span class="hl-2">.</span><span class="hl-1">endpoint</span><span class="hl-2">(), </span><span class="hl-5">ZHttpMethod</span><span class="hl-2">.</span><span class="hl-5">Post</span><span class="hl-2">, (</span><span class="hl-5">r</span><span class="hl-2">) </span><span class="hl-6">=></span><br/><span class="hl-2"> </span><span class="hl-6">new</span><span class="hl-2"> </span><span class="hl-1">ZHttpResultBuilder</span><span class="hl-2"><</span><span class="hl-7">User</span><span class="hl-2">>()</span><br/><span class="hl-2"> .</span><span class="hl-1">data</span><span class="hl-2">(</span><span class="hl-5">Object</span><span class="hl-2">.</span><span class="hl-1">assign</span><span class="hl-2">({}, </span><span class="hl-5">r</span><span class="hl-2">.</span><span class="hl-5">body</span><span class="hl-2">!, { </span><span class="hl-5">id:</span><span class="hl-2"> </span><span class="hl-1">createGuid</span><span class="hl-2">() }))</span><br/><span class="hl-2"> .</span><span class="hl-1">build</span><span class="hl-2">(),</span><br/><span class="hl-2"> );</span><br/><span class="hl-2"> });</span><br/><br/><span class="hl-2"> </span><span class="hl-1">it</span><span class="hl-2">(</span><span class="hl-3">"should retrieve the list of users"</span><span class="hl-2">, </span><span class="hl-6">async</span><span class="hl-2"> () </span><span class="hl-6">=></span><span class="hl-2"> {</span><br/><span class="hl-2"> </span><span class="hl-0">// Arrange.</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">target</span><span class="hl-2"> = </span><span class="hl-1">createTestTarget</span><span class="hl-2">();</span><br/><span class="hl-2"> </span><span class="hl-0">// Act.</span><br/><span class="hl-2"> </span><span class="hl-6">const</span><span class="hl-2"> </span><span class="hl-8">actual</span><span class="hl-2"> = </span><span class="hl-4">await</span><span class="hl-2"> </span><span class="hl-5">target</span><span class="hl-2">.</span><span class="hl-1">list</span><span class="hl-2">();</span><br/><span class="hl-2"> </span><span class="hl-0">// Assert.</span><br/><span class="hl-2"> </span><span class="hl-1">expect</span><span class="hl-2">(</span><span class="hl-5">actual</span><span class="hl-2">.</span><span class="hl-5">length</span><span class="hl-2">).</span><span class="hl-1">toEqual</span><span class="hl-2">(</span><span class="hl-9">2</span><span class="hl-2">);</span><br/><span class="hl-2"> });</span><br/><span class="hl-2">});</span>
|
|
19
21
|
</code><button type="button">Copy</button></pre>
|
|
20
22
|
|
|
21
23
|
</section><section class="tsd-panel-group tsd-index-group"><section class="tsd-panel tsd-index-panel"><h3 class="tsd-index-heading uppercase">Index</h3><section class="tsd-index-section"><h3 class="tsd-index-heading">Enumerations</h3><div class="tsd-index-list"><a href="../enums/_zthun_webigail_http.ZHttpCodeCategory.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-8"></use></svg><span>ZHttp<wbr/>Code<wbr/>Category</span></a>
|
|
@@ -51,4 +53,4 @@ implementation of the http service.</p>
|
|
|
51
53
|
<a href="../functions/_zthun_webigail_http.getHttpCodeSeverity.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><span>get<wbr/>Http<wbr/>Code<wbr/>Severity</span></a>
|
|
52
54
|
<a href="../functions/_zthun_webigail_http.isBodyInit.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><span>is<wbr/>Body<wbr/>Init</span></a>
|
|
53
55
|
<a href="../functions/_zthun_webigail_http.toBodyInit.html" class="tsd-index-link"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-64"></use></svg><span>to<wbr/>Body<wbr/>Init</span></a>
|
|
54
|
-
</div></section></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:webigail-http"><span>Webigail <wbr/>Http</span></a><ul><li><a href="#md:build-status"><span>Build <wbr/>Status</span></a></li><li><a href="#md:usage"><span>Usage</span></a></li><li><a href="#md:testing"><span>Testing</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../
|
|
56
|
+
</div></section></section></section></div><div class="col-sidebar"><div class="page-menu"><div class="tsd-navigation settings"><details class="tsd-accordion"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>Settings</h3></summary><div class="tsd-accordion-details"><div class="tsd-filter-visibility"><span class="settings-label">Member Visibility</span><ul id="tsd-filter-options"><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li><li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></div><div class="tsd-theme-toggle"><label class="settings-label" for="tsd-theme">Theme</label><select id="tsd-theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div><details open class="tsd-accordion tsd-page-navigation"><summary class="tsd-accordion-summary"><h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><use href="../assets/icons.svg#icon-chevronDown"></use></svg>On This Page</h3></summary><div class="tsd-accordion-details"><a href="#md:webigail-http"><span>Webigail <wbr/>Http</span></a><ul><li><a href="#md:build-status"><span>Build <wbr/>Status</span></a></li><li><a href="#md:usage"><span>Usage</span></a></li><li><a href="#md:testing"><span>Testing</span></a></li></ul></div></details></div><div class="site-menu"><nav class="tsd-navigation"><a href="../modules.html"><svg class="tsd-kind-icon" viewBox="0 0 24 24"><use href="../assets/icons.svg#icon-1"></use></svg><span>Webigail</span></a><ul class="tsd-small-nested-navigation" id="tsd-nav-container" data-base=".."><li>Loading...</li></ul></nav></div></div></div><footer><p class="tsd-generator">Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></footer><div class="overlay"></div></body></html>
|