mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-09 15:38:19 -07:00
Beta plugins
This commit is contained in:
parent
50a795dc97
commit
e2cb06f0f2
117 changed files with 4414 additions and 168 deletions
|
|
@ -15,6 +15,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ const details = (): IpluginDetails => ({
|
|||
tags: 'video',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: 2,
|
||||
icon: 'faPlay',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ const details = ():IpluginDetails => ({
|
|||
tags: 'video',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ const details = () :IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: 1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = (): IpluginDetails => ({
|
|||
tags: '',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = (): IpluginDetails => ({
|
|||
tags: '',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ const details = (): IpluginDetails => ({
|
|||
tags: '',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [
|
||||
|
|
@ -115,6 +117,18 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
args.jobLog(`Input path: ${args.inputFileObj._id}`);
|
||||
args.jobLog(`Output path: ${outputPath}`);
|
||||
|
||||
if (args.inputFileObj._id === ouputFilePath) {
|
||||
args.jobLog('Input and output path are the same, skipping copy.');
|
||||
|
||||
return {
|
||||
outputFileObj: {
|
||||
_id: args.inputFileObj._id,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
}
|
||||
|
||||
args.deps.fsextra.ensureDirSync(outputPath);
|
||||
|
||||
await fs.copyFile(args.inputFileObj._id, ouputFilePath);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ const details = (): IpluginDetails => ({
|
|||
tags: '',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [],
|
||||
|
|
@ -51,6 +53,18 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
args.jobLog(`Input path: ${args.inputFileObj._id}`);
|
||||
args.jobLog(`Output path: ${outputPath}`);
|
||||
|
||||
if (args.inputFileObj._id === ouputFilePath) {
|
||||
args.jobLog('Input and output path are the same, skipping copy.');
|
||||
|
||||
return {
|
||||
outputFileObj: {
|
||||
_id: args.inputFileObj._id,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
}
|
||||
|
||||
args.deps.fsextra.ensureDirSync(outputPath);
|
||||
|
||||
await fs.copyFile(args.inputFileObj._id, ouputFilePath);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ const details = ():IpluginDetails => ({
|
|||
tags: '',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [
|
||||
|
|
@ -97,6 +99,18 @@ const plugin = async (args:IpluginInputArgs):Promise<IpluginOutputArgs> => {
|
|||
args.jobLog(`Input path: ${args.inputFileObj._id}`);
|
||||
args.jobLog(`Output path: ${ouputFilePath}`);
|
||||
|
||||
if (args.inputFileObj._id === ouputFilePath) {
|
||||
args.jobLog('Input and output path are the same, skipping move.');
|
||||
|
||||
return {
|
||||
outputFileObj: {
|
||||
_id: args.inputFileObj._id,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
}
|
||||
|
||||
args.deps.fsextra.ensureDirSync(outputPath);
|
||||
|
||||
await moveFileAndValidate({
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ const details = ():IpluginDetails => ({
|
|||
tags: '',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [],
|
||||
|
|
@ -40,6 +42,18 @@ const plugin = async (args:IpluginInputArgs):Promise<IpluginOutputArgs> => {
|
|||
|
||||
const ouputFilePath = `${outputDir}/${fileName}.${container}`;
|
||||
|
||||
if (args.inputFileObj._id === ouputFilePath) {
|
||||
args.jobLog('Input and output path are the same, skipping move.');
|
||||
|
||||
return {
|
||||
outputFileObj: {
|
||||
_id: args.inputFileObj._id,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
}
|
||||
|
||||
await moveFileAndValidate({
|
||||
inputPath: args.inputFileObj._id,
|
||||
outputPath: ouputFilePath,
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
@ -54,6 +56,18 @@ const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
|||
const fileDir = getFileAbosluteDir(args.inputFileObj._id);
|
||||
const newPath = `${fileDir}/${newName}`;
|
||||
|
||||
if (args.inputFileObj._id === newPath) {
|
||||
args.jobLog('Input and output path are the same, skipping rename.');
|
||||
|
||||
return {
|
||||
outputFileObj: {
|
||||
_id: args.inputFileObj._id,
|
||||
},
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
}
|
||||
|
||||
await moveFileAndValidate({
|
||||
inputPath: args.inputFileObj._id,
|
||||
outputPath: newPath,
|
||||
|
|
|
|||
|
|
@ -10,12 +10,14 @@ import {
|
|||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = (): IpluginDetails => ({
|
||||
name: 'Replace Original File',
|
||||
description: 'Replace the original file',
|
||||
description: 'Replace the original file. If the file hasn\'t changed then no action is taken.',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -12,8 +12,9 @@ const details = ():IpluginDetails => ({
|
|||
borderColor: 'pink',
|
||||
},
|
||||
tags: '',
|
||||
|
||||
isStartPlugin: true,
|
||||
pType: 'start',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -0,0 +1,53 @@
|
|||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
IpluginOutputArgs,
|
||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = (): IpluginDetails => ({
|
||||
name: 'Comment',
|
||||
nameUI: {
|
||||
type: 'textarea',
|
||||
style: {
|
||||
height: '250px',
|
||||
},
|
||||
},
|
||||
description: `Add a comment to your flow. Can place anywhere and link together.
|
||||
Any file input into the comment will be passed straight through.`,
|
||||
style: {
|
||||
borderColor: 'white',
|
||||
borderRadius: '10px',
|
||||
backgroundColor: '#043775',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faComment',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||
const lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
export {
|
||||
details,
|
||||
plugin,
|
||||
};
|
||||
|
|
@ -13,6 +13,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faExclamationTriangle',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -9,14 +9,26 @@ const details = ():IpluginDetails => ({
|
|||
name: 'Go To Flow',
|
||||
description: 'Go to a different flow',
|
||||
style: {
|
||||
borderColor: 'red',
|
||||
opacity: 0.5,
|
||||
borderColor: 'green',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [],
|
||||
inputs: [
|
||||
{
|
||||
name: 'flowId',
|
||||
type: 'string',
|
||||
defaultValue: '',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [],
|
||||
},
|
||||
tooltip: 'Specify flow ID to go to',
|
||||
},
|
||||
],
|
||||
outputs: [],
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,45 @@
|
|||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
IpluginOutputArgs,
|
||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = ():IpluginDetails => ({
|
||||
name: 'On Flow Error',
|
||||
description: `Runs if an error occurs in this specific flow.
|
||||
Won't run if error occurs in after going to a different flow (unless that flow comes back to this one).`,
|
||||
style: {
|
||||
borderColor: 'red',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: 'onFlowError',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||
const lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
export {
|
||||
details,
|
||||
plugin,
|
||||
};
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
import {
|
||||
IpluginDetails,
|
||||
IpluginInputArgs,
|
||||
IpluginOutputArgs,
|
||||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = (): IpluginDetails => ({
|
||||
name: 'Require Review',
|
||||
description: `Makes the flow pause.
|
||||
The file will stay in the staging section on the Tdarr tab until the user clicks the "Reviewed" button.
|
||||
`,
|
||||
style: {
|
||||
borderColor: 'yellow',
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faHand',
|
||||
inputs: [],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
tooltip: 'Continue to next plugin',
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const plugin = (args: IpluginInputArgs): IpluginOutputArgs => {
|
||||
const lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
variables: args.variables,
|
||||
};
|
||||
};
|
||||
export {
|
||||
details,
|
||||
plugin,
|
||||
};
|
||||
|
|
@ -15,6 +15,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -5,18 +5,72 @@ import {
|
|||
} from '../../../../FlowHelpers/1.0.0/interfaces/interfaces';
|
||||
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = ():IpluginDetails => ({
|
||||
const details = (): IpluginDetails => ({
|
||||
name: 'Send Web Request',
|
||||
description: 'Send Web Request',
|
||||
style: {
|
||||
borderColor: 'green',
|
||||
opacity: 0.5,
|
||||
},
|
||||
tags: '',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faArrowRight',
|
||||
inputs: [],
|
||||
inputs: [
|
||||
{
|
||||
name: 'method',
|
||||
type: 'string',
|
||||
defaultValue: 'post',
|
||||
inputUI: {
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
'get',
|
||||
'post',
|
||||
'put',
|
||||
'delete',
|
||||
],
|
||||
},
|
||||
tooltip: 'Specify request method',
|
||||
},
|
||||
{
|
||||
name: 'requestUrl',
|
||||
type: 'string',
|
||||
defaultValue: 'http://example.com',
|
||||
inputUI: {
|
||||
type: 'text',
|
||||
},
|
||||
tooltip: 'Specify request URL',
|
||||
},
|
||||
{
|
||||
name: 'requestHeaders',
|
||||
type: 'string',
|
||||
defaultValue: `{
|
||||
"Content-Type": "application/json"
|
||||
}`,
|
||||
inputUI: {
|
||||
type: 'textarea',
|
||||
style: {
|
||||
height: '100px',
|
||||
},
|
||||
},
|
||||
tooltip: 'Specify request URL',
|
||||
},
|
||||
{
|
||||
name: 'requestBody',
|
||||
type: 'string',
|
||||
defaultValue: `{
|
||||
"test": "test"
|
||||
}`,
|
||||
inputUI: {
|
||||
type: 'textarea',
|
||||
style: {
|
||||
height: '100px',
|
||||
},
|
||||
},
|
||||
tooltip: 'Specify request body',
|
||||
},
|
||||
],
|
||||
outputs: [
|
||||
{
|
||||
number: 1,
|
||||
|
|
@ -26,11 +80,32 @@ const details = ():IpluginDetails => ({
|
|||
});
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||
const plugin = async (args: IpluginInputArgs): Promise<IpluginOutputArgs> => {
|
||||
const lib = require('../../../../../methods/lib')();
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
|
||||
const method = String(args.inputs.method);
|
||||
const requestUrl = String(args.inputs.requestUrl);
|
||||
const requestHeaders = JSON.parse(String(args.inputs.requestHeaders));
|
||||
const requestBody = JSON.parse(String(args.inputs.requestBody));
|
||||
|
||||
const requestConfig = {
|
||||
method,
|
||||
url: requestUrl,
|
||||
headers: requestHeaders,
|
||||
data: requestBody,
|
||||
};
|
||||
|
||||
try {
|
||||
const res = await args.deps.axios(requestConfig);
|
||||
args.jobLog(`Web request succeeded: Status Code: ${res.status}`);
|
||||
} catch (err) {
|
||||
args.jobLog('Web Request Failed');
|
||||
args.jobLog(JSON.stringify(err));
|
||||
throw new Error('Web Request Failed');
|
||||
}
|
||||
|
||||
return {
|
||||
outputFileObj: args.inputFileObj,
|
||||
outputNumber: 1,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -6,13 +6,15 @@ import {
|
|||
|
||||
/* eslint no-plusplus: ["error", { "allowForLoopAfterthoughts": true }] */
|
||||
const details = (): IpluginDetails => ({
|
||||
name: 'Check HDR',
|
||||
name: 'Check HDR Video',
|
||||
description: 'Check if video is HDR',
|
||||
style: {
|
||||
borderColor: 'orange',
|
||||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const details = (): IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ const details = ():IpluginDetails => ({
|
|||
},
|
||||
tags: 'video',
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ const details = ():IpluginDetails => ({
|
|||
tags: 'video',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: 'faQuestion',
|
||||
inputs: [],
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ const details = ():IpluginDetails => ({
|
|||
tags: '',
|
||||
|
||||
isStartPlugin: false,
|
||||
pType: '',
|
||||
requiresVersion: '2.11.01',
|
||||
sidebarPosition: -1,
|
||||
icon: '',
|
||||
inputs: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue