Send purpose with render request

This commit is contained in:
Gregory Schier
2024-08-23 13:31:39 -07:00
parent 5ba11ca788
commit 7ca3b9bd20
20 changed files with 47 additions and 47 deletions

View File

@@ -8,7 +8,7 @@
"name": "exporter-curl",
"version": "0.0.1",
"dependencies": {
"@yaakapp/api": "^0.1.11"
"@yaakapp/api": "^0.1.12"
},
"devDependencies": {
"@types/node": "^20.14.9",
@@ -701,9 +701,9 @@
}
},
"node_modules/@yaakapp/api": {
"version": "0.1.11",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.11.tgz",
"integrity": "sha512-dRZAXrQpftWygy9nJXiIYPzLA9om6reO/RiEacMe9RKqMjNG6FRF8cGmj7BcdyreizJOkH/DmcOpxn09kDD0XA==",
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/@yaakapp/api/-/api-0.1.12.tgz",
"integrity": "sha512-qA+2BBZz1LGTi0wsOmlwaw6xJbE3elPIUMt/BkiRT+DqQC5spZtISsyoPXjtsM0xZc2orjoRJd0LesXH7xkD0g==",
"dependencies": {
"@types/node": "^22.0.0"
}

View File

@@ -11,6 +11,6 @@
"vitest": "^1.4.0"
},
"dependencies": {
"@yaakapp/api": "^0.1.11"
"@yaakapp/api": "^0.1.12"
}
}

View File

@@ -8,7 +8,7 @@ export const plugin: Plugin = {
label: 'Copy as Curl',
icon: 'copy',
async onSelect(ctx, args) {
const rendered_request = await ctx.httpRequest.render({ httpRequest: args.httpRequest });
const rendered_request = await ctx.httpRequest.render({ httpRequest: args.httpRequest, purpose: 'preview' });
const data = await pluginHookExport(ctx, rendered_request);
ctx.clipboard.copyText(data);
ctx.toast.show({ variant: 'copied', message: 'Curl copied to clipboard' });