Merge branch 'master' into feat/dotenv

This commit is contained in:
Liyas Thomas
2020-05-12 00:20:59 +05:30
committed by GitHub
6 changed files with 63 additions and 19 deletions

View File

@@ -123,6 +123,15 @@
"contributions": [ "contributions": [
"code" "code"
] ]
},
{
"login": "sboulema",
"name": "Samir Boulema",
"avatar_url": "https://avatars2.githubusercontent.com/u/1820661?v=4",
"profile": "http://www.sboulema.nl",
"contributions": [
"code"
]
} }
], ],
"contributorsPerLine": 7, "contributorsPerLine": 7,

View File

@@ -342,7 +342,7 @@ See the [CHANGELOG](CHANGELOG.md) file for details.
* ([contributors](https://github.com/liyasthomas/postwoman/graphs/contributors)) * ([contributors](https://github.com/liyasthomas/postwoman/graphs/contributors))
### Collaborators <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --> ### Collaborators <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-) [![All Contributors](https://img.shields.io/badge/all_contributors-14-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END --> <!-- ALL-CONTRIBUTORS-BADGE:END -->
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
@@ -365,6 +365,7 @@ See the [CHANGELOG](CHANGELOG.md) file for details.
<td align="center"><a href="https://github.com/hosseinnedaee"><img src="https://avatars2.githubusercontent.com/u/42691357?v=4" width="100px;" alt=""/><br /><sub><b>Hossein Nedaee</b></sub></a><br /><a href="https://github.com/liyasthomas/postwoman/commits?author=hosseinnedaee" title="Code">💻</a></td> <td align="center"><a href="https://github.com/hosseinnedaee"><img src="https://avatars2.githubusercontent.com/u/42691357?v=4" width="100px;" alt=""/><br /><sub><b>Hossein Nedaee</b></sub></a><br /><a href="https://github.com/liyasthomas/postwoman/commits?author=hosseinnedaee" title="Code">💻</a></td>
<td align="center"><a href="https://ghuser.io/jamesgeorge007"><img src="https://avatars2.githubusercontent.com/u/25279263?v=4" width="100px;" alt=""/><br /><sub><b>James George</b></sub></a><br /><a href="https://github.com/liyasthomas/postwoman/commits?author=jamesgeorge007" title="Code">💻</a></td> <td align="center"><a href="https://ghuser.io/jamesgeorge007"><img src="https://avatars2.githubusercontent.com/u/25279263?v=4" width="100px;" alt=""/><br /><sub><b>James George</b></sub></a><br /><a href="https://github.com/liyasthomas/postwoman/commits?author=jamesgeorge007" title="Code">💻</a></td>
<td align="center"><a href="https://dmitryyankowski.com"><img src="https://avatars0.githubusercontent.com/u/20114263?v=4" width="100px;" alt=""/><br /><sub><b>Dmitry Yankowski</b></sub></a><br /><a href="https://github.com/liyasthomas/postwoman/commits?author=dmitryyankowski" title="Code">💻</a></td> <td align="center"><a href="https://dmitryyankowski.com"><img src="https://avatars0.githubusercontent.com/u/20114263?v=4" width="100px;" alt=""/><br /><sub><b>Dmitry Yankowski</b></sub></a><br /><a href="https://github.com/liyasthomas/postwoman/commits?author=dmitryyankowski" title="Code">💻</a></td>
<td align="center"><a href="http://www.sboulema.nl"><img src="https://avatars2.githubusercontent.com/u/1820661?v=4" width="100px;" alt=""/><br /><sub><b>Samir Boulema</b></sub></a><br /><a href="https://github.com/liyasthomas/postwoman/commits?author=sboulema" title="Code">💻</a></td>
</tr> </tr>
</table> </table>

View File

@@ -119,15 +119,28 @@ export default {
let reader = new FileReader() let reader = new FileReader()
reader.onload = event => { reader.onload = event => {
let content = event.target.result let content = event.target.result
let environments = JSON.parse(content) let importFileObj = JSON.parse(content)
let confirmation = this.$t("file_imported") if (importFileObj["_postman_variable_scope"] === "environment") {
this.$store.commit("postwoman/importAddEnvironments", { this.importFromPostman(importFileObj)
environments, } else {
confirmation, this.importFromPostwoman(importFileObj)
}) }
} }
reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0]) reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0])
}, },
importFromPostwoman(environments) {
let confirmation = this.$t("file_imported")
this.$store.commit("postwoman/importAddEnvironments", {
environments,
confirmation,
})
},
importFromPostman(importFileObj) {
let environment = { name: importFileObj.name, variables: [] }
importFileObj.values.forEach(element => environment.variables.push({ key: element.key, value: element.value }));
let environments = [ environment ]
this.importFromPostwoman(environments)
},
exportJSON() { exportJSON() {
let text = this.environmentJson let text = this.environmentJson
text = text.replace(/\n/g, "\r\n") text = text.replace(/\n/g, "\r\n")

28
package-lock.json generated
View File

@@ -1628,9 +1628,19 @@
} }
}, },
"@intlify/vue-i18n-extensions": { "@intlify/vue-i18n-extensions": {
"version": "1.0.1", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/@intlify/vue-i18n-extensions/-/vue-i18n-extensions-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@intlify/vue-i18n-extensions/-/vue-i18n-extensions-1.0.2.tgz",
"integrity": "sha512-vQRvxZ0GUtL5nezXr6wEjASm/cn6dhnFGq6jF33WDug4q8nm5kzn4imglmRjXVfMrCGmfXqbO12afPGgssStxA==" "integrity": "sha512-rnfA0ScyBXyp9xsSD4EAMGeOh1yv/AE7fhqdAdSOr5X8N39azz257umfRtzNT9sHXAKSSzpCVhIbMAkp5c/gjQ==",
"requires": {
"@babel/parser": "^7.9.6"
},
"dependencies": {
"@babel/parser": {
"version": "7.9.6",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz",
"integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q=="
}
}
}, },
"@intlify/vue-i18n-loader": { "@intlify/vue-i18n-loader": {
"version": "1.0.0", "version": "1.0.0",
@@ -9655,9 +9665,9 @@
} }
}, },
"nuxt-i18n": { "nuxt-i18n": {
"version": "6.11.0", "version": "6.11.1",
"resolved": "https://registry.npmjs.org/nuxt-i18n/-/nuxt-i18n-6.11.0.tgz", "resolved": "https://registry.npmjs.org/nuxt-i18n/-/nuxt-i18n-6.11.1.tgz",
"integrity": "sha512-gavslWFIEezY0IUsmNb5GR25jSgWYoH4XKHUkRNGopDvIGA0+xmNx4kpA1BcWTKM9DVDI2BqXfxIROHy0XGtXQ==", "integrity": "sha512-nyr53JhHRoF3Ig6slUaXRALtAUOyGbKonL5AcNXxGkRdHpzF9HJ6mZ13W2wZCf2AiH3XatRYEh6GAmwLAOUj3A==",
"requires": { "requires": {
"@babel/parser": "^7.5.5", "@babel/parser": "^7.5.5",
"@babel/traverse": "^7.5.5", "@babel/traverse": "^7.5.5",
@@ -13943,9 +13953,9 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==" "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog=="
}, },
"vue-i18n": { "vue-i18n": {
"version": "8.17.4", "version": "8.17.5",
"resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.17.4.tgz", "resolved": "https://registry.npmjs.org/vue-i18n/-/vue-i18n-8.17.5.tgz",
"integrity": "sha512-wpk/drIkPf6gHCtvHc8zAZ1nsWBZ+/OOJYtJxqhYD6CKT0FJAG5oypwgF9kABt30FBWhl8NEb/QY+vaaBARlFg==" "integrity": "sha512-gijXwvyTH3aeJhuq8EoQ9SDDlm1mgJexNccSK1ctalxsa6C7ifbWiH7V/YGfm9WJ7udYoD8ezfZdazxxvKvKYw=="
}, },
"vue-loader": { "vue-loader": {
"version": "15.9.1", "version": "15.9.1",

View File

@@ -41,7 +41,7 @@
"graphql": "^14.6.0", "graphql": "^14.6.0",
"graphql-language-service-interface": "^2.3.3", "graphql-language-service-interface": "^2.3.3",
"nuxt": "^2.12.2", "nuxt": "^2.12.2",
"nuxt-i18n": "^6.11.0", "nuxt-i18n": "^6.11.1",
"paho-mqtt": "^1.1.0", "paho-mqtt": "^1.1.0",
"socket.io-client": "^2.3.0", "socket.io-client": "^2.3.0",
"socketio-wildcard": "^2.0.0", "socketio-wildcard": "^2.0.0",

View File

@@ -1936,7 +1936,12 @@ export default {
}) })
} }
if (["POST", "PUT", "PATCH"].includes(this.method)) { if (["POST", "PUT", "PATCH"].includes(this.method)) {
const requestBody = this.rawInput ? this.rawParams : this.rawRequestBody let requestBody = this.rawInput ? this.rawParams : this.rawRequestBody
if (this.contentType.includes("json")) {
requestBody = `JSON.stringify(${requestBody})`
} else if (this.contentType.includes("x-www-form-urlencoded")) {
requestBody = `"${requestBody}"`
}
requestString.push(`xhr.setRequestHeader('Content-Length', ${requestBody.length})`) requestString.push(`xhr.setRequestHeader('Content-Length', ${requestBody.length})`)
requestString.push( requestString.push(
`xhr.setRequestHeader('Content-Type', '${this.contentType}; charset=utf-8')` `xhr.setRequestHeader('Content-Type', '${this.contentType}; charset=utf-8')`
@@ -1960,7 +1965,13 @@ export default {
headers.push(` "Authorization": "Bearer ${this.bearerToken}",\n`) headers.push(` "Authorization": "Bearer ${this.bearerToken}",\n`)
} }
if (["POST", "PUT", "PATCH"].includes(this.method)) { if (["POST", "PUT", "PATCH"].includes(this.method)) {
const requestBody = this.rawInput ? this.rawParams : this.rawRequestBody let requestBody = this.rawInput ? this.rawParams : this.rawRequestBody
if (this.contentType.includes("json")) {
requestBody = `JSON.stringify(${requestBody})`
} else if (this.contentType.includes("x-www-form-urlencoded")) {
requestBody = `"${requestBody}"`
}
requestString.push(` body: ${requestBody},\n`) requestString.push(` body: ${requestBody},\n`)
headers.push(` "Content-Length": ${requestBody.length},\n`) headers.push(` "Content-Length": ${requestBody.length},\n`)
headers.push(` "Content-Type": "${this.contentType}; charset=utf-8",\n`) headers.push(` "Content-Type": "${this.contentType}; charset=utf-8",\n`)