mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-24 01:38:26 +02:00
Rebuild plugins
This commit is contained in:
@@ -76,7 +76,7 @@
|
|||||||
"developmentTeam": "7PU3P6ELJ8"
|
"developmentTeam": "7PU3P6ELJ8"
|
||||||
},
|
},
|
||||||
"macOS": {
|
"macOS": {
|
||||||
"minimumSystemVersion": "13.0",
|
"minimumSystemVersion": "15.0",
|
||||||
"exceptionDomain": "",
|
"exceptionDomain": "",
|
||||||
"entitlements": "macos/entitlements.plist",
|
"entitlements": "macos/entitlements.plist",
|
||||||
"frameworks": []
|
"frameworks": []
|
||||||
|
|||||||
@@ -288,7 +288,8 @@ var SUPPORTED_ARGS = [
|
|||||||
// Request method
|
// Request method
|
||||||
DATA_FLAGS
|
DATA_FLAGS
|
||||||
].flatMap((v) => v);
|
].flatMap((v) => v);
|
||||||
function pluginHookImport(ctx, rawData) {
|
var BOOL_FLAGS = ["G", "get", "digest"];
|
||||||
|
function pluginHookImport(_ctx, rawData) {
|
||||||
if (!rawData.match(/^\s*curl /)) {
|
if (!rawData.match(/^\s*curl /)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -359,10 +360,11 @@ function importCommand(parseEntries, workspaceId) {
|
|||||||
}
|
}
|
||||||
let value;
|
let value;
|
||||||
const nextEntry = parseEntries[i + 1];
|
const nextEntry = parseEntries[i + 1];
|
||||||
|
const hasValue = !BOOL_FLAGS.includes(name);
|
||||||
if (isSingleDash && name.length > 1) {
|
if (isSingleDash && name.length > 1) {
|
||||||
value = name.slice(1);
|
value = name.slice(1);
|
||||||
name = name.slice(0, 1);
|
name = name.slice(0, 1);
|
||||||
} else if (typeof nextEntry === "string" && !nextEntry.startsWith("-")) {
|
} else if (typeof nextEntry === "string" && hasValue && !nextEntry.startsWith("-")) {
|
||||||
value = nextEntry;
|
value = nextEntry;
|
||||||
i++;
|
i++;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
55
src-tauri/vendored/plugins/template-function-fs/build/index.js
generated
Normal file
55
src-tauri/vendored/plugins/template-function-fs/build/index.js
generated
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
"use strict";
|
||||||
|
var __create = Object.create;
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __getProtoOf = Object.getPrototypeOf;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||||
|
// If the importer is in node compatibility mode or this is not an ESM
|
||||||
|
// file that has been converted to a CommonJS file using a Babel-
|
||||||
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||||
|
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||||
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||||
|
mod
|
||||||
|
));
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// src/index.ts
|
||||||
|
var src_exports = {};
|
||||||
|
__export(src_exports, {
|
||||||
|
plugin: () => plugin
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(src_exports);
|
||||||
|
var import_node_fs = __toESM(require("node:fs"));
|
||||||
|
var plugin = {
|
||||||
|
templateFunctions: [{
|
||||||
|
name: "fs.readFile",
|
||||||
|
description: "Read the contents of a file as utf-8",
|
||||||
|
args: [{ title: "Select File", type: "file", name: "path", label: "File" }],
|
||||||
|
async onRender(_ctx, args) {
|
||||||
|
if (!args.values.path) return null;
|
||||||
|
try {
|
||||||
|
return import_node_fs.default.promises.readFile(args.values.path, "utf-8");
|
||||||
|
} catch (err) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
0 && (module.exports = {
|
||||||
|
plugin
|
||||||
|
});
|
||||||
9
src-tauri/vendored/plugins/template-function-fs/package.json
generated
Normal file
9
src-tauri/vendored/plugins/template-function-fs/package.json
generated
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"name": "@yaakapp/template-function-fs",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.1",
|
||||||
|
"scripts": {
|
||||||
|
"build": "yaakcli build ./src/index.ts",
|
||||||
|
"dev": "yaakcli dev ./src/index.js"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,6 +28,7 @@ var algorithms = ["md5", "sha1", "sha256", "sha512"];
|
|||||||
var plugin = {
|
var plugin = {
|
||||||
templateFunctions: algorithms.map((algorithm) => ({
|
templateFunctions: algorithms.map((algorithm) => ({
|
||||||
name: `hash.${algorithm}`,
|
name: `hash.${algorithm}`,
|
||||||
|
description: "Hash a value to its hexidecimal representation",
|
||||||
args: [
|
args: [
|
||||||
{
|
{
|
||||||
name: "input",
|
name: "input",
|
||||||
|
|||||||
@@ -26,24 +26,21 @@ module.exports = __toCommonJS(src_exports);
|
|||||||
var plugin = {
|
var plugin = {
|
||||||
templateFunctions: [{
|
templateFunctions: [{
|
||||||
name: "prompt.text",
|
name: "prompt.text",
|
||||||
|
description: "Prompt the user for input when sending a request",
|
||||||
args: [
|
args: [
|
||||||
{ type: "text", name: "title", label: "Title" },
|
{ type: "text", name: "title", label: "Title" },
|
||||||
{ type: "text", name: "label", label: "Label", optional: true },
|
|
||||||
{ type: "text", name: "defaultValue", label: "Default Value", optional: true },
|
{ type: "text", name: "defaultValue", label: "Default Value", optional: true },
|
||||||
{ type: "text", name: "placeholder", label: "Placeholder", optional: true }
|
{ type: "text", name: "placeholder", label: "Placeholder", optional: true }
|
||||||
],
|
],
|
||||||
async onRender(ctx, args) {
|
async onRender(ctx, args) {
|
||||||
console.log("PROMPT", args);
|
|
||||||
if (args.purpose !== "send") return null;
|
if (args.purpose !== "send") return null;
|
||||||
const value = await ctx.prompt.text({
|
return await ctx.prompt.text({
|
||||||
id: `prompt-${args.values.label}`,
|
id: `prompt-${args.values.label}`,
|
||||||
label: args.values.label ?? "",
|
label: args.values.title ?? "",
|
||||||
title: args.values.title ?? "",
|
title: args.values.title ?? "",
|
||||||
defaultValue: args.values.defaultValue,
|
defaultValue: args.values.defaultValue,
|
||||||
placeholder: args.values.placeholder
|
placeholder: args.values.placeholder
|
||||||
});
|
});
|
||||||
console.log("VALUE", value);
|
|
||||||
return value;
|
|
||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8837,6 +8837,7 @@ var plugin = {
|
|||||||
templateFunctions: [
|
templateFunctions: [
|
||||||
{
|
{
|
||||||
name: "response.header",
|
name: "response.header",
|
||||||
|
description: "Read the value of a response header, by name",
|
||||||
args: [
|
args: [
|
||||||
requestArg,
|
requestArg,
|
||||||
{
|
{
|
||||||
@@ -8863,6 +8864,7 @@ var plugin = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "response.body.path",
|
name: "response.body.path",
|
||||||
|
description: "Access a field of the response body using JsonPath or XPath",
|
||||||
aliases: ["response"],
|
aliases: ["response"],
|
||||||
args: [
|
args: [
|
||||||
requestArg,
|
requestArg,
|
||||||
@@ -8901,6 +8903,34 @@ var plugin = {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "response.body.raw",
|
||||||
|
description: "Access the entire response body, as text",
|
||||||
|
aliases: ["response"],
|
||||||
|
args: [
|
||||||
|
requestArg,
|
||||||
|
behaviorArg
|
||||||
|
],
|
||||||
|
async onRender(ctx, args) {
|
||||||
|
if (!args.values.request) return null;
|
||||||
|
const response = await getResponse(ctx, {
|
||||||
|
requestId: args.values.request,
|
||||||
|
purpose: args.purpose,
|
||||||
|
behavior: args.values.behavior ?? null
|
||||||
|
});
|
||||||
|
if (response == null) return null;
|
||||||
|
if (response.bodyPath == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
let body;
|
||||||
|
try {
|
||||||
|
body = (0, import_node_fs.readFileSync)(response.bodyPath, "utf-8");
|
||||||
|
} catch (_) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return body;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user