feat: init codegen state
This commit is contained in:
@@ -86,32 +86,46 @@
|
|||||||
</SmartModal>
|
</SmartModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
|
import { defineComponent } from "@nuxtjs/composition-api"
|
||||||
import { codegens } from "~/helpers/codegen/codegen"
|
import { codegens } from "~/helpers/codegen/codegen"
|
||||||
|
import { getRESTRequest } from "~/newstore/RESTSession"
|
||||||
|
import { getEffectiveRESTRequest } from "~/helpers/utils/EffectiveURL"
|
||||||
|
import { getCurrentEnvironment } from "~/newstore/environments"
|
||||||
|
|
||||||
export default {
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
requestCode: { type: String, default: null },
|
|
||||||
requestTypeProp: { type: String, default: "curl" },
|
requestTypeProp: { type: String, default: "curl" },
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
codegens,
|
codegens,
|
||||||
copyIcon: "content_copy",
|
copyIcon: "content_copy",
|
||||||
|
request: getRESTRequest(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
requestType: {
|
requestType: {
|
||||||
get() {
|
get(): string {
|
||||||
return this.requestTypeProp
|
return this.requestTypeProp
|
||||||
},
|
},
|
||||||
set(val) {
|
set(val: string) {
|
||||||
this.$emit("set-request-type", val)
|
this.$emit("set-request-type", val)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
show(goingToShow) {
|
||||||
|
if (goingToShow) {
|
||||||
|
this.request = getRESTRequest()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
requestCode() {
|
||||||
|
return getEffectiveRESTRequest(this.request, getCurrentEnvironment())
|
||||||
|
},
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal")
|
this.$emit("hide-modal")
|
||||||
},
|
},
|
||||||
@@ -119,15 +133,16 @@ export default {
|
|||||||
this.$emit("handle-import")
|
this.$emit("handle-import")
|
||||||
},
|
},
|
||||||
copyRequestCode() {
|
copyRequestCode() {
|
||||||
this.$refs.generatedCode.editor.selectAll()
|
;(this.$refs.generatedCode as any).editor
|
||||||
this.$refs.generatedCode.editor.focus()
|
.selectAll()(this.$refs.generatedCode as any)
|
||||||
|
.editor.focus()
|
||||||
document.execCommand("copy")
|
document.execCommand("copy")
|
||||||
this.copyIcon = "done"
|
this.copyIcon = "done"
|
||||||
this.$toast.success(this.$t("copied_to_clipboard"), {
|
this.$toast.success(this.$t("copied_to_clipboard").toString(), {
|
||||||
icon: "done",
|
icon: "done",
|
||||||
})
|
})
|
||||||
setTimeout(() => (this.copyIcon = "content_copy"), 1000)
|
setTimeout(() => (this.copyIcon = "content_copy"), 1000)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
<template #body>
|
<template #body>
|
||||||
<textarea
|
<textarea
|
||||||
id="import-curl"
|
id="import-curl"
|
||||||
|
v-model="curl"
|
||||||
class="textarea"
|
class="textarea"
|
||||||
autofocus
|
autofocus
|
||||||
rows="8"
|
rows="8"
|
||||||
@@ -24,18 +25,97 @@
|
|||||||
</SmartModal>
|
</SmartModal>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script lang="ts">
|
||||||
export default {
|
import { defineComponent } from "@nuxtjs/composition-api"
|
||||||
|
import parseCurlCommand from "~/helpers/curlparser"
|
||||||
|
import {
|
||||||
|
HoppRESTHeader,
|
||||||
|
HoppRESTParam,
|
||||||
|
makeRESTRequest,
|
||||||
|
} from "~/helpers/types/HoppRESTRequest"
|
||||||
|
import { setRESTRequest } from "~/newstore/RESTSession"
|
||||||
|
|
||||||
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
show: Boolean,
|
show: Boolean,
|
||||||
},
|
},
|
||||||
|
emits: ["hide-modal"],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
curl: "",
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
hideModal() {
|
hideModal() {
|
||||||
this.$emit("hide-modal")
|
this.$emit("hide-modal")
|
||||||
},
|
},
|
||||||
handleImport() {
|
handleImport() {
|
||||||
this.$emit("handle-import")
|
const text = this.curl
|
||||||
|
try {
|
||||||
|
const parsedCurl = parseCurlCommand(text)
|
||||||
|
const { origin, pathname } = new URL(
|
||||||
|
parsedCurl.url.replace(/"/g, "").replace(/'/g, "")
|
||||||
|
)
|
||||||
|
const endpoint = origin + pathname
|
||||||
|
const headers: HoppRESTHeader[] = []
|
||||||
|
const params: HoppRESTParam[] = []
|
||||||
|
if (parsedCurl.query) {
|
||||||
|
for (const key of Object.keys(parsedCurl.query)) {
|
||||||
|
const val = parsedCurl.query[key]!
|
||||||
|
|
||||||
|
if (Array.isArray(val)) {
|
||||||
|
val.forEach((value) => {
|
||||||
|
params.push({
|
||||||
|
key,
|
||||||
|
value,
|
||||||
|
active: true,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
params.push({
|
||||||
|
key,
|
||||||
|
value: val!,
|
||||||
|
active: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (parsedCurl.headers) {
|
||||||
|
for (const key of Object.keys(parsedCurl.headers)) {
|
||||||
|
headers.push({
|
||||||
|
key,
|
||||||
|
value: parsedCurl.headers[key],
|
||||||
|
active: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const method = parsedCurl.method.toUpperCase()
|
||||||
|
// let rawInput = false
|
||||||
|
// let rawParams: any | null = null
|
||||||
|
|
||||||
|
// if (parsedCurl.data) {
|
||||||
|
// rawInput = true
|
||||||
|
// rawParams = parsedCurl.data
|
||||||
|
// }
|
||||||
|
|
||||||
|
this.showCurlImportModal = false
|
||||||
|
|
||||||
|
setRESTRequest(
|
||||||
|
makeRESTRequest({
|
||||||
|
endpoint,
|
||||||
|
method,
|
||||||
|
params,
|
||||||
|
headers,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
} catch (error) {
|
||||||
|
this.showCurlImportModal = false
|
||||||
|
this.$toast.error(this.$t("curl_invalid_format").toString(), {
|
||||||
|
icon: "error",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this.hideModal()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -169,6 +169,14 @@
|
|||||||
</tippy>
|
</tippy>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
<HttpImportCurl
|
||||||
|
:show="showCurlImportModal"
|
||||||
|
@hide-modal="showCurlImportModal = false"
|
||||||
|
/>
|
||||||
|
<HttpCodegenModal
|
||||||
|
:show="showCodegenModal"
|
||||||
|
@hide-modal="showCodegenModal = false"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { HoppRESTHeader, HoppRESTParam } from "../types/HoppRESTRequest"
|
||||||
import { CLibcurlCodegen } from "./generators/c-libcurl"
|
import { CLibcurlCodegen } from "./generators/c-libcurl"
|
||||||
import { CsRestsharpCodegen } from "./generators/cs-restsharp"
|
import { CsRestsharpCodegen } from "./generators/cs-restsharp"
|
||||||
import { CurlCodegen } from "./generators/curl"
|
import { CurlCodegen } from "./generators/curl"
|
||||||
@@ -54,7 +55,30 @@ export const codegens = [
|
|||||||
ShellWgetCodegen,
|
ShellWgetCodegen,
|
||||||
]
|
]
|
||||||
|
|
||||||
export function generateCodeWithGenerator(codegenID, context) {
|
export type HoppCodegenContext = {
|
||||||
|
name: string
|
||||||
|
method: string
|
||||||
|
uri: string
|
||||||
|
url: string
|
||||||
|
pathName: string
|
||||||
|
auth: any // TODO: Change this
|
||||||
|
httpUser: string | null
|
||||||
|
httpPassword: string | null
|
||||||
|
bearerToken: string | null
|
||||||
|
headers: HoppRESTHeader[]
|
||||||
|
params: HoppRESTParam[]
|
||||||
|
bodyParams: any // TODO: Change this
|
||||||
|
rawParams: string | null
|
||||||
|
rawInput: boolean
|
||||||
|
rawRequestBody: any
|
||||||
|
contentType: string
|
||||||
|
queryString: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export function generateCodeWithGenerator(
|
||||||
|
codegenID: string,
|
||||||
|
context: HoppCodegenContext
|
||||||
|
) {
|
||||||
if (codegenID) {
|
if (codegenID) {
|
||||||
const gen = codegens.find(({ id }) => id === codegenID)
|
const gen = codegens.find(({ id }) => id === codegenID)
|
||||||
return gen ? gen.generator(context) : ""
|
return gen ? gen.generator(context) : ""
|
||||||
@@ -8,7 +8,7 @@ import parser from "yargs-parser"
|
|||||||
* output this: 'msg1=value1&msg2=value2'
|
* output this: 'msg1=value1&msg2=value2'
|
||||||
* @param dataArguments
|
* @param dataArguments
|
||||||
*/
|
*/
|
||||||
const joinDataArguments = (dataArguments) => {
|
const joinDataArguments = (dataArguments: string[]) => {
|
||||||
let data = ""
|
let data = ""
|
||||||
dataArguments.forEach((argument, i) => {
|
dataArguments.forEach((argument, i) => {
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
@@ -20,7 +20,49 @@ const joinDataArguments = (dataArguments) => {
|
|||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
|
||||||
const parseCurlCommand = (curlCommand) => {
|
const parseDataFromArguments = (parsedArguments: any) => {
|
||||||
|
if (parsedArguments.data) {
|
||||||
|
return {
|
||||||
|
data: Array.isArray(parsedArguments.data)
|
||||||
|
? joinDataArguments(parsedArguments.data)
|
||||||
|
: parsedArguments.data,
|
||||||
|
dataArray: Array.isArray(parsedArguments.data)
|
||||||
|
? parsedArguments.data
|
||||||
|
: null,
|
||||||
|
isDataBinary: false,
|
||||||
|
}
|
||||||
|
} else if (parsedArguments["data-binary"]) {
|
||||||
|
return {
|
||||||
|
data: Array.isArray(parsedArguments["data-binary"])
|
||||||
|
? joinDataArguments(parsedArguments["data-binary"])
|
||||||
|
: parsedArguments["data-binary"],
|
||||||
|
dataArray: Array.isArray(parsedArguments["data-binary"])
|
||||||
|
? parsedArguments["data-binary"]
|
||||||
|
: null,
|
||||||
|
isDataBinary: true,
|
||||||
|
}
|
||||||
|
} else if (parsedArguments.d) {
|
||||||
|
return {
|
||||||
|
data: Array.isArray(parsedArguments.d)
|
||||||
|
? joinDataArguments(parsedArguments.d)
|
||||||
|
: parsedArguments.d,
|
||||||
|
dataArray: Array.isArray(parsedArguments.d) ? parsedArguments.d : null,
|
||||||
|
isDataBinary: false,
|
||||||
|
}
|
||||||
|
} else if (parsedArguments["data-ascii"]) {
|
||||||
|
return {
|
||||||
|
data: Array.isArray(parsedArguments["data-ascii"])
|
||||||
|
? joinDataArguments(parsedArguments["data-ascii"])
|
||||||
|
: parsedArguments["data-ascii"],
|
||||||
|
dataArray: Array.isArray(parsedArguments["data-ascii"])
|
||||||
|
? parsedArguments["data-ascii"]
|
||||||
|
: null,
|
||||||
|
isDataBinary: false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const parseCurlCommand = (curlCommand: string) => {
|
||||||
const newlineFound = /\\/gi.test(curlCommand)
|
const newlineFound = /\\/gi.test(curlCommand)
|
||||||
if (newlineFound) {
|
if (newlineFound) {
|
||||||
// remove '\' and newlines
|
// remove '\' and newlines
|
||||||
@@ -47,9 +89,9 @@ const parseCurlCommand = (curlCommand) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let headers
|
let headers: any
|
||||||
|
|
||||||
const parseHeaders = (headerFieldName) => {
|
const parseHeaders = (headerFieldName: string) => {
|
||||||
if (parsedArguments[headerFieldName]) {
|
if (parsedArguments[headerFieldName]) {
|
||||||
if (!headers) {
|
if (!headers) {
|
||||||
headers = {}
|
headers = {}
|
||||||
@@ -57,7 +99,7 @@ const parseCurlCommand = (curlCommand) => {
|
|||||||
if (!Array.isArray(parsedArguments[headerFieldName])) {
|
if (!Array.isArray(parsedArguments[headerFieldName])) {
|
||||||
parsedArguments[headerFieldName] = [parsedArguments[headerFieldName]]
|
parsedArguments[headerFieldName] = [parsedArguments[headerFieldName]]
|
||||||
}
|
}
|
||||||
parsedArguments[headerFieldName].forEach((header) => {
|
parsedArguments[headerFieldName].forEach((header: string) => {
|
||||||
if (header.includes("Cookie")) {
|
if (header.includes("Cookie")) {
|
||||||
// stupid javascript tricks: closure
|
// stupid javascript tricks: closure
|
||||||
cookieString = header
|
cookieString = header
|
||||||
@@ -91,13 +133,12 @@ const parseCurlCommand = (curlCommand) => {
|
|||||||
if (parsedArguments.cookie) {
|
if (parsedArguments.cookie) {
|
||||||
cookieString = parsedArguments.cookie
|
cookieString = parsedArguments.cookie
|
||||||
}
|
}
|
||||||
let multipartUploads
|
const multipartUploads: Record<string, string> = {}
|
||||||
if (parsedArguments.F) {
|
if (parsedArguments.F) {
|
||||||
multipartUploads = {}
|
|
||||||
if (!Array.isArray(parsedArguments.F)) {
|
if (!Array.isArray(parsedArguments.F)) {
|
||||||
parsedArguments.F = [parsedArguments.F]
|
parsedArguments.F = [parsedArguments.F]
|
||||||
}
|
}
|
||||||
parsedArguments.F.forEach((multipartArgument) => {
|
parsedArguments.F.forEach((multipartArgument: string) => {
|
||||||
// input looks like key=value. value could be json or a file path prepended with an @
|
// input looks like key=value. value could be json or a file path prepended with an @
|
||||||
const [key, value] = multipartArgument.split("=", 2)
|
const [key, value] = multipartArgument.split("=", 2)
|
||||||
multipartUploads[key] = value
|
multipartUploads[key] = value
|
||||||
@@ -105,7 +146,7 @@ const parseCurlCommand = (curlCommand) => {
|
|||||||
}
|
}
|
||||||
if (cookieString) {
|
if (cookieString) {
|
||||||
const cookieParseOptions = {
|
const cookieParseOptions = {
|
||||||
decode: (s) => s,
|
decode: (s: any) => s,
|
||||||
}
|
}
|
||||||
// separate out cookie headers into separate data structure
|
// separate out cookie headers into separate data structure
|
||||||
// note: cookie is case insensitive
|
// note: cookie is case insensitive
|
||||||
@@ -169,7 +210,7 @@ const parseCurlCommand = (curlCommand) => {
|
|||||||
delete parsedArguments[option]
|
delete parsedArguments[option]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const query = querystring.parse(urlObject.query, null, null, {
|
const query = querystring.parse(urlObject.query!, null as any, null as any, {
|
||||||
maxKeys: 10000,
|
maxKeys: 10000,
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -177,51 +218,18 @@ const parseCurlCommand = (curlCommand) => {
|
|||||||
const request = {
|
const request = {
|
||||||
url,
|
url,
|
||||||
urlWithoutQuery: URL.format(urlObject),
|
urlWithoutQuery: URL.format(urlObject),
|
||||||
}
|
compressed,
|
||||||
if (compressed) {
|
query,
|
||||||
request.compressed = true
|
headers,
|
||||||
|
method,
|
||||||
|
cookies,
|
||||||
|
cookieString: cookieString?.replace("Cookie: ", ""),
|
||||||
|
multipartUploads,
|
||||||
|
...parseDataFromArguments(parsedArguments),
|
||||||
|
auth: parsedArguments.u,
|
||||||
|
user: parsedArguments.user,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Object.keys(query).length > 0) {
|
|
||||||
request.query = query
|
|
||||||
}
|
|
||||||
if (headers) {
|
|
||||||
request.headers = headers
|
|
||||||
}
|
|
||||||
request.method = method
|
|
||||||
|
|
||||||
if (cookies) {
|
|
||||||
request.cookies = cookies
|
|
||||||
request.cookieString = cookieString.replace("Cookie: ", "")
|
|
||||||
}
|
|
||||||
if (multipartUploads) {
|
|
||||||
request.multipartUploads = multipartUploads
|
|
||||||
}
|
|
||||||
if (parsedArguments.data) {
|
|
||||||
request.data = parsedArguments.data
|
|
||||||
} else if (parsedArguments["data-binary"]) {
|
|
||||||
request.data = parsedArguments["data-binary"]
|
|
||||||
request.isDataBinary = true
|
|
||||||
} else if (parsedArguments.d) {
|
|
||||||
request.data = parsedArguments.d
|
|
||||||
} else if (parsedArguments["data-ascii"]) {
|
|
||||||
request.data = parsedArguments["data-ascii"]
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parsedArguments.u) {
|
|
||||||
request.auth = parsedArguments.u
|
|
||||||
}
|
|
||||||
if (parsedArguments.user) {
|
|
||||||
request.auth = parsedArguments.user
|
|
||||||
}
|
|
||||||
if (Array.isArray(request.data)) {
|
|
||||||
request.dataArray = request.data
|
|
||||||
request.data = joinDataArguments(request.data)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parsedArguments.k || parsedArguments.insecure) {
|
|
||||||
request.insecure = true
|
|
||||||
}
|
|
||||||
return request
|
return request
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,6 +21,15 @@ export interface HoppRESTRequest {
|
|||||||
headers: HoppRESTHeader[]
|
headers: HoppRESTHeader[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function makeRESTRequest(
|
||||||
|
x: Omit<HoppRESTRequest, "v">
|
||||||
|
): HoppRESTRequest {
|
||||||
|
return {
|
||||||
|
...x,
|
||||||
|
v: RESTReqSchemaVersion,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function isHoppRESTRequest(x: any): x is HoppRESTRequest {
|
export function isHoppRESTRequest(x: any): x is HoppRESTRequest {
|
||||||
return x && typeof x === "object" && "v" in x
|
return x && typeof x === "object" && "v" in x
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,30 @@ export interface EffectiveHoppRESTRequest extends HoppRESTRequest {
|
|||||||
effectiveFinalHeaders: { key: string; value: string }[]
|
effectiveFinalHeaders: { key: string; value: string }[]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outputs an executable request format with environment variables applied
|
||||||
|
*
|
||||||
|
* @param request The request to source from
|
||||||
|
* @param environment The environment to apply
|
||||||
|
*
|
||||||
|
* @returns An object with extra fields defining a complete request
|
||||||
|
*/
|
||||||
|
export function getEffectiveRESTRequest(
|
||||||
|
request: HoppRESTRequest,
|
||||||
|
_environment: Environment
|
||||||
|
) {
|
||||||
|
// TODO: Change this
|
||||||
|
return {
|
||||||
|
...request,
|
||||||
|
effectiveFinalURL: request.endpoint,
|
||||||
|
effectiveFinalHeaders: request.headers.filter(
|
||||||
|
(x) =>
|
||||||
|
x.key !== "" && // Remove empty keys
|
||||||
|
x.active // Only active
|
||||||
|
),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an Observable Stream that emits HoppRESTRequests whenever
|
* Creates an Observable Stream that emits HoppRESTRequests whenever
|
||||||
* the input streams emit a value
|
* the input streams emit a value
|
||||||
@@ -27,17 +51,8 @@ export function getEffectiveRESTRequestStream(
|
|||||||
environment$: Observable<Environment>
|
environment$: Observable<Environment>
|
||||||
): Observable<EffectiveHoppRESTRequest> {
|
): Observable<EffectiveHoppRESTRequest> {
|
||||||
return combineLatest([request$, environment$]).pipe(
|
return combineLatest([request$, environment$]).pipe(
|
||||||
map(([request, _env]) => {
|
map(([request, env]) => {
|
||||||
// TODO: Change this
|
return getEffectiveRESTRequest(request, env)
|
||||||
return {
|
|
||||||
...request,
|
|
||||||
effectiveFinalURL: request.endpoint,
|
|
||||||
effectiveFinalHeaders: request.headers.filter(
|
|
||||||
(x) =>
|
|
||||||
x.key !== "" && // Remove empty keys
|
|
||||||
x.active // Only active
|
|
||||||
),
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -304,6 +304,10 @@ const dispatchers = defineDispatchers({
|
|||||||
|
|
||||||
const restSessionStore = new DispatchingStore(defaultRESTSession, dispatchers)
|
const restSessionStore = new DispatchingStore(defaultRESTSession, dispatchers)
|
||||||
|
|
||||||
|
export function getRESTRequest() {
|
||||||
|
return restSessionStore.subject$.value.request
|
||||||
|
}
|
||||||
|
|
||||||
export function setRESTRequest(req: HoppRESTRequest) {
|
export function setRESTRequest(req: HoppRESTRequest) {
|
||||||
restSessionStore.dispatch({
|
restSessionStore.dispatch({
|
||||||
dispatcher: "setRequest",
|
dispatcher: "setRequest",
|
||||||
|
|||||||
@@ -127,6 +127,8 @@ export default {
|
|||||||
"@nuxt/typescript-build",
|
"@nuxt/typescript-build",
|
||||||
// https://github.com/nuxt-community/dotenv-module
|
// https://github.com/nuxt-community/dotenv-module
|
||||||
"@nuxtjs/dotenv",
|
"@nuxtjs/dotenv",
|
||||||
|
// https://github.com/nuxt-community/composition-api
|
||||||
|
"@nuxtjs/composition-api/module",
|
||||||
],
|
],
|
||||||
|
|
||||||
// Modules (https://go.nuxtjs.dev/config-modules)
|
// Modules (https://go.nuxtjs.dev/config-modules)
|
||||||
|
|||||||
166
package-lock.json
generated
166
package-lock.json
generated
@@ -9,6 +9,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.21",
|
"@apollo/client": "^3.3.21",
|
||||||
"@nuxtjs/axios": "^5.13.6",
|
"@nuxtjs/axios": "^5.13.6",
|
||||||
|
"@nuxtjs/composition-api": "^0.24.7",
|
||||||
"@nuxtjs/gtm": "^2.4.0",
|
"@nuxtjs/gtm": "^2.4.0",
|
||||||
"@nuxtjs/robots": "^2.5.0",
|
"@nuxtjs/robots": "^2.5.0",
|
||||||
"@nuxtjs/sitemap": "^2.4.0",
|
"@nuxtjs/sitemap": "^2.4.0",
|
||||||
@@ -63,6 +64,7 @@
|
|||||||
"@nuxtjs/stylelint-module": "^4.0.0",
|
"@nuxtjs/stylelint-module": "^4.0.0",
|
||||||
"@nuxtjs/svg": "^0.1.12",
|
"@nuxtjs/svg": "^0.1.12",
|
||||||
"@testing-library/jest-dom": "^5.14.1",
|
"@testing-library/jest-dom": "^5.14.1",
|
||||||
|
"@types/cookie": "^0.4.1",
|
||||||
"@types/lodash": "^4.14.171",
|
"@types/lodash": "^4.14.171",
|
||||||
"@vue/test-utils": "^1.2.1",
|
"@vue/test-utils": "^1.2.1",
|
||||||
"babel-core": "^7.0.0-bridge.0",
|
"babel-core": "^7.0.0-bridge.0",
|
||||||
@@ -5338,6 +5340,63 @@
|
|||||||
"integrity": "sha512-VHg73EDeRXlu7oYWRmmrNp/nl7QkdXUxkQQKig0Zk8daNmm84AbGoC8Be6/VVLJEKxn12hR0UBmz8O+xQiAPKQ==",
|
"integrity": "sha512-VHg73EDeRXlu7oYWRmmrNp/nl7QkdXUxkQQKig0Zk8daNmm84AbGoC8Be6/VVLJEKxn12hR0UBmz8O+xQiAPKQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/@nuxtjs/composition-api": {
|
||||||
|
"version": "0.24.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@nuxtjs/composition-api/-/composition-api-0.24.7.tgz",
|
||||||
|
"integrity": "sha512-q633RvsCi3veuGzTSkP/+a55Fn9EZS1APV2GJrdjajnBKKOMNPIXlAC8xAWGcsHE73/Cgf9DfGURQhcFvERRJA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@vue/composition-api": "1.0.0-rc.14",
|
||||||
|
"defu": "^5.0.0",
|
||||||
|
"estree-walker": "^2.0.2",
|
||||||
|
"fs-extra": "^9.1.0",
|
||||||
|
"magic-string": "^0.25.7",
|
||||||
|
"ufo": "^0.7.7",
|
||||||
|
"upath": "^2.0.1"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@nuxt/vue-app": "^2.15",
|
||||||
|
"nuxt": "^2.15",
|
||||||
|
"vue": "^2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@nuxtjs/composition-api/node_modules/defu": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/defu/-/defu-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-VHg73EDeRXlu7oYWRmmrNp/nl7QkdXUxkQQKig0Zk8daNmm84AbGoC8Be6/VVLJEKxn12hR0UBmz8O+xQiAPKQ=="
|
||||||
|
},
|
||||||
|
"node_modules/@nuxtjs/composition-api/node_modules/fs-extra": {
|
||||||
|
"version": "9.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
|
||||||
|
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"at-least-node": "^1.0.0",
|
||||||
|
"graceful-fs": "^4.2.0",
|
||||||
|
"jsonfile": "^6.0.1",
|
||||||
|
"universalify": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@nuxtjs/composition-api/node_modules/jsonfile": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"universalify": "^2.0.0"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"graceful-fs": "^4.1.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@nuxtjs/composition-api/node_modules/universalify": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 10.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@nuxtjs/dotenv": {
|
"node_modules/@nuxtjs/dotenv": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxtjs/dotenv/-/dotenv-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxtjs/dotenv/-/dotenv-1.4.1.tgz",
|
||||||
@@ -6961,6 +7020,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.3.tgz",
|
||||||
"integrity": "sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg=="
|
"integrity": "sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg=="
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/cookie": {
|
||||||
|
"version": "0.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz",
|
||||||
|
"integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"node_modules/@types/cookies": {
|
"node_modules/@types/cookies": {
|
||||||
"version": "0.7.6",
|
"version": "0.7.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.6.tgz",
|
||||||
@@ -7778,6 +7843,22 @@
|
|||||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
|
||||||
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
|
"integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI="
|
||||||
},
|
},
|
||||||
|
"node_modules/@vue/composition-api": {
|
||||||
|
"version": "1.0.0-rc.14",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.0.0-rc.14.tgz",
|
||||||
|
"integrity": "sha512-WKbOiy1zk8loM7ma88fOH0yacOEfMIQb0IZJEq561A+4C8GvLSqVSLT5K1iBVkzzJ07Pha8ntbeWSUQlBhRDKg==",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.3.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"vue": ">= 2.5 < 3"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@vue/composition-api/node_modules/tslib": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
|
||||||
|
},
|
||||||
"node_modules/@vue/test-utils": {
|
"node_modules/@vue/test-utils": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-1.2.1.tgz",
|
||||||
@@ -14312,6 +14393,11 @@
|
|||||||
"node": ">=4.0"
|
"node": ">=4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/estree-walker": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||||
|
},
|
||||||
"node_modules/esutils": {
|
"node_modules/esutils": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||||
@@ -21046,7 +21132,6 @@
|
|||||||
"version": "0.25.7",
|
"version": "0.25.7",
|
||||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
|
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
|
||||||
"integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
|
"integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"sourcemap-codec": "^1.4.4"
|
"sourcemap-codec": "^1.4.4"
|
||||||
}
|
}
|
||||||
@@ -26450,8 +26535,7 @@
|
|||||||
"node_modules/sourcemap-codec": {
|
"node_modules/sourcemap-codec": {
|
||||||
"version": "1.4.8",
|
"version": "1.4.8",
|
||||||
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
|
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
|
||||||
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
|
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node_modules/spdx-correct": {
|
"node_modules/spdx-correct": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
@@ -35864,6 +35948,52 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@nuxtjs/composition-api": {
|
||||||
|
"version": "0.24.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@nuxtjs/composition-api/-/composition-api-0.24.7.tgz",
|
||||||
|
"integrity": "sha512-q633RvsCi3veuGzTSkP/+a55Fn9EZS1APV2GJrdjajnBKKOMNPIXlAC8xAWGcsHE73/Cgf9DfGURQhcFvERRJA==",
|
||||||
|
"requires": {
|
||||||
|
"@vue/composition-api": "1.0.0-rc.14",
|
||||||
|
"defu": "^5.0.0",
|
||||||
|
"estree-walker": "^2.0.2",
|
||||||
|
"fs-extra": "^9.1.0",
|
||||||
|
"magic-string": "^0.25.7",
|
||||||
|
"ufo": "^0.7.7",
|
||||||
|
"upath": "^2.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"defu": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/defu/-/defu-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-VHg73EDeRXlu7oYWRmmrNp/nl7QkdXUxkQQKig0Zk8daNmm84AbGoC8Be6/VVLJEKxn12hR0UBmz8O+xQiAPKQ=="
|
||||||
|
},
|
||||||
|
"fs-extra": {
|
||||||
|
"version": "9.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
|
||||||
|
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
|
||||||
|
"requires": {
|
||||||
|
"at-least-node": "^1.0.0",
|
||||||
|
"graceful-fs": "^4.2.0",
|
||||||
|
"jsonfile": "^6.0.1",
|
||||||
|
"universalify": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"jsonfile": {
|
||||||
|
"version": "6.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||||
|
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "^4.1.6",
|
||||||
|
"universalify": "^2.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"universalify": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@nuxtjs/dotenv": {
|
"@nuxtjs/dotenv": {
|
||||||
"version": "1.4.1",
|
"version": "1.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@nuxtjs/dotenv/-/dotenv-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/@nuxtjs/dotenv/-/dotenv-1.4.1.tgz",
|
||||||
@@ -37241,6 +37371,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/content-disposition/-/content-disposition-0.5.3.tgz",
|
||||||
"integrity": "sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg=="
|
"integrity": "sha512-P1bffQfhD3O4LW0ioENXUhZ9OIa0Zn+P7M+pWgkCKaT53wVLSq0mrKksCID/FGHpFhRSxRGhgrQmfhRuzwtKdg=="
|
||||||
},
|
},
|
||||||
|
"@types/cookie": {
|
||||||
|
"version": "0.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz",
|
||||||
|
"integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"@types/cookies": {
|
"@types/cookies": {
|
||||||
"version": "0.7.6",
|
"version": "0.7.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/cookies/-/cookies-0.7.6.tgz",
|
||||||
@@ -38024,6 +38160,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@vue/composition-api": {
|
||||||
|
"version": "1.0.0-rc.14",
|
||||||
|
"resolved": "https://registry.npmjs.org/@vue/composition-api/-/composition-api-1.0.0-rc.14.tgz",
|
||||||
|
"integrity": "sha512-WKbOiy1zk8loM7ma88fOH0yacOEfMIQb0IZJEq561A+4C8GvLSqVSLT5K1iBVkzzJ07Pha8ntbeWSUQlBhRDKg==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^2.3.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@vue/test-utils": {
|
"@vue/test-utils": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@vue/test-utils/-/test-utils-1.2.1.tgz",
|
||||||
@@ -43602,6 +43753,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
|
||||||
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw=="
|
"integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw=="
|
||||||
},
|
},
|
||||||
|
"estree-walker": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||||
|
},
|
||||||
"esutils": {
|
"esutils": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
||||||
@@ -49143,7 +49299,6 @@
|
|||||||
"version": "0.25.7",
|
"version": "0.25.7",
|
||||||
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
|
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz",
|
||||||
"integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
|
"integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"sourcemap-codec": "^1.4.4"
|
"sourcemap-codec": "^1.4.4"
|
||||||
}
|
}
|
||||||
@@ -53676,8 +53831,7 @@
|
|||||||
"sourcemap-codec": {
|
"sourcemap-codec": {
|
||||||
"version": "1.4.8",
|
"version": "1.4.8",
|
||||||
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
|
"resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
|
||||||
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
|
"integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"spdx-correct": {
|
"spdx-correct": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.21",
|
"@apollo/client": "^3.3.21",
|
||||||
"@nuxtjs/axios": "^5.13.6",
|
"@nuxtjs/axios": "^5.13.6",
|
||||||
|
"@nuxtjs/composition-api": "^0.24.7",
|
||||||
"@nuxtjs/gtm": "^2.4.0",
|
"@nuxtjs/gtm": "^2.4.0",
|
||||||
"@nuxtjs/robots": "^2.5.0",
|
"@nuxtjs/robots": "^2.5.0",
|
||||||
"@nuxtjs/sitemap": "^2.4.0",
|
"@nuxtjs/sitemap": "^2.4.0",
|
||||||
@@ -79,6 +80,7 @@
|
|||||||
"@nuxtjs/stylelint-module": "^4.0.0",
|
"@nuxtjs/stylelint-module": "^4.0.0",
|
||||||
"@nuxtjs/svg": "^0.1.12",
|
"@nuxtjs/svg": "^0.1.12",
|
||||||
"@testing-library/jest-dom": "^5.14.1",
|
"@testing-library/jest-dom": "^5.14.1",
|
||||||
|
"@types/cookie": "^0.4.1",
|
||||||
"@types/lodash": "^4.14.171",
|
"@types/lodash": "^4.14.171",
|
||||||
"@vue/test-utils": "^1.2.1",
|
"@vue/test-utils": "^1.2.1",
|
||||||
"babel-core": "^7.0.0-bridge.0",
|
"babel-core": "^7.0.0-bridge.0",
|
||||||
|
|||||||
@@ -448,20 +448,6 @@
|
|||||||
:editing-request="editRequest"
|
:editing-request="editRequest"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<HttpImportCurl
|
|
||||||
:show="showCurlImportModal"
|
|
||||||
@hide-modal="showCurlImportModal = false"
|
|
||||||
@handle-import="handleImport"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<HttpCodegenModal
|
|
||||||
:show="showCodegenModal"
|
|
||||||
:requestTypeProp="requestType"
|
|
||||||
:requestCode="requestCode"
|
|
||||||
@hide-modal="showCodegenModal = false"
|
|
||||||
@set-request-type="setRequestType"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<HttpTokenList
|
<HttpTokenList
|
||||||
:show="showTokenListModal"
|
:show="showTokenListModal"
|
||||||
:tokens="tokens"
|
:tokens="tokens"
|
||||||
@@ -556,7 +542,6 @@ import "splitpanes/dist/splitpanes.css"
|
|||||||
|
|
||||||
import url from "url"
|
import url from "url"
|
||||||
import querystring from "querystring"
|
import querystring from "querystring"
|
||||||
import parseCurlCommand from "~/helpers/curlparser"
|
|
||||||
import getEnvironmentVariablesFromScript from "~/helpers/preRequest"
|
import getEnvironmentVariablesFromScript from "~/helpers/preRequest"
|
||||||
import runTestScriptWithVariables from "~/helpers/postwomanTesting"
|
import runTestScriptWithVariables from "~/helpers/postwomanTesting"
|
||||||
import parseTemplateString from "~/helpers/templating"
|
import parseTemplateString from "~/helpers/templating"
|
||||||
@@ -1065,41 +1050,6 @@ export default {
|
|||||||
.join("&")
|
.join("&")
|
||||||
return result === "" ? "" : `?${result}`
|
return result === "" ? "" : `?${result}`
|
||||||
},
|
},
|
||||||
requestCode() {
|
|
||||||
let headers = []
|
|
||||||
if (this.preRequestScript || hasPathParams(this.params)) {
|
|
||||||
let environmentVariables = getEnvironmentVariablesFromScript(
|
|
||||||
this.preRequestScript
|
|
||||||
)
|
|
||||||
environmentVariables = addPathParamsToVariables(
|
|
||||||
this.params,
|
|
||||||
environmentVariables
|
|
||||||
)
|
|
||||||
for (let k of this.headers.filter((item) =>
|
|
||||||
item.hasOwnProperty("active") ? item.active == true : true
|
|
||||||
)) {
|
|
||||||
const kParsed = parseTemplateString(k.key, environmentVariables)
|
|
||||||
const valParsed = parseTemplateString(k.value, environmentVariables)
|
|
||||||
headers.push({ key: kParsed, value: valParsed })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return generateCodeWithGenerator(this.requestType, {
|
|
||||||
auth: this.auth,
|
|
||||||
method: this.method,
|
|
||||||
url: this.url,
|
|
||||||
pathName: this.pathName,
|
|
||||||
queryString: this.queryString,
|
|
||||||
httpUser: this.httpUser,
|
|
||||||
httpPassword: this.httpPassword,
|
|
||||||
bearerToken: this.bearerToken,
|
|
||||||
headers,
|
|
||||||
rawInput: this.rawInput,
|
|
||||||
rawParams: this.rawParams,
|
|
||||||
rawRequestBody: this.rawRequestBody,
|
|
||||||
contentType: this.contentType,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
tokenReqDetails() {
|
tokenReqDetails() {
|
||||||
const details = {
|
const details = {
|
||||||
oidcDiscoveryUrl: this.oidcDiscoveryUrl,
|
oidcDiscoveryUrl: this.oidcDiscoveryUrl,
|
||||||
@@ -1593,48 +1543,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleImport() {
|
|
||||||
const { value: text } = document.getElementById("import-curl")
|
|
||||||
try {
|
|
||||||
const parsedCurl = parseCurlCommand(text)
|
|
||||||
const { origin, pathname } = new URL(
|
|
||||||
parsedCurl.url.replace(/"/g, "").replace(/'/g, "")
|
|
||||||
)
|
|
||||||
this.url = origin
|
|
||||||
this.path = pathname
|
|
||||||
this.uri = this.url + this.path
|
|
||||||
this.headers = []
|
|
||||||
if (parsedCurl.query) {
|
|
||||||
for (const key of Object.keys(parsedCurl.query)) {
|
|
||||||
this.$store.commit("addParams", {
|
|
||||||
key,
|
|
||||||
value: parsedCurl.query[key],
|
|
||||||
type: "query",
|
|
||||||
active: true,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (parsedCurl.headers) {
|
|
||||||
for (const key of Object.keys(parsedCurl.headers)) {
|
|
||||||
this.$store.commit("addHeaders", {
|
|
||||||
key,
|
|
||||||
value: parsedCurl.headers[key],
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.method = parsedCurl.method.toUpperCase()
|
|
||||||
if (parsedCurl["data"]) {
|
|
||||||
this.rawInput = true
|
|
||||||
this.rawParams = parsedCurl["data"]
|
|
||||||
}
|
|
||||||
this.showCurlImportModal = false
|
|
||||||
} catch (error) {
|
|
||||||
this.showCurlImportModal = false
|
|
||||||
this.$toast.error(this.$t("curl_invalid_format"), {
|
|
||||||
icon: "error",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
switchVisibility() {
|
switchVisibility() {
|
||||||
this.passwordFieldType =
|
this.passwordFieldType =
|
||||||
this.passwordFieldType === "password" ? "text" : "password"
|
this.passwordFieldType === "password" ? "text" : "password"
|
||||||
|
|||||||
Reference in New Issue
Block a user