mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-20 07:51:20 +02:00
Add template function descriptions
This commit is contained in:
@@ -4,6 +4,7 @@ import fs from 'node:fs';
|
|||||||
export const plugin: PluginDefinition = {
|
export const plugin: PluginDefinition = {
|
||||||
templateFunctions: [{
|
templateFunctions: [{
|
||||||
name: 'fs.readFile',
|
name: 'fs.readFile',
|
||||||
|
description: 'Read the contents of a file as utf-8',
|
||||||
args: [{ title: 'Select File', type: 'file', name: 'path', label: 'File' }],
|
args: [{ title: 'Select File', type: 'file', name: 'path', label: 'File' }],
|
||||||
async onRender(_ctx: Context, args: CallTemplateFunctionArgs): Promise<string | null> {
|
async onRender(_ctx: Context, args: CallTemplateFunctionArgs): Promise<string | null> {
|
||||||
if (!args.values.path) return null;
|
if (!args.values.path) return null;
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ const algorithms = ['md5', 'sha1', 'sha256', 'sha512'];
|
|||||||
export const plugin: PluginDefinition = {
|
export const plugin: PluginDefinition = {
|
||||||
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',
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ export const plugin: PluginDefinition = {
|
|||||||
templateFunctions: [
|
templateFunctions: [
|
||||||
{
|
{
|
||||||
name: 'response.header',
|
name: 'response.header',
|
||||||
|
description: 'Read the value of a response header, by name',
|
||||||
args: [
|
args: [
|
||||||
requestArg,
|
requestArg,
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user