diff --git a/.all-contributorsrc b/.all-contributorsrc index 6ecfa8b21..ca0269c27 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -52,15 +52,6 @@ "code" ] }, - { - "login": "terranblake", - "name": "Terran Blake", - "avatar_url": "https://avatars3.githubusercontent.com/u/8795767?v=4", - "profile": "https://www.lumahealth.io/", - "contributions": [ - "code" - ] - }, { "login": "AndrewBastin", "name": "Andrew Bastin", diff --git a/README.md b/README.md index 8331939ad..8f6a9a66b 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@

- [![Travis Build Status](https://img.shields.io/travis/com/liyasthomas/postwoman?logo=Travis)](https://travis-ci.com/liyasthomas/postwoman) [![GitHub release](https://img.shields.io/github/release/liyasthomas/postwoman/all?logo=GitHub)](https://github.com/liyasthomas/postwoman/releases/latest) [![Website](https://img.shields.io/website?url=https%3A%2F%2Fpostwoman.io&logo=Postwoman)](https://postwoman.io) [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen?style=flat)](CONTRIBUTING.md) [![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors) [![Financial Contributors on Open Collective](https://img.shields.io/opencollective/all/postwoman?logo=Open-Collective&label=financial+contributors)](https://opencollective.com/postwoman) [![Donate on PayPal](https://img.shields.io/badge/support-PayPal-blue?logo=PayPal)](https://www.paypal.me/liyascthomas) [![Chat on Telegram](https://img.shields.io/badge/chat-Telegram-blueviolet?logo=Telegram)](https://t.me/postwoman_app) [![Chat on Discord](https://img.shields.io/badge/chat-Discord-violet?logo=discord)](https://discord.gg/GAMWxmR) [![Tweet](https://img.shields.io/twitter/url?url=https%3A%2F%2Fpostwoman.io%2F)](https://twitter.com/intent/tweet?url=https%3A%2F%2Fpostwoman.io&text=%F0%9F%91%BD%20Postwoman%20%E2%80%A2%20API%20request%20builder%20-%20Helps%20you%20create%20your%20requests%20faster%2C%20saving%20you%20precious%20time%20on%20your%20development&original_referer=https%3A%2F%2Ftwitter.com%2Fshare%3Ftext%3D%25F0%259F%2591%25BD%2520Postwoman%2520%25E2%2580%25A2%2520API%2520request%2520builder%2520-%2520Helps%2520you%2520create%2520your%2520requests%2520faster%2C%2520saving%2520you%2520precious%2520time%2520on%2520your%2520development%26url%3Dhttps%3A%2F%2Fpostwoman.io%26hashtags%3Dpostwoman%26via%3Dliyasthomas&via=liyasthomas&hashtags=postwoman) + [![Travis Build Status](https://img.shields.io/travis/com/liyasthomas/postwoman?logo=Travis)](https://travis-ci.com/liyasthomas/postwoman) [![GitHub release](https://img.shields.io/github/release/liyasthomas/postwoman/all?logo=GitHub)](https://github.com/liyasthomas/postwoman/releases/latest) [![Website](https://img.shields.io/website?url=https%3A%2F%2Fpostwoman.io&logo=Postwoman)](https://postwoman.io) [![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen)](CONTRIBUTING.md) [![Financial Contributors on Open Collective](https://img.shields.io/opencollective/all/postwoman?logo=Open-Collective&label=financial+contributors)](https://opencollective.com/postwoman) [![Donate on PayPal](https://img.shields.io/badge/support-PayPal-blue?logo=PayPal)](https://www.paypal.me/liyascthomas) [![Chat on Telegram](https://img.shields.io/badge/chat-Telegram-blueviolet?logo=Telegram)](https://t.me/postwoman_app) [![Chat on Discord](https://img.shields.io/badge/chat-Discord-violet?logo=discord)](https://discord.gg/GAMWxmR) [![Tweet](https://img.shields.io/twitter/url?url=https%3A%2F%2Fpostwoman.io%2F)](https://twitter.com/intent/tweet?url=https%3A%2F%2Fpostwoman.io&text=%F0%9F%91%BD%20Postwoman%20%E2%80%A2%20API%20request%20builder%20-%20Helps%20you%20create%20your%20requests%20faster%2C%20saving%20you%20precious%20time%20on%20your%20development&original_referer=https%3A%2F%2Ftwitter.com%2Fshare%3Ftext%3D%25F0%259F%2591%25BD%2520Postwoman%2520%25E2%2580%25A2%2520API%2520request%2520builder%2520-%2520Helps%2520you%2520create%2520your%2520requests%2520faster%2C%2520saving%2520you%2520precious%2520time%2520on%2520your%2520development%26url%3Dhttps%3A%2F%2Fpostwoman.io%26hashtags%3Dpostwoman%26via%3Dliyasthomas&via=liyasthomas&hashtags=postwoman)

@@ -94,7 +94,7 @@ _Customized themes are synced with local session storage_ 📡 **Server Sent Events**: Receive a stream of updates from a server over a HTTP connection without resorting to polling. -🌍 **GraphQL**: GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. +🔮 **GraphQL**: GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. - Set endpoint and get schemas - Multi-column docs @@ -161,9 +161,9 @@ _Collections are synced with local session storage_ - Access APIs served in non-HTTPS (`http://`) - Use custom Proxy URL -_Official Postwoman Proxy is hosted by ApolloTV - [Privacy policy](https://apollotv.xyz/legal)_ +_Official Postwoman Proxy is hosted by ApolloTV - **[Privacy policy](https://apollotv.xyz/legal)**_ -📜 **Pre-Request Scripts**: Snippets of code associated with a request that are executed before the request is sent. +📜 **Pre-Request Scripts β**: Snippets of code associated with a request that are executed before the request is sent. **Use-cases:** - Include timestamp in the request headers @@ -171,6 +171,13 @@ _Official Postwoman Proxy is hosted by ApolloTV - [Privacy policy](https://apoll _Requests with Pre-Request Scripts are indicated in History entries_ +📄 **API Documentation**: Create and share dynamic API documentation easily, quickly. + +**Usage:** + 1. Add your requests to Collections and Folders + 2. Export Collections and easily share your APIs with the rest of your team + 3. Import Collections and Generate Documentation on-the-go + ⌨️ **Keyboard Shortcuts**: Optimized for efficiency. **Shortcuts:** @@ -179,7 +186,15 @@ _Requests with Pre-Request Scripts are indicated in History entries_ - Copy Request Link Ctrl + K - Reset Request Ctrl + L -🌎 **i18n**: Internationalization β. +🌎 **i18n β**: Experience the app in your own language. + + 1. Scroll down to the footer + 2. Click "Choose Language" button + 3. Select your language from the menu + +_Keep in mind translations aren't available for all source and target language combinations_ + +**To provide a localized experience for users around the world, you can add you own translations.** - Add a new locale in `lang/` @@ -200,11 +215,22 @@ _Requests with Pre-Request Scripts are indicated in History entries_ _**All `i18n` contributions are welcome to `i18n` [branch](https://github.com/liyasthomas/postwoman/tree/i18n) only!**_ +📦 **Add-ons**: Official add-ons for Postwoman. + + - **[Postwoman Proxy β](https://github.com/postwoman-io/postwoman-proxy)** - A simple proxy server created for Postwoman + - **[Postwoman CLI β](https://github.com/postwoman-io/postwoman-cli)** - A CLI solution for Postwoman + +_Add-ons are developed and maintained under **[Official Postwoman Organization](https://github.com/postwoman-io)**_ + **To find out more, please check out [Postwoman Wiki](https://github.com/liyasthomas/postwoman/wiki).** ## Demo 🚀 [![Website](https://img.shields.io/website?url=https%3A%2F%2Fpostwoman.io&logo=Postwoman)](https://postwoman.io) -[https://postwoman.io](https://postwoman.io) +[postwoman.io](https://postwoman.io) + + + + ## Usage 💡 @@ -302,11 +328,10 @@ See the [CHANGELOG](CHANGELOG.md) file for details. Nicholas La Roux
Nicholas La Roux

💻 Thomas Yuba
Thomas Yuba

💻 Nick Palenchar
Nick Palenchar

💻 - Terran Blake
Terran Blake

💻 Andrew Bastin
Andrew Bastin

💻 + Vladislav
Vladislav

💻 - Vladislav
Vladislav

💻 izerozlu
izerozlu

💻 Jacob Anavisca
Jacob Anavisca

💻 Nityananda Gohain
Nityananda Gohain

💻 @@ -364,75 +389,34 @@ This project is licensed under the [MIT License](https://opensource.org/licenses ## Badges -

- -[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-121212?logo=Postwoman)](https://postwoman.io) -

-Default -

- -``` -[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-121212?logo=Postwoman)](https://postwoman.io) -``` -

-
-

-

- ---- -[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-success?logo=Postwoman)](https://postwoman.io) -

-Success -

- -``` -[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-success?logo=Postwoman)](https://postwoman.io) -``` -

-
-

-

- ---- -[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-critical?logo=Postwoman)](https://postwoman.io) -

-Critical -

- -``` -[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-critical?logo=Postwoman)](https://postwoman.io) -``` -

-
-

-

- ---- -[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-blueviolet?logo=Postwoman)](https://postwoman.io) -

-Custom -

- -``` -[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-blueviolet?logo=Postwoman)](https://postwoman.io) -``` -

-
-

-

- ---- -[![Postwoman](https://img.shields.io/badge/your_text-Postwoman-hex_color_code?logo=Postwoman)](https://postwoman.io) -

-Customize -

- -``` -[![Postwoman](https://img.shields.io/badge/your_text-Postwoman-hex_color_code?logo=Postwoman)](https://postwoman.io) -``` -

-
-

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
PreviewMarkdown code


Default
[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-202124?logo=Postwoman)](https://postwoman.io)


Success
[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-success?logo=Postwoman)](https://postwoman.io)


Critical
[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-critical?logo=Postwoman)](https://postwoman.io)


Custom
[![Postwoman](https://img.shields.io/badge/Tested_on-Postwoman-blueviolet?logo=Postwoman)](https://postwoman.io)


Customize
[![Postwoman](https://img.shields.io/badge/your_text-Postwoman-hex_color_code?logo=Postwoman)](https://postwoman.io)

diff --git a/assets/css/styles.scss b/assets/css/styles.scss index cc02e327a..48b6130c3 100644 --- a/assets/css/styles.scss +++ b/assets/css/styles.scss @@ -146,6 +146,7 @@ footer { z-index: 1; height: 100vh; padding: 0 8px; + background-color: var(--bg-light-color); } .main { @@ -155,7 +156,6 @@ footer { order: 2; position: relative; padding: 0 16px; - background-color: var(--bg-light-color); height: 100%; } @@ -251,20 +251,23 @@ nav.secondary-nav { h1, h2, -h3 { +h3, +h4 { + display: flex; + align-items: center; margin: 0; font-weight: 700; } .tooltip { - $bgcolor: var(--bg-color); + $bgcolor: var(--tt-color); $fgcolor: var(--fg-color); display: block !important; z-index: 10000; .tooltip-inner { - background: black; - color: white; + background: $bgcolor; + color: $fgcolor; border-radius: 8px; padding: 8px 16px; font-size: 12px; @@ -278,7 +281,7 @@ h3 { border-style: solid; position: absolute; margin: 5px; - border-color: black; + border-color: $bgcolor; z-index: 1; } @@ -379,6 +382,11 @@ h3.title { margin: 4px; } +.info { + margin-left: 4px; + color: var(--fg-light-color); +} + button { display: inline-flex; align-items: center; @@ -424,6 +432,17 @@ button { transition: all 0.2s ease-in-out; } } + + &.primary { + color: var(--ac-color); + + &:not([disabled]):hover, + &:not([disabled]):active, + &:not([disabled]):focus { + background-color: var(--ac-color); + color: var(--act-color); + } + } } @keyframes beat { @@ -444,7 +463,6 @@ button { fieldset { margin: 16px 0; - // border: 1px solid var(--brd-color); border-radius: 16px; transition: all 0.2s ease-in-out; background-color: var(--bg-dark-color); @@ -503,6 +521,11 @@ fieldset.yellow legend { color: #f1fa8c; } +input[type="file"], +input[type="radio"], +.tab, +.hide-on-large-screen, +#installPWA, .hidden { display: none; } @@ -511,7 +534,9 @@ kbd, select, input, textarea, -pre { +pre, +code { + display: inline-flex; margin: 4px; padding: 8px; border-radius: 8px; @@ -545,9 +570,10 @@ pre.ace_editor { z-index: 0; } -code { - height: 336px; - border-radius: 8px; +kbd, +code, +pre { + width: auto; } .select-wrapper { @@ -648,6 +674,7 @@ ol li { display: inline-flex; flex-direction: column; flex-grow: 1; + justify-content: center; } .flex-wrap { @@ -669,18 +696,10 @@ ol li { display: flex; } -.hide-on-large-screen { - display: none; -} - .show-on-large-screen { display: inline-flex; } -#installPWA { - display: none; -} - .info-response { color: #ffeb3b; } @@ -774,12 +793,6 @@ section { order: 1; } -input[type="file"], -input[type="radio"], -.tab { - display: none; -} - input[type="radio"] + label { padding: 8px 16px; border-bottom: 2px solid transparent; @@ -856,6 +869,7 @@ input[type="radio"]:checked + label + .tab { width: 100%; background-color: var(--bg-color); transition: all 0.2s ease-in-out; + box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.45); } nav.primary-nav { diff --git a/assets/css/themes.scss b/assets/css/themes.scss index f0dc2058a..5bd10c541 100644 --- a/assets/css/themes.scss +++ b/assets/css/themes.scss @@ -9,13 +9,13 @@ // Dark is the default theme variant. @mixin darkTheme { // Background color - --bg-color: rgba(18, 18, 18, 1); + --bg-color: rgba(32, 33, 36, 1); // Light Background color --bg-light-color: rgba(255, 255, 255, 0.02); // Dark Background color --bg-dark-color: rgba(0, 0, 0, 0.1); // Text color - --fg-color: rgba(255, 255, 255, 1); + --fg-color: rgba(255, 255, 255, 0.9); // Light Text color --fg-light-color: rgba(255, 255, 255, 0.5); // Border color @@ -25,9 +25,11 @@ // Acent color --ac-color: rgba(80, 250, 123, 1); // Active text color - --act-color: rgba(18, 18, 18, 1); + --act-color: rgba(32, 33, 36, 1); // Auto-complete color - --atc-color: rgba(18, 18, 18, 1); + --atc-color: rgba(32, 33, 36, 1); + // Tooltip color + --tt-color: rgba(53, 53, 53, 1); } @mixin lightTheme { @@ -38,7 +40,7 @@ // Dark Background color --bg-dark-color: rgba(0, 0, 0, 0.02); // Text color - --fg-color: rgba(0, 0, 0, 1); + --fg-color: rgba(0, 0, 0, 0.9); // Light Text color --fg-light-color: rgba(0, 0, 0, 0.6); // Border color @@ -51,17 +53,19 @@ --act-color: rgba(255, 255, 255, 1); // Auto-complete color --atc-color: rgba(255, 255, 255, 1); + // Tooltip color + --tt-color: rgba(220, 220, 220, 1); } @mixin blackTheme { // Background color --bg-color: rgba(0, 0, 0, 1); // Light Background color - --bg-light-color: rgba(255, 255, 255, 0); + --bg-light-color: rgba(255, 255, 255, 0.02); // Dark Background color --bg-dark-color: rgba(255, 255, 255, 0.02); // Text color - --fg-color: rgba(255, 255, 255, 1); + --fg-color: rgba(255, 255, 255, 0.9); // Light Text color --fg-light-color: rgba(255, 255, 255, 0.5); // Border color @@ -74,6 +78,8 @@ --act-color: rgba(0, 0, 0, 1); // Auto-complete color --atc-color: rgba(0, 0, 0, 1); + // Tooltip color + --tt-color: rgba(18, 18, 18, 1); } :root { diff --git a/components/collections/addCollection.vue b/components/collections/addCollection.vue index 9a00ed2a6..2c68f630f 100644 --- a/components/collections/addCollection.vue +++ b/components/collections/addCollection.vue @@ -22,14 +22,17 @@
- + + +
diff --git a/components/collections/addFolder.vue b/components/collections/addFolder.vue index 3a582c13a..40ec5c574 100644 --- a/components/collections/addFolder.vue +++ b/components/collections/addFolder.vue @@ -22,14 +22,17 @@
- + + +
diff --git a/components/collections/editCollection.vue b/components/collections/editCollection.vue index 34e2b0999..3a3feac53 100644 --- a/components/collections/editCollection.vue +++ b/components/collections/editCollection.vue @@ -1,12 +1,12 @@ @@ -66,7 +69,7 @@ export default { }); this.$emit("hide-modal"); }, - hideModel() { + hideModal() { this.$emit("hide-modal"); } } diff --git a/components/collections/editFolder.vue b/components/collections/editFolder.vue index b5c8ef03c..17388fd34 100644 --- a/components/collections/editFolder.vue +++ b/components/collections/editFolder.vue @@ -27,14 +27,17 @@
- + + +
diff --git a/components/collections/editRequest.vue b/components/collections/editRequest.vue index 46323d10e..12d818909 100644 --- a/components/collections/editRequest.vue +++ b/components/collections/editRequest.vue @@ -71,14 +71,17 @@
- + + +
diff --git a/components/collections/importExportCollections.vue b/components/collections/importExportCollections.vue index b70f97f70..e6396bc66 100644 --- a/components/collections/importExportCollections.vue +++ b/components/collections/importExportCollections.vue @@ -1,12 +1,12 @@ @@ -76,7 +84,7 @@ export default { } }, methods: { - hideModel() { + hideModal() { this.$emit("hide-modal"); }, openDialogChooseFileToReplaceWith() { diff --git a/components/collections/index.vue b/components/collections/index.vue index ec7a1cef2..c55054891 100644 --- a/components/collections/index.vue +++ b/components/collections/index.vue @@ -5,10 +5,7 @@ TODO: diff --git a/components/graphql/field.vue b/components/graphql/field.vue index 0da0f522f..b5acb1b54 100644 --- a/components/graphql/field.vue +++ b/components/graphql/field.vue @@ -15,7 +15,7 @@ .field-box { padding: 16px; margin: 4px; - border-bottom: 1px solid var(--brd-color); + border-bottom: 1px dashed var(--brd-color); } .field-deprecated { diff --git a/components/history.vue b/components/history.vue index 9b9ac14d5..0d64fc4a8 100644 --- a/components/history.vue +++ b/components/history.vue @@ -162,11 +162,9 @@ - +

+ History is empty +

+
+ +
diff --git a/pages/index.vue b/pages/index.vue index 03308febf..1660dac51 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -224,12 +224,18 @@ @@ -728,14 +734,17 @@
- + + +
@@ -1399,7 +1408,7 @@ export default { requestString.push("xhr.send()"); } return requestString.join("\n"); - } else if (this.requestType == "Fetch") { + } else if (this.requestType === "Fetch") { const requestString = []; let headers = []; requestString.push( @@ -1806,38 +1815,6 @@ export default { } }); }, - formatRawParams(event) { - if (event.which !== 13 && event.which !== 9) { - return; - } - const textBody = event.target.value; - const textBeforeCursor = textBody.substring( - 0, - event.target.selectionStart - ); - const textAfterCursor = textBody.substring(event.target.selectionEnd); - if (event.which === 13) { - event.preventDefault(); - const oldSelectionStart = event.target.selectionStart; - const lastLine = textBeforeCursor.split("\n").slice(-1)[0]; - const rightPadding = lastLine.match(/([\s\t]*).*/)[1] || ""; - event.target.value = - textBeforeCursor + "\n" + rightPadding + textAfterCursor; - setTimeout( - () => - (event.target.selectionStart = event.target.selectionEnd = - oldSelectionStart + rightPadding.length + 1), - 1 - ); - } else if (event.which === 9) { - event.preventDefault(); - const oldSelectionStart = event.target.selectionStart; - event.target.value = textBeforeCursor + "\xa0\xa0" + textAfterCursor; - event.target.selectionStart = event.target.selectionEnd = - oldSelectionStart + 2; - return false; - } - }, copyRequest() { if (navigator.share) { let time = new Date().toLocaleTimeString(); @@ -1891,7 +1868,7 @@ export default { }); const aux = document.createElement("textarea"); const copy = - this.responseType == "application/json" + this.responseType === "application/json" ? JSON.stringify(this.response.body) : this.response.body; aux.innerText = copy; @@ -1986,7 +1963,7 @@ export default { window.location.href, "", "/?" + - encodeURIComponent( + encodeURI( flats .concat(deeps, bodyParams) .join("") @@ -1999,7 +1976,7 @@ export default { throw new Error("Route query parameters must be a Object"); for (const key in queries) { if (["headers", "params", "bodyParams"].includes(key)) - this[key] = JSON.parse(queries[key]); + this[key] = JSON.parse(decodeURI(queries[key])); if (key === "rawParams") { this.rawInput = true; this.rawParams = queries["rawParams"]; @@ -2033,7 +2010,7 @@ export default { let parsedCurl = parseCurlCommand(text); this.url = parsedCurl.url.replace(/"/g, "").replace(/'/g, ""); this.url = - this.url.slice(-1).pop() == "/" ? this.url.slice(0, -1) : this.url; + this.url.slice(-1).pop() === "/" ? this.url.slice(0, -1) : this.url; this.path = ""; this.headers = []; for (const key of Object.keys(parsedCurl.headers)) { @@ -2157,7 +2134,7 @@ export default { uploadPayload() { this.rawInput = true; let file = this.$refs.payload.files[0]; - if (file !== null) { + if (file !== undefined && file !== null) { let reader = new FileReader(); reader.onload = e => { this.rawParams = e.target.result; diff --git a/pages/realtime.vue b/pages/realtime.vue index cf583bd1c..5aaf17851 100644 --- a/pages/realtime.vue +++ b/pages/realtime.vue @@ -36,6 +36,7 @@ + + - +