@scalar/pre-post-request-scripts 0.3.18 → 0.4.1
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/CHANGELOG.md +8 -0
- package/dist/components/ScriptEditor.vue.d.ts.map +1 -0
- package/dist/components/ScriptEditor.vue.js +7 -0
- package/dist/components/ScriptEditor.vue.js.map +1 -0
- package/dist/{plugins/post-response-scripts/components/PostResponseScripts → components}/ScriptEditor.vue.script.js +1 -1
- package/dist/components/ScriptEditor.vue.script.js.map +1 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/libs/execute-scripts/build-sandbox-context.d.ts +15 -0
- package/dist/libs/execute-scripts/build-sandbox-context.d.ts.map +1 -0
- package/dist/libs/execute-scripts/build-sandbox-context.js +29 -0
- package/dist/libs/execute-scripts/build-sandbox-context.js.map +1 -0
- package/dist/libs/execute-scripts/execute-post-response-script.d.ts +3 -0
- package/dist/libs/execute-scripts/execute-post-response-script.d.ts.map +1 -1
- package/dist/libs/execute-scripts/execute-post-response-script.js +9 -4
- package/dist/libs/execute-scripts/execute-post-response-script.js.map +1 -1
- package/dist/libs/execute-scripts/execute-pre-request-script.d.ts +14 -0
- package/dist/libs/execute-scripts/execute-pre-request-script.d.ts.map +1 -0
- package/dist/libs/execute-scripts/execute-pre-request-script.js +26 -0
- package/dist/libs/execute-scripts/execute-pre-request-script.js.map +1 -0
- package/dist/libs/execute-scripts/index.d.ts +1 -0
- package/dist/libs/execute-scripts/index.d.ts.map +1 -1
- package/dist/libs/execute-scripts/postman-adapter/request-factory-adapter.d.ts +16 -0
- package/dist/libs/execute-scripts/postman-adapter/request-factory-adapter.d.ts.map +1 -0
- package/dist/libs/execute-scripts/postman-adapter/request-factory-adapter.js +95 -0
- package/dist/libs/execute-scripts/postman-adapter/request-factory-adapter.js.map +1 -0
- package/dist/libs/execute-scripts/postman-adapter/sandbox-adapter.d.ts +16 -0
- package/dist/libs/execute-scripts/postman-adapter/sandbox-adapter.d.ts.map +1 -0
- package/dist/libs/execute-scripts/{postman-sandbox-adapter.js → postman-adapter/sandbox-adapter.js} +43 -8
- package/dist/libs/execute-scripts/postman-adapter/sandbox-adapter.js.map +1 -0
- package/dist/libs/execute-scripts/variables-store.d.ts +22 -0
- package/dist/libs/execute-scripts/variables-store.d.ts.map +1 -0
- package/dist/libs/execute-scripts/variables-store.js +36 -0
- package/dist/libs/execute-scripts/variables-store.js.map +1 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +2 -0
- package/dist/plugins/request-scripts/components/ExampleScripts.vue.d.ts.map +1 -0
- package/dist/plugins/{post-response-scripts/components/PostResponseScripts → request-scripts/components}/ExampleScripts.vue.js +1 -1
- package/dist/plugins/request-scripts/components/ExampleScripts.vue.js.map +1 -0
- package/dist/plugins/{post-response-scripts/components/PostResponseScripts → request-scripts/components}/ExampleScripts.vue.script.js +2 -2
- package/dist/plugins/request-scripts/components/ExampleScripts.vue.script.js.map +1 -0
- package/dist/plugins/{post-response-scripts/components/PostResponseScripts/PostResponseScripts.vue.d.ts → request-scripts/components/ScriptsSection.vue.d.ts} +3 -3
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.d.ts.map +1 -0
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.js +7 -0
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.js.map +1 -0
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.script.js +59 -0
- package/dist/plugins/request-scripts/components/ScriptsSection.vue.script.js.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResultIndicator.vue.d.ts +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResultIndicator.vue.d.ts.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResultIndicator.vue.js +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResultIndicator.vue.js.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResultIndicator.vue.script.js +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResultIndicator.vue.script.js.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResultItem.vue.d.ts +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResultItem.vue.d.ts.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResultItem.vue.js +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResultItem.vue.js.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResultItem.vue.script.js +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResultItem.vue.script.js.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResults.vue.d.ts +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResults.vue.d.ts.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResults.vue.js +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResults.vue.js.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestResults.vue.script.js +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestResults.vue.script.js.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestSummary.vue.d.ts +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestSummary.vue.d.ts.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestSummary.vue.js +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestSummary.vue.js.map +1 -0
- package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/TestSummary.vue.script.js +1 -1
- package/dist/plugins/request-scripts/components/TestResults/TestSummary.vue.script.js.map +1 -0
- package/dist/plugins/request-scripts/components/TestResults/index.d.ts.map +1 -0
- package/dist/plugins/request-scripts/request-scripts-plugin.d.ts +13 -0
- package/dist/plugins/request-scripts/request-scripts-plugin.d.ts.map +1 -0
- package/dist/plugins/request-scripts/request-scripts-plugin.js +55 -0
- package/dist/plugins/request-scripts/request-scripts-plugin.js.map +1 -0
- package/package.json +12 -25
- package/dist/_virtual/_plugin-vue_export-helper.js +0 -8
- package/dist/libs/execute-scripts/index.js +0 -2
- package/dist/libs/execute-scripts/postman-sandbox-adapter.d.ts +0 -9
- package/dist/libs/execute-scripts/postman-sandbox-adapter.d.ts.map +0 -1
- package/dist/libs/execute-scripts/postman-sandbox-adapter.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/ExampleScripts.vue.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/ExampleScripts.vue.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/ExampleScripts.vue.script.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/PostResponseScripts.vue.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/PostResponseScripts.vue.js +0 -7
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/PostResponseScripts.vue.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/PostResponseScripts.vue.script.js +0 -49
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/PostResponseScripts.vue.script.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue.js +0 -9
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue.script.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/index.d.ts +0 -2
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/index.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/PostResponseScripts/index.js +0 -2
- package/dist/plugins/post-response-scripts/components/TestResults/TestResultIndicator.vue.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestResultIndicator.vue.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestResultIndicator.vue.script.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestResultItem.vue.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestResultItem.vue.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestResultItem.vue.script.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestResults.vue.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestResults.vue.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestResults.vue.script.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestSummary.vue.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestSummary.vue.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/TestSummary.vue.script.js.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/index.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/components/TestResults/index.js +0 -2
- package/dist/plugins/post-response-scripts/index.d.ts +0 -2
- package/dist/plugins/post-response-scripts/index.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/index.js +0 -2
- package/dist/plugins/post-response-scripts/post-response-scripts-plugin.d.ts +0 -6
- package/dist/plugins/post-response-scripts/post-response-scripts-plugin.d.ts.map +0 -1
- package/dist/plugins/post-response-scripts/post-response-scripts-plugin.js +0 -61
- package/dist/plugins/post-response-scripts/post-response-scripts-plugin.js.map +0 -1
- package/dist/style.css +0 -64
- /package/dist/{plugins/post-response-scripts/components/PostResponseScripts → components}/ScriptEditor.vue.d.ts +0 -0
- /package/dist/plugins/{post-response-scripts/components/PostResponseScripts → request-scripts/components}/ExampleScripts.vue.d.ts +0 -0
- /package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/index.d.ts +0 -0
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import ViewLayoutCollapse_default from "../../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
|
|
2
|
-
import ExampleScripts_default from "./ExampleScripts.vue.js";
|
|
3
|
-
import ScriptEditor_default from "./ScriptEditor.vue.js";
|
|
4
|
-
import { computed, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, openBlock, unref, withCtx } from "vue";
|
|
5
|
-
//#region src/plugins/post-response-scripts/components/PostResponseScripts/PostResponseScripts.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var _hoisted_1 = { class: "w-full" };
|
|
7
|
-
var _hoisted_2 = { class: "mr-2" };
|
|
8
|
-
var _hoisted_3 = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "bg-green h-2 w-2 rounded-full"
|
|
11
|
-
};
|
|
12
|
-
var _hoisted_4 = { class: "border-y p-3" };
|
|
13
|
-
var PostResponseScripts_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
|
|
14
|
-
__name: "PostResponseScripts",
|
|
15
|
-
props: { operation: {} },
|
|
16
|
-
emits: ["operation:update:extension"],
|
|
17
|
-
setup(__props, { emit: __emit }) {
|
|
18
|
-
const emit = __emit;
|
|
19
|
-
const script = computed(() => __props.operation["x-post-response"] || "");
|
|
20
|
-
const updatePostResponseScript = (value) => {
|
|
21
|
-
emit("operation:update:extension", { "x-post-response": value });
|
|
22
|
-
};
|
|
23
|
-
return (_ctx, _cache) => {
|
|
24
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [createVNode(unref(ViewLayoutCollapse_default), {
|
|
25
|
-
class: "w-full",
|
|
26
|
-
defaultOpen: true
|
|
27
|
-
}, {
|
|
28
|
-
title: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode("Scripts", -1)])]),
|
|
29
|
-
suffix: withCtx(() => [createElementVNode("div", _hoisted_2, [script.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true)])]),
|
|
30
|
-
default: withCtx(() => [
|
|
31
|
-
_cache[1] || (_cache[1] = createElementVNode("div", { class: "text-c-3 flex h-8 items-center border-y px-3 text-sm" }, " Post-Response ", -1)),
|
|
32
|
-
createVNode(ScriptEditor_default, {
|
|
33
|
-
modelValue: script.value,
|
|
34
|
-
"onUpdate:modelValue": updatePostResponseScript
|
|
35
|
-
}, null, 8, ["modelValue"]),
|
|
36
|
-
createElementVNode("div", _hoisted_4, [createVNode(ExampleScripts_default, {
|
|
37
|
-
modelValue: script.value,
|
|
38
|
-
"onUpdate:modelValue": updatePostResponseScript
|
|
39
|
-
}, null, 8, ["modelValue"])])
|
|
40
|
-
]),
|
|
41
|
-
_: 1
|
|
42
|
-
})]);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
//#endregion
|
|
47
|
-
export { PostResponseScripts_vue_vue_type_script_setup_true_lang_default as default };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=PostResponseScripts.vue.script.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PostResponseScripts.vue.script.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/PostResponseScripts/PostResponseScripts.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { Operation } from '@scalar/oas-utils/entities/spec'\nimport { computed } from 'vue'\n\nimport { ViewLayoutCollapse } from '@/components/ViewLayout'\n\nimport ExampleScripts from './ExampleScripts.vue'\nimport ScriptEditor from './ScriptEditor.vue'\n\nconst { operation } = defineProps<{\n operation: Pick<Operation, 'x-post-response'>\n}>()\n\nconst emit = defineEmits<{\n (e: 'operation:update:extension', payload: any): void\n}>()\n\nconst script = computed(() => (operation['x-post-response'] as string) || '')\n\nconst updatePostResponseScript = (value: string) => {\n emit('operation:update:extension', {\n 'x-post-response': value,\n })\n}\n</script>\n\n<template>\n <div class=\"w-full\">\n <ViewLayoutCollapse\n class=\"w-full\"\n :defaultOpen=\"true\">\n <template #title>Scripts</template>\n <template #suffix>\n <!-- Show an indicator whether we have a script -->\n <div class=\"mr-2\">\n <div\n v-if=\"script.length > 0\"\n class=\"bg-green h-2 w-2 rounded-full\" />\n </div>\n </template>\n\n <div class=\"text-c-3 flex h-8 items-center border-y px-3 text-sm\">\n Post-Response\n </div>\n\n <ScriptEditor\n :modelValue=\"script\"\n @update:modelValue=\"updatePostResponseScript\" />\n\n <div class=\"border-y p-3\">\n <ExampleScripts\n :modelValue=\"script\"\n @update:modelValue=\"updatePostResponseScript\" />\n </div>\n </ViewLayoutCollapse>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAaA,MAAM,OAAO;EAIb,MAAM,SAAS,eAAgB,QAAA,UAAU,sBAAiC,GAAE;EAE5E,MAAM,4BAA4B,UAAkB;AAClD,QAAK,8BAA8B,EACjC,mBAAmB,OACpB,CAAA;;;uBAKD,mBA4BM,OA5BN,YA4BM,CA3BJ,YA0BqB,MAAA,2BAAA,EAAA;IAzBnB,OAAM;IACL,aAAa;;IACH,OAAK,cAAQ,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAP,WAAO,GAAA,CAAA,EAAA,CAAA;IACb,QAAM,cAMT,CAJN,mBAIM,OAJN,YAIM,CAFI,OAAA,MAAO,SAAM,KAAA,WAAA,EADrB,mBAE0C,OAF1C,WAE0C,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA,CAAA,CAAA;2BAMxC;+BAFN,mBAEM,OAAA,EAFD,OAAM,wDAAsD,EAAC,mBAElE,GAAA;KAEA,YAEkD,sBAAA;MAD/C,YAAY,OAAA;MACZ,uBAAmB;;KAEtB,mBAIM,OAJN,YAIM,CAHJ,YAEkD,wBAAA;MAD/C,YAAY,OAAA;MACZ,uBAAmB"}
|
package/dist/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptEditor.vue.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue"],"names":[],"mappings":"AAuHA,KAAK,WAAW,GAAG;IACjB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAC;AAiEF,QAAA,MAAM,YAAY;;;;kFAGhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import ScriptEditor_vue_vue_type_script_setup_true_lang_default from "./ScriptEditor.vue.script.js";
|
|
2
|
-
/* empty css */
|
|
3
|
-
import _plugin_vue_export_helper_default from "../../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
//#region src/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue
|
|
5
|
-
var ScriptEditor_default = /* @__PURE__ */ _plugin_vue_export_helper_default(ScriptEditor_vue_vue_type_script_setup_true_lang_default, [["__scopeId", "data-v-a9df3276"]]);
|
|
6
|
-
//#endregion
|
|
7
|
-
export { ScriptEditor_default as default };
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ScriptEditor.vue.js.map
|
package/dist/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptEditor.vue.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { javascript } from '@codemirror/lang-javascript'\nimport { useCodeMirror } from '@scalar/use-codemirror'\nimport { ref, toRef } from 'vue'\n\nconst props = defineProps<{\n modelValue: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst codeMirrorRef = ref<HTMLDivElement | null>(null)\n\nuseCodeMirror({\n codeMirrorRef,\n content: toRef(() => props.modelValue),\n language: undefined,\n // We want to use some custom configuration for the syntax highlighting.\n extensions: [javascript()],\n lineNumbers: true,\n onChange: (value) => {\n emit('update:modelValue', value)\n },\n})\n</script>\n\n<template>\n <div class=\"script-editor text-sm\">\n <div\n ref=\"codeMirrorRef\"\n class=\"editor-container\" />\n </div>\n</template>\n\n<style scoped>\n.script-editor {\n width: 100%;\n height: 100%;\n position: relative;\n}\n\n.editor-container {\n width: 100%;\n height: 100%;\n background: var(--scalar-background-1);\n border-radius: var(--scalar-radius);\n overflow: hidden;\n padding-left: 3px;\n}\n\n:deep(.cm-editor) {\n height: 100%;\n outline: none;\n background: var(--scalar-background-1);\n}\n\n:deep(.cm-content) {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-small);\n padding: 8px 2px;\n}\n\n:deep(.cm-gutters) {\n border-right: none;\n color: var(--scalar-color-3);\n background: var(--scalar-background-1);\n font-size: var(--scalar-mini);\n line-height: 1.44;\n}\n\n:deep(.cm-gutters:before) {\n content: '';\n position: absolute;\n top: 2px;\n left: 2px;\n width: calc(100% - 2px);\n height: calc(100% - 4px);\n border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);\n}\n\n:deep(.cm-gutterElement) {\n font-family: var(--scalar-font-code) !important;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n position: relative;\n}\n\n:deep(.cm-scroller) {\n overflow: auto;\n}\n\n:deep(.cm-activeLine),\n:deep(.cm-activeLineGutter) {\n background-color: var(--scalar-background-2);\n}\n\n:deep(.cm-selectionMatch),\n:deep(.cm-matchingBracket) {\n border-radius: var(--scalar-radius);\n background: var(--scalar-background-4) !important;\n}\n\n:deep(.cm-tooltip) {\n background: var(--scalar-background-1) !important;\n border: 1px solid var(--scalar-border-color) !important;\n border-radius: var(--scalar-radius);\n box-shadow: var(--scalar-shadow-2);\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ScriptEditor.vue.script.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/PostResponseScripts/ScriptEditor.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { javascript } from '@codemirror/lang-javascript'\nimport { useCodeMirror } from '@scalar/use-codemirror'\nimport { ref, toRef } from 'vue'\n\nconst props = defineProps<{\n modelValue: string\n}>()\n\nconst emit = defineEmits<{\n (e: 'update:modelValue', value: string): void\n}>()\n\nconst codeMirrorRef = ref<HTMLDivElement | null>(null)\n\nuseCodeMirror({\n codeMirrorRef,\n content: toRef(() => props.modelValue),\n language: undefined,\n // We want to use some custom configuration for the syntax highlighting.\n extensions: [javascript()],\n lineNumbers: true,\n onChange: (value) => {\n emit('update:modelValue', value)\n },\n})\n</script>\n\n<template>\n <div class=\"script-editor text-sm\">\n <div\n ref=\"codeMirrorRef\"\n class=\"editor-container\" />\n </div>\n</template>\n\n<style scoped>\n.script-editor {\n width: 100%;\n height: 100%;\n position: relative;\n}\n\n.editor-container {\n width: 100%;\n height: 100%;\n background: var(--scalar-background-1);\n border-radius: var(--scalar-radius);\n overflow: hidden;\n padding-left: 3px;\n}\n\n:deep(.cm-editor) {\n height: 100%;\n outline: none;\n background: var(--scalar-background-1);\n}\n\n:deep(.cm-content) {\n font-family: var(--scalar-font-code);\n font-size: var(--scalar-small);\n padding: 8px 2px;\n}\n\n:deep(.cm-gutters) {\n border-right: none;\n color: var(--scalar-color-3);\n background: var(--scalar-background-1);\n font-size: var(--scalar-mini);\n line-height: 1.44;\n}\n\n:deep(.cm-gutters:before) {\n content: '';\n position: absolute;\n top: 2px;\n left: 2px;\n width: calc(100% - 2px);\n height: calc(100% - 4px);\n border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);\n}\n\n:deep(.cm-gutterElement) {\n font-family: var(--scalar-font-code) !important;\n display: flex;\n align-items: center;\n justify-content: flex-end;\n position: relative;\n}\n\n:deep(.cm-scroller) {\n overflow: auto;\n}\n\n:deep(.cm-activeLine),\n:deep(.cm-activeLineGutter) {\n background-color: var(--scalar-background-2);\n}\n\n:deep(.cm-selectionMatch),\n:deep(.cm-matchingBracket) {\n border-radius: var(--scalar-radius);\n background: var(--scalar-background-4) !important;\n}\n\n:deep(.cm-tooltip) {\n background: var(--scalar-background-1) !important;\n border: 1px solid var(--scalar-border-color) !important;\n border-radius: var(--scalar-radius);\n box-shadow: var(--scalar-shadow-2);\n}\n</style>\n"],"mappings":";;;;;;;;;;EAKA,MAAM,QAAQ;EAId,MAAM,OAAO;EAIb,MAAM,gBAAgB,IAA2B,KAAI;AAErD,gBAAc;GACZ;GACA,SAAS,YAAY,MAAM,WAAW;GACtC,UAAU,KAAA;GAEV,YAAY,CAAC,YAAY,CAAC;GAC1B,aAAa;GACb,WAAW,UAAU;AACnB,SAAK,qBAAqB,MAAK;;GAElC,CAAA;;uBAIC,mBAIM,OAJN,YAIM,CAHJ,mBAE6B,OAAA;aADvB;IAAJ,KAAI;IACJ,OAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/post-response-scripts/components/PostResponseScripts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA"}
|
package/dist/plugins/post-response-scripts/components/TestResults/TestResultIndicator.vue.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResultIndicator.vue.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResultIndicator.vue"],"names":[],"mappings":"AA8FA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,KAAK,WAAW,GAAG;IACf,KAAK,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;IAC5B,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAqHJ,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
package/dist/plugins/post-response-scripts/components/TestResults/TestResultIndicator.vue.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResultIndicator.vue.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResultIndicator.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva, ScalarIcon, useBindCx, type Icon } from '@scalar/components'\nimport { computed } from 'vue'\n\nimport type { TestResult } from '@/libs/execute-scripts'\n\nconst { state, totalTestsCount, pendingTestsCount, failedTestsCount } =\n defineProps<{\n state?: TestResult['status']\n failedTestsCount: number | undefined\n pendingTestsCount: number | undefined\n totalTestsCount: number | undefined\n inline?: boolean\n }>()\n\nconst { cx } = useBindCx()\n\nconst icon = computed(() => {\n if (state === 'passed') {\n return { name: 'Checkmark', color: 'text-green p-0.25' }\n }\n\n if (state === 'failed') {\n return { name: 'Close', color: 'text-red' }\n }\n\n return { name: 'Ellipses', color: 'text-c-1' }\n})\n\nconst statusVariants = cva({\n base: 'flex items-center gap-1.5 rounded-full border pr-2 pl-1.25',\n variants: {\n status: {\n passed: 'text-green',\n failed: 'text-red',\n pending: 'text-orange',\n },\n },\n})\n\nconst textVariants = cva({\n base: 'text-c-2',\n variants: {\n inline: {\n true: 'text-xs',\n false: 'text-sm',\n },\n },\n})\n\n// Display the number of tests that passed e.g 1/3\nconst getTestCountDisplay = computed(() => {\n // When there are no tests, show nothing\n if (totalTestsCount === undefined) {\n return ''\n }\n\n // When they failed, show failed/total\n if (failedTestsCount) {\n return `${failedTestsCount}/${totalTestsCount}`\n }\n\n // When they passed, show passed/total\n const completedTests =\n totalTestsCount - (pendingTestsCount || 0) - (failedTestsCount || 0)\n return `${completedTests}/${totalTestsCount}`\n})\n</script>\n\n<template>\n <div v-bind=\"cx(statusVariants({ status: state }))\">\n <ScalarIcon\n v-if=\"state\"\n :class=\"icon.color\"\n :icon=\"icon.name as Icon\"\n size=\"sm\" />\n <span\n v-if=\"!inline\"\n class=\"ml-1.25 capitalize\">\n {{ state }}\n </span>\n <span\n v-if=\"totalTestsCount !== undefined\"\n v-bind=\"cx(textVariants({ inline }))\">\n {{ getTestCountDisplay }}\n </span>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResultIndicator.vue.script.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResultIndicator.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { cva, ScalarIcon, useBindCx, type Icon } from '@scalar/components'\nimport { computed } from 'vue'\n\nimport type { TestResult } from '@/libs/execute-scripts'\n\nconst { state, totalTestsCount, pendingTestsCount, failedTestsCount } =\n defineProps<{\n state?: TestResult['status']\n failedTestsCount: number | undefined\n pendingTestsCount: number | undefined\n totalTestsCount: number | undefined\n inline?: boolean\n }>()\n\nconst { cx } = useBindCx()\n\nconst icon = computed(() => {\n if (state === 'passed') {\n return { name: 'Checkmark', color: 'text-green p-0.25' }\n }\n\n if (state === 'failed') {\n return { name: 'Close', color: 'text-red' }\n }\n\n return { name: 'Ellipses', color: 'text-c-1' }\n})\n\nconst statusVariants = cva({\n base: 'flex items-center gap-1.5 rounded-full border pr-2 pl-1.25',\n variants: {\n status: {\n passed: 'text-green',\n failed: 'text-red',\n pending: 'text-orange',\n },\n },\n})\n\nconst textVariants = cva({\n base: 'text-c-2',\n variants: {\n inline: {\n true: 'text-xs',\n false: 'text-sm',\n },\n },\n})\n\n// Display the number of tests that passed e.g 1/3\nconst getTestCountDisplay = computed(() => {\n // When there are no tests, show nothing\n if (totalTestsCount === undefined) {\n return ''\n }\n\n // When they failed, show failed/total\n if (failedTestsCount) {\n return `${failedTestsCount}/${totalTestsCount}`\n }\n\n // When they passed, show passed/total\n const completedTests =\n totalTestsCount - (pendingTestsCount || 0) - (failedTestsCount || 0)\n return `${completedTests}/${totalTestsCount}`\n})\n</script>\n\n<template>\n <div v-bind=\"cx(statusVariants({ status: state }))\">\n <ScalarIcon\n v-if=\"state\"\n :class=\"icon.color\"\n :icon=\"icon.name as Icon\"\n size=\"sm\" />\n <span\n v-if=\"!inline\"\n class=\"ml-1.25 capitalize\">\n {{ state }}\n </span>\n <span\n v-if=\"totalTestsCount !== undefined\"\n v-bind=\"cx(textVariants({ inline }))\">\n {{ getTestCountDisplay }}\n </span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;EAeA,MAAM,EAAE,OAAO,WAAU;EAEzB,MAAM,OAAO,eAAe;AAC1B,OAAI,QAAA,UAAU,SACZ,QAAO;IAAE,MAAM;IAAa,OAAO;IAAoB;AAGzD,OAAI,QAAA,UAAU,SACZ,QAAO;IAAE,MAAM;IAAS,OAAO;IAAW;AAG5C,UAAO;IAAE,MAAM;IAAY,OAAO;IAAW;IAC9C;EAED,MAAM,iBAAiB,IAAI;GACzB,MAAM;GACN,UAAU,EACR,QAAQ;IACN,QAAQ;IACR,QAAQ;IACR,SAAS;IACV,EACF;GACF,CAAA;EAED,MAAM,eAAe,IAAI;GACvB,MAAM;GACN,UAAU,EACR,QAAQ;IACN,MAAM;IACN,OAAO;IACR,EACF;GACF,CAAA;EAGD,MAAM,sBAAsB,eAAe;AAEzC,OAAI,QAAA,oBAAoB,KAAA,EACtB,QAAO;AAIT,OAAI,QAAA,iBACF,QAAO,GAAG,QAAA,iBAAiB,GAAG,QAAA;AAMhC,UAAO,GADL,QAAA,mBAAmB,QAAA,qBAAqB,MAAM,QAAA,oBAAoB,GAC3C,GAAG,QAAA;IAC7B;;uBAIC,mBAgBM,OAAA,eAAA,mBAhBO,MAAA,GAAE,CAAC,MAAA,eAAc,CAAA,EAAA,QAAW,QAAA,OAAK,CAAA,CAAA,CAAA,CAAA,EAAA;IAEpC,QAAA,SAAA,WAAA,EADR,YAIc,MAAA,WAAA,EAAA;;KAFX,OAAK,eAAE,KAAA,MAAK,MAAK;KACjB,MAAM,KAAA,MAAK;KACZ,MAAK;;KAEE,QAAA,UAAA,WAAA,EADT,mBAIO,QAJP,YAIO,gBADF,QAAA,MAAK,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA;IAGF,QAAA,oBAAoB,KAAA,KAAA,WAAA,EAD5B,mBAIO,QAAA,eAAA,WAAA,EAAA,KAAA,GAAA,EAFG,MAAA,GAAE,CAAC,MAAA,aAAY,CAAA,EAAA,QAAG,QAAA,QAAM,CAAA,CAAA,CAAA,CAAA,EAAA,gBAC7B,oBAAA,MAAmB,EAAA,GAAA,IAAA,mBAAA,IAAA,KAAA"}
|
package/dist/plugins/post-response-scripts/components/TestResults/TestResultItem.vue.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResultItem.vue.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResultItem.vue"],"names":[],"mappings":"AA2DA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAExD,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,UAAU,CAAA;IAClB,YAAY,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAA;CACnC,CAAC;AAsGF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResultItem.vue.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResultItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon, type Icon } from '@scalar/components'\nimport { computed } from 'vue'\n\nimport type { TestResult } from '@/libs/execute-scripts'\n\nconst { currentState, result } = defineProps<{\n result: TestResult\n currentState: TestResult['status']\n}>()\n\nconst resultStatus = computed(() => {\n if (result.passed) {\n return { icon: 'Checkmark', color: 'text-green p-0.25' }\n }\n\n if (!result.passed && currentState !== 'pending') {\n return { icon: 'Close', color: 'text-red' }\n }\n\n return { icon: 'Ellipses', color: 'text-c-1' }\n})\n</script>\n\n<template>\n <div class=\"flex flex-col\">\n <div\n class=\"flex h-8 items-center gap-2 pr-3 pl-2.25\"\n :class=\"result.error && 'bg-b-danger'\">\n <!-- Title -->\n <div class=\"flex items-center gap-3 p-2\">\n <ScalarIcon\n :class=\"resultStatus.color\"\n :icon=\"resultStatus.icon as Icon\"\n size=\"sm\" />\n\n <span class=\"text-c-2 overflow-hidden text-ellipsis whitespace-nowrap\">\n {{ result.title }}\n </span>\n </div>\n <!-- Duration -->\n <span class=\"text-c-3 ml-auto whitespace-nowrap\">\n {{ result.duration }} ms\n </span>\n </div>\n <!-- Error -->\n <div\n v-if=\"result.error\"\n class=\"bg-b-danger text-c-1 flex items-center pr-3 pb-1.5 pl-9\">\n {{ result.error }}\n </div>\n </div>\n</template>\n"],"mappings":""}
|
package/dist/plugins/post-response-scripts/components/TestResults/TestResultItem.vue.script.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResultItem.vue.script.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResultItem.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { ScalarIcon, type Icon } from '@scalar/components'\nimport { computed } from 'vue'\n\nimport type { TestResult } from '@/libs/execute-scripts'\n\nconst { currentState, result } = defineProps<{\n result: TestResult\n currentState: TestResult['status']\n}>()\n\nconst resultStatus = computed(() => {\n if (result.passed) {\n return { icon: 'Checkmark', color: 'text-green p-0.25' }\n }\n\n if (!result.passed && currentState !== 'pending') {\n return { icon: 'Close', color: 'text-red' }\n }\n\n return { icon: 'Ellipses', color: 'text-c-1' }\n})\n</script>\n\n<template>\n <div class=\"flex flex-col\">\n <div\n class=\"flex h-8 items-center gap-2 pr-3 pl-2.25\"\n :class=\"result.error && 'bg-b-danger'\">\n <!-- Title -->\n <div class=\"flex items-center gap-3 p-2\">\n <ScalarIcon\n :class=\"resultStatus.color\"\n :icon=\"resultStatus.icon as Icon\"\n size=\"sm\" />\n\n <span class=\"text-c-2 overflow-hidden text-ellipsis whitespace-nowrap\">\n {{ result.title }}\n </span>\n </div>\n <!-- Duration -->\n <span class=\"text-c-3 ml-auto whitespace-nowrap\">\n {{ result.duration }} ms\n </span>\n </div>\n <!-- Error -->\n <div\n v-if=\"result.error\"\n class=\"bg-b-danger text-c-1 flex items-center pr-3 pb-1.5 pl-9\">\n {{ result.error }}\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;EAWA,MAAM,eAAe,eAAe;AAClC,OAAI,QAAA,OAAO,OACT,QAAO;IAAE,MAAM;IAAa,OAAO;IAAoB;AAGzD,OAAI,CAAC,QAAA,OAAO,UAAU,QAAA,iBAAiB,UACrC,QAAO;IAAE,MAAM;IAAS,OAAO;IAAW;AAG5C,UAAO;IAAE,MAAM;IAAY,OAAO;IAAW;IAC9C;;uBAIC,mBA0BM,OA1BN,YA0BM,CAzBJ,mBAkBM,OAAA,EAjBJ,OAAK,eAAA,CAAC,4CACE,QAAA,OAAO,SAAK,cAAA,CAAA,EAAA,EAAA,CAEpB,mBASM,OATN,YASM,CARJ,YAGc,MAAA,WAAA,EAAA;IAFX,OAAK,eAAE,aAAA,MAAa,MAAK;IACzB,MAAM,aAAA,MAAa;IACpB,MAAK;mCAEP,mBAEO,QAFP,YAEO,gBADF,QAAA,OAAO,MAAK,EAAA,EAAA,CAAA,CAAA,EAInB,mBAEO,QAFP,YAEO,gBADF,QAAA,OAAO,SAAQ,GAAG,QACvB,EAAA,CAAA,EAAA,EAAA,EAIM,QAAA,OAAO,SAAA,WAAA,EADf,mBAIM,OAJN,YAIM,gBADD,QAAA,OAAO,MAAK,EAAA,EAAA,IAAA,mBAAA,IAAA,KAAA,CAAA,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResults.vue.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResults.vue"],"names":[],"mappings":"AAyFA,OAAO,EAAY,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAExC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAOxD,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,SAAS,CAAA;CACxC,CAAC;AA6JF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResults.vue.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResults.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, type Ref } from 'vue'\n\nimport type { TestResult } from '@/libs/execute-scripts'\n\nimport { ViewLayoutCollapse } from '../../../../components/ViewLayout'\nimport TestResultIndicator from './TestResultIndicator.vue'\nimport TestResultItem from './TestResultItem.vue'\nimport TestSummary from './TestSummary.vue'\n\nconst { results } = defineProps<{\n results?: Ref<TestResult[]> | undefined\n}>()\n\nconst passedTests = computed(() =>\n results?.value?.filter((result: TestResult) => result.status === 'passed'),\n)\n\nconst pendingTests = computed(() =>\n results?.value?.filter((result: TestResult) => result.status === 'pending'),\n)\n\nconst failedTests = computed(() =>\n results?.value?.filter((result: TestResult) => result.status === 'failed'),\n)\n\nconst allTestsPassed = computed(\n () => passedTests.value?.length === results?.value?.length,\n)\n\nconst currentState = computed(() => {\n if (allTestsPassed.value) {\n return 'passed'\n }\n\n if (pendingTests.value?.length) {\n return 'pending'\n }\n\n return 'failed'\n})\n\nconst totalDuration = computed(\n () =>\n results?.value?.reduce(\n (acc: number, curr: TestResult) => acc + curr.duration,\n 0,\n ) ?? 0,\n)\n</script>\n\n<template>\n <ViewLayoutCollapse\n v-if=\"results?.value?.length\"\n class=\"overflow-auto text-sm\"\n :defaultOpen=\"true\">\n <template #title> Tests </template>\n <template #suffix>\n <TestResultIndicator\n :failedTestsCount=\"failedTests?.length\"\n inline\n :passedTestsCount=\"passedTests?.length\"\n :pendingTestsCount=\"pendingTests?.length\"\n :state=\"currentState\"\n :totalTestsCount=\"results?.value?.length\" />\n </template>\n\n <div class=\"max-h-[calc(100%-32px)] divide-y overflow-y-auto border-t\">\n <!-- Results -->\n <TestResultItem\n v-for=\"result in results?.value\"\n :key=\"result.title\"\n :currentState=\"result.status\"\n :result=\"result\" />\n\n <TestSummary\n v-if=\"results\"\n :allTestsPassed=\"allTestsPassed\"\n :failedTests=\"failedTests ?? []\"\n :passedTests=\"passedTests ?? []\"\n :pendingTests=\"pendingTests ?? []\"\n :results=\"results?.value\"\n :totalDuration=\"totalDuration\" />\n </div>\n </ViewLayoutCollapse>\n</template>\n"],"mappings":""}
|
package/dist/plugins/post-response-scripts/components/TestResults/TestResults.vue.script.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestResults.vue.script.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestResults.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, type Ref } from 'vue'\n\nimport type { TestResult } from '@/libs/execute-scripts'\n\nimport { ViewLayoutCollapse } from '../../../../components/ViewLayout'\nimport TestResultIndicator from './TestResultIndicator.vue'\nimport TestResultItem from './TestResultItem.vue'\nimport TestSummary from './TestSummary.vue'\n\nconst { results } = defineProps<{\n results?: Ref<TestResult[]> | undefined\n}>()\n\nconst passedTests = computed(() =>\n results?.value?.filter((result: TestResult) => result.status === 'passed'),\n)\n\nconst pendingTests = computed(() =>\n results?.value?.filter((result: TestResult) => result.status === 'pending'),\n)\n\nconst failedTests = computed(() =>\n results?.value?.filter((result: TestResult) => result.status === 'failed'),\n)\n\nconst allTestsPassed = computed(\n () => passedTests.value?.length === results?.value?.length,\n)\n\nconst currentState = computed(() => {\n if (allTestsPassed.value) {\n return 'passed'\n }\n\n if (pendingTests.value?.length) {\n return 'pending'\n }\n\n return 'failed'\n})\n\nconst totalDuration = computed(\n () =>\n results?.value?.reduce(\n (acc: number, curr: TestResult) => acc + curr.duration,\n 0,\n ) ?? 0,\n)\n</script>\n\n<template>\n <ViewLayoutCollapse\n v-if=\"results?.value?.length\"\n class=\"overflow-auto text-sm\"\n :defaultOpen=\"true\">\n <template #title> Tests </template>\n <template #suffix>\n <TestResultIndicator\n :failedTestsCount=\"failedTests?.length\"\n inline\n :passedTestsCount=\"passedTests?.length\"\n :pendingTestsCount=\"pendingTests?.length\"\n :state=\"currentState\"\n :totalTestsCount=\"results?.value?.length\" />\n </template>\n\n <div class=\"max-h-[calc(100%-32px)] divide-y overflow-y-auto border-t\">\n <!-- Results -->\n <TestResultItem\n v-for=\"result in results?.value\"\n :key=\"result.title\"\n :currentState=\"result.status\"\n :result=\"result\" />\n\n <TestSummary\n v-if=\"results\"\n :allTestsPassed=\"allTestsPassed\"\n :failedTests=\"failedTests ?? []\"\n :passedTests=\"passedTests ?? []\"\n :pendingTests=\"pendingTests ?? []\"\n :results=\"results?.value\"\n :totalDuration=\"totalDuration\" />\n </div>\n </ViewLayoutCollapse>\n</template>\n"],"mappings":";;;;;;;;;;;EAcA,MAAM,cAAc,eAClB,QAAA,SAAS,OAAO,QAAQ,WAAuB,OAAO,WAAW,SAAS,CAC5E;EAEA,MAAM,eAAe,eACnB,QAAA,SAAS,OAAO,QAAQ,WAAuB,OAAO,WAAW,UAAU,CAC7E;EAEA,MAAM,cAAc,eAClB,QAAA,SAAS,OAAO,QAAQ,WAAuB,OAAO,WAAW,SAAS,CAC5E;EAEA,MAAM,iBAAiB,eACf,YAAY,OAAO,WAAW,QAAA,SAAS,OAAO,OACtD;EAEA,MAAM,eAAe,eAAe;AAClC,OAAI,eAAe,MACjB,QAAO;AAGT,OAAI,aAAa,OAAO,OACtB,QAAO;AAGT,UAAO;IACR;EAED,MAAM,gBAAgB,eAElB,QAAA,SAAS,OAAO,QACb,KAAa,SAAqB,MAAM,KAAK,UAC9C,EACD,IAAI,EACT;;UAKU,QAAA,SAAS,OAAO,UAAA,WAAA,EADxB,YAgCqB,MAAA,2BAAA,EAAA;;IA9BnB,OAAM;IACL,aAAa;;IACH,OAAK,cAAQ,CAAA,GAAA,OAAA,OAAA,OAAA,KAAA,CAAA,gBAAP,WAAO,GAAA,CAAA,EAAA,CAAA;IACb,QAAM,cAO+B,CAN9C,YAM8C,6BAAA;KAL3C,kBAAkB,YAAA,OAAa;KAChC,QAAA;KACC,kBAAkB,YAAA,OAAa;KAC/B,mBAAmB,aAAA,OAAc;KACjC,OAAO,aAAA;KACP,iBAAiB,QAAA,SAAS,OAAO;;;;;;;;2BAmBhC,CAhBN,mBAgBM,OAhBN,YAgBM,EAAA,UAAA,KAAA,EAdJ,mBAIqB,UAAA,MAAA,WAHF,QAAA,SAAS,QAAnB,WAAM;yBADf,YAIqB,wBAAA;MAFlB,KAAK,OAAO;MACZ,cAAc,OAAO;MACb;;eAGH,QAAA,WAAA,WAAA,EADR,YAOmC,qBAAA;;KALhC,gBAAgB,eAAA;KAChB,aAAa,YAAA,SAAW,EAAA;KACxB,aAAa,YAAA,SAAW,EAAA;KACxB,cAAc,aAAA,SAAY,EAAA;KAC1B,SAAS,QAAA,SAAS;KAClB,eAAe,cAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestSummary.vue.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestSummary.vue"],"names":[],"mappings":"AAmCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAIxD,KAAK,WAAW,GAAG;IACjB,OAAO,EAAE,UAAU,EAAE,CAAA;IACrB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,YAAY,EAAE,UAAU,EAAE,CAAA;IAC1B,cAAc,EAAE,OAAO,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;CACtB,CAAC;AA0DF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestSummary.vue.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestSummary.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TestResult } from '@/libs/execute-scripts'\n\nimport TestResultIndicator from './TestResultIndicator.vue'\n\ndefineProps<{\n results: TestResult[]\n passedTests: TestResult[]\n failedTests: TestResult[]\n pendingTests: TestResult[]\n allTestsPassed: boolean\n totalDuration: number\n}>()\n</script>\n\n<template>\n <div class=\"flex h-8 items-center gap-1.5 pr-3 pl-1\">\n <TestResultIndicator\n :failedTestsCount=\"failedTests?.length\"\n :passedTestsCount=\"passedTests?.length\"\n :pendingTestsCount=\"pendingTests?.length\"\n :state=\"allTestsPassed ? 'passed' : 'failed'\"\n :totalTestsCount=\"results?.length\" />\n <span\n v-if=\"pendingTests?.length\"\n class=\"text-orange\">\n {{ pendingTests?.length }}\n Pending\n </span>\n <span class=\"text-c-3 ml-auto\"> {{ totalDuration.toFixed(1) }} ms </span>\n </div>\n</template>\n"],"mappings":""}
|
package/dist/plugins/post-response-scripts/components/TestResults/TestSummary.vue.script.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TestSummary.vue.script.js","names":[],"sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/TestSummary.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { TestResult } from '@/libs/execute-scripts'\n\nimport TestResultIndicator from './TestResultIndicator.vue'\n\ndefineProps<{\n results: TestResult[]\n passedTests: TestResult[]\n failedTests: TestResult[]\n pendingTests: TestResult[]\n allTestsPassed: boolean\n totalDuration: number\n}>()\n</script>\n\n<template>\n <div class=\"flex h-8 items-center gap-1.5 pr-3 pl-1\">\n <TestResultIndicator\n :failedTestsCount=\"failedTests?.length\"\n :passedTestsCount=\"passedTests?.length\"\n :pendingTestsCount=\"pendingTests?.length\"\n :state=\"allTestsPassed ? 'passed' : 'failed'\"\n :totalTestsCount=\"results?.length\" />\n <span\n v-if=\"pendingTests?.length\"\n class=\"text-orange\">\n {{ pendingTests?.length }}\n Pending\n </span>\n <span class=\"text-c-3 ml-auto\"> {{ totalDuration.toFixed(1) }} ms </span>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;uBAgBE,mBAcM,OAdN,YAcM;IAbJ,YAKuC,6BAAA;KAJpC,kBAAkB,QAAA,aAAa;KAC/B,kBAAkB,QAAA,aAAa;KAC/B,mBAAmB,QAAA,cAAc;KACjC,OAAO,QAAA,iBAAc,WAAA;KACrB,iBAAiB,QAAA,SAAS;;;;;;;;IAErB,QAAA,cAAc,UAAA,WAAA,EADtB,mBAKO,QALP,YAKO,gBAFF,QAAA,cAAc,OAAM,GAAG,aAE5B,EAAA,IAAA,mBAAA,IAAA,KAAA;IACA,mBAAyE,QAAzE,YAAyE,gBAAtC,QAAA,cAAc,QAAO,EAAA,CAAA,GAAM,QAAI,EAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/post-response-scripts/components/TestResults/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/post-response-scripts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ClientPlugin } from '@scalar/oas-utils/helpers';
|
|
2
|
-
import type { ApiClientPlugin } from '@scalar/types/api-reference';
|
|
3
|
-
export declare const postResponseScriptsPlugin: () => ApiClientPlugin;
|
|
4
|
-
/** Post Response Scripts Plugin for client V2 */
|
|
5
|
-
export declare const postResponseScriptsPluginV2: () => ClientPlugin;
|
|
6
|
-
//# sourceMappingURL=post-response-scripts-plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post-response-scripts-plugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/post-response-scripts/post-response-scripts-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAQlE,eAAO,MAAM,yBAAyB,QAAO,eAoC5C,CAAA;AAED,iDAAiD;AACjD,eAAO,MAAM,2BAA2B,QAAO,YAuB9C,CAAA"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { executePostResponseScript } from "../../libs/execute-scripts/execute-post-response-script.js";
|
|
2
|
-
import PostResponseScripts_default from "./components/PostResponseScripts/PostResponseScripts.vue.js";
|
|
3
|
-
import TestResults_default from "./components/TestResults/TestResults.vue.js";
|
|
4
|
-
import { ref } from "vue";
|
|
5
|
-
//#region src/plugins/post-response-scripts/post-response-scripts-plugin.ts
|
|
6
|
-
var postResponseScriptsPlugin = () => {
|
|
7
|
-
const results = ref([]);
|
|
8
|
-
return () => ({
|
|
9
|
-
name: "post-response-scripts",
|
|
10
|
-
views: {
|
|
11
|
-
"request.section": [{
|
|
12
|
-
title: "Scripts",
|
|
13
|
-
component: PostResponseScripts_default
|
|
14
|
-
}],
|
|
15
|
-
"response.section": [{
|
|
16
|
-
title: "Tests",
|
|
17
|
-
component: TestResults_default,
|
|
18
|
-
props: { results }
|
|
19
|
-
}]
|
|
20
|
-
},
|
|
21
|
-
hooks: {
|
|
22
|
-
onBeforeRequest() {
|
|
23
|
-
results.value = [];
|
|
24
|
-
},
|
|
25
|
-
async onResponseReceived({ response, operation }) {
|
|
26
|
-
await executePostResponseScript(operation["x-post-response"], {
|
|
27
|
-
response,
|
|
28
|
-
onTestResultsUpdate: (newResults) => results.value = [...newResults]
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
/** Post Response Scripts Plugin for client V2 */
|
|
35
|
-
var postResponseScriptsPluginV2 = () => {
|
|
36
|
-
const results = ref([]);
|
|
37
|
-
return {
|
|
38
|
-
components: {
|
|
39
|
-
request: { component: PostResponseScripts_default },
|
|
40
|
-
response: {
|
|
41
|
-
component: TestResults_default,
|
|
42
|
-
additionalProps: { results }
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
hooks: {
|
|
46
|
-
beforeRequest: () => {
|
|
47
|
-
results.value = [];
|
|
48
|
-
},
|
|
49
|
-
responseReceived: async ({ response, operation }) => {
|
|
50
|
-
await executePostResponseScript(operation["x-post-response"], {
|
|
51
|
-
response,
|
|
52
|
-
onTestResultsUpdate: (newResults) => results.value = [...newResults]
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
//#endregion
|
|
59
|
-
export { postResponseScriptsPlugin, postResponseScriptsPluginV2 };
|
|
60
|
-
|
|
61
|
-
//# sourceMappingURL=post-response-scripts-plugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"post-response-scripts-plugin.js","names":[],"sources":["../../../src/plugins/post-response-scripts/post-response-scripts-plugin.ts"],"sourcesContent":["import type { ClientPlugin } from '@scalar/oas-utils/helpers'\nimport type { ApiClientPlugin } from '@scalar/types/api-reference'\nimport { ref } from 'vue'\n\nimport { type TestResult, executePostResponseScript } from '@/libs/execute-scripts'\n\nimport { PostResponseScripts } from './components/PostResponseScripts'\nimport { TestResults } from './components/TestResults'\n\nexport const postResponseScriptsPlugin = (): ApiClientPlugin => {\n const results = ref<TestResult[]>([])\n\n return () => ({\n name: 'post-response-scripts',\n views: {\n 'request.section': [\n {\n title: 'Scripts',\n component: PostResponseScripts,\n },\n ],\n 'response.section': [\n {\n title: 'Tests',\n component: TestResults,\n props: {\n results,\n },\n },\n ],\n },\n hooks: {\n // Reset test results when a new request is sent\n onBeforeRequest() {\n results.value = []\n },\n // Execute post-response scripts when a response is received\n async onResponseReceived({ response, operation }) {\n await executePostResponseScript(operation['x-post-response'], {\n response,\n onTestResultsUpdate: (newResults) => (results.value = [...newResults]),\n })\n },\n },\n })\n}\n\n/** Post Response Scripts Plugin for client V2 */\nexport const postResponseScriptsPluginV2 = (): ClientPlugin => {\n const results = ref<TestResult[]>([])\n\n return {\n components: {\n request: { component: PostResponseScripts },\n response: { component: TestResults, additionalProps: { results } },\n },\n\n hooks: {\n // Reset test results when a new request is sent\n beforeRequest: () => {\n results.value = []\n },\n // Execute post-response scripts when a response is received\n responseReceived: async ({ response, operation }) => {\n await executePostResponseScript(operation['x-post-response'], {\n response,\n onTestResultsUpdate: (newResults) => (results.value = [...newResults]),\n })\n },\n },\n }\n}\n"],"mappings":";;;;;AASA,IAAa,kCAAmD;CAC9D,MAAM,UAAU,IAAkB,EAAE,CAAC;AAErC,eAAc;EACZ,MAAM;EACN,OAAO;GACL,mBAAmB,CACjB;IACE,OAAO;IACP,WAAW;IACZ,CACF;GACD,oBAAoB,CAClB;IACE,OAAO;IACP,WAAW;IACX,OAAO,EACL,SACD;IACF,CACF;GACF;EACD,OAAO;GAEL,kBAAkB;AAChB,YAAQ,QAAQ,EAAE;;GAGpB,MAAM,mBAAmB,EAAE,UAAU,aAAa;AAChD,UAAM,0BAA0B,UAAU,oBAAoB;KAC5D;KACA,sBAAsB,eAAgB,QAAQ,QAAQ,CAAC,GAAG,WAAW;KACtE,CAAC;;GAEL;EACF;;;AAIH,IAAa,oCAAkD;CAC7D,MAAM,UAAU,IAAkB,EAAE,CAAC;AAErC,QAAO;EACL,YAAY;GACV,SAAS,EAAE,WAAW,6BAAqB;GAC3C,UAAU;IAAE,WAAW;IAAa,iBAAiB,EAAE,SAAS;IAAE;GACnE;EAED,OAAO;GAEL,qBAAqB;AACnB,YAAQ,QAAQ,EAAE;;GAGpB,kBAAkB,OAAO,EAAE,UAAU,gBAAgB;AACnD,UAAM,0BAA0B,UAAU,oBAAoB;KAC5D;KACA,sBAAsB,eAAgB,QAAQ,QAAQ,CAAC,GAAG,WAAW;KACtE,CAAC;;GAEL;EACF"}
|
package/dist/style.css
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
.script-editor[data-v-a9df3276] {
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100%;
|
|
5
|
-
position: relative;
|
|
6
|
-
}
|
|
7
|
-
.editor-container[data-v-a9df3276] {
|
|
8
|
-
width: 100%;
|
|
9
|
-
height: 100%;
|
|
10
|
-
background: var(--scalar-background-1);
|
|
11
|
-
border-radius: var(--scalar-radius);
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
padding-left: 3px;
|
|
14
|
-
}
|
|
15
|
-
[data-v-a9df3276] .cm-editor {
|
|
16
|
-
height: 100%;
|
|
17
|
-
outline: none;
|
|
18
|
-
background: var(--scalar-background-1);
|
|
19
|
-
}
|
|
20
|
-
[data-v-a9df3276] .cm-content {
|
|
21
|
-
font-family: var(--scalar-font-code);
|
|
22
|
-
font-size: var(--scalar-small);
|
|
23
|
-
padding: 8px 2px;
|
|
24
|
-
}
|
|
25
|
-
[data-v-a9df3276] .cm-gutters {
|
|
26
|
-
border-right: none;
|
|
27
|
-
color: var(--scalar-color-3);
|
|
28
|
-
background: var(--scalar-background-1);
|
|
29
|
-
font-size: var(--scalar-mini);
|
|
30
|
-
line-height: 1.44;
|
|
31
|
-
}
|
|
32
|
-
[data-v-a9df3276] .cm-gutters:before {
|
|
33
|
-
content: '';
|
|
34
|
-
position: absolute;
|
|
35
|
-
top: 2px;
|
|
36
|
-
left: 2px;
|
|
37
|
-
width: calc(100% - 2px);
|
|
38
|
-
height: calc(100% - 4px);
|
|
39
|
-
border-radius: var(--scalar-radius) 0 0 var(--scalar-radius);
|
|
40
|
-
}
|
|
41
|
-
[data-v-a9df3276] .cm-gutterElement {
|
|
42
|
-
font-family: var(--scalar-font-code) !important;
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
justify-content: flex-end;
|
|
46
|
-
position: relative;
|
|
47
|
-
}
|
|
48
|
-
[data-v-a9df3276] .cm-scroller {
|
|
49
|
-
overflow: auto;
|
|
50
|
-
}
|
|
51
|
-
[data-v-a9df3276] .cm-activeLine,[data-v-a9df3276] .cm-activeLineGutter {
|
|
52
|
-
background-color: var(--scalar-background-2);
|
|
53
|
-
}
|
|
54
|
-
[data-v-a9df3276] .cm-selectionMatch,[data-v-a9df3276] .cm-matchingBracket {
|
|
55
|
-
border-radius: var(--scalar-radius);
|
|
56
|
-
background: var(--scalar-background-4) !important;
|
|
57
|
-
}
|
|
58
|
-
[data-v-a9df3276] .cm-tooltip {
|
|
59
|
-
background: var(--scalar-background-1) !important;
|
|
60
|
-
border: 1px solid var(--scalar-border-color) !important;
|
|
61
|
-
border-radius: var(--scalar-radius);
|
|
62
|
-
box-shadow: var(--scalar-shadow-2);
|
|
63
|
-
}
|
|
64
|
-
/*$vite$:1*/
|
|
File without changes
|
|
File without changes
|
/package/dist/plugins/{post-response-scripts → request-scripts}/components/TestResults/index.d.ts
RENAMED
|
File without changes
|